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 DotPosition: Equatable, Hashable { | |
| let row: Int | |
| let column: Int | |
| } | |
| struct DotGridView: 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
| import SwiftUI | |
| // https://x.com/_take_hito_/status/1890677320895066252 | |
| struct ContentView: View { | |
| var body: some View { | |
| WavingText() | |
| .foregroundStyle(.white) | |
| .frame(maxWidth: .infinity, maxHeight: .infinity) | |
| .background(Color(hue: 220/360, saturation: 0.3, brightness: 0.9)) | |
| } |
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 | |
| // MARK: InfiniteScrollView | |
| struct InfiniteScrollView<Content: View>: View { | |
| @State private var scrollPosition: ScrollPosition = ScrollPosition(idType: Int.self) | |
| @Binding var currentIndex: Int | |
| var spacing: CGFloat = 10 | |
| var itemSize: CGSize | |
| var count: Int = 0 |
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
| fileprivate struct InfiniteScrollHelper: UIViewRepresentable { | |
| @Binding var contentSize: CGSize | |
| @Binding var declarationRate: UIScrollView.DecelerationRate | |
| func makeCoordinator() -> Coordinator { | |
| Coordinator(declarationRate: declarationRate, contentSize: contentSize) | |
| } | |
| func makeUIView(context: Context) -> some UIView { | |
| let view = UIView(frame: .zero) | |
| view.backgroundColor = .clear |
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
| // | |
| // CarouselInfinite.swift | |
| // IOS18Playground | |
| // | |
| // Created by Codelaby on 28/9/24. | |
| // | |
| // based: https://www.youtube.com/watch?v=p1nN9eFOPNQ | |
| 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 BezierGridView: View { | |
| @State private var vertices: [[BezierVertex]] | |
| let rows: Int | |
| let cols: Int | |
| init(rows: Int, cols: Int) { | |
| self.rows = rows |
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 | |
| fileprivate extension View { | |
| @ViewBuilder func reverseMask<Mask: View>( | |
| alignment: Alignment = .center, | |
| @ViewBuilder _ mask: () -> Mask | |
| ) -> some View { | |
| self.mask { | |
| Rectangle() |
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
| /* | |
| Third Library based -> https://github.com/lukerobertsapps/LRStreakKit | |
| */ | |
| import Foundation | |
| /// Data for a streak, codable so it can be persisted | |
| struct Streak: Codable { | |
| /// The length of the streak in days | |
| var length: Int = 0 |
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
| struct TwoListPlayground: View { | |
| @State private var users1 = ["Paul", "Taylor", "Adele"] | |
| @State private var users2 = ["Pauline", "Tom", "Adam"] | |
| var body: some View { | |
| VStack { | |
| HStack { | |
| Spacer() |