Post

Replies

Boosts

Views

Activity

Reply to HELP!
You will need Swift in anycase, either you use UIKit or SwiftUI. But you will probably learn the two at the same time. Go to pathway : https : / / developer.apple.com/pathways/?cid=ht-pathways
Apr ’25
Reply to Myanmar Language font changed after iOS 18.4
The problem could come from the baseline offset: https://stackoverflow.com/questions/69760382/how-do-i-fix-clipped-ascenders-and-descenders-in-a-custom-font See more here: https://medium.com/mobimeo-technology/what-if-your-designers-want-a-baseline-grid-on-ios-d5234c7b52c0 Here on how to change offset (through attributes): https://developer.apple.com/forums/thread/124799 Why did it change in iOS 18.4 is another question…
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Reply to Impossible to post a reply on the forum ?
So, I try now to answer my own post (this one)… It works. But not when trying to reply to another thread, such as: https://developer.apple.com/forums/thread/779777 I tried from an iPhone, doesn't work either. It seems that the (new) anti spam is at work. • If I post this answer, with the word f r e e (edited from f--e), reply not accepted. Go here for (f r e e) material to get started: https://developer.apple.com/pathways/?cid=ht-pathways • But this reply is accepted: Go here for material to get started: https://developer.apple.com/pathways/?cid=ht-pathways Anti spam is now way too sensitive.
Apr ’25
Reply to Unable to use altitude for our use case (NYC MTA)
That's an intrinsic limite of GPS localisation (not iPhone): vertical precision is less than horizontal. You have probably noticed in your car. Sometimes, at the same point on a road, it says 295m, another day 305. 30 ft difference. See details here and may be some hints to a workaround: https://stackoverflow.com/questions/8282169/cllocation-elevation-accuracy Ot to get info on vertical accuracy: https://developer.apple.com/documentation/corelocation/cllocation/verticalaccuracy
Apr ’25
Reply to How to capture the currently pressed key when a TextField is in focus?
Did you try to use .onChange ? If you want to detect a pressed key (but not a typed character in the TextField, that will not do it. or onKeyPress ? More details here: https://www.avanderlee.com/swiftui/key-press-events-detection/#:~:text=Key%20press%20events%20detection%20in%20SwiftUI%20allows%20you%20to%20listen,able%20to%20get%20any%20callbacks. Something like: struct ContentView: View { @State private var vText: String = "" var body: some View { HStack { TextField("Enter text", text: Binding( get: { vText }, set: { newValue in // print("Text will change to: \(newValue)") vText = newValue } )) .onChange(of: vText) { oldText, newText in let typed = newText.replacingOccurrences(of: oldText, with: "") if newText.count < oldText.count { print("backspace") } else { print("typed char is: ", typed) } } } .onKeyPress(characters: .alphanumerics, /*phases: .up, */action: { keyPress in print("Released key \(keyPress.characters)") return .ignored // handled would intercept the typing }) } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Apr ’25
Reply to Persistent 'buildExpression unavailable' error in ContentView with switch/AppState
Problem: I consistently get the build error 'buildExpression' is unavailable: this expression does not conform to 'View' pointing to the lines inside the .setup and .game cases of the switch statement in ContentView. No problem with WelcomeView ? Do you still get the problem if you replace .transition(.asymmetric(insertion: .move(edge: .trailing), removal: .move(edge: .leading))) by .transition(.opacity) in SetupView ? Could you also show how you declare the environment var in struct TheApp: App { }
Topic: UI Frameworks SubTopic: SwiftUI
Apr ’25