Swift

Swift

49 bookmarks
Custom sorting
FocusedValue and FocusedBinding property wrappers in SwiftUI
FocusedValue and FocusedBinding property wrappers in SwiftUI
FocusedValue property wrapper allows us to observe the value from the focused view or one of its ancestors. It works in a very similar way to the Environment property wrapper, but instead of observing the environment, it observes the view hierarchy’s focused view.
Ggfftcyfvyt
·swiftwithmajid.com·
FocusedValue and FocusedBinding property wrappers in SwiftUI
Creating hex-based colors in UIKit, AppKit and SwiftUI
Creating hex-based colors in UIKit, AppKit and SwiftUI
In this post, let’s take a quick look at how to we can extend the UIKit, AppKit and SwiftUI colors with hex-based initializers that accept strings (e.g. "#abcdef") and numeric values (e.g. 0xabcdef).
Although you can use asset catalogs to define colors for your apps and frameworks, there may come a time when you have to create colors from hex codes, for instance when fetching colors from a web api.
Some
·danielsaidi.com·
Creating hex-based colors in UIKit, AppKit and SwiftUI