About 46,100,000 results
Open links in new tab
  1. Swift await/async - how to wait synchronously for an async task to ...

    Feb 3, 2022 · 77 I'm bridging the sync/async worlds in Swift and doing incremental adoption of async/await. I'm trying to invoke an async function that returns a value from a non async …

  2. How does one declare optional methods in a Swift protocol?

    415 In Swift 2 and onwards it's possible to add default implementations of a protocol. This creates a new way of optional methods in protocols.

  3. null / nil in Swift - Stack Overflow

    8 Swift’s nil is not the same as nil in Objective-C. In Objective-C, nil is a pointer to a non-existent object. In Swift, nil is not a pointer—it is the absence of a value of a certain type. Optionals of …

  4. syntax - Swift make method parameter mutable? - Stack Overflow

    Jun 6, 2014 · 46 For Swift 1 and 2 (for Swift 3 see answer by achi using an inout parameter): Argument of a function in Swift is let by default so change it to var if you need to alter the value …

  5. ios - How to format localised strings in Swift? - Stack Overflow

    How to format localised strings in Swift? Asked 9 years, 9 months ago Modified 9 months ago Viewed 40k times

  6. What's NSLocalizedString equivalent in Swift? - Stack Overflow

    Once Apple does update it for Swift, Xcode will be able to just auto-convert this API to its new Swift API and nothing else will break. Even in Xcode's Refractor menu currently (v 11.4.1) …

  7. Rounding a double value to x number of decimal places in swift

    Dec 7, 2014 · The nature of Swift's Double appears to be that it can be imprecise – because of the way it's stored/accessed in binary, even using this rounding function will not return a …

  8. swift2 - Swift: guard let vs if let - Stack Overflow

    The Swift Docs on Control Flow explain the idea behind that: Using a guard statement for requirements improves the readability of your code, compared to doing the same check with …

  9. ios - Swift - encode URL - Stack Overflow

    Jul 3, 2014 · 98 Swift 4 & 5 To encode a parameter in URL I find using .alphanumerics character set the easiest option:

  10. What is the difference between `let` and `var` in Swift?

    Jun 3, 2014 · 38 According to The Swift Programming Language Book Like C, Swift uses variables to store and to values by an identifying name. Swift also makes extensive use of …