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
struct UnknownProgressIndicator: View { | |
var size: CGFloat = 100 | |
var primaryColor = Color(red: 1.0, green: 0.5, blue: 0.4) | |
var bgColor = Color(red: 0.155, green: 0.041, blue: 0.3) | |
var animationCycleTime: CGFloat = 3.5 | |
@State private var rotation: CGFloat = 90 | |
var body: some View { | |
Circle() |
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 | |
/// These modifiers are designed to observe changes in the view's bounds and provide a stretchy background effect for a list. | |
/// | |
/// Source: https://gist.github.com/satishVekariya/c52477b6acafdf200606335e39a37382 | |
public extension View { | |
/// List/View bound change observer | |
/// | |
/// Mostly you need to use this on List cell | |
/// |
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
struct UShape: Shape { | |
var radius: CGFloat = 8 | |
var inset: CGFloat = 5/2 | |
func path(in rect: CGRect) -> Path { | |
var path = Path() | |
let rect = rect.inset(by: .init(top: 0, left: inset, bottom: inset, right: inset)) | |
let width = rect.maxX | |
let height = rect.maxY | |
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 | |
import AVKit | |
public struct VideoPlayerView<Overlay: View>: View { | |
let overlay: Overlay | |
let player: AVPlayer | |
@State private var isShowOverlay = true | |
public init(_ player: AVPlayer, overlay: () -> (Overlay)) { | |
self.player = player |
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
// | |
// CollectionViewRepresentable.swift | |
// | |
// | |
// Created by Satish Vekariya on 12/11/2023. | |
// | |
import SwiftUI | |
import UIKit |
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 UIKit | |
/// The CarouselLayoutGenerator struct provides a convenient way to generate a UICollectionViewCompositionalLayout with a carousel-style layout. | |
/// This layout is suitable for creating horizontally scrolling carousels of items, commonly used in applications to showcase a series of items or images. | |
/// | |
/// Example: | |
/// ``` | |
/// +----------------------------+ | |
/// | ______________________ ____|_________________ ______________________ | |
/// | | | | | | | | |
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 Swinject /// https://github.com/Swinject/Swinject.git | |
import Foundation | |
@propertyWrapper | |
public struct Inject<Dependency> { | |
public let wrappedValue: Dependency | |
public init(resolver: Resolver = AppAssembler.shared.resolver) { | |
wrappedValue = resolver.resolve(Dependency.self)! | |
} |
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
fileprivate struct KeyboardToolBar: ViewModifier { | |
let focusableIds: [String] | |
@State private var activeId: String? = nil | |
func body(content: Content) -> some View { | |
content | |
.toolbar { | |
ToolbarItemGroup(placement: .keyboard) { | |
if focusableIds.count > 1 { | |
Button { |
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 Combine | |
import Foundation | |
// MARK: - Polling | |
/// A thread safe polling(repeat task over given time) handler object | |
public actor Polling { | |
public typealias TaskItem = () async -> Void | |
public typealias PollingTask = Task<Void, Never> | |
typealias PollingSubject = CurrentValueSubject<Int, Never> |
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
// | |
// LastAtBottomVStack.swift | |
// | |
// | |
// Created by Satish Vekariya on 21/04/2023. | |
// | |
import SwiftUI | |
// MARK: - LastAtBottomVStack |
NewerOlder