This file contains 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
#Preview { | |
@Previewable @State var currentPage = 0 | |
HPagingScrollView(currentPage: $currentPage, spacing: 30, pageWidth: 200, pageHeight: 450) { | |
RoundedRectangle(cornerRadius: 20) | |
RoundedRectangle(cornerRadius: 20) | |
RoundedRectangle(cornerRadius: 20) | |
RoundedRectangle(cornerRadius: 20) | |
} |
This file contains 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
// | |
// View+OpenUrl.swift | |
// | |
// Created by James Sedlacek on 11/26/24. | |
// | |
/// This file provides a safe way to open URLs in SwiftUI applications. | |
/// It adds a view modifier that handles URL opening with user confirmation | |
/// and multiple opening options (browser, in-app, or copy to clipboard). | |
/// |
This file contains 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
// | |
// MatrixEffect.swift | |
// | |
// Created by J.T on 9/8/24. | |
// | |
import SwiftUI | |
import Combine | |
class MatrixEffectModel: ObservableObject { |
This file contains 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
// by klaytonb | |
// https://forums.developer.apple.com/forums/thread/699111?answerId=740437022#740437022 | |
import Combine | |
import SwiftUI | |
public extension Publishers { | |
static var keyboardHeight: AnyPublisher<CGFloat, Never> { | |
let willShow = NotificationCenter.default.publisher(for: UIApplication.keyboardWillShowNotification) | |
.map { $0.keyboardHeight } | |
let willHide = NotificationCenter.default.publisher(for: UIApplication.keyboardWillHideNotification) |
This file contains 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 ScrollViewWrapper<Content: View>: UIViewRepresentable { | |
@Binding var contentOffset: CGPoint | |
let content: () -> Content | |
public init(contentOffset: Binding<CGPoint>, @ViewBuilder _ content: @escaping () -> Content) { | |
self._contentOffset = contentOffset | |
self.content = content | |
} |
This file contains 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 { | |
HStack { | |
Text("Hello") | |
.padding() | |
.background(.blue) | |
.overlay { | |
Color.yellow |