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 EnumPicker<T: Hashable & CaseIterable, V: View>: View { | |
@Binding var selected: T | |
var title: String? = nil | |
let mapping: (T) -> V | |
var body: some View { |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
let alert = UIAlertController(title: "Sender ...", message: nil, preferredStyle: .alert) | |
let activityIndicator = UIActivityIndicatorView(style: .gray) | |
activityIndicator.translatesAutoresizingMaskIntoConstraints = false | |
activityIndicator.isUserInteractionEnabled = false | |
activityIndicator.startAnimating() | |
alert.view.addSubview(activityIndicator) | |
alert.view.heightAnchor.constraint(equalToConstant: 95).isActive = true | |
activityIndicator.centerXAnchor.constraint(equalTo: alert.view.centerXAnchor, constant: 0).isActive = 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
import Foundation | |
// We provide some json and transform it to Data-type | |
let json = """ | |
[{ | |
"name": "John", | |
"startingTime": 581167640.06502903 | |
}, { | |
"name": "Mark", | |
"startingTime": 582031640.06502903 |
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 QuartzCore | |
class ConfettiView: UIView { | |
public var colors: [UIColor]! | |
public var intensity: Float! | |
private(set) var active: Bool! | |
override public class var layerClass: Swift.AnyClass { |
NewerOlder