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 NSUserDefaults no-go macOS, Objective-C, Big Sur
What do you want to achieve ? I do this, which works (in Swift, but easy to adapt). In DidFinishLaunching: let defaults = UserDefaults.standard let h = defaults.bool(forKey: "someKey") When I need to save: let defaults = UserDefaults.standard let h = true // the value to save defaults.set(h, forKey: "someKey") In fact, I don't even use synchronise. PS: MacOS could be a relevant tag
Topic: UI Frameworks SubTopic: AppKit Tags:
Jul ’21