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 UIKit | |
| extension UIView { | |
| /* Usage Example | |
| * bgView.addBottomRoundedEdge(desiredCurve: 1.5) | |
| */ | |
| func addBottomRoundedEdge(desiredCurve: CGFloat?) { |
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 | |
| import HealthKit | |
| struct WorkoutSplit: Hashable { | |
| let label: String | |
| let distance: HKQuantity | |
| let duration: TimeInterval | |
| } | |
| extension WorkoutSplit { |
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 | |
| import HealthKit | |
| struct WorkoutSplit: Hashable { | |
| let label: String | |
| let distance: HKQuantity | |
| let duration: TimeInterval | |
| } | |
| extension WorkoutSplit { |
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 | |
| private struct OnFirstAppear: ViewModifier { | |
| let perform: () -> Void | |
| @State private var firstTime = true | |
| func body(content: Content) -> some View { | |
| content.onAppear { | |
| if firstTime { |
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 | |
| private struct OnLoad: ViewModifier { | |
| let action: () -> Void | |
| @State private var loaded = false | |
| func body(content: Content) -> some View { | |
| content.onAppear { | |
| if !loaded { | |
| loaded = true |
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
| extension StringProtocol { | |
| subscript(_ offset: Int) -> String.Element { | |
| if offset >= 0 { | |
| self[index(startIndex, offsetBy: offset)] | |
| } else { | |
| self[index(endIndex, offsetBy: offset)] | |
| } | |
| } | |
OlderNewer

