Post

Replies

Boosts

Views

Activity

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
Reply to Versioning Question
You have defined, in the Targets, in Identity section, a version number and a build number (which should appear during archiving). Is it 5.0 ?  If so, What number will be returned by "infoDictionary?["CFBundleShortVersionString"]"? it should return 5.0. But, why having 2 different version numbers ? Is it a mistake or on purpose ?
Mar ’25
Reply to Our app gets rejected the whole time
As we have no details, that can only be a guess. The reviewer does not if there are any legal classes set by Teltonika to interface with their products and probably "control" them. So they are cautious on this. What you could do: write to Teltonika and explain what your app is doing ask them if there are any limits (technical, legal or just a notice to write in your app) tor your app. ask them to provide a written letter confirming that your app is compliant with their rules. Attach this letter to your submission file. Hope that helps.
Mar ’25
Reply to App Rejected for Guideline 4.3(a) - Need Help Differentiating My App
Just relooking the UI is not enough. That often what spam are. My advice would be to add some specific features to X2. It could be additional capabilities, an Apple Watch companion app (even very simple), …  Then, state clearly in the comments to reviewer what are the differences between X1 and X2. Provide this information both for X1 and X2 submission. Add this message on any future update of your app.
Mar ’25
Reply to Why does Array's contains(_:) method cause an error when comparing an optional value with a non-optional value in Swift?
My guess for the first is that the compiler in the first performs type inference and analyses ["hello", "world"] as array of optional. let result = ["hello", "world"].contains(Optional("hello")) // ✅ Works fine But in the second, let stringArray = ["hello", "world"] let result = stringArray.contains(Optional("hello")) // ❌ Compile-time error you explicitly declare stringArray to be [String]. Then in second line, compiler balks at it.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’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
Reply to Call Center BTN melalui WhatsApp (+62) 877777 20286
I commented 3 times today, wondering how such an appreciative reply (automated probably) could be done on a spam. Problème is that it removes credibility to other (serious) Apple's engineers replies. Big sigh.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Cs Ajaib Sekuritas adalah 082172226661
3 spam, and the same appreciation message. Bizarre…
Replies
Boosts
Views
Activity
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
Replies
Boosts
Views
Activity
Apr ’25
Reply to Whatsapp ajaib adalah 082172226661
Yet another spam from the same account.
Replies
Boosts
Views
Activity
Apr ’25
Reply to Nomor Whatsapp Resmi Pintu
@App Store Connect Engineer The OP is clearly a spam. Do we really appreciate to have the forum polluted by such messages ?
Replies
Boosts
Views
Activity
Apr ’25
Reply to Versioning Question
You have defined, in the Targets, in Identity section, a version number and a build number (which should appear during archiving). Is it 5.0 ?  If so, What number will be returned by "infoDictionary?["CFBundleShortVersionString"]"? it should return 5.0. But, why having 2 different version numbers ? Is it a mistake or on purpose ?
Replies
Boosts
Views
Activity
Mar ’25
Reply to How are we supposed to get Ipad screenshots for our store, without having an Ipad? haha
I have an iPhone I was able to run the app there and take screenshots, Why would you take screenshots on the iPhone device ? That's not the way to do it. Just run the app from Xcode in a simulator (iPhone 6.9", iPhone 6.5" and iPad 13"), command-S to capture the screenshot you need, and you're done.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Our app gets rejected the whole time
As we have no details, that can only be a guess. The reviewer does not if there are any legal classes set by Teltonika to interface with their products and probably "control" them. So they are cautious on this. What you could do: write to Teltonika and explain what your app is doing ask them if there are any limits (technical, legal or just a notice to write in your app) tor your app. ask them to provide a written letter confirming that your app is compliant with their rules. Attach this letter to your submission file. Hope that helps.
Replies
Boosts
Views
Activity
Mar ’25
Reply to App Rejected for Guideline 4.3(a) - Need Help Differentiating My App
Just relooking the UI is not enough. That often what spam are. My advice would be to add some specific features to X2. It could be additional capabilities, an Apple Watch companion app (even very simple), …  Then, state clearly in the comments to reviewer what are the differences between X1 and X2. Provide this information both for X1 and X2 submission. Add this message on any future update of your app.
Replies
Boosts
Views
Activity
Mar ’25
Reply to Why does Array's contains(_:) method cause an error when comparing an optional value with a non-optional value in Swift?
My guess for the first is that the compiler in the first performs type inference and analyses ["hello", "world"] as array of optional. let result = ["hello", "world"].contains(Optional("hello")) // ✅ Works fine But in the second, let stringArray = ["hello", "world"] let result = stringArray.contains(Optional("hello")) // ❌ Compile-time error you explicitly declare stringArray to be [String]. Then in second line, compiler balks at it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Cannot snapshot view warning
10 years later… with Xcode 16.2, same error message. I do not call snapshotView.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to tableView.dequeueReusableHeaderFooterView(withIdentifier: ) crashes on iPad only
Found it. My mistake. I had a test for iPad in the viewDidload. I inadvertently put the register in the iOS section ; so it did not apply for iPad !
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to Developing a driver to read HFS disks on MacOS Sonoma and newer
Many thanks ffor the information.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Mar ’25
Reply to How to edit a question?
You cannot beyond 1 hour after posting. If it is critical to get it deleted, ask forum administrator. You may try to just mark your own post as 'Duplicate', or 'other cause' (not spam, nor inappropriate, that could cause you problems later) ; usually, post is rapidly deleted.
Replies
Boosts
Views
Activity
Mar ’25