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 Fundamentals Parts I and II

Video Description

In Swift Fundamentals LiveLessons, Paul Deitel teaches core Swift programming concepts through his signature "live code" approach. Rather than using code snippets, Deitel presents concepts in the context of complete working Swift programs that run on iOS® 8 and OS X®.

This video is intended for three audiences considering using Swift:

  • Objective-C programmers who are developing new iOS and/or OS X apps and who want to quickly begin using Swift in their apps.
  • Objective-C programmers who are enhancing existing iOS and/or OS X apps and who want to quickly begin using Swift in their apps.
  • Java, C++ and C# programmers who are new to iOS and OS X development and who want to start developing iOS and/or OS X apps in Swift.

Throughout the video, Deitel emphasizes software engineering best practices gleaned from many years of programming experience.

The source code repository for this LiveLesson can be found at www.informit.com/title/9780134049854.

About the Instructor:

Paul J. Deitel, CEO and Chief Technical Officer of Deitel & Associates, Inc., is a graduate of MIT, where he studied Information Technology. He holds the Sun (now Oracle) Certified Java Programmer and Certified Java Developer certifications, and is an Oracle Java Champion. Through Deitel & Associates, Inc., he has delivered Java, C#, Visual Basic, C++, C and Internet programming courses to industry clients, including Cisco, IBM, Sun Micro systems, Dell, Siemens, Lucent Technologies, Fidelity, NASA at the Kennedy Space Center, the National Severe Storm Laboratory, White Sands Missile Range, Rogue Wave Software, Boeing, SunGard Higher Education, Stratus, Cambridge Technology Partners, One Wave, Hyperion Software, Adra Systems, Entergy, CableData Systems, Nortel Networks, Puma, iRobot, Invensys and many more. He and his co-author, Dr. Harvey M. Deitel, are the world’s best-selling programming-language textbook/professional book authors.

