O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

SWIFT 4.2: Tips, Tricks, and Techniques

Video Description

Build powerful and efficient iOS apps with proven techniques and tricks in Swift to increase productivity

About This Video

  • Take your programming skills to the next level and harness the power of Swift 4's rich features by writing cleaner, faster code.
  • Become a Swift expert by learning many exciting tips, best practices, and techniques for your iOS app development to make your code more robust and error-free.
  • Work with expert tools and tips to improve your iOS application performance with Swift 4 and save time and effort.

In Detail

Swift 4.0 is a major new release for everyone's favorite app development language, and introduces a variety of features that let us write simpler safer code. With this course, you will discover new possibilities with SWIFT 4.x and bring improvement to your app development process.

In this course, you will work with interesting tools and techniques with examples you can adopt straightaway. You will be able to enhance development speed with less coding and get faster results.

By the end of this course, you will have learned some exciting tips, best practices, and techniques for your iOS development. You will be able to build your own applications in Swift much more rapidly and with easily.

All the code and supporting files for this course are available on Github at https://github.com/PacktPublishing/SWIFT-4.2-Tips-Tricks-and-Techniques

Table of Contents

  1. Chapter 1 : Type Less with Extensions
    1. The Course Overview 00:02:36
    2. Color Extension 00:08:30
    3. Square Extension 00:04:23
    4. Creating Extensions with Static Factory Methods 00:06:01
    5. Print All Elements in an Array with Generics 00:06:00
    6. Split Array by Chunks of Size 00:04:09
    7. Get Next Element in Array 00:06:05
    8. Remove Object from Array 00:04:01
  2. Chapter 2 : Tips for Better Use of Code Structure
    1. Expressively Matching a Value Against a List of Candidates 00:04:47
    2. Avoiding Massive View Controllers 00:02:40
    3. Optional Methods in Protocols 00:05:23
    4. Using Self-Executing Closures for Lazy Properties 00:03:08
    5. Type Inference for Lazy Properties 00:02:04
  3. Chapter 3 : Use Loop for Less Bugs Tips
    1. For Loop versus While Loop 00:02:39
    2. Using Where in For Loops 00:03:13
    3. Loops with Functional Programming 00:03:15
  4. Chapter 4 : Tips for Optional Unwrapping and Coalescing
    1. guard let versus if let 00:05:05
    2. Safe Way to Return Element at Specified Index 00:04:18
    3. Using the New nil Coalescing 00:02:15
    4. Conditional Coalescing 00:02:51
  5. Chapter 5 : Leverage Enums, Tuples and Print, and More
    1. Enum Type Safety 00:05:41
    2. allcases Property for Enum 00:02:15
    3. Comparing Tuples 00:01:51
    4. Print Separator and Terminator 00:03:31
    5. Passing Operators as Closures 00:01:32
    6. Avoid Default in Switch Cases 00:03:05
    7. Working on Async in Playgrounds 00:02:11
  6. Chapter 6 : Tips in Using UIKit
    1. Named UIColors 00:02:51
    2. Use Override to Hide Status Bar 00:02:21
    3. Transparent/Opaque Navigation Bar 00:02:57
    4. Add Gradient to Navigation Bar 00:03:49
    5. Left/Right Text Offset for UITextField 00:02:57
    6. Update UIView with Fade Transition 00:02:16
  7. Chapter 7 : Tricks to Handle Errors, UserDefaults, Dictionaries, and More
    1. Enumerated Iteration 00:01:57
    2. Write Good Error Messages 00:03:22
    3. assert, precondition, and fatalError 00:02:48
    4. Semicolons in Swift 00:01:55
    5. Split String into Words 00:01:49
    6. Defining Static URLs Using String Literals 00:01:33
    7. Create a Fallback for UserDefaults with Register 00:03:01
    8. Update Dictionary with Dictionary 00:02:00