Post

Replies

Boosts

Views

Activity

Reply to SwiftUI view execution confusion, both buttons execute same code
Change like this: var body: some View { Form { TextField("Enter name", text: $personModel.modelName) HStack { Button("Cancel") { print("in cancel") presentationMode.wrappedValue.dismiss() } .buttonStyle(BorderlessButtonStyle()) Spacer() Button("Save") { print("in save") personModel.save() presentationMode.wrappedValue.dismiss() } .buttonStyle(BorderlessButtonStyle()) } } } Adding .buttonStyle(BorderlessButtonStyle()). Problem was caused by Form (idem with List) : all the HStack react to tap. Read here: h t t p s : / / w w w.hackingwithswift.com/forums/swiftui/button-s-on-click-event-being-applied-to-hstack-surrounding-it/2859
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Oct ’21
Reply to Developer Account for Kids
That's a suggestion / request to make by filing a Feedback assistant report with suggestion. You can already set a free account that allows to download app on an iPhone. It will work 7 days, after which you will need to download again. You will find information about this free developer program on the web, or here: https://developer.apple.com/forums/thread/71283
Topic: Business & Education SubTopic: General Tags:
Oct ’21
Reply to Deleted Table View Cell Copying Remaining Tableview Cell Instead of Disappearing
Why do you repeat reload line 11 ? 1. if let spotKey = spot.key { 2. Database.database().reference().child("Spots").child(spotKey).removeValue { (error, ref) in 3. if error != nil { 4. print("Failed to delete message:", error!) 5. return 6. } 7. self.spotsList.remove(at: indexPath.row) 8. self.tblSpots.deleteRows(at: [indexPath], with: .automatic) 9. self.tblSpots.reloadData() 10. } 11. tblSpots.reloadData() 12. } Try commenting out this line 11.
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to Xcode crashing Mac
Is it a SwiftUI code ? According to this post: https://developer.apple.com/forums/thread/691415, there is a problem with Xcode 13. And Swift team now aware of it. You should file a critical bug, to hopefully speed up correction. In the meantime, you may have to revert to last Xcode 12 (12.5.1 that you can download here: h t t p s : / / xcodereleases.com)
Oct ’21
Reply to UITableView reload not working
What is the goal of following statement ? In which cases does Users[matches.memberId] == nil and != nil ?                   guard blockedUsers[matches.memberId] == nil else { return } I'm not sure to understand because logic is a bit complex. If blockedUsers[matches.memberId] is nil then you append matches ? Is it what you want ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Oct ’21
Reply to Print location shared when user tap 'locate me' button
What is it you don't know how to do ? To display an alert: let alert = UIAlertController(title: "Notice", message: "Check location", preferredStyle: .alert) alert.addAction(UIAlertAction( title: "OK", style: UIAlertAction.Style.default, handler: { _ in DispatchQueue.main.async { // to update UI // Here I segue to another VC if let passDataVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NoticeViewID") as? NoticeScrollViewController { self.present(passDataVC, animated: true, completion: nil) } } })) self.present(alert, animated: true, completion: { print("some message") } )
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to 5.1.1(x) - How does Apple expect us to support user accounts without contact details?
"Apps may request basic contact information (such as name and email address) so long as the request is optional for the user, features and services are not conditional on providing the information, ….” The way I understand it: you cannot force customer to give a contact address and need to provide the service of the app (but clause 5.1.1(v) says differently, as you noted, for Core functionalities that need ID): so the question is "how do we define a core functionality and prove it requires ID" ? And whether 5.1.1.(v) supersedes 5.1.1.(x) However, you could state that support like recovery of lost password for instance will not be available in such a case. As this is outside the app, I understand it is authorised. Did you contact support ?
Topic: Privacy & Security SubTopic: General Tags:
Oct ’21
Reply to Print location shared when user tap 'locate me' button
What about changing like this:     func checkLocationAuthorization() { let manager = CLLocationManager() switch manager.authorizationStatus { case .authorizedWhenInUse: print("authorizedWhenInUse") case .denied: print("denied") // Show alert telling users how to turn on permissions let alertController = UIAlertController(title: "Localisation denied", message: "Change privacy settings for the app", preferredStyle: .alert) let okAction = UIAlertAction(title: "OK", style: .cancel, handler: {action in}) alertController.addAction(okAction) present(alertController, animated: true, completion: nil) case .notDetermined: print("notDetermined") case .restricted: print("restricted")// Show an alert letting them know what’s up case .authorizedAlways: print("authorizedAlways") @unknown default: break } }
Topic: Programming Languages SubTopic: Swift Tags:
Oct ’21
Reply to SwiftUI view execution confusion, both buttons execute same code
Change like this: var body: some View { Form { TextField("Enter name", text: $personModel.modelName) HStack { Button("Cancel") { print("in cancel") presentationMode.wrappedValue.dismiss() } .buttonStyle(BorderlessButtonStyle()) Spacer() Button("Save") { print("in save") personModel.save() presentationMode.wrappedValue.dismiss() } .buttonStyle(BorderlessButtonStyle()) } } } Adding .buttonStyle(BorderlessButtonStyle()). Problem was caused by Form (idem with List) : all the HStack react to tap. Read here: h t t p s : / / w w w.hackingwithswift.com/forums/swiftui/button-s-on-click-event-being-applied-to-hstack-surrounding-it/2859
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Developer Account for Kids
That's a suggestion / request to make by filing a Feedback assistant report with suggestion. You can already set a free account that allows to download app on an iPhone. It will work 7 days, after which you will need to download again. You will find information about this free developer program on the web, or here: https://developer.apple.com/forums/thread/71283
Topic: Business & Education SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Axie Infinity
This repeated question looks like a spam.
Replies
Boosts
Views
Activity
Oct ’21
Reply to Deleted Table View Cell Copying Remaining Tableview Cell Instead of Disappearing
Why do you repeat reload line 11 ? 1. if let spotKey = spot.key { 2. Database.database().reference().child("Spots").child(spotKey).removeValue { (error, ref) in 3. if error != nil { 4. print("Failed to delete message:", error!) 5. return 6. } 7. self.spotsList.remove(at: indexPath.row) 8. self.tblSpots.deleteRows(at: [indexPath], with: .automatic) 9. self.tblSpots.reloadData() 10. } 11. tblSpots.reloadData() 12. } Try commenting out this line 11.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Change my country and reset my account
Read this Apple support note: https://support.apple.com/en-euro/HT201389
Replies
Boosts
Views
Activity
Oct ’21
Reply to Xcode crashing Mac
Is it a SwiftUI code ? According to this post: https://developer.apple.com/forums/thread/691415, there is a problem with Xcode 13. And Swift team now aware of it. You should file a critical bug, to hopefully speed up correction. In the meantime, you may have to revert to last Xcode 12 (12.5.1 that you can download here: h t t p s : / / xcodereleases.com)
Replies
Boosts
Views
Activity
Oct ’21
Reply to Can not remove the reviewing version.
By experience, I noticed that it should be better to complete the first submission and send a new one immediately after for review. Otherwise the first may block the whole process.
Replies
Boosts
Views
Activity
Oct ’21
Reply to How do i get rid of the black background behind my HStack?
Could you show the code ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Launch screen xcode 13 beta
What is in Swift, what is in SwiftUI ?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to UITableView reload not working
What is the goal of following statement ? In which cases does Users[matches.memberId] == nil and != nil ?                   guard blockedUsers[matches.memberId] == nil else { return } I'm not sure to understand because logic is a bit complex. If blockedUsers[matches.memberId] is nil then you append matches ? Is it what you want ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Deleted Table View Cell Copying Remaining Tableview Cell Instead of Disappearing
Sorry this is an older version of the code Too bad 😉 So could you post the actual code that still fails ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Print location shared when user tap 'locate me' button
What is it you don't know how to do ? To display an alert: let alert = UIAlertController(title: "Notice", message: "Check location", preferredStyle: .alert) alert.addAction(UIAlertAction( title: "OK", style: UIAlertAction.Style.default, handler: { _ in DispatchQueue.main.async { // to update UI // Here I segue to another VC if let passDataVC = UIStoryboard(name: "Main", bundle: nil).instantiateViewController(withIdentifier: "NoticeViewID") as? NoticeScrollViewController { self.present(passDataVC, animated: true, completion: nil) } } })) self.present(alert, animated: true, completion: { print("some message") } )
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to 5.1.1(x) - How does Apple expect us to support user accounts without contact details?
"Apps may request basic contact information (such as name and email address) so long as the request is optional for the user, features and services are not conditional on providing the information, ….” The way I understand it: you cannot force customer to give a contact address and need to provide the service of the app (but clause 5.1.1(v) says differently, as you noted, for Core functionalities that need ID): so the question is "how do we define a core functionality and prove it requires ID" ? And whether 5.1.1.(v) supersedes 5.1.1.(x) However, you could state that support like recovery of lost password for instance will not be available in such a case. As this is outside the app, I understand it is authorised. Did you contact support ?
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to How do i get the whole background to be the same color?
I tested on Xcode 13.1RC and 13 with iPhone 12 ProMax and iPhone 8 simulators 15.0. All work OK: 13.1RC-12ProMax 13- 12ProMax 13 iPhone 8:
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Oct ’21
Reply to Print location shared when user tap 'locate me' button
What about changing like this:     func checkLocationAuthorization() { let manager = CLLocationManager() switch manager.authorizationStatus { case .authorizedWhenInUse: print("authorizedWhenInUse") case .denied: print("denied") // Show alert telling users how to turn on permissions let alertController = UIAlertController(title: "Localisation denied", message: "Change privacy settings for the app", preferredStyle: .alert) let okAction = UIAlertAction(title: "OK", style: .cancel, handler: {action in}) alertController.addAction(okAction) present(alertController, animated: true, completion: nil) case .notDetermined: print("notDetermined") case .restricted: print("restricted")// Show an alert letting them know what’s up case .authorizedAlways: print("authorizedAlways") @unknown default: break } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Oct ’21