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 CrashingView: View { | |
@State private var items: [String] = Array(1...10).map { String("\($0)") } | |
var body: some View { | |
VStack { | |
HStack { | |
ForEach(items, id: \.self) { item in | |
Text(item) | |
/// Adding @Sendable to the closure fixes the crash | |
.alignmentGuide(HorizontalAlignment.center) { @Sendable d in |
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 SwiftData | |
extension ModelContext { | |
/// FetchDescriptor is Sendable but inside a parameter pack there are sometimes issues with this working in Swift 6.0 | |
func fetch<each T: PersistentModel, Result: Sendable>( | |
_ descriptor: repeat FetchDescriptor<each T>, | |
with closure: @escaping @Sendable (repeat [each T]) throws -> Result | |
) throws -> Result { | |
try closure(repeat try fetch(each descriptor)) | |
} |
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
// | |
// CrashingView.swift | |
// CrashRemovingItem | |
// | |
// Created by Ryan Lintott on 2024-08-13. | |
// | |
import SwiftUI | |
struct CrashingView: View { |
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
// | |
// CrashingView.swift | |
// CrashRemovingItem | |
// | |
// Created by Ryan Lintott on 2024-08-13. | |
// | |
import SwiftUI | |
fileprivate struct _VariadicRoot: _VariadicView_MultiViewRoot { |
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
// | |
// NoClipTextRenderer.swift | |
// | |
// | |
// Created by Ryan Lintott on 2024-07-08. | |
// | |
import SwiftUI | |
@available(iOS 18, *) |
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
// | |
// AutoLayoutTestApp.swift | |
// AutoLayoutTest | |
// | |
// Created by Ryan Lintott on 2024-03-07. | |
// | |
import FrameUp | |
import SwiftUI |
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
// | |
// ShrinkingLabel.swift | |
// FrameUpExample | |
// | |
// Created by Ryan Lintott on 2024-02-21. | |
// | |
import FrameUp | |
import SwiftUI |
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 Theme: Identifiable { | |
let id: UUID | |
let name: String | |
} | |
extension Theme { | |
static let blue = Self(id: UUID(), name: "Blue") | |
static let red = Self(id: UUID(), name: "Red") |
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 ContentView: View { | |
var body: some View { | |
KeyboardAvoidingWithOffset() | |
.keyboardHeightEnvironmentValue() | |
} | |
} | |
struct KeyboardAvoidingWithOffset: View { |
NewerOlder