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 Cancel: CustomAnimation { | |
func animate<V: VectorArithmetic>( | |
value: V, time: TimeInterval, context: inout AnimationContext<V> | |
) -> V? { | |
return nil // Fin inmediato | |
} | |
func shouldMerge<V>( |
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: Expandable Floating Action Button | |
struct ExpandableFAB<Content: View>: View { | |
@Binding var isPresented: Bool | |
@ViewBuilder var content: Content | |
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
// | |
// AudiowaveDemo.swift | |
// RangeSlidersPlaygroun | |
// | |
// Created by Codelaby on 9/4/25. | |
// | |
import SwiftUI | |
import AVKit |
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 ChatMessageModel: Identifiable, Hashable, Sendable { | |
var id: UUID = .init() | |
let content: String | |
let timestamp: Date | |
let sender: String | |
} |
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
// | |
// CraterShape.swift | |
// IOS18Playground | |
// | |
// Created by Codelay on 26/3/25. | |
// | |
import SwiftUI | |
// Helper for animating three values |
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 Foundation | |
class Tree { | |
let left, right: Tree? | |
init(left: Tree?, right: Tree?) { | |
self.left = left | |
self.right = right | |
} | |
} | |
let tree = (1..<100000000).reduce(Tree(left: nil, right: nil), { prev, result in |
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 | |
// AnimationTimingCurve | |
// | |
// Created by Chris Eidhof on 25.09.19. | |
// Copyright © 2019 Chris Eidhof. All rights reserved. | |
// | |
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
/// Renders `View` as `UIImage`. | |
extension View { | |
func snapshot(renderOnce: UnsafeMutablePointer<Bool>? = nil) -> UIImage? { | |
if let flag = renderOnce, flag.pointee { | |
return nil | |
} | |
renderOnce?.pointee = true | |
let renderer = ImageRenderer(content: self) | |
renderer.scale = UIScreen.main.scale |
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 |
NewerOlder