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 SwiftUI | |
struct BackwardScrollView<V: View>: View { | |
var axis: Axis.Set = .horizontal | |
var content: ()->V | |
var leadingInset: CGFloat | |
init(_ axis: Axis.Set = .horizontal, leadingInset: CGFloat = 10, content: @escaping ()->V) { | |
self.axis = axis |
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
// | |
// AppError.swift | |
// ImagePickerDisplayer | |
// | |
// Created by Neil on 03/12/20. | |
// | |
import Foundation | |
enum AppError: Equatable, Error { |
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 OneTimeCodeField: UIControl { | |
enum FieldState { | |
case empty | |
case filled | |
case respoding | |
} | |
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 | |
import MessageUI | |
struct MailInfo { | |
var recipient: String | |
var subject: String? | |
var message: String? | |
var isHTML: Bool = false | |
} |
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
class AppTextView: UITextView { | |
var onTextChange: ((String?)->Void)? | |
override init(frame: CGRect, textContainer: NSTextContainer?) { | |
super.init(frame: frame, textContainer: textContainer) | |
observeTextChanges() | |
} | |
required init?(coder aDecoder: NSCoder) { |
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
@propertyWrapper | |
struct UserDefaulter<A: RawRepresentable> { | |
let key: String | |
init(_ key: String) { | |
self.key = key | |
} | |
private var fetchedValue: A? | |
var wrappedValue: A? { | |
mutating get { |
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 FetchingView { | |
enum State { | |
case fetching | |
case fetched | |
case error(ResponseError) | |
} | |
} |
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
protocol ReusableView: class { | |
static var identifier: String { get } | |
} | |
extension ReusableView where Self: NSObject { | |
static var identifier: String { | |
return String(describing: 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
class NotchView: UIView { | |
var notchWidth: CGFloat = 16 | |
var notchHeight: CGFloat = 12 | |
var cornerRadius: CGFloat = 8 | |
override func awakeFromNib() { | |
super.awakeFromNib() | |
self.isUserInteractionEnabled = true | |
} | |
NewerOlder