This file contains hidden or 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 hidden or 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 hidden or 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 { |
This file contains hidden or 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
| // | |
| // GridAccessibilityTest.swift | |
| // FrameUpExample | |
| // | |
| // Created by Ryan Lintott on 2023-10-22. | |
| // | |
| import FrameUp | |
| import SwiftUI |
This file contains hidden or 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
| // | |
| // WidgetConfiguration+extensions.swift | |
| // | |
| // | |
| // Created by Ryan Lintott on 2023-09-11. | |
| // | |
| import SwiftUI | |
| import WidgetKit |
This file contains hidden or 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
| extension Collection where Element == Text { | |
| func joined() -> Text { | |
| reduce(into: Text("")) { | |
| $0 = $0 + $1 | |
| } | |
| } | |
| func joined(separator: String) -> Text { | |
| joined(separator: Text(separator)) | |
| } |
This file contains hidden or 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 PreviewState<each T, Content: View>: View { | |
| @State private var value: (repeat each T) | |
| var content: (Binding<(repeat each T)>) -> Content | |
| init( | |
| _ value: repeat each T, | |
| @ViewBuilder content: @escaping (Binding<(repeat each T)>) -> Content | |
| ) { |
This file contains hidden or 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
| // | |
| // AnimatablePack.swift | |
| // ShapeUp | |
| // | |
| // Created by Ryan Lintott on 2023-08-02. | |
| // | |
| /// AnimatablePack uses parameter pack iteration that is only available in swift 6.0 | |
| /// https://forums.swift.org/t/pitch-enable-pack-iteration/66168 | |
| #if compiler(>=6.0) |