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 | |
| /// 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 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
| 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 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 extension View { | |
| /// Adds a polling task to a SwiftUI view that repeatedly performs an asynchronous action at a specified interval. | |
| /// | |
| /// This method wraps SwiftUI's `.task(id:priority:)` modifier to repeatedly invoke a given asynchronous `action` | |
| /// until the task is cancelled. It is useful for scenarios like periodic data refreshing. | |
| /// | |
| /// - Parameters: | |
| /// - value: A value to identify the task. Changing this value will cancel and restart the task. Must conform to `Equatable`. |
OlderNewer