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: 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
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
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
enum Weight: String { | |
case bold = "Bold" | |
case light = "Light" | |
case regular = "Regular" | |
case semiBold = "SemiBold" | |
} |
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, weight: Weight, size: CGFloat) -> UIFont { | |
UIFont(name: "\(name.rawValue)-\(weight.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
struct Fonts { | |
enum Weight: String { | |
case bold = "Bold" | |
case light = "Light" | |
case regular = "Regular" | |
case semiBold = "SemiBold" | |
} | |
enum Font: String { |
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
titleLabel?.font = Fonts.font(.quicksand, weight: .bold, size: 14) |
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
func constrainToEdges(of view: UIView) { | |
translatesAutoresizingMaskIntoConstraints = false | |
NSLayoutConstraint.activate([ | |
leftAnchor.constraint(equalTo: view.leftAnchor), | |
topAnchor.constraint(equalTo: view.topAnchor), | |
rightAnchor.constraint(equalTo: view.rightAnchor), | |
bottomAnchor.constraint(equalTo: view.bottomAnchor) | |
]) | |
} |
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 | |
final class SheetModalPresentationController: UIPresentationController { | |
// MARK: Private Properties | |
private let isDismissable: Bool | |
private let interactor = UIPercentDrivenInteractiveTransition() | |
private let dimmingView = UIView() | |
private var propertyAnimator: UIViewPropertyAnimator! |