About 21,400,000 results
Open links in new tab
  1. xcode - Swift: Understanding // MARK - Stack Overflow

    What is the purpose of writing comments in Swift as: // MARK: This is a comment When you can also do: // This is a comment What does the // MARK achieve?

  2. Swift: How to use sizeof? - Stack Overflow

    Swift uses an generic type to make it explicit that the number is known at compile time. To summarize, MemoryLayout<Type>.size is the space required for a single instance while …

  3. Swift - Convert Array to Dictionary - Stack Overflow

    Swift - Convert Array to Dictionary Asked 7 years, 3 months ago Modified 4 years, 6 months ago Viewed 15k times

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

    Jun 6, 2014 · As stated in other answers, as of Swift 3 placing var before a variable has been deprecated. Though not stated in other answers is the ability to declare an inout parameter. …

  5. What is the "some" keyword in Swift (UI)? - Stack Overflow

    Jun 3, 2019 · Swift 5.1 does not appear to have some as a keyword, and I don't see what else the word some could be doing there, since it goes where the type usually goes. Is there a new, …

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

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

  7. ios - Swift: Testing optionals for nil - Stack Overflow

    Swift 3.0, 4.0 There are mainly two ways of checking optional for nil. Here are examples with comparison between them 1. if let if let is the most basic way to check optional for nil. Other …

  8. Swift: print () vs println () vs NSLog () - Stack Overflow

    Sep 20, 2014 · Back in Swift 1.x, print did not add newline characters at the end of the printed string, whereas println did. But nowadays, print always adds the newline character at the end …

  9. Using a dispatch_once singleton model in Swift - Stack Overflow

    Jun 4, 2014 · I'm trying to work out an appropriate singleton model for usage in Swift. So far, I've been able to get a non-thread safe model working as: class var sharedInstance: …

  10. How does String substring work in Swift - Stack Overflow

    1073 All of the following examples use var str = "Hello, playground" Swift 4 Strings got a pretty big overhaul in Swift 4. When you get some substring from a String now, you get a Substring type …