Initial commit
This commit is contained in:
56
skills/programming-swift/GuidedTour/AboutSwift.md
Normal file
56
skills/programming-swift/GuidedTour/AboutSwift.md
Normal file
@@ -0,0 +1,56 @@
|
||||
# About Swift
|
||||
|
||||
Understand the high-level goals of the language.
|
||||
|
||||
Swift is a fantastic way to write software
|
||||
for phones, tablets, desktops, servers,
|
||||
or anything else that runs code.
|
||||
It's a safe and fast programming language
|
||||
that combines the best in modern language thinking
|
||||
with wisdom from a diverse open source community.
|
||||
|
||||
Swift is friendly to new programmers,
|
||||
without sacrificing the power and flexibility
|
||||
that experienced programmers need.
|
||||
It's an industrial-quality programming language
|
||||
that's as expressive and enjoyable as a scripting language.
|
||||
The compiler is optimized for performance
|
||||
and the language is optimized for development,
|
||||
without compromising on either.
|
||||
|
||||
Swift defines away large classes of common programming errors
|
||||
by adopting modern programming patterns:
|
||||
|
||||
- Variables are always initialized before use.
|
||||
- Array indices are checked for out-of-bounds errors.
|
||||
- Integers are checked for overflow.
|
||||
- Optionals ensure that `nil` values are handled explicitly.
|
||||
- Memory is managed automatically.
|
||||
- Error handling allows controlled recovery from unexpected failures.
|
||||
|
||||
Swift code is compiled and optimized to get the most out of modern hardware.
|
||||
The syntax and standard library have been designed
|
||||
based on the guiding principle that
|
||||
the obvious way to write your code should also perform the best.
|
||||
Its combination of safety and speed make Swift an excellent choice for
|
||||
everything from "Hello, world!" to an entire operating system.
|
||||
|
||||
Swift combines a modern, lightweight syntax
|
||||
that's familiar for developers coming from other popular languages
|
||||
with powerful features like type inference and pattern matching,
|
||||
allowing complex ideas to be expressed in a clear and concise manner.
|
||||
As a result, code is easier to read, write, and maintain.
|
||||
|
||||
Swift continues to evolve with thoughtful new features and powerful capabilities.
|
||||
The goals for Swift are ambitious.
|
||||
We can’t wait to see what you create with it.
|
||||
|
||||
<!--
|
||||
This source file is part of the Swift.org open source project
|
||||
|
||||
Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
|
||||
Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
|
||||
See https://swift.org/LICENSE.txt for license information
|
||||
See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
-->
|
||||
54
skills/programming-swift/GuidedTour/Compatibility.md
Normal file
54
skills/programming-swift/GuidedTour/Compatibility.md
Normal file
@@ -0,0 +1,54 @@
|
||||
# Version Compatibility
|
||||
|
||||
Learn what functionality is available in older language modes.
|
||||
|
||||
This book describes Swift 6.2.1,
|
||||
the default version of Swift that's included in Xcode 26.1.
|
||||
You can use the Swift 6.2.1 compiler to build code
|
||||
that's written in Swift 6.2.1, Swift 5, Swift 4.2, or Swift 4.
|
||||
|
||||
When you use the Swift 6.2.1 compiler
|
||||
to build code that uses the Swift 5 language mode,
|
||||
you can use the new features from Swift 6.2.1 ---
|
||||
they're enabled either by default or by an upcoming feature flag.
|
||||
However, to enable strict concurrency checking,
|
||||
you need to upgrade to the Swift 6.2.1 language mode.
|
||||
|
||||
In addition,
|
||||
when you use Xcode 15.3 to build Swift 4 and Swift 4.2 code,
|
||||
most Swift 5 functionality is still available.
|
||||
That said,
|
||||
the following changes are available only to code
|
||||
that uses the Swift 5 language mode:
|
||||
|
||||
- Functions that return an opaque type require the Swift 5.1 runtime.
|
||||
- The `try?` expression doesn't introduce an extra level of optionality
|
||||
to expressions that already return optionals.
|
||||
- Large integer literal initialization expressions are inferred
|
||||
to be of the correct integer type.
|
||||
For example, `UInt64(0xffff_ffff_ffff_ffff)` evaluates to the correct value
|
||||
rather than overflowing.
|
||||
|
||||
Concurrency requires the Swift 5 language mode
|
||||
and a version of the Swift standard library
|
||||
that provides the corresponding concurrency types.
|
||||
On Apple platforms, set a deployment target
|
||||
of at least iOS 13, macOS 10.15, tvOS 13, watchOS 6, or visionOS 1.
|
||||
|
||||
A target written in Swift 6.2.1 can depend on
|
||||
a target that's written in Swift 5, Swift 4.2 or Swift 4,
|
||||
and vice versa.
|
||||
This means, if you have a large project
|
||||
that's divided into multiple frameworks,
|
||||
you can migrate your code to a newer language version
|
||||
one framework at a time.
|
||||
|
||||
<!--
|
||||
This source file is part of the Swift.org open source project
|
||||
|
||||
Copyright (c) 2014 - 2022 Apple Inc. and the Swift project authors
|
||||
Licensed under Apache License v2.0 with Runtime Library Exception
|
||||
|
||||
See https://swift.org/LICENSE.txt for license information
|
||||
See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
|
||||
-->
|
||||
2459
skills/programming-swift/GuidedTour/GuidedTour.md
Normal file
2459
skills/programming-swift/GuidedTour/GuidedTour.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user