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 | |
| import LocalAuthentication | |
| /// `AuthenticationFallbackType` is the backup authentication method if `touchID` user used was invalid. | |
| /// | |
| /// Don't Forget to add `LocalAuthentication.framework` into your `Linked Frameworks and Librarys`. | |
| enum AuthenticationFallbackType { | |
| /// Keep trying with `touchID` only. No other methods to authenticate the user. | |
| case none | |
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 Dictionary { | |
| func jsonView() -> String { | |
| guard let data = try? JSONSerialization.data(withJSONObject: self, options: .prettyPrinted) else { return "" } | |
| return String(data: data, encoding: .utf8) ?? "" | |
| } | |
| } |
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 | |
| extension UIAlertController { | |
| // MARK: - Alert Types | |
| static func alert(title: String = "", message: String = "") -> UIAlertController { | |
| return UIAlertController(title: title, message: message, preferredStyle: .alert) | |
| } | |
| static func sheet(title: String = "", message: String = "") -> UIAlertController { |
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 GradientView: UIView { | |
| private var gradientLayer: CAGradientLayer! | |
| let startColor: UIColor = .blue | |
| let endColor: UIColor = .red | |
| let startPointX: CGFloat = 0 | |
| let startPointY: CGFloat = 0.5 |
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 PopupViewController: UIViewController { | |
| var viewToAnimate: UIView? | |
| lazy var transform: CGAffineTransform = { | |
| return CGAffineTransform.identity.scaledBy(x: 0.01, y: 0.01) | |
| }() | |
| override func viewWillAppear(_ animated: Bool) { |
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 { | |
| enum AssetIdentifier: String { | |
| case darkRed | |
| case fadedRed = "customFadedRed" | |
| } | |
| convenience init!(asset: AssetIdentifier) { | |
| self.init(named: asset.rawValue) | |
| } | |
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 | |
| /// A protocol for easy use of `UIActivityIndicators` (Spinners). | |
| protocol SpinnerCompatible: class { | |
| /// Adds an activity indicator to the the view. Disables the view interaction as long as the spinner is displayed. | |
| /// Call `hideSpinner()` to hide it. | |
| /// - parameter color: color of the spinner. Default value is `gary`. | |
| /// - parameter dims: optional bool to dim the holding view while displaying the spinner. Default value is `false`. | |
| /// - parameter blocks: optional bool to block the holding view while displaying the spinner. Default value is `true`. |
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 | |
| import CoreData | |
| // MARK: - CoreData Protocols | |
| protocol CoreDataRetrivable { | |
| init(managedObject: NSManagedObject) | |
| } | |
| protocol CoreDataStorable { | |
| @discardableResult |
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 BaseCollectionViewCell: UICollectionViewCell, Identifiable { | |
| override init(frame: CGRect) { | |
| super.init(frame: .zero) | |
| setupViews() | |
| setupConstraints() | |
| } |
OlderNewer