Post

Replies

Boosts

Views

Activity

Reply to SwiftUI slider step broken since iOS 15
Trying to post the code in an answer again. VStack { HStack { Text("Trades per session: \(Int(settings.tradesPerGame))"); Spacer() } Slider( value: $settings.tradesPerGame, in: 5 ... 100, step: 5, onEditingChanged: { editing in if !editing { UserDefaults.standard.set( settings.tradesPerGame, forKey: Setting.tradesPerGame.rawValue ) } } ) { EmptyView() } }
Oct ’21
Reply to SwiftUI slider step broken since iOS 15
I tried to post it in an answer, but when I submitted it disappeared. This is the code: VStack { HStack { Text("Trades per session: (Int(settings.tradesPerGame))"); Spacer() } Slider( value: $settings.tradesPerGame, in: 5 ... 100, step: 5, onEditingChanged: { editing in if !editing { UserDefaults.standard.set( settings.tradesPerGame, forKey: Setting.tradesPerGame.rawValue ) } } ) { EmptyView() } }
Oct ’21
Reply to SwiftUI slider step broken since iOS 15
My code looks like this: VStack { HStack { Text("Trades per session: \(Int(settings.tradesPerGame))"); Spacer() } Slider( value: $settings.tradesPerGame, in: 5 ... 100, step: 5, onEditingChanged: { editing in if !editing { UserDefaults.standard.set( settings.tradesPerGame, forKey: Setting.tradesPerGame.rawValue ) } } ) { EmptyView() } }
Oct ’21