Do Swift applications work on OS X 10.9 / iOS 7 and older versions?
Hi everyone! I just started learning Swift and am writing my first macOS application. In Xcode, I selected Swift as the language, and everything compiles fine. But I have users who are still on OS X 10.9 (Mavericks) and even older versions. I'm worried that my program will crash or not launch for them.
I wrote a simple code that prints "Hello, World!", but I use some modern constructs, such as optional chaining and closures:
```swift
func greet(name: String?) {
let greeting = name.map { "Hello, \($0)!" } ?? "Hello, stranger!"
print(greeting)
}
greet(name: "Anna")
```
Question: will such an application work on OS X 10.9? And on iOS 7? Do I need to configure anything special in Xcode to make it run on older systems?
No answers yet.
Log in to leave an answer