Skip to content

Instantly share code, notes, and snippets.

View Codelaby's full-sized avatar

Codelaby Codelaby

View GitHub Profile
@Koshimizu-Takehito
Koshimizu-Takehito / VisualEffect3.swift
Created April 12, 2025 10:59
visualEffectモディファイア
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)
}
@JEuler
JEuler / ReorderableListExample.swift
Created March 16, 2025 23:31
SwiftUI Reorder With Buttons List Example
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 {
@JuniperPhoton
JuniperPhoton / FloatingOverlayApp.swift
Last active March 31, 2025 08:47
A simple application to show a black, resizable, title-less, always-on-top NSWindow on Mac.
//
// FloatingOverlayApp.swift
// FloatingOverlay
//
// Created by JuniperPhoton on 2025/3/12.
//
import SwiftUI
// Dependency: https://github.com/sindresorhus/KeyboardShortcuts
@rygrob
rygrob / BezierGridView.swift
Created February 5, 2025 17:36
Bézier Grid View
import SwiftUI
struct BezierGridView: View {
@State private var vertices: [[BezierVertex]]
let rows: Int
let cols: Int
init(rows: Int, cols: Int) {
self.rows = rows
@Lofionic
Lofionic / ContentView.swift
Last active October 22, 2024 23:34
Shader fun
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()
import SwiftUI
extension View where Self: Shape {
func glow(
fill: some ShapeStyle,
lineWidth: Double,
blurRadius: Double = 8.0,
lineCap: CGLineCap = .round
) -> some View {
self
@1998code
1998code / ContentView.swift
Created July 27, 2024 10:48
Olympic Games 2024
//
// ContentView.swift
// olympics
//
// Created by Ming on 27/7/2024.
//
import SwiftUI
struct ContentView: View {
@metasidd
metasidd / PillButtons.swift
Last active June 30, 2024 02:45
Pill Buttons - Mail App iOS 18 - SwiftUI
//
// PillButtons.swift
//
// Created by Siddhant Mehta on 6/11/24
// Twitter: @metasidd
//
// Feel free to reuse, or remix.
import SwiftUI
@xavierLowmiller
xavierLowmiller / Shimmer.swift
Last active April 4, 2025 02:36
Slide-to-Unlock animation in SwiftUI
import SwiftUI
public struct Shimmer: AnimatableModifier {
private let gradient: Gradient
@State private var position: CGFloat = 0
public var animatableData: CGFloat {
get { position }