Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Swift High Performance

You're reading from   Swift High Performance Leverage Swift and enhance your code to take your applications to the next level

Arrow left icon
Product type Paperback
Published in Nov 2015
Publisher Packt
ISBN-13 9781785282201
Length 212 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Kostiantyn Koval Kostiantyn Koval
Author Profile Icon Kostiantyn Koval
Kostiantyn Koval
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. Exploring Swift's Power and Performance FREE CHAPTER 2. Making a Good Application Architecture in Swift 3. Testing and Identifying Slow Code with the Swift Toolkit 4. Improving Code Performance 5. Choosing the Correct Data Structure 6. Architecting Applications for High Performance 7. The Importance of Being Lazy 8. Discovering All the Underlying Swift Power Index

Welcome to Swift

The Swift programming language has been designed by Apple from the ground up. It was released with the slogan Objective-C without the C. The meaning of this phrase is that Swift doesn't have any limitation of backward compatibilities. It's totally new and with no old baggage. Before you start learning all the power of Swift, I think it would be useful to answer a few questions about why should you learn it, and if you have any doubts about that, I should dispel them.

Why should I learn Swift?

Swift is a very new programming language but it has become very popular and has gained huge traction. However, many iOS and OS X developers ask these questions:

  • Should I learn Swift?
  • What should I learn, Swift or Objective-C?
  • Is Objective-C going to stay or die?
  • Is Swift ready for production apps?
  • Is Swift faster than Objective-C or C?
  • What applications can I write using Swift?

My answer is, "Yes. Definitely!" You should learn Swift. It doesn't matter whether you are a new iOS and OS X developer or you have some Objective-C background; you should definitely learn Swift.

If you are new developer, then it's really useful to start with Swift, because you will learn programming basics and techniques in Swift, and further Swift learning would be much easier. Although it would definitely useful to learn Objective-C as well, I would recommend learning Swift first so that you build your programming mindset on Swift.

If you already have some experience in Objective-C, then you should try Swift as soon as possible. It will not only give you the knowledge of a new programming language, but also open the door to new ideas and ways of solving problems in Objective-C. We can see that Objective-C has started evolving right now because of Swift.

Objective-C has many limitations because of its backward capabilities with C. It was created 23 years ago, in 1983, but it will die much sooner than Swift.

After the release of Swift version 1.0, in only a year's time we have seen many Swift applications successfully developed and released on the App Store. In this time period, many Swift tools and open source libraries that increase development productivity have been created.

During WWDC 2015, Apple announced that Swift will be made open source. This means that Swift can be used to write any software and not only iOS or OS X apps. You can write a piece of server-side code or web app in Swift. This is one more reason you should learn it.

On the other hand, we see that Swift is under constant development. There were many changes and improvements in version 1.2, and there were even more changes in version 2.0. Although it's very easy to upgrade to the newer Swift version with the Xcode migrator, it's something you should think about.

Swift has some promising performance characteristics. We have seen a huge performance improvement in the Swift 1.2 release, and some improvements in Swift 2.0 as well. You have seen from the previous example how fast Swift is, and in general, Swift has more potential to achieve high performance than Objective-C.

Finally, I want to mention a phrase I really like, by Bryan Irace:

When the iOS SDK says "Jump", ask "How High?"

Don't wait, learn Swift!

You have been reading a chapter from
Swift High Performance
Published in: Nov 2015
Publisher: Packt
ISBN-13: 9781785282201
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime