Filters

Hide filters
Platform
Content Type
Difficulty

All Tutorials · 20 Results

Contained in: Expert Swift swift
iOS & Swift

Chapter in Expert Swift

Objective-C Interoperability

…many years. In your own apps, you’ll often have a sizable Objective-C codebase that just doesn’t feel at home inside your Swift code or want to use some of your shiny new Swift code in your Objective-C code. In this chapter, you'll learn…
iOS & Swift

Chapter in Expert Swift

Introduction

Welcome to Expert Swift. In this chapter, you’ll learn about some of the motivations behind creating the Swift language, take a short but deep dive into the Swift toolchain flow and look at Swift. You’ll develop a simple language feature, ifelse, to explore some of the facilities Swift
iOS & Swift

Chapter in Expert Swift

Protocols

…used Swift before, you’ve probably used protocols. A lot. Protocols and protocol-oriented programming are built into the DNA of Swift, and it’s hard to imagine what Swift would look like without all the power its protocols hold. Because they’re an integral part of Swift, this whole…
iOS & Swift

Chapter in Expert Swift

Generics

Almost everyone using Swift — from complete beginners to seasoned veterans — has used generics, whether they know it or not. Generics power arrays and dictionaries, JSON decoding, optionals, Combine publishers and many other parts of Swift and iOS. Because you’ve already used many of these features, you know firsthand…
iOS & Swift
Expert Swift
Master the Swift language with the Expert Swift book! Swift is a rich language with a plethora of features to offer. Reading the official documentation or entry-level books is important, but it’s not enough to grasp the true power of the language. Expert Swift is here to help…
iOS & Swift

Chapter in Expert Swift

Numerics and Ranges

Swift is a platform-agnostic, general-purpose programming language that supports various numeric types with differing space, range, accuracy and performance characteristics. Building two apps (BitViewer and Mandlebrot), you’ll see how Swift simplifies programming with protocols and generics. You’ll also look at range types and how operators…
iOS & Swift

Chapter in Expert Swift

API Design Tips & Tricks

…diving into specific topics, learning how they work, writing code to sharpen your instincts around them and working through real-life examples. Although using Swift and all its incredible capabilities is a wonderful skill to have, it doesn’t help much without actually shipping code with it. More often than…
iOS & Swift

Chapter in Expert Swift

Strings

…proper implementation of a string type in Swift has been a controversial topic for quite some time. The design is a delicate balance between Unicode correctness, encoding agnosticism, ease-of-use and high-performance. Almost every major release of Swift has refined the String type to the awesome design…
iOS & Swift

Chapter in Expert Swift

Codable

…your data. Unfortunately NSCoding, while an incredible abstraction at the time, suffers from many issues and a lack of modern touch that fits the Swift world — such as automatically synthesized encoding and decoding, support for value types and more. Enter Codable. What is Codable? Codable is a type alias combining…
iOS & Swift

Chapter in Expert Swift

Types & Mutation

Types are essential to building Swift programs. The Swift compiler type checks your code to verify correctness, ensure safety and enable greater optimization. You’ll gain experience about the different nominal types and mutation with several small examples. You’ll also implement mutable value semantics for a QuadTree type using…
iOS & Swift

Chapter in Expert Swift

Sequences, Collections & Algorithms

…atop a highly composable hierarchy of fundamental protocols. These protocols, which include Sequence and Collection among others, capture the essence of these types. The Swift standard library design serves as a case study in Swift generics and protocol-oriented programming that you can learn from and leverage. The concepts these…
iOS & Swift

Chapter in Expert Swift

Unsafe

Swift is a memory-safe and type-safe language. In some cases, you might need your code to be extremely optimized, in which case the tiny overhead added by the safety checks from Swift might be too expensive. You might be dealing with a huge stream of real-time data…
iOS & Swift

Chapter in Expert Swift

Higher-Order Functions

…more readable, a lot shorter and easier to reuse. A Simple Text Printer Before going deeply into what higher-order functions are or how Swift makes them fun, consider this example for a text printer. Create a new playground and add the following: class TextPrinter { var formatter: ParagraphFormatterProtocol init(formatter…
iOS & Swift

Chapter in Expert Swift

Conclusion

…hope you learned a lot about the advanced features of Swift in this book — and had some fun in the process! With the advanced knowledge you’ve acquired, you’re ready to write better Swift code and improve your existing apps. If you want to read more, there are several…
iOS & Swift

Chapter in Expert Swift

Introduction

Welcome to Expert Swift! The book for intermediate Swift developers looking to enhance their skills and understanding of the language. Swift is a powerful and wonderful language, used by many developers around the world to build iOS, macOS, tvOS and watchOS apps. If you’re reading this book, then…
iOS & Swift

Chapter in Expert Swift

Functional Reactive Programming

…filter and reduce), which you learned about in the previous chapter. Many of these operators have parallels with the same name in the Swift standard library and also perform the same sort of work. An example of this is map, which transforms each element in a stream…
iOS & Swift

Chapter in Expert Swift

Instrumentation

Being a great iOS software engineer isn't only about being a grandmaster of the Swift language. It's also about knowing which tools the platform puts at your disposal, how to use them to sharpen your skills and how to identify areas of improvement in your code. In this…
iOS & Swift

Chapter in Expert Swift

About the Team

Discover Echo Inc. in San Diego, California. Ray enjoys learning new things and is excited about math, data, visualization, machine learning and computer vision. Swift is his problem-solving language of choice and he has been using it and teaching others about it since its 2014 public release. About…
iOS & Swift

Chapter in Expert Swift

Dedications

…teaching me all of the things I thought were too hard to know.” — Marin Bencevic “To my friends and family and the Swift community of dreamers, inventors, teachers, learners and doers. You guys make this place awesome…
iOS & Swift

Chapter in Expert Swift

What You Need

…installed the latest version of Xcode, be sure to do that before continuing with the book. The code covered in this book depends on Swift 6.1 and Xcode 16.3 — you may get lost if you try to work with an older version or work outside the playground environment that this…