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 { | |
GeometryReader { geometry in | |
let scrollViewFrame = geometry.frame(in: .local) | |
ScrollView { | |
ForEach(0..<1000) { offset in | |
RowContent(offset: offset, scrollViewFrame: scrollViewFrame) | |
} |
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 | |
// Simple example of a custom reordering implementation in SwiftUI | |
struct ReorderableListExample: View { | |
// Sample data | |
@State private var items = ["Item 1", "Item 2", "Item 3", "Item 4", "Item 5"] | |
@State private var isEditMode: EditMode = .inactive | |
var body: some View { | |
VStack { |
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
// | |
// FloatingOverlayApp.swift | |
// FloatingOverlay | |
// | |
// Created by JuniperPhoton on 2025/3/12. | |
// | |
import SwiftUI | |
// Dependency: https://github.com/sindresorhus/KeyboardShortcuts |
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 | |
struct ContentView: View { | |
@State private var start = Date.now | |
var body: some View { | |
VStack { | |
TimelineView(.animation) { timeline in | |
let time = start.distance(to: timeline.date) | |
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
import SwiftUI | |
extension View where Self: Shape { | |
func glow( | |
fill: some ShapeStyle, | |
lineWidth: Double, | |
blurRadius: Double = 8.0, | |
lineCap: CGLineCap = .round | |
) -> some View { | |
self |
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
// | |
// ContentView.swift | |
// olympics | |
// | |
// Created by Ming on 27/7/2024. | |
// | |
import SwiftUI | |
struct ContentView: 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 | |
public struct Shimmer: AnimatableModifier { | |
private let gradient: Gradient | |
@State private var position: CGFloat = 0 | |
public var animatableData: CGFloat { | |
get { position } |