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
Fonts.font(.poppins, size: 12) |
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
static func font(_ name: Font, size: CGFloat) -> UIFont { | |
UIFont(name: name.rawValue, size: size)! | |
} |
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
UIFont(name: Fonts.Font.poppins.rawValue, size: 12) |
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
struct Fonts { | |
enum Font: String { | |
case poppins = "Poppins" | |
case quicksand = "Quicksand" | |
} | |
} |
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
UIFont(name: "Quicksand-Bold", weight: 16) |
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
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class Cell: UITableViewCell { | |
private let borderLayer = CAShapeLayer() | |
private let _backgroundView = UIView() |
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
cell.item = items[indexPath.row] |
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
UIColor(named: "Primary") |
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
extension UIColor { | |
static var accent: UIColor { | |
UIColor(named: "Accent")! | |
} | |
static var primary: UIColor { | |
UIColor(named: "Primary")! | |
} | |
static var primaryText: UIColor { |
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
extension UIViewController { | |
func embed(_ vc: UIViewController, in _containerView: UIView? = nil) { | |
let containerView: UIView = _containerView ?? view // Use the whole view if no container view is provided. | |
containerView.addSubview(vc.view) | |
NSLayoutConstraint.activate([ | |
vc.view.leadingAnchor.constraint(equalTo: containerView.leadingAnchor, constant: 0), | |
vc.view.trailingAnchor.constraint(equalTo: containerView.trailingAnchor, constant: 0), | |
vc.view.topAnchor.constraint(equalTo: containerView.topAnchor, constant: 0), | |
vc.view.bottomAnchor.constraint(equalTo: containerView.bottomAnchor, constant: 0) | |
]) |