Swift is the result of the latest research on programming languages combined with decades of experience building Apple platforms.
Named parameters are expressed in a clean syntax that makes APIs in Swift even easier to read and maintain. Better still, you don't even need to type semicolons. Modules eliminate headers and provide namespaces, while extracted types make code cleaner and less error prone.
To best support international languages and emoji, Strings are Unicode accurate and use UTF-8 based encoding to optimize performance for a wide variety of use cases.
Memory is managed automatically using tight, deterministic reference counting, keeping memory usage to a minimum without the overhead of garbage collection.
These forward-thinking concepts result in a fun and easy-to-use language.
Swift has many other features to make your code more meaningful:
- Powerful and easy-to-use generics
- Protocol extensions that make it easier to write general code
- First-class functions and a light closing syntax
- Quick and concise iteration over a range or collection
- Tuples and multiple return values
- Structures supporting methods, extensions and protocols
- Enumerations can have payloads and support pattern matching
Swift eliminates entire classes of unsafe code. Variables are always initialized before they are used, arrays and integers are checked for overflow, memory is managed automatically, and the implementation of special access to memory protects against many programming errors. The syntax has been adjusted to make it easy to define your purpose.
Fast and Powerful
Swift was built to be fast from the very first conception. Using the incredibly high performance LLVM compiler technology, Swift code is converted into optimized native code that makes the most of modern hardware. The syntax and standard library are set to perform at their best, whether the most obvious way to write your code is running on your wrist or on a server cluster.
Swift is the successor to both C and Objective-C languages. It includes low-level fundamentals such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics, giving Cocoa and Cocoa Touch developers the performance and power they demand.