Post

Replies

Boosts

Views

Activity

Reply to Reference to currently active window
Did you see this one (at the end of the thread) ? https://stackoverflow.com/questions/26667009/get-top-most-uiviewcontroller I copy the answer here: extension UIApplication { func topViewController() -> UIViewController? { var topViewController: UIViewController? = nil if #available(iOS 13, *) { for scene in connectedScenes { if let windowScene = scene as? UIWindowScene { for window in windowScene.windows { if window.isKeyWindow { topViewController = window.rootViewController } } } } } else { topViewController = keyWindow?.rootViewController } while true { if let presented = topViewController?.presentedViewController { topViewController = presented } else if let navController = topViewController as? UINavigationController { topViewController = navController.topViewController } else if let tabBarController = topViewController as? UITabBarController { topViewController = tabBarController.selectedViewController } else { // Handle any other third party container in `else if` if required break } } return topViewController } } // It could be used in this way: let topController = UIApplication.shared.topViewController() topController?.present(controllerToPresent, animated: true, completion: nil) If you don't need iOS < 13, you can remove the call to keywindow. Hope that works for you.
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to Guideline 3.2
it was approved, and it was pending publication. Why didn't you publish at the time ? Rejecting a publication is generally not a good idea, as it can block the process. It is better to publish and immediately submit a new release. . I also do not understand why it was rejected by the same reason that I explained two or three months ago and after having an approved binary that was pending of publication if the functionalities and design of the app are the same. Problem may be that reviewer is not the same. A good practice, if you have had problems to get accepted one time, is to very clearly explain the situation for the new review: what issues were raised, how you solved and that it was accepted. Note: which topic in 3.2.2 caused the rejection ?
Nov ’21
Reply to How to load a URL ?
What do you want to do exactly ? load and open in a web page ? @IBAction func testLoad(_ sender: Any) { let website = "https://www.google.com/" let vc = SFSafariViewController(url: URL(string: website)!) if #available(iOS 13.0, *) { vc.modalPresentationStyle = .overFullScreen } else { // Fallback on earlier versions } present(vc, animated: true) } load data from a site ? For instance from a txt file: var theText = ""             // 1. Build request for file let url = URL(string:"https://someSite.com/TestAir.txt")! let request = URLRequest(url: url) // 2. Sends request with the completion, launch task sendRequest(request: request) { (data) in if let dataRead = data, let readText = String(data: dataRead, encoding: .utf8) { theText = readText } } What else ?
Nov ’21
Reply to Save Changes
Normally, it is with Cmd-S. have a detailed look here: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/Web_Inspector_Tutorial/EditingCode/EditingCode.html
Topic: Safari & Web SubTopic: General Tags:
Nov ’21
Reply to Guideline 3.2
So, the older version of your app is on the Appstore ? And you submitted a new version that was rejected for a different reason ? Did you explain what you wrote here in Comments for reviewer ? . Now they reject the app because they think that my app should be in Apple Manager Bussines I do sot find this in Guidelines 3.2.2 What is the exact message you get ?
Nov ’21
Reply to Both protocol and implement have same name and type, however different Optional Type value.
Why are you surprised ? 1. protocol TTTT { 2. 3. var sid: String? { get set } 4. 5. } 6. 7. class ViewController: UIViewController { 8. 9. var sid: String = "" 10. 11. override func viewDidLoad() { 12. 13. super.viewDidLoad() 14. 15. // Do any additional setup after loading the view. 16. 17. } 18. } 19. 20. extension ViewController: TTTT { 21. 22. var sid: String? { 23. 24. get { 25. // Need some return value 26. } 27. 28. set { 29. 30. } 31. } 32. } Line 22, whatever type you give to sid var sid: String? { is a redeclaration of the class property at line 9:     var sid: String = "" You would have the same error with     var sid: String? = "" Of course, the following does work: protocol TTTT { var sid2: String? { get set } } class ViewController: UIViewController { var sid: String? = "" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view.          sid = sid2 // <<-- set sid property } } extension ViewController: TTTT { var sid2: String? { get { return "" } set { } } } Note: it is not a good practice to reuse same names in such situations.
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to Reference to currently active window
Did you see this one (at the end of the thread) ? https://stackoverflow.com/questions/26667009/get-top-most-uiviewcontroller I copy the answer here: extension UIApplication { func topViewController() -> UIViewController? { var topViewController: UIViewController? = nil if #available(iOS 13, *) { for scene in connectedScenes { if let windowScene = scene as? UIWindowScene { for window in windowScene.windows { if window.isKeyWindow { topViewController = window.rootViewController } } } } } else { topViewController = keyWindow?.rootViewController } while true { if let presented = topViewController?.presentedViewController { topViewController = presented } else if let navController = topViewController as? UINavigationController { topViewController = navController.topViewController } else if let tabBarController = topViewController as? UITabBarController { topViewController = tabBarController.selectedViewController } else { // Handle any other third party container in `else if` if required break } } return topViewController } } // It could be used in this way: let topController = UIApplication.shared.topViewController() topController?.present(controllerToPresent, animated: true, completion: nil) If you don't need iOS < 13, you can remove the call to keywindow. Hope that works for you.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Guideline 3.2
it was approved, and it was pending publication. Why didn't you publish at the time ? Rejecting a publication is generally not a good idea, as it can block the process. It is better to publish and immediately submit a new release. . I also do not understand why it was rejected by the same reason that I explained two or three months ago and after having an approved binary that was pending of publication if the functionalities and design of the app are the same. Problem may be that reviewer is not the same. A good practice, if you have had problems to get accepted one time, is to very clearly explain the situation for the new review: what issues were raised, how you solved and that it was accepted. Note: which topic in 3.2.2 caused the rejection ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to Can't run Xcode project on iPhone
The code signature version is no longer supported. You have apparently a signature error: Are you trying to load the app from Xcode by running on your device ? Check in the project Targets > Signing & Capabilities
Replies
Boosts
Views
Activity
Nov ’21
Reply to Please contact us regarding App Store Review Guidelines 5.1.1.
Please contact us Who asks to contact whom ? Is it a message from reviewer ? When you create account, yo do some operations, to get and store data. Delete means deleting them all. If you have any doubt, explain in the comments for reviewer during submission how you allow to delete and what the delete does.
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to load a URL ?
What do you want to do exactly ? load and open in a web page ? @IBAction func testLoad(_ sender: Any) { let website = "https://www.google.com/" let vc = SFSafariViewController(url: URL(string: website)!) if #available(iOS 13.0, *) { vc.modalPresentationStyle = .overFullScreen } else { // Fallback on earlier versions } present(vc, animated: true) } load data from a site ? For instance from a txt file: var theText = ""             // 1. Build request for file let url = URL(string:"https://someSite.com/TestAir.txt")! let request = URLRequest(url: url) // 2. Sends request with the completion, launch task sendRequest(request: request) { (data) in if let dataRead = data, let readText = String(data: dataRead, encoding: .utf8) { theText = readText } } What else ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to Save Changes
Normally, it is with Cmd-S. have a detailed look here: https://developer.apple.com/library/archive/documentation/NetworkingInternetWeb/Conceptual/Web_Inspector_Tutorial/EditingCode/EditingCode.html
Topic: Safari & Web SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to I Can't edit my bank info on App Store Connect
Did you check all the information on the page to save ? That may be another field which is incorrect.
Replies
Boosts
Views
Activity
Nov ’21
Reply to I upload modifications to testflight and the testers do not see the changes.
I have uploaded them and the internal tester of my app do not see the changes made Please detail exactly how you uploaded the new version.
Replies
Boosts
Views
Activity
Nov ’21
Reply to App partial localization
Localised means fully localised, not only some elements. What you could do is let it be known in app description that subtitles are displayed in the local language. But Appstore may state that the app is only available in one language (which is in fact the case).
Replies
Boosts
Views
Activity
Nov ’21
Reply to how to extract text messages - financial service app
Did you try asking to Apple Support ?
Topic: Privacy & Security SubTopic: General Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Getting started with creating swift playground
To create a playground, open Xcode, select File > New > Playground select platform (iOS / MacOS) And here you are. For totorials, search for "Swift playground" in Apple Books.
Replies
Boosts
Views
Activity
Nov ’21
Reply to Guideline 3.2
So, the older version of your app is on the Appstore ? And you submitted a new version that was rejected for a different reason ? Did you explain what you wrote here in Comments for reviewer ? . Now they reject the app because they think that my app should be in Apple Manager Bussines I do sot find this in Guidelines 3.2.2 What is the exact message you get ?
Replies
Boosts
Views
Activity
Nov ’21
Reply to Both protocol and implement have same name and type, however different Optional Type value.
Why are you surprised ? 1. protocol TTTT { 2. 3. var sid: String? { get set } 4. 5. } 6. 7. class ViewController: UIViewController { 8. 9. var sid: String = "" 10. 11. override func viewDidLoad() { 12. 13. super.viewDidLoad() 14. 15. // Do any additional setup after loading the view. 16. 17. } 18. } 19. 20. extension ViewController: TTTT { 21. 22. var sid: String? { 23. 24. get { 25. // Need some return value 26. } 27. 28. set { 29. 30. } 31. } 32. } Line 22, whatever type you give to sid var sid: String? { is a redeclaration of the class property at line 9:     var sid: String = "" You would have the same error with     var sid: String? = "" Of course, the following does work: protocol TTTT { var sid2: String? { get set } } class ViewController: UIViewController { var sid: String? = "" override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view.          sid = sid2 // <<-- set sid property } } extension ViewController: TTTT { var sid2: String? { get { return "" } set { } } } Note: it is not a good practice to reuse same names in such situations.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to How to save a photo to the camera roll Xcode?
You will find complete solution here: https://stackoverflow.com/questions/40854886/take-a-photo-and-save-to-photo-library-in-swift Don't forget to add authorisation request in plist. Note: when you paste code, lease use "Paste and Match Style" to avoid all the blank lines that make code nearly unreadable.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Resetting a NSPredicate
Check what is the string value you passed: private func _filterTracks(str: String) { print("filter string is", str, "---") Where do you set filter tag, and how ?
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’21