
Programming in Swift
Learn and Master App Development on iPhone
What you'll learn
- Understand the basics of the Swift language
- Learn the rules of programming in the language
- Use loop statements and control the flow of the program
- Write functions
- Apply object-oriented programming and inheritance
- Use the Protocol to build the program structure
- Work with arrays and handle errors
- Get to know Xcode and the project interface tools
- Work with pages and tables
About this course
This course teaches programming in the Swift language to develop iOS apps for iPhone. Swift is an open-source language that came as an easier replacement for Objective-C. You start with highlights from the course, then an introduction to the world of the Swift language, followed by programming rules, loop statements, statements that control the flow of the program, and functions. Then you learn object-oriented programming, inheritance, using the Protocol to build the program structure, working with arrays, handling program errors and databases. After that you move on to setting up the work environment and getting to know Xcode, the project interface tools, working with pages and tables, markup languages, and advanced skills. This course suits anyone who wants to learn to develop iPhone apps, whether you are a beginner or know another programming language. You need no previous experience with Swift. The course is divided into many lectures, so you learn each topic on its own and practice it yourself. By the end you will be able to write programs in Swift, design pages and tables, and work with Xcode to build an iOS app.
Expected outcomes
- Master Swift for professional iOS app development.
- Design and implement applications using object-oriented programming.
- Write clean and efficient code.
- Execute iOS app projects using advanced Swift techniques.
- Analyze and debug programs effectively.
Learner reviews
Course content
1Introduction to the Swift Language
6 lectures
- Course HighlightsApplies a Date Picker in Xcode so users pick a date instead of typing it, connecting components to code through Outlets and Actions, and saving and displaying data with Core Data.8:41
- Introduction to the World of Swift (1)Introduces Swift for programming Apple devices, outlines the course structure of two books and three discs and its lesson sequence, and presents Xcode as the development environment where Swift code is written.7:30
- Introduction to the World of Swift (2)Introduces iOS and the Swift language, its ease compared with Objective-C, its performance and community, and clarifies that Xcode is a work environment and not a language, plus ways to practice online without a Mac.7:43
- Introduction to the World of Swift (3)Explains writing and trying Swift commands on online sites for those without a Mac, including changing the font and layout there, then leads into using Xcode.6:29
- Introduction to the World of Swift (4)Explains installing Xcode on a Mac, from checking the machine is suitable and updating it to downloading from the App Store and completing the installation, noting that online alternatives exist.9:24
- Introduction to the World of Swift (5)Explains creating a first project in Xcode by choosing its name and location, reviewing the project components and main file, writing a first command, running it and seeing the result in the output area.8:58
2Programming Rules in Swift
5 lectures
- Programming Rules in Swift (1)Explains Swift basics: creating variables, printing their value inside text by wrapping the name in parentheses after a backslash, and declaring the type explicitly or letting it be inferred from the value.22:51
- Programming Rules in Swift (2)Continues Swift data types: Character, Bool with true and false values, and String, the most used type, with examples of declaring and printing them.5:22
- Programming Rules in Swift (3)Explains string functions in Swift such as checking for an empty string, converting letters to upper or lower case, repeating a string, comparing two strings, and special characters like \n and \r.7:58
- Programming Rules in Swift (4)Explains the mandatory variable naming rules, such as not starting with a digit, not containing symbols like the plus sign and not using a reserved word, then comments in code.4:01
- Programming Rules in Swift (5)Explains operators in Swift, arithmetic, comparison and logical, incrementing and decrementing by one, operator precedence and parentheses, and converting value types.5:53
3Loop Statements
3 lectures
- Loops (1)Explains the for loop in Swift by printing numbers from one to ten and tweaking it, trying different range forms, then extending it to compute the sum and product of the numbers.16:43
- Loops (2)Explains using the for loop in Swift to print array elements without specifying the index, nested loops, and drawing shapes with stars such as a square, rectangle and triangle.16:59
- Loops (3)Explains the while loop and the repeat-while loop and how they differ in where the condition is checked, with break to exit a loop and continue to return to its start.7:14
4Control Statements in Program Flow
4 lectures
- Control Statements in Program Flow (1)Explains the if and else statements in Swift for running code based on a condition, with examples comparing two values, checking whether a number is even using the remainder, and finding the larger of two numbers.11:14
- Control Statements in Program Flow (2)Explains multiple conditions in Swift with an if, else if, else chain, using examples such as finding the largest of three numbers with and, and grading by score ranges.7:04
- Control Statements in Program Flow (3)Explains using if with multiple conditions through a student grade and rating example, then nested if statements, as a lead-in to the switch statement.5:56
- Control Statements in Program Flow (4)Explains the switch case statement for testing a variable's value against multiple cases with a default case, using a day-of-the-week example that prints its name and handles an out-of-range value.12:15
5Functions
3 lectures
- Functions (1)Explains functions in Swift: the func keyword and its structure of name, parameters and return type, calling a function, then adding a parameter to pass a variable message instead of fixed text.11:04
- Functions (2)Continues functions in Swift with parameters and return values, building a function that takes a Double score and returns its grade by range, and stresses understanding what, why and how of each piece of code.12:07
- Functions (3)Explains writing a function with two Double parameters that returns a result with return, calling it, storing and printing its output, and reviews the progression from a simple function to one with parameters.13:42
6Programming with Objectives OOP
5 lectures
- Programming by Objectives (1)Introduces object-oriented programming in Swift: creating a class that holds several functions, then creating an object from it and calling its functions by writing the object name followed by the function.10:51
- Programming by Objectives (2)Continues object-oriented programming in Swift: a class holds variables and functions, several objects can be created from it with different values, with a quick introduction to inheritance and encapsulation as core features.7:50
- Programming by Objectives (3)Explains building a rectangle class with length and width variables and a function that computes the area, creating an object from it, setting its values and calling the function, within object-oriented programming.6:53
- Programming by Objectives (4)Explains set and get functions in a class for setting and reading its variables, such as setting length and width, and why they are useful in object-oriented programming.6:25
- Programming by Objectives (5)Explains the constructor, a function inside a class that gives an object initial values when it is created, then overloading, defining more than one function with the same name but different parameters.6:51
7Inheritance Feature
2 lectures
- Inheritance Property (1)Explains inheritance in Swift: putting shared properties in a Superclass that subclasses inherit, using a Person, Employee and Manager example to avoid repeating code.11:34
- Inheritance Property (2)Continues inheritance in Swift, showing how classes extend each other, then redefining a superclass function with a different formula in the subclass (Overriding), using geometric shapes like circle and rectangle.8:01
8Using Protocols to Create Program Structure
2 lectures
- Using Protocol to Create Program Structure (1)Explains the Protocol in Swift as a form of inheritance, using a generic geometric shape with no area formula, so each shape such as rectangle and square must implement the function with its own formula.9:26
- Using Protocol to Create Program Structure (2)Continues the Protocol in Swift with a generic shape that has no formula, forcing each shape to implement the area function with its own formula, showing that skipping it causes an error, then testing rectangle and square.5:30
9Working with Arrays
4 lectures
- Working with Arrays (1)Explains arrays in Swift: a group of same-type elements under one name accessed by index, how to declare them and print them whole or element by element with a for loop.8:56
- Working with Arrays (2)Explains giving an array initial values directly, adding the elements of two arrays into a third array and printing the result, then two-dimensional arrays with their rows and columns.6:29
- Working with Arrays (3)Explains useful array functions such as checking for an empty array, adding an element with append, inserting at a given position with insert, removing, reversing the order with reverse, and counting elements.7:50
- Working with Arrays (4)Explains the difference between Array, Set and Dictionary, that a Set prevents duplicate values and a Dictionary stores a key and a value, with printing examples.6:11
10Error Handling in Programs
1 lectures
- Error Handling in ProgrammingExplains error handling in Swift and the three error types: syntax errors, runtime errors and logical errors, with handling exceptions using try and catch and the defer statement.11:42
11Setting Up the Work Environment
2 lectures
- Setting Up the Work Environment (1)Introduces the second book in the Swift series on mobile programming, previews its lessons from environment setup and Xcode basics to tables, JSON and Core Data, and stresses using Xcode instead of the online compiler.6:21
- Setting Up the Work Environment (2)Explains the tools needed for the work environment, JDK and Android Studio, the device requirements of strong RAM and graphics card, installing the program and running a first Hello World example.10:30
12Getting to Know Xcode
3 lectures
- Getting to Know Xcode (1)Introduces the Xcode environment and its parts: the Navigator that shows project files, the design area, adding a button and changing its properties such as font size, and running the project on the simulator.11:18
- Getting to Know Xcode (2)Explains programming interface elements after designing them, creating an Outlet to control an element such as a Label and an Action for a button, and changing the element's text from code.9:42
- Getting to Know Xcode (3)Explains running code when a page first loads inside the viewDidLoad function, and that working with any on-screen element requires an Outlet while programming a button requires an Action.5:51
13Project Interface Tools
15 lectures
- Project Interface Tools (1)Surveys iOS interface components, such as UIView as an extra view, the Text Field for receiving user input, and selection components, progress indicators and steppers the user interacts with.9:19
- Project Interface Tools (2)Explains using a text box, a Label and a button, creating an Outlet and an Action, and reading what the user typed in the text box and showing it in the Label when the button is pressed.13:14
- Project Interface Tools (3)Explains checking the username typed in a text box in code and showing a message when it is invalid, then designing a calculator screen with text boxes and buttons.10:29
- Project Interface Tools (4)Explains programming the calculator by creating Outlets for the text boxes and the result Label, converting text to Double, and performing addition, then subtraction and multiplication the same way.16:42
- Project Interface Tools (5)Explains checking in the calculator app that the user has not left the fields empty before adding, and showing a red error message in a Label instead of printing it.7:33
- Project Interface Tools (6)Explains creating a launch screen for the app, then using a Switch element with an Outlet and an Action to change the background color depending on whether it is on or off.11:30
- Project Interface Tools (7)Explains the Segmented Control component in Swift: setting up its segments with different colors, then coding its action so the screen background color changes according to the segment the user selects.5:37
- Project Interface Tools (8)Explains the image view component and adding images to the project by drag and drop, then using and coding a Segmented Control to switch between two images in the image view.22:53
- Project Interface Tools (9)Explains the Stepper component, which raises or lowers a number step by step, and uses its value to show a different image from a set of images, leading into the Slider component.20:11
- Project Interface Tools (10)Explains the Slider component, which gives a value as its handle moves, and connects it to an image through an Outlet and an Action to change the alpha property and fade the image according to the handle position.9:57
- Project Interface Tools (11)Explains components that contain other components, such as the Scroll View, with an image placed inside it, then introduces the Progress Bar component that shows the progress of an operation as a bar.5:40
- Project Interface Tools (12)Explains the Progress Bar component, linking its current value to another control's movement and setting its minimum and maximum values so it starts at one point and ends at another.9:53
- Project Interface Tools (13)Explains the Date Picker component, which lets users choose a date instead of typing it by hand, and links it to a Label through an Outlet and an Action to display the selected date.6:41
- Project Interface Tools (14)Explains the Alert component for showing the user a message when a button is tapped, creating a new project and setting the message title, its text, and the close button.8:09
- Project Interface ToolsExplains upgrading an Alert so it offers several options instead of just a message, such as choosing a color from a list, and finding which button the user pressed through its index to run a different action for each option.9:13
14Working with Pages
7 lectures
- Working with Pages (1)Explains handling more than one view within a single iOS page, adding a View and an Image View and hiding or showing them with the hidden property set to true or false.14:13
- Working with Pages (2)Explains creating two pages in the project, each with its own class, designing them with a button and text, and linking navigation between them by drag and drop without code.12:24
- Working with Pages (3)Explains navigating between two screens by dragging the button to the other page and choosing the Show type, which is static navigation, and sets up doing the navigation in code.2:49
- Working with Pages (4)Explains rebuilding the two-screen project in code, linking each page to its own class, and creating an Action for the button that opens the other page in code instead of by dragging.11:32
- Working with Pages (5)Explains passing data from one page to another, taking the name typed on the first page and sending it through a function to the Label on the second page.4:32
- Working with Pages (6)Explains saving user settings and restoring them when the app opens again using UserDefaults, storing a value under a key then reading and showing it, such as a chosen color.14:36
- Working with Pages (7)Explains saving the user's color choice in the app settings, then reading the saved value back when the program restarts so the screen appears in the color previously chosen.6:53
15Working with Tables
4 lectures
- Working with Tables (1)Introduces the Table View component in iOS apps for showing content in a table split into sections, such as a settings page, and how to connect it in code through functions that set the number of rows and their values.4:26
- Working with Tables (2)Explains splitting a table into sections and setting the number of rows in each section, and linking it to the project so it runs, for use in something like a settings page.7:31
- Working with Tables (3)Explains working with a table in code, setting the number of rows, and filling each cell's content through the table functions using the row index, so the content is dynamic.13:52
- Working with Tables (4)Explains showing array data in a table, where the number of rows comes from the array's element count and each cell's value from the element matching the row index, with sections.9:56
16Markup Languages
4 lectures
- Markup Languages (1)Compares XML and JSON as structured data-exchange formats, explaining tags in XML and the key-value form in JSON, and noting that JSON is the one mostly used on mobile.5:34
- Markup Languages (2)Explains putting data in JSON format, reading it in code and storing it in a variable, then looping over its items and printing the keys and values or specific columns.5:49
- Markup Languages (3)Explains reading JSON data from a file inside the project, opening the file, looping over its contents and printing the key and value of each item, as a step toward reading from a URL.6:14
- Markup Languages (4)Explains reading content from a website URL inside the viewDidLoad function and displaying it in the app, by writing a few lines of code without needing a button.4:24
17Advanced Skills
2 lectures
- Advanced Skills (1)Covers assorted iOS skills such as moving components on screen, getting screen dimensions, and changing a button's position in code using the frame property and a CGPoint made of X and Y coordinates.18:55
- Advanced Skills (2)Explains how to find the screen dimensions in code using coordinates, and writing the code that shows these values in a text element in the interface.10:56
18Databases
5 lectures
- Databases (2)Creates a new Xcode project with Core Data enabled, designs a Student entity with fields such as id, name and age, then adds Save and Display buttons.5:28
- Databases (1)Introduces databases in Swift through Core Data: tables, rows and fields, defining a Student entity with its attributes, and Save and Display buttons that rely on try and catch.8:33
- Databases (3)Explains working with Core Data, importing the framework, creating Actions for the save and display buttons, saving a new record and printing it, and fixing variable errors by declaring them at project level.5:38
- Databases (4)Explains adding an interface where the user enters the id, name and age instead of fixed values in Core Data, using insert and update, and preparing a search by id.6:47
- Databases (5)Explains searching the database with an id typed by the user instead of a fixed number in the code, and showing the requested person's name and age, with a closing note on the book's projects.7:50
19Extensions
1 attachments
- Download Attachments from Here
Instructor

Eng. Azab Mohamed Azab
This course is part of the diploma




