Post

Replies

Boosts

Views

Activity

Reply to Issue with calculating the distance between two points on a map
You should either declare from and to in: an init() - just declare type in the general declaration and set value in init in .onAppear as a modifier of the VStack But there are many errors in the code that you have to correct first: you call distance in the distance func. That will cause infinite loop return from.distance(from: to) You need to set values of parameters, let distanceFrom = from.distance(from: to) such as let distanceFrom = from.distance(from: from, to: to) from is a CLLocationCoordinate2D But distance is defined for CLLocation only…
Apr ’25
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 Issue with calculating the distance between two points on a map
You should either declare from and to in: an init() - just declare type in the general declaration and set value in init in .onAppear as a modifier of the VStack But there are many errors in the code that you have to correct first: you call distance in the distance func. That will cause infinite loop return from.distance(from: to) You need to set values of parameters, let distanceFrom = from.distance(from: to) such as let distanceFrom = from.distance(from: from, to: to) from is a CLLocationCoordinate2D But distance is defined for CLLocation only…
Replies
Boosts
Views
Activity
Apr ’25
Reply to My first Xcode build ever But EXC_BAD_ACCESS (code=2, address=0x16e837f30) keeps happening
You'd better show the complete code. Is it SwiftUI ? UIKit ? The fact that image is of Niagara Falls or a corn field in Kansas does not matter and is useless information.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Impossible to post a reply on the forum ?
Really messy here. This post was rejected several times as well, after a Gateway timeout in some cases. 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
Replies
Boosts
Views
Activity
Apr ’25
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
Replies
Boosts
Views
Activity
Apr ’25
Reply to Impossible to post a reply on the forum ?
Just filed a bug report: Apr 7, 2025 at 2:09 PM – FB17148876
Replies
Boosts
Views
Activity
Apr ’25
Reply to My App Rejected 4.3 Design: Spam
A 20 lines dense text, mixing facts and just feelings and recriminations, is just unreadable. Please state clearly what is the question you have that other developers may help you resolve.
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Impossible to post a reply on the forum ?
Removed
Replies
Boosts
Views
Activity
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.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Help!
Go here for (gratis) material to get started: https://developer.apple.com/pathways/?cid=ht-pathways
Replies
Boosts
Views
Activity
Apr ’25
Reply to Problems With Car Connectivity
You once had problem with your Suzuki, now with your Skoda… It would probably be time to stop installing betas on your main phone… In any case, the forum is not the place to expose usage issues. Go to the support forum or file a bug report instead.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Myanmar Language font changed after iOS 18.4
What happens if you set the frame height ? Text("\(count.toMyanmarDigits())") .frame(height: 50) // or even 60 .font(.system(size: 40, weight: .bold, design: .rounded)) .monospaced() .foregroundStyle(.accent)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Apr ’25
Reply to Is a spam an appreciated participation in the forums ?
Very good news Quinn. And thanks for taking the time to reply.
Replies
Boosts
Views
Activity
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
Replies
Boosts
Views
Activity
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:
Replies
Boosts
Views
Activity
Apr ’25