About 18,600,000 results
Open links in new tab
  1. 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, …

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

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

  5. ios - Swift `in` keyword meaning? - Stack Overflow

    May 21, 2015 · The question of what purpose in serves has been well-answered by other users here; in summary: in is a keyword defined in the Swift closure syntax as a separator between …

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

  7. ios - How do you create a Swift Date object? - Stack Overflow

    Swift has its own Date type. No need to use NSDate. Creating a Date and Time in Swift In Swift, dates and times are stored in a 64-bit floating point number measuring the number of seconds …

  8. bash - How do I run a terminal command in a Swift script? (e.g ...

    I want to replace my CI bash scripts with swift. I can't figure out how to invoke normal terminal command such as ls or xcodebuild #!/usr/bin/env xcrun swift import Foundation // Works …

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

    Jun 6, 2014 · 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 …

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