Post

Replies

Boosts

Views

Activity

Reply to Xcode 26.1 RC issue
Same problem here with ReportCrash. But I see it even with the iOS 26.0 Simulator. It started in Xcode 26.1. I didn't have this issue in Xcode 26.0. Reported yesterday via Feedback Assistant: FB20918609 I can't work like this. My MacBook is getting extremely hot in seconds.
Nov ’25
Reply to SwiftUI - conditional onChange
OK, I've figured it out 🙂 I needed two variables, one per TextField: isFocused1, isFocused2. Each of them changes to true with onEditingChanged. And each onChange has if condition that checks if isFocused for this TextField is true. Now onChange is triggered only if each TextField is being edited. I have added changing background colors to visualize focus changes. Working code: import SwiftUI struct ContentView: View { @State private var string1: String = "" @State private var int1: Int = 0 @State private var string2: String = "" @State private var int2: Int = 0 let multiplier: Int = 2 @State private var isFocused1 = false @State private var isFocused2 = false var body: some View { VStack { HStack { TextField("0", text: $string1, onEditingChanged: { (changed) in isFocused1 = changed }) .keyboardType(.decimalPad) .onChange(of: string1, perform: { value in if isFocused1 { int1 = Int(string1) ?? 0 int2 = int1 * multiplier string2 = "\(int2)" print("int1: \(int1)") } }) .background(isFocused1 ? Color.yellow : Color.gray) } .multilineTextAlignment(.trailing) .font(.largeTitle) HStack { Spacer() Text("x2") } HStack { TextField("0", text: $string2, onEditingChanged: { (changed) in isFocused2 = changed }) .keyboardType(.decimalPad) .onChange(of: string2, perform: { value in if isFocused2 { int2 = Int(string2) ?? 0 int1 = int2 / multiplier string1 = ("\(int1)") print("int2: \(int2)") } }) .background(isFocused2 ? Color.yellow : Color.gray) } .multilineTextAlignment(.trailing) .font(.largeTitle) } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
Reply to Xcode 26.1 RC issue
Same problem here with ReportCrash. But I see it even with the iOS 26.0 Simulator. It started in Xcode 26.1. I didn't have this issue in Xcode 26.0. Reported yesterday via Feedback Assistant: FB20918609 I can't work like this. My MacBook is getting extremely hot in seconds.
Replies
Boosts
Views
Activity
Nov ’25
Reply to Last 24 Hours removed from Sales & Trends?
Same problem. It disappeared yesterday. It didn't show anything but now it shows me just one point on the axis with the aggregate of all my sales. Dear Apple, please bring the "Last 24 Hours" view 🥹
Replies
Boosts
Views
Activity
Nov ’24
Reply to App screenshots - PNG or JPG?
Thanks. Good point about the simulator. I just started to wonder because I noticed my screenshots sometimes need a while to load when I’m checking my apps in the App Store app. And I always use PNG files which are often much bigger than JPG.
Replies
Boosts
Views
Activity
Jul ’24
Reply to 500 error code when trying to create a new Sandbox user
Same problem here. Did anyone manage to fix this? 😕
Replies
Boosts
Views
Activity
Mar ’23
Reply to SwiftUI - conditional onChange
OK, I've figured it out 🙂 I needed two variables, one per TextField: isFocused1, isFocused2. Each of them changes to true with onEditingChanged. And each onChange has if condition that checks if isFocused for this TextField is true. Now onChange is triggered only if each TextField is being edited. I have added changing background colors to visualize focus changes. Working code: import SwiftUI struct ContentView: View { @State private var string1: String = "" @State private var int1: Int = 0 @State private var string2: String = "" @State private var int2: Int = 0 let multiplier: Int = 2 @State private var isFocused1 = false @State private var isFocused2 = false var body: some View { VStack { HStack { TextField("0", text: $string1, onEditingChanged: { (changed) in isFocused1 = changed }) .keyboardType(.decimalPad) .onChange(of: string1, perform: { value in if isFocused1 { int1 = Int(string1) ?? 0 int2 = int1 * multiplier string2 = "\(int2)" print("int1: \(int1)") } }) .background(isFocused1 ? Color.yellow : Color.gray) } .multilineTextAlignment(.trailing) .font(.largeTitle) HStack { Spacer() Text("x2") } HStack { TextField("0", text: $string2, onEditingChanged: { (changed) in isFocused2 = changed }) .keyboardType(.decimalPad) .onChange(of: string2, perform: { value in if isFocused2 { int2 = Int(string2) ?? 0 int1 = int2 / multiplier string1 = ("\(int1)") print("int2: \(int2)") } }) .background(isFocused2 ? Color.yellow : Color.gray) } .multilineTextAlignment(.trailing) .font(.largeTitle) } .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21