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 MyToggle: View { | |
@Binding var isOn: Bool | |
private enum SwitchState { | |
case notPressed | |
case pressed(percent: CGFloat) | |
} | |
@State private var state: SwitchState = .notPressed | |
@State private var startPercent: CGFloat? | |
@State private var pressed = false | |