About 36,900,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. Swift - How to replace characters in a String? - Stack Overflow

    I am looking for a way to replace characters in a Swift String. In this example String: "This is my string" I would like to replace the spaces, " ", with "+" to end up...

  4. ios - What is "self" used for in Swift? - Stack Overflow

    Nov 10, 2014 · I am new to Swift and I'm wondering what self is used for and why. I have seen it in classes and structures but I really don't find them essential nor necessary to even mention …

  5. 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 …

  6. swift - Read and write a String from text file - Stack Overflow

    I need to read and write data to/from a text file, but I haven't been able to figure out how. I found this sample code in the Swift's iBook, but I still don't know how to write or read data. import...

  7. 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 …

  8. How to write a multiline string in Swift? - Stack Overflow

    10 Swift 4 has addressed this issue by giving Multi line string literal support.To begin string literal add three double quotes marks (”””) and press return key, After pressing return key start …

  9. ios - How to create a delay in Swift? - Stack Overflow

    Dec 17, 2014 · 51 In Swift 4.2 and Xcode 10.1 You have 4 ways total to delay. Out of these option 1 is preferable to call or execute a function after some time. The sleep () is least case in use. …

  10. How do I get the App version and build number using Swift?

    I have an IOS app with an Azure back-end, and would like to log certain events, like logins and which versions of the app users are running. How can I return the version and build number …