Post

Replies

Boosts

Views

Activity

Reply to Crash with NSURL URLWithString
could you show more code, and show the url (unless it is a local file URL)? Did you try to access the URL directly ? Doc says: This method expects URLString to contain only characters that are allowed in a properly formed URL. All other characters must be properly percent escaped. Any percent-escaped characters are interpreted using UTF-8 encoding. Is it the case ?
Topic: App & System Services SubTopic: Core OS Tags:
Jul ’21
Reply to Delay Button To Site
Call it in the button handler : var justOnce: Bool = true @IBAction func playStats(_ sender: Any) { //show alert only once if justOnce { let alert = UIAlertController(title: "Stats Important", message: "You can copy and paste the name here when you see the searchbar", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: {_ in justOnce = false gotoSite() } )) self.present(alert, animated: true, completion: nil) } }
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to TabView disappearing on Xcode 13
I cant see the background in the TabView. There were changes in the display of tab. We refined the appearance of UIToolbar and UITabBar. This updated look removes the background material when scrolled to bottom, giving more visual clarity to your content. In UITabBar, we've enhanced support for SF Symbols, giving great results when using any of your favorite symbols. Look at WWDC21 videos on UIKit for more info. Look here https://developer.apple.com/videos/play/wwdc2021/10059/?time=336 and here for a synthesis of UIKit evolutions: https : / / w w w .wwdcnotes.com/notes/wwdc21/10059/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jul ’21
Reply to *Really* unusual XPC/Swift question
What happens if you remove 'as? Hello'. I never practiced, so I am more ignorant than you probably. I found this interesting link: h t t p s : / / matthewminer. com/2018/08/25/creating-an-xpc-service-in-swift.html What they do differently is to define connection.exportedInterface in the listener.
Topic: Programming Languages SubTopic: Swift Tags:
Jul ’21
Reply to The amount of source code files can affect the build time?
the number of source files can make build slower?  for sure, but there is little you can do now (too much work to restructure probably). Do all members of the team experience the same issue ? What is your configuration : Mac model Memory available Here is a discussion where slowlessness occurred with 150 files. May be worth reading even if some old parts are really outdated: https://stackoverflow.com/questions/28032506/how-to-handle-large-swift-project I remember old days when it took 20 minutes to compile the code… We did take care to check the changes before starting compiling. 2 minutes is not that long if you don't try to build after each small change in code.
Jul ’21
Reply to Images added to Resource Folder in Playground Not Found
Please show code, not through a partial screenshot. Screenshot says "Ready to continue". Where did you stop code ? How did you add the image to the project ? I tested in playground, with Test.png in the Resources folder as well import UIKit import PlaygroundSupport let image = UIImage(named: "Test.png")! let uiImageView = UIImageView(image: image) It does work (image is found, not nil). So try to close and reopen the project. Note: by convention, names in Swift do not use underscore, but camelCase: sampleImage
Jul ’21
Reply to How use new UIkit Button system?
what do you mean with 'del'
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to How use new UIkit Button system?
If you look how to use .filled(), it's shown in video: What information are you missing ?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to tableview with multiple selection but without delete button
Could you explain more ? And possibly show screen capture.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to How can I deselect a button when other consecutive button is pressed?
Please show code. Is it SwiftUI or UIKit. You have set the 2 tags, which should not be the case.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Crash with NSURL URLWithString
could you show more code, and show the url (unless it is a local file URL)? Did you try to access the URL directly ? Doc says: This method expects URLString to contain only characters that are allowed in a properly formed URL. All other characters must be properly percent escaped. Any percent-escaped characters are interpreted using UTF-8 encoding. Is it the case ?
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Playlist's curatorName property always returns nil.
Where did you see it is optional ? That's not what doc says here: curatorName string (Required) The display name of the curator. https://developer.apple.com/documentation/applemusicapi/playlists/attributes
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to What is the simplest approach to execute a Swift statement only after an asynchronous operation finishes?
Usually it is to call operation B in completion handler of operation A.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Delay Button To Site
Call it in the button handler : var justOnce: Bool = true @IBAction func playStats(_ sender: Any) { //show alert only once if justOnce { let alert = UIAlertController(title: "Stats Important", message: "You can copy and paste the name here when you see the searchbar", preferredStyle: .alert) alert.addAction(UIAlertAction(title: "OK", style: UIAlertAction.Style.default, handler: {_ in justOnce = false gotoSite() } )) self.present(alert, animated: true, completion: nil) } }
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to TabView disappearing on Xcode 13
I cant see the background in the TabView. There were changes in the display of tab. We refined the appearance of UIToolbar and UITabBar. This updated look removes the background material when scrolled to bottom, giving more visual clarity to your content. In UITabBar, we've enhanced support for SF Symbols, giving great results when using any of your favorite symbols. Look at WWDC21 videos on UIKit for more info. Look here https://developer.apple.com/videos/play/wwdc2021/10059/?time=336 and here for a synthesis of UIKit evolutions: https : / / w w w .wwdcnotes.com/notes/wwdc21/10059/
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Does iOS maintain a constant connection to Apple’s servers?
It is not a constant connection. For instance, when app launches, it connects to Apple and then get notifications. These 2 posts will give some details: https://stackoverflow.com/questions/13897575/apns-apple-push-notification-service-reliability https://stackoverflow.com/questions/25830597/how-to-know-push-notification-delivery-status/25830955#25830955
Replies
Boosts
Views
Activity
Jul ’21
Reply to App crashes immediately on latest iOS 15 beta (19A5297e)
Does it crash on device or simulator ? You may try the usual tricks: clean build folder restart XCode restart Mac
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to *Really* unusual XPC/Swift question
What happens if you remove 'as? Hello'. I never practiced, so I am more ignorant than you probably. I found this interesting link: h t t p s : / / matthewminer. com/2018/08/25/creating-an-xpc-service-in-swift.html What they do differently is to define connection.exportedInterface in the listener.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to The amount of source code files can affect the build time?
the number of source files can make build slower?  for sure, but there is little you can do now (too much work to restructure probably). Do all members of the team experience the same issue ? What is your configuration : Mac model Memory available Here is a discussion where slowlessness occurred with 150 files. May be worth reading even if some old parts are really outdated: https://stackoverflow.com/questions/28032506/how-to-handle-large-swift-project I remember old days when it took 20 minutes to compile the code… We did take care to check the changes before starting compiling. 2 minutes is not that long if you don't try to build after each small change in code.
Replies
Boosts
Views
Activity
Jul ’21
Reply to Images added to Resource Folder in Playground Not Found
Please show code, not through a partial screenshot. Screenshot says "Ready to continue". Where did you stop code ? How did you add the image to the project ? I tested in playground, with Test.png in the Resources folder as well import UIKit import PlaygroundSupport let image = UIImage(named: "Test.png")! let uiImageView = UIImageView(image: image) It does work (image is found, not nil). So try to close and reopen the project. Note: by convention, names in Swift do not use underscore, but camelCase: sampleImage
Replies
Boosts
Views
Activity
Jul ’21
Reply to Deployment Target Suddenly to Change to MacOS Development
Suddenly my ios 14 for iphone changed to MacOS deployment target. I suspect it changed once it unable to connect to internet. Please explain in detail. Is it in the Xcode project ? Where exactly do you see the change ? If you open the project Targets, what do you see ? Can't you uncheck the Mac checkbox ?
Replies
Boosts
Views
Activity
Jul ’21