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
/// Some exploration into how selector-based notification interact with actors. | |
/// | |
/// Or in the words of Brent Simmons (@[email protected]), | |
/// "Selector-based Notification Observers Are Actually Good" | |
/// Overall, I'm reasonably convinced, in that it avoids the headaches of `deinit` in actors. | |
/// However, Combine-based observation is also good at this, so I don't yet have a strong opinion | |
/// about old-school selectors vs Combine beyond my usual nervousness around Combine. | |
/// Whether "I'd like to reduce Combine" is more or less powerful than "I'd like to reduce @objc" | |
/// is yet to be seen. |
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
// Setup | |
class Child: ObservableObject { | |
@Published var value = "" | |
} | |
class Parent: ObservableObjectContainer { | |
let single = Child() | |
let array = [Child(), Child()] | |
func updateSingle() { |
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 Combine | |
import SwiftUI | |
extension View { | |
public func focused<T>(file: StaticString = #file, _ state: FocusState<T>, equals value: T) -> some View { | |
modifier(FocusedModifier(state: state, id: value, file: file)) | |
} | |
} | |
@propertyWrapper |
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
### Points and display type | |
PPI is points per inch below, not pixels per inch. Not all models are listed, just the first model with a new display size. Diamond, RGB Stripe and Pentile RGB refer to the subpixel patterns. | |
iPhone 1 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 4 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 5 = 320×568 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 6 = 375×667 at 163PPI sRGB IPS LCD RGB Stripe | |
iPhone 6 Plus = 414×736 at 153.5PPI sRGB IPS LCD RGB Stripe | |
iPhone 7 = 375×667 at 163PPI P3 IPS LCD RGB Stripe |
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 HeroAnimationTest: View { | |
let indices = 0 ..< 3 | |
@State | |
var showsOtherView = false | |
@Namespace | |
var namespaceID: Namespace.ID |
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 | |
let LINE_LENGTH: Double = 500.0 | |
let N = 720 | |
let LINES = 18 | |
let WAVES: Double = 18.0 | |
let WAVE_HEIGHT: Double = 20 | |
let SPACING: Double = 27.0 | |
let CURL_AMOUNT: Double = 12.0 |
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 | |
import PlaygroundSupport | |
struct Sunset: View { | |
@State var backgroundColor = Color.blue | |
@State var sunSetted = false | |
let sunGradient = [Color.yellow, Color.orange] | |
let moonGradient = [Color.gray, Color.black] | |
@State var alignment = Alignment.top | |
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
# A Best in Class Checklist | |
A boiled down checklist adapted from this [post](https://www.swiftjectivec.com/a-best-in-class-app/), created by @jordanmorgan10. | |
> To use this, create a Github Issue in your own repo, and simply copy and paste this text. | |
## iOS Core Technology | |
_Things any iOS app can benefit from_ | |
- [ ] iCloud Sync | |
- [ ] Focus Filter Support |
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 | |
let colors = [ | |
Color.pink, | |
Color.blue, | |
Color.green, | |
Color.orange, | |
Color.purple, | |
Color.black, | |
] |
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
// | |
// AnimatableVector2D.swift | |
// | |
// this is derivation of generic AnimatableVector presented at: https://nerdyak.tech/development/2020/01/12/animating-complex-shapes-in-swiftui.html | |
// | |
// Created by Pavel Zak on 18/05/2020. | |
// | |
import SwiftUI |
NewerOlder