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
struct StripePaymentCardTextField: UIViewRepresentable { | |
@Binding var cardParams: STPPaymentMethodCardParams | |
@Binding var isValid: Bool | |
func makeUIView(context: Context) -> STPPaymentCardTextField { | |
let input = STPPaymentCardTextField() | |
input.borderWidth = 0 | |
input.delegate = context.coordinator | |
return input |
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 RealmSwift | |
typealias Model = Object & Identifiable | |
struct ListKey<T: Model>: Identifiable { | |
let id: T.ID | |
} | |
extension Results where Element: Model { | |
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
struct PageControl: View { | |
var numberOfPages: Int | |
@Binding var currentPage: Int | |
var body: some View { | |
HStack { | |
ForEach(0..<numberOfPages) { index in | |
Circle() |
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 | |
extension String: Identifiable { | |
public var id: String { self } | |
} | |
struct ContentView: View { | |
@State private var baseNumber = "" | |
@State private var dimensionSelection: String = "" |
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
struct Grid<Data: RandomAccessCollection, Content: View>: View, DynamicViewContent where Data.Index == Int { | |
public var data: Data | |
public var colCount: Int | |
public var alignment: HorizontalAlignment | |
public var spacing: CGFloat | |
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
impost SwiftUI | |
struct TactileSliderView: UIViewRepresentable { | |
@Binding var value: Float | |
func makeUIView(context: Context) -> TactileSlider { | |
let slider = TactileSlider() | |
slider.setValue(value, animated: false) | |
slider.addTarget(context.coordinator, action: #selector(context.coordinator.valueChanged), for: .valueChanged) |
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 | |
@IBDesignable | |
class CustomTextField: UITextField { | |
@IBInspectable var isPasteEnabled: Bool = true | |
@IBInspectable var isSelectEnabled: Bool = true | |
@IBInspectable var isSelectAllEnabled: Bool = true |
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
public class Async { | |
/// Throw version implementation of waterfall | |
/// | |
/// - Parameters: | |
/// - initialValue: initial passed value of the chain | |
/// - chain: chain of closures to process | |
/// - end: last callback. Called after the chain finished or in an error occures | |
/// - Throws: Any error that one of the chain elements throwed |
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
public let YAAAS = true |
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
public protocol OptionalValueObservable { | |
var isComplete: Bool {get} | |
var hasAnyProperty: Bool {get} | |
} | |
public extension OptionalValueObservable { | |
var isComplete: Bool { | |
get { | |
return Mirror(reflecting: self).children.reduce(true) { acc, val in | |
let subMirror = Mirror(reflecting: val.value) |
NewerOlder