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 SwiftUI | |
import Transmission | |
extension PresentationLinkTransition { | |
static let custom: PresentationLinkTransition = .custom( | |
options: .init(), | |
CustomTransition() | |
) | |
} |
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 ContentView: View { | |
@State var counter: Int = 0 | |
var body: some View { | |
VStack(spacing: 24) { | |
Image(systemName: "exclamationmark.triangle.fill") | |
.font(Font.system(size: 50)) |
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
// | |
// Copyright (c) Nathan Tannar | |
// | |
import SwiftUI | |
import Engine // https://github.com/nathantannar4/Engine | |
import Turbocharger // https://github.com/nathantannar4/Turbocharger | |
import Transmission // https://github.com/nathantannar4/Transmission | |
#if os(iOS) |
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 | |
protocol IView: AnyObject where Self: UIView { | |
func viewDidLoad() | |
func viewWillAppear(_ animated: Bool) | |
func viewDidAppear(_ animated: Bool) | |
func viewWillDisappear(_ animated: Bool) | |
func viewDidDisappear(_ animated: Bool) | |
} |
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 Controller<RootViewType: IView>: UIViewController { | |
var rootView: RootViewType! { | |
return view as? RootViewType | |
} | |
// MARK: - View Life Cycle |
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 TextFieldCell: RowView<UILabel, TextField, UIView> { | |
var label: UILabel { return leftView } | |
var textField: TextField { return rightView } | |
} | |
class TextViewCell: RowView<UILabel, InputTextView, UIView> { | |
var label: UILabel { return leftView } | |
var textView: InputTextView { return rightView } |
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 RowView<LeftViewType: UIView, RightViewType: UIView, AccessoryViewType: UIView>: View { | |
let leftView = LeftViewType() | |
let rightView = RightViewType() | |
let accessoryView = AccessoryViewType() | |
override func viewDidLoad() { | |
super.viewDidLoad() |
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 | |
protocol IReusableView: AnyObject where Self: UIView { | |
func prepareForReuse() | |
} | |
class TableViewCell<ViewType: IReusableView>: UITableViewCell { | |
let wrappedView = ViewType() |
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 ViewModelController<ViewModelType: IViewModel>: UIViewController { | |
let viewModel: ViewModelType | |
required init(viewModel: ViewModelType) { | |
self.viewModel = viewModel | |
super.init(nibName: nil, bundle: nil) | |
} |
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 Switch: UIControl { | |
var isOn: Bool | |
// Determines if the thumbLayer stretches on touchDown | |
var isStretchEnable: Bool | |
// Border of the trackLayer, this also determines the inset of the innerLayer | |
var borderWidth: CGFloat | |
NewerOlder