This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class ViewControllerLayout: Layout { | |
| lazy var contactList: UITableView = { | |
| let tableView = UITableView() | |
| tableView.showsHorizontalScrollIndicator = false | |
| tableView.showsVerticalScrollIndicator = false | |
| tableView.register(ContactCell.self, forCellReuseIdentifier: ContactCell.cellId) | |
| return tableView |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| class ContactsAdapter: NSObject, UITableViewDelegate, UITableViewDataSource { | |
| var contacts = [Contact]() | |
| func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
| contacts.count | |
| } | |
| func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class ContactCell: UITableViewCell { | |
| static let cellId = "ContactCell" | |
| private lazy var profilePicture = ProfilePictureView() | |
| @HeaderStyle private var nameLabel | |
| @ParagraphStyle private var emailLabel |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| struct Contact { | |
| var id: Int | |
| var name: String | |
| var email: String | |
| var profilePicture: URL? | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class ViewControllerLayout: Layout { | |
| lazy var scrollView: UIScrollView = { | |
| let scrollView = UIScrollView() | |
| scrollView.showsHorizontalScrollIndicator = false | |
| scrollView.showsVerticalScrollIndicator = false | |
| scrollView.keyboardDismissMode = .onDrag |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class CardView: UIView { | |
| init(cornerRadius: CGFloat) { | |
| super.init(frame: .zero) | |
| layer.shadowColor = UIColor.darkGray.cgColor | |
| layer.masksToBounds = false | |
| layer.shadowOffset = CGSize(width: 0, height: 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class UnderlinedTextField: UIView { | |
| lazy var textField: UITextField = { | |
| let textField = UITextField() | |
| textField.backgroundColor = .clear | |
| textField.borderStyle = .none | |
| return textField | |
| }() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class HorizontalLineView: UIView { | |
| init(backgroundColor: UIColor, height: CGFloat) { | |
| super.init(frame: .zero) | |
| snp.makeConstraints { | |
| $0.height.equalTo(height) | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Kingfisher | |
| import SnapKit | |
| import UIKit | |
| class ProfilePictureView: UIView { | |
| lazy var shadowView: UIView = { | |
| let view = UIView(backgroundColor: .white, cornerRadius: 64) | |
| view.layer.shadowColor = UIColor.darkGray.cgColor | |
| view.layer.masksToBounds = false | |
| view.layer.shadowOffset = CGSize(width: 0, height: 2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SnapKit | |
| import UIKit | |
| class ViewControllerLayout: Layout { | |
| @HeaderStyle private var headerLabel | |
| @ParagraphStyle private var paragraphLabel | |
| required init() { | |
| super.init() |