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
🏁 🍇 | |
150 ➡️ offer | |
100 ➡️ minPrice | |
200 ➡️ maxPrice | |
💭 Edit the condition below: | |
↪️ 🤜 offer ▶️ minPrice 🤛 🤝 🤜 offer ◀️ maxPrice 🤛 🍇 | |
😀 🔤Offer accepted!🔤❗️ | |
🍉 |
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 | |
// The life of a developer using Phantom Types | |
enum Eating {} | |
enum Coding {} | |
enum Sleeping {} | |
struct Transition<From, To> { } |
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 LocalStorage<T: Codable> { | |
private let userDefaults: UserDefaults = .standard | |
private let key: String | |
private let defaultValue: T | |
init(wrappedValue defaultValue: T, key: String) { | |
self.key = key | |
self.defaultValue = defaultValue | |
} |
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 ViewController: UIViewController { | |
var animator: UIDynamicAnimator? | |
var origins: [(String, CGPoint)] = [] | |
let range: ClosedRange<CGFloat> = 0.0...255.0 | |
var message = "This is cedric trying to animate the components with gravity" | |
override func 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
struct PassCodeCodeView: UIViewRepresentable { | |
init(_ count: Int = 5, | |
width: CGFloat, | |
height: CGFloat, | |
spacing: CGFloat = 10, | |
action: @escaping (String) -> ()) { | |
self.width = width | |
self.height = height | |
self.spacing = spacing |
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 DebuggingResource: NSObject { | |
private static func printLine(_ line: String) { | |
print("--- \(line) ---") | |
} | |
public static func logJsonDataFormat(_ data: Data) { | |
printLine("Start Debugging Json Format") | |
if let json = try? JSONSerialization.jsonObject(with: data) { | |
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 DraggableAnnotationView: MGLAnnotationView { | |
var didSetNewCoord: (CLLocationCoordinate2D) -> Void = { _ in } | |
init(reuseIdentifier: String, size: CGFloat, didSetCoord: @escaping(CLLocationCoordinate2D) -> Void) { | |
self.didSetNewCoord = didSetCoord | |
super.init(reuseIdentifier: reuseIdentifier) | |
// `isDraggable` is a property of MGLAnnotationView, disabled by default. | |
isDraggable = 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
class DebuggingResource: NSObject { | |
private static func printLine(_ line: String) { | |
print("--- \(line) ---") | |
} | |
public static func logJsonDataFormat(_ data: Data) { | |
printLine("Start Debugging Json Format") | |
if let json = try? JSONSerialization.jsonObject(with: data) { | |
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
// Answer to https://stackoverflow.com/questions/69929331/current-time-is-not-displayed-in-the-analog-view | |
struct Hand: Shape { | |
let inset: CGFloat | |
let angle: Angle | |
func path(in rect: CGRect) -> Path { | |
let rect = rect.insetBy(dx: inset, dy: inset) | |
var path = Path() | |
path.move(to: CGPoint(x: rect.midX, y: rect.midY)) | |
path.addRoundedRect(in: CGRect(x: rect.midX - 4, y: rect.midY - 4, width: 8, height: 8), cornerSize: CGSize(width: 8, height: 8)) |
OlderNewer