Table of Contents

  1. Introduction
    1. Swift Fundamentals LiveLessons: Introduction to Part I 00:14:32
  2. BeforeYouBegin: Setting Up Your Development Environment
    1. Lesson Introduction 00:01:41
    2. Before You Begin 00:09:03
  3. Lesson 1: Introduction to Swift and Xcode 6
    1. Lesson Introduction 00:02:03
    2. Swift Introduction 00:25:58
    3. Creating Swift Apps with Xcode 6: Creating a Playground 00:10:57
    4. Creating Swift Apps with Xcode 6: Creating a Project 00:10:03
  4. Lesson 2: Introduction to Swift Programming
    1. Lesson Introduction 00:02:33
    2. A First Swift Program: Printing a Line of Text 00:10:09
    3. Displaying a Single Line of Text with Multiple Statements 00:00:49
    4. Displaying Multiple Lines of Text with a Single Statement 00:01:44
    5. Composing Larger Strings with String Interpolation—Introducing constants, variables, type inference, type annotations, built-in types, initialization and Identifier naming 00:11:08
    6. Addition program—Introducing the arithmetic operators and overflow checking 00:12:05
    7. The if Conditional Statement and the Comparative Operators 00:10:47
  5. Lesson 3: Introduction to Classes, Objects, Methods and Functions
    1. Lesson Introduction 00:02:56
    2. Account Class: Defining a Class 00:10:05
    3. Account Class: Defining a Class Attribute as a Stored Property 00:04:46
    4. Account Class: Defining a public Stored Property with a private Setter 00:03:33
    5. Account Class: Initializing a Class’s Properties with init 00:07:20
    6. Account Class: Defining a Class’s Behaviors as Methods 00:05:07
    7. Creating and Using Account Objects: Importing the Foundation Framework 00:02:49
    8. Creating and Using Account Objects: Creating and Configuring an NSNumberFormatter to Format Currency Values 00:04:43
    9. Creating and Using Account Objects: Defining a Function—formatAccountString 00:06:42
    10. Creating and Using Account Objects: Creating Objects and Calling an Initializer 00:06:19
    11. Creating and Using Account Objects: Calling Methods on Objects—Depositing into Account Objects 00:03:13
    12. Creating and Using Account Objects: Calling Methods on Objects—Withdrawing from Account Objects 00:01:36
    13. Value Types vs. Reference Types 00:06:53
    14. Software Engineering with Access Modifiers 00:06:27
  6. Lesson 4: Control Statements; Assignment, Increment and Logical Operators
    1. Lesson Introduction 00:02:56
    2. if and if...else Conditional Statements and the Ternary Conditional Operator (?:) 00:08:29
    3. Compound Assignment Operators 00:01:24
    4. Increment and Decrement Operators 00:04:01
    5. switch Conditional Statement 00:12:16
    6. while Loop Statement and an Introduction to the Xcode playground timeline 00:04:01
    7. do...while Loop Statement 00:03:04
    8. for...in Loop Statement and the Range Operators: Iterating over Collections of Values with Closed Ranges, Half-Open Ranges and the Global stride Function; Locating Documentation about Swift Standard Library Features. 00:09:59
    9. for...in Loop Statement and the Range Operators: Compound-Interest Calculations with for...in 00:12:14
    10. for Loop Statement 00:04:31
    11. break Statement 00:01:04
    12. continue Statement 00:01:08
    13. Logical Operators 00:04:30
  7. Lesson 5: Functions and Methods: A Deeper Look; enums and Tuples
    1. Lesson Introduction 00:03:31
    2. Multiple-Parameter Function Definition 00:07:34
    3. Random-Number Generation: Rolling a Six-Sided Die 20 Times 00:04:48
    4. Introducing Enumerations and Tuples: Dice Game Example; Tuples and Multiple Function Return Values; Tuples as Function Arguments 00:24:24
    5. Scope of Declarations 00:09:10
    6. Function and Method Overloading 00:05:26
    7. External Parameter Names 00:11:31
    8. Default Parameter Values 00:02:11
    9. Passing Arguments by Value or by Reference 00:02:11
    10. Recursion 00:02:11
    11. Nested Functions 00:05:14
  8. Lesson 6: Arrays and an Introduction to Closures
    1. Lesson Introduction 00:05:46
    2. Array overview 00:05:56
    3. Creating and Initializing Arrays 00:11:47
    4. Iterating Through Arrays 00:09:48
    5. Adding and Removing Array Elements 00:11:01
    6. Subscript Expressions with Ranges—Slicing an Array 00:06:51
    7. Closures and Closure Expressions 00:03:02
    8. Array Methods sort and sorted 00:17:42
    9. Array Methods filter, map and reduce—Introduction to Internal Iteration 00:07:35
    10. Filtering an Array 00:05:15
    11. Mapping an Array’s Elements to New Values 00:01:55
    12. Reducing an Array’s Elements to a Single Value 00:01:53
    13. Combining Filtering, Mapping and Reducing 00:03:46
    14. Card Shuffling and Dealing Simulation—Class Card and an Introduction to Computed Properties 00:06:01
    15. Card Shuffling and Dealing Simulation—Class DeckOfCards, Reference-Type Arrays and an Introduction to Optionals 00:09:28
    16. Card Shuffling and Dealing Simulation—Shuffling and Dealing Cards, and Unwrapping Optional Values with Optional Binding and the if Statement 00:11:31
    17. Passing Arrays to Functions by value and by reference 00:08:03
    18. Multidimensional Arrays 00:12:32
    19. Variadic parameters 00:06:43
  9. Introduction
    1. Swift Fundamentals LiveLessons: Introduction to Part II 00:20:57
  10. Lesson 7: Dictionary
    1. Lesson Introduction 00:03:33
    2. Dictionary overview 00:04:57
    3. Declaring Dictionary Key-Value Pairs and Dictionary Literals 00:06:48
    4. Delcaring and Printing Empty Dictionary Objects 00:04:29
    5. Iterating through a Dictionary with for...in 00:04:57
    6. General-Purpose Generic Dictionary Printing Function 00:03:36
    7. Dictionary Comparison Operators == and != 00:03:33
    8. Dictionary count and isEmpty properties 00:03:18
    9. Dictionary with Values that are Arrays 00:06:33
    10. Dictionary Properties keys and values 00:06:32
    11. Inserting, Modifying and Removing Key-Value Pairs with Subscripting 00:08:48
    12. Inserting, Modifying and Removing Key-Value Pairs with Dictionary Methods 00:07:56
    13. Builing a Dictionary Dynamically: Word Countsin a String 00:07:01
  11. Lesson 8: Classes: A Deeper-Look and Extensions
    1. Lesson Introduction 00:05:42
    2. Time Class: Default Initializers and Property Observers 00:04:14
    3. Stored Property Initialization and the Default Initializer 00:03:02
    4. willSet and didSet Property Observers for Stored Properties 00:06:18
    5. Computed Read-Only Properties universalDescription and description 00:03:22
    6. Using Class Time 00:08:21
    7. Class Time with Overloaded Designated and Convenience Initializers 00:10:06
    8. Designated Initializers 00:06:39
    9. Convenience Initializers and Initializer Delegation with self 00:02:38
    10. Using Class Time’s Designated and Convenience Initializers 00:06:40
    11. Failable Initializers in Class Time 00:15:20
    12. Extensions to Class Time 00:07:26
    13. Read-Write Computed Properties 00:09:42
    14. Composition 00:07:06
    15. Automatic Reference Counting, Strong References and Weak References 00:03:18
    16. Deinitializers 00:01:37
    17. Using NSDecimalNumber for Precise Monetary Calculations 00:06:29
    18. Type Properties and Type Methods 00:12:52
    19. Lazy Stored Properties and Delayed Initialization 00:03:00
  12. Lesson 9: Structures, Enumerations and Nested Types
    1. Lesson Introduction 00:03:18
    2. Prefer Constants and Immutability By Default 00:04:41
    3. Time struct Definition with Default and Memberwise Initializers 00:08:04
    4. Custom Initializers extension to struct Time 00:04:52
    5. Computed Properties extension to struct Time 00:02:27
    6. Mutating Methods extension to struct Time 00:04:14
    7. Testing the Time struct 00:07:09
    8. Enumerations and Nested Types 00:03:57
    9. Card struct with Nested Suit and Face enum Types 00:04:33
    10. Nested enum Type Suit 00:06:28
    11. Nested enum Type Face 00:03:59
    12. Using enum Constants in switch Statements 00:02:00
    13. DeckOfCards struct 00:07:07
    14. Testing the struct Types Card and DeckOfCards, and the enum Types Suit and Face; Creating an enum Constant from a Raw Value 00:08:35
    15. Choosing Among Structures, Enumerations and Classes in Your Apps 00:04:15
    16. Associated Values for enums 00:03:50
    17. Demonstrating Associated Values with Optional<Int> 00:06:49
  13. Lesson 10: Inheritance, Polymorphism and Protocols
    1. Lesson Introduction 00:03:36
    2. Superclasses and Subclasses 00:02:11
    3. An Inheritance Hierarchy 00:03:19
    4. Utility Functions Used in Each of This Lesson’s Examples 00:04:20
    5. Using Inheritance to Create Related Employee Types—Superclass CommissionEmployee 00:07:30
    6. Using Inheritance to Create Related Employee Types—Subclass BasePlusCommissionEmployee 00:11:31
    7. Using Inheritance to Create Related Employee Types—Testing the Class Hierarchy 00:13:18
    8. Access Modifiers in Inheritance Hierarchies 00:04:16
    9. Introduction to Polymorphism: A Polymorphic Video Game Discussion 00:05:01
    10. Payroll System Class Hierarchy Using Polymorphism 00:02:42
    11. Payroll System Class Hierarchy Using Polymorphism—Base Class Employee 00:04:17
    12. Payroll System Class Hierarchy Using Polymorphism—Subclass SalariedEmployee 00:04:51
    13. Payroll System Class Hierarchy Using Polymorphism—Subclass CommissionEmployee 00:03:34
    14. Payroll System Class Hierarchy Using Polymorphism—Indirect Subclass BasePlusCommissionEmployee 00:02:53
    15. Polymorphic Processing 00:14:42
    16. Creating and Using Custom Protocols 00:10:27
    17. Creating and Using Custom Protocols—Declaring Protocol Payable 00:07:49
    18. Creating and Using Custom Protocols—Creating Class Invoice 00:11:43
    19. Creating and Using Custom Protocols—Using Extensions to add Printable and Payable Conformance to Class Employee 00:04:26
    20. Creating and Using Custom Protocols—Using Protocol Payable to Process Invoices and Employees Polymorphically 00:08:27
    21. Additional Protocol Features 00:07:20
    22. Using final to Prevent Method Overriding and Inheritance 00:01:21
    23. Initialization and Deinitialization in Class Hierarchies—Basic Class-Instance Initialization 00:02:10
    24. Initialization and Deinitialization in Class Hierarchies—Initialization in Class Hierarchies 00:03:39
    25. Initialization and Deinitialization in Class Hierarchies—Overriding Initializers and Required Initializers 00:01:53
    26. Initialization and Deinitialization in Class Hierarchies—Deinitialization in Class Hierarchies 00:01:40
  14. Lesson 11: Generics
    1. Lesson Introduction 00:03:52
    2. Motivation for generic functions 00:04:45
    3. Generic Functions: Implementation and Specialization 00:05:22
    4. Type Parameters with Type Constraints 00:05:31
    5. Generic Types—Implementing a Generic Stack Type 00:07:20
    6. Generic Types—Testing the Generic Stack Type 00:06:42
    7. Note About Associated Types for Protocols 00:01:28
  15. Lesson 12: Operator Overloading and Subscripts
    1. Lesson Introduction 00:04:20
    2. Overview 00:02:15
    3. String Operators and Methods: Variables and Constants 00:01:43
    4. String Operators and Methods: Comparative Operators 00:03:31
    5. String Operators and Methods: Custom String Unary Prefix Operator ! 00:02:58
    6. String Operators and Methods: Concatenation with + and += 00:01:49
    7. String Operators and Methods: Subscript Operator for Creating Substrings 00:03:44
    8. String Operators and Methods: Other String Methods 00:03:57
    9. Custom Complex Numeric Type with Overloaded Arithmetic Operators 00:09:34
    10. Overloading Arithmetic Operators for Class NSDecimalNumber 00:03:50
    11. Overloading Unary Operators ++ and — 00:10:45
    12. Overloading Subscripts 00:13:42
    13. Custom Operators Overview 00:06:54
    14. Custom Generic Defining a Custom Exponentiation Operator for Type Int 00:06:22
    15. Custom Generic Operators 00:05:40