Book Image

Swift 3 New Features

By : Keith Elliott
Book Image

Swift 3 New Features

By: Keith Elliott

Overview of this book

Since Swift was introduced by Apple in WWDC 2015, it has gone on to become one of the most beloved languages to develop iOS applications with. In the new version, the Swift team aimed to take its adoption to the next level by making it available for new platforms and audiences. This book will very quickly get you up to speed and productive with Swift 3. You will begin by understanding the process of submitting new feature requests for future versions of Swift. Swift 3 allows you to develop and run your applications on a Linux machine. Using this feature, you will write your first Linux application using the debugger in Linux. Using Swift migrator, you will initiate a conversion from Swift 2.2 to Swift 3. Further on, you will learn how to interact with Cocoa libraries when importing Objective C to Swift. You will explore the function and operator changes new to Swift 3, followed by Collection and Closure changes. You will also see the changes in Swift 3 that allow you write tests easier with XCTest and debug your running code better with new formats as well. Finally, you will have a running server written completely in Swift on a Linux box. By the end of the book, you will know everything you need to know to dive into Swift 3 and build successful projects.
Table of Contents (16 chapters)
Swift 3 New Features
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
5
Function and Operator Changes – New Ways to Get Things Done

Open source Swift


On December 3 2015, Apple open-sourced Swift (including the language, supporting libraries, debugger, and package manager) under the Apache 2.0 license and launched the https://Swift.org/ website on the same day. https://Swift.org/ is the official site to find resources on the various projects that make up Swift. It's your main source to read announcements on all of the development work on the language, from proposals of new features, to links to development branches of Swift code that you can download and test.

https://Swift.org/ is a website that you will want to bookmark for future reference. The entire Swift codebase is hosted on GitHub and is available for anyone to access. Take a second to think about that. Anyone can download Swift, play around with a binary, build a project, or look under the hood to see how things actually work. For a company of Apple's size and reputation, releasing Swift, the language that they are betting on to power all of their applications, to the community is amazing and should not be taken lightly. This is huge!

Naturally, Apple didn't just hand the language over and walk away. Instead, Apple set up an internal team to shepherd the development process and to be responsible for the day-to-day project management. The open sourced version of the Swift language is comprised of a group of projects each hosted as a separate repository on GitHub. Today, you can find links to six active projects:

  • Swift compiler: Command line tool

  • Standard library: Distributed as part of the core language

  • Core libraries: Provide a higher level functionality

  • LLDB debugger: Includes the Swift REPL

  • Swift Package manager: Building projects and distributing them

Each project has a dedicated section on https://Swift.org/ that explains the project goals and links on how to use both Swift and contribute as a community member. I encourage you to review https://Swift.org/ to get a better handle on all things Swift from Apple's perspective. Before we end our section on where to find resources on Swift, I do want to briefly discuss what it means to be a community contributor.

The community structure has been well thought out and it's designed to provide strong leadership from members in the community. This structure will guide the on-going development of the language and will hopefully ensure that as the community expands, many new community contributors will have a voice that is heard and respected. See below for the roles that make up members of the community:

  • Project Lead: Apple is the project lead and will select others from the community to serve in various technical lead positions

  • Core Team: This small team of engineers is responsible for strategic direction

  • Code Owner: This title goes to anyone responsible for a specific area of a Swift project codebase

  • Committer: This role is given to anyone with commit access to a Swift repository

  • Contributor: This role is reserved for anyone who contributes to a patch or helps with a code review

You can read more about the individual roles in the community on https://Swift.org/ under the community section. The Swift community is growing and, not unexpectedly, many developers are curious about  how to contribute. With that in mind, let's explore how things get done.