aboutsummaryrefslogtreecommitdiff
path: root/foray/ForayDetailView.swift
diff options
context:
space:
mode:
authorNicholas Tay <nick@windblume.net>2022-03-24 16:32:23 +1100
committerNicholas Tay <nick@windblume.net>2022-03-24 16:32:23 +1100
commit1b292bc251b3dbef532dacad9705bd197ac4227b (patch)
tree1635ed0cc70922f6337d010b42e2119258877114 /foray/ForayDetailView.swift
parent716724df0fee78a8976d5255096e000af29daad1 (diff)
downloadforayios-1b292bc251b3dbef532dacad9705bd197ac4227b.tar.gz
forayios-1b292bc251b3dbef532dacad9705bd197ac4227b.tar.bz2
forayios-1b292bc251b3dbef532dacad9705bd197ac4227b.zip
Reorganise into folder groups
In preparation for presenters to come in largely, lots of files starting to go everywhere...
Diffstat (limited to 'foray/ForayDetailView.swift')
-rw-r--r--foray/ForayDetailView.swift96
1 files changed, 0 insertions, 96 deletions
diff --git a/foray/ForayDetailView.swift b/foray/ForayDetailView.swift
deleted file mode 100644
index 5997016..0000000
--- a/foray/ForayDetailView.swift
+++ /dev/null
@@ -1,96 +0,0 @@
-//
-// ForayDetailView.swift
-// foray
-//
-// Created by Nicholas Tay on 24/3/2022.
-//
-
-import UIKit
-
-class ForayDetailView: UIView {
-
- let scrollView: UIScrollView = {
- let sv = UIScrollView()
- sv.alwaysBounceVertical = true // just for fun
- return sv
- }()
- let container = UIView()
-
- let nameLabel: UILabel = {
- let l = UILabel()
- l.font = UIFont.preferredFont(forTextStyle: .largeTitle)
- l.adjustsFontForContentSizeCategory = true
- l.numberOfLines = 3
- l.textAlignment = .center
- return l
- }()
-
- let itemImageView: UIImageView = {
- let iv = UIImageView()
- iv.contentMode = .scaleAspectFit
- return iv
- }()
-
- let descLabel: UILabel = {
- let l = UILabel()
- l.font = UIFont.preferredFont(forTextStyle: .body)
- l.adjustsFontForContentSizeCategory = true
- l.numberOfLines = 10
- return l
- }()
-
- override init(frame: CGRect) {
- super.init(frame: frame)
- initialiseViews()
- }
-
- required init?(coder: NSCoder) {
- fatalError("init(coder:) has not been implemented")
- }
-
- private func initialiseViews() {
- backgroundColor = .systemBackground
-
- addSubview(scrollView)
- scrollView.addSubview(container)
-
- container.addSubview(nameLabel)
- container.addSubview(itemImageView)
- container.addSubview(descLabel)
-
- setupConstraints()
- }
-
- private func setupConstraints() {
- scrollView.snp.makeConstraints { (make) in
- make.edges.equalToSuperview()
- }
- container.snp.makeConstraints { (make) in
- make.top.bottom.equalToSuperview()
- make.leading.equalTo(snp.leadingMargin)
- make.trailing.equalTo(snp.trailingMargin)
- }
-
- nameLabel.snp.makeConstraints { (make) in
- make.top.equalToSuperview().inset(16)
- make.leading.trailing.equalToSuperview().inset(8)
- }
- itemImageView.snp.makeConstraints { (make) in
- make.top.equalTo(nameLabel.snp.bottom).offset(32)
- make.leading.trailing.equalToSuperview()
- make.height.equalTo(150)
- }
- descLabel.snp.makeConstraints { (make) in
- make.top.equalTo(itemImageView.snp.bottom).offset(32)
- make.leading.trailing.equalToSuperview()
- make.bottom.equalTo(container.snp.bottom).inset(16)
- }
- }
-
- public func setDetails(name: String, description: String, image: UIImage) {
- nameLabel.text = name
- descLabel.text = description
- itemImageView.image = image
- }
-
-}