This file contains 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 UIView { | |
class func animate(_ animation: @autoclosure @escaping () -> Void, duration: TimeInterval = 0.25, delay: TimeInterval = 0) { | |
UIView.animate(withDuration: duration, delay: delay, animations: animation) | |
} | |
} | |
UIView.animate(self.label.alpha = 1) |
This file contains 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 ViewBuilder { | |
private var view = UIView() | |
func frame(_ frame: CGRect) -> ViewBuilder { | |
view.frame = frame | |
return self | |
} |
This file contains 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 validation rule for text input. | |
public enum TextValidationRule { | |
/// Any input is valid, including an empty string. | |
case noRestriction | |
/// The input must not be empty. | |
case nonEmpty | |
/// The enitre input must match a regular expression. A matching substring is not enough. | |
case regularExpression(NSRegularExpression) |
This file contains 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 | |
enum TargetEnum: Codable { | |
case first(SomeObject) | |
case second(OtherObject) | |
enum CodingKeys: CodingKey { | |
case first | |
case second |
This file contains 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
// | |
// File.swift | |
// SP | |
// | |
// Created by Yevgen Sagidulin on 12.06.2022. | |
// | |
import Foundation | |
protocol AnimalFeed { |