Swift in 30 Days
eBook - ePub

Swift in 30 Days

Build iOS Apps by Learning Swift, Xcode, and SwiftUI in Just Four Weeks (English Edition)

Gaurang Ratnaparkhi

Buch teilen
  1. English
  2. ePUB (handyfreundlich)
  3. Über iOS und Android verfügbar
eBook - ePub

Swift in 30 Days

Build iOS Apps by Learning Swift, Xcode, and SwiftUI in Just Four Weeks (English Edition)

Gaurang Ratnaparkhi

Angaben zum Buch
Buchvorschau
Inhaltsverzeichnis
Quellenangaben

Über dieses Buch

Designing iOS mobile apps using simple Swift codes and libraries.

Key Features
? Combines the fundamentals of Swift and power-packed libraries, including SwiftUI.
? Includes graphical illustrations and step-by-step instructions on coding your first iOS application.
? Covers end-to-end iOS app development with code debugging and best practices.

Description
'Swift in 30 Days' teaches young graduates and coding applicants to enter the field of rapid development of applications through simplified, pragmatic, and quick programming learning without much theory.The book examines the basics of Swift programming, fundamental Swift building blocks, how to write syntax, constructs, define classes, arrays, model data with interfaces, and several examples of Swift programming. The book will help you to create the environment for app development, including tools and libraries like Xcode and SwiftUI. You will learn to work with Xcode and Swift libraries and finally make an independently developed Swift application. You will have access to design patterns and learn how to handle errors, debug, and work with protocols.By the end of this book, you will become a trusted Swift programmer and a successful iOS developer who will dive deeper into Apple's intelligent app programming challenge.

What you will learn
? Create an iOS app from scratch and learn fundamental Swift concepts such as operators and control flow.
? Create intuitive and intelligent user interfaces with an understanding of self-design and constraints.
? Recap OOP concepts and Swift protocol-based programming.
? Work with design patterns, write clean codes, and build expert tables and navigations.
? Work with Xcode and SwiftUI 2.0.

Who this book is for
This book is for students, graduates, and entry-level coders who want to learn iOS app development without prior Swift or mobile app development experience.

Table of Contents Week 1 (Beginner)
 1. Building Your First App
 2. Swift Programming Basics
 3. Auto Layout
 4. Types and Control Flow Week 2 (Intermediate)
 5. Optional Type and More
 6. Code Structuring Week 3 (Advanced)
 7. OOP in Swift
 8. Protocols and Delegates Week 4 (Bonus)
 9. Error handling and Debugging
 10. SwiftUI

About the Authors
Gaurang Ratnaparkhi has over a decade-long experience as a software developer with a specialization in iOS app development. Starting from Objective C and now to Swift 5.0, he has been able to work on a wide range of applications, from small calculators to apps in the aviation domain. His career highlight has been his position as a Team Lead for an iOS app in the restaurant domain. Followed by being a Tech lead for Cognizant IT solutions. He is a graduate from the University of Grenoble Alpes, France, and a certified Scrum Master. After moving to Xamarin and Windows development for a while, he returned to iOS development. He loves teaching and learning new languages. He is currently living in Toulouse, France. LinkedIn Profile: https://www.linkedin.com/in/gaurang-ratnaparkhi-0b47b81b/

Häufig gestellte Fragen

Wie kann ich mein Abo kündigen?
Gehe einfach zum Kontobereich in den Einstellungen und klicke auf „Abo kündigen“ – ganz einfach. Nachdem du gekündigt hast, bleibt deine Mitgliedschaft für den verbleibenden Abozeitraum, den du bereits bezahlt hast, aktiv. Mehr Informationen hier.
(Wie) Kann ich Bücher herunterladen?
Derzeit stehen all unsere auf Mobilgeräte reagierenden ePub-Bücher zum Download über die App zur Verfügung. Die meisten unserer PDFs stehen ebenfalls zum Download bereit; wir arbeiten daran, auch die übrigen PDFs zum Download anzubieten, bei denen dies aktuell noch nicht möglich ist. Weitere Informationen hier.
Welcher Unterschied besteht bei den Preisen zwischen den Aboplänen?
Mit beiden Aboplänen erhältst du vollen Zugang zur Bibliothek und allen Funktionen von Perlego. Die einzigen Unterschiede bestehen im Preis und dem Abozeitraum: Mit dem Jahresabo sparst du auf 12 Monate gerechnet im Vergleich zum Monatsabo rund 30 %.
Was ist Perlego?
Wir sind ein Online-Abodienst für Lehrbücher, bei dem du für weniger als den Preis eines einzelnen Buches pro Monat Zugang zu einer ganzen Online-Bibliothek erhältst. Mit über 1 Million Büchern zu über 1.000 verschiedenen Themen haben wir bestimmt alles, was du brauchst! Weitere Informationen hier.
Unterstützt Perlego Text-zu-Sprache?
Achte auf das Symbol zum Vorlesen in deinem nächsten Buch, um zu sehen, ob du es dir auch anhören kannst. Bei diesem Tool wird dir Text laut vorgelesen, wobei der Text beim Vorlesen auch grafisch hervorgehoben wird. Du kannst das Vorlesen jederzeit anhalten, beschleunigen und verlangsamen. Weitere Informationen hier.
Ist Swift in 30 Days als Online-PDF/ePub verfügbar?
Ja, du hast Zugang zu Swift in 30 Days von Gaurang Ratnaparkhi im PDF- und/oder ePub-Format sowie zu anderen beliebten Büchern aus Informatik & Programmierung von Mobilgeräten. Aus unserem Katalog stehen dir über 1 Million Bücher zur Verfügung.

Information

CHAPTER 1

Building Your First Application

Welcome to ‘Learning swift in 30 days’. During these 30 days, we will learn Swift and alongside learn to build basic iOS applications. You will familiarize yourself with the iOS application development environment. As we do not have enough time, let us jump right away into building our first application!

Structure

In this chapter, we will cover the following topics:
  • Setting up the environment
  • Creating your first project
  • Understanding Xcode
  • Running the application
  • Working of an application
  • Building the interface
  • Finding help

Objective

The objective of this chapter is to give you some initial confidence. We will do this by introducing you to the Xcode environment and then building a simple application. By the end of this chapter, you should be able to work easily with Xcode and create an iOS project.

Setting up the environment

One of the characteristic features of Apple is its bubble. You can enter this bubble and have all the Apple services. This holds true even for application development. If you want to develop an iOS or a macOS application, you will need a mac OS. Following are the steps to set up the environment for iOS application development:
  1. You need a mac system with a minimum OS version 10.15.
  2. Then, you need to create an Apple account. Go to https://appleid.apple.com/account as shown in Figure 1.1:
    Figure 1.1: Apple account Sign up page
  3. Complete the preceding steps to create your app store account. They may ask for credit card details. Don’t worry you won’t be charged.
  4. Once your app store account is set up, go to the Apple App Store by clicking on the icon in Applications as shown in Figure 1.2:
    Figure 1.2: App Store icon
  5. Then, type “Xcode” in the search box. Here, you will need the Apple account created above to download the latest version of Xcode. Make sure you have at least 20 GB of free space on your Mac.
  6. Once installed, you should be able to see the Xcode icon (Figure 1.3) in your applications.
  7. We will build simple applications, so you won’t need an iPhone. Xcode comes with a simulator.
    Figure 1.3: Xcode icon

Creating your first project

We will create our first project. This will help you understand the different elements that go into making of a project. The end product is a simple application with an image. No complicated logic or even coding! You will even understand the Xcode development environment and after reading this chapter, you will be easily able to navigate through Xcode.
Let us create our brand new Xcode project:
  1. Click on the Xcode icon. You should be able to see a window similar to Figure 1.4. The version (red box) might be different from yours but a minimum of 11.x is recommended. Here, we choose a starting template for our iOS. We are new developers, so let us stick to the simplest form, Single View App.
    Figure 1.4: Xcode launch window
  2. Next, click on the second option (green box) to start creating our first iOS project. You should then be able to see a window like the one in Figure 1.5:
    Figure 1.5: Template selection for new project
    The other templates are up to you to explore. But the single view application is the most basic and customizable template available.
  3. Once you click on “Next”, you will see a window as shown in Figure 1.6:
    Figure 1.6: Choose options for your new project
    Before you create a new project, we have to specify some details. So, let us understand what details we need to fill in:
    • Product Name: This is the name of our application. This is a demo application so it is not so important right now. But in future when you develop applications for the App Store, this name is very important. Let us name our application “MyFirstApp”.
    • Team/Organisation Name: This can be “None”. For real-world applications, this option is often the Team account of your company and the organisation name is your company name. Well, right now you are your own boss so go ahead and put your name. If you have an Apple developer account, you can link it and then you can see your own name under teams.
    • Organisation/Bundle Identifier: This is a unique identifier for the application. It is the web address equivalent for an application. You can see the required format in tiny grey letters below the box. You just have to put the first two parts: com.yourCompanyName.
    • Interface: THIS IS IMPORTANT. Set this to Storyboard. We will make SwiftUI applications later. But for now, we will work with Storyboards.
    • Language: Swift! If you want to choose Objective C, this is the wrong book for you.
  4. Once done, your window will look something like the one in Figure 1.7. Now, click on “Next” and choose where you want to save the project. That’s it! We have created our first iOS Application project. Congratulations!!
    Figure 1.7: Filled options for new project

Understanding Xcode

So what is Xcode? Xcode is an Integrated Development Environment (IDE) by Apple. It has the complete developer toolset to develop software for macOS, Apple watch, Apple TV, iPhone, and iPad. It is the ONLY way to develop applications for the Apple environment. This makes it our only option and we must know it well.
Our new project is ready and by now, you should see a window like the one in Figure 1.8. What you are looking at is the project settings. These are quite self-explanatory, but diving deep into the project settings is not our aim. Next, click on the file “App Delegate” which is in the pane of the left-hand side of the screen.
Figure 1.8: New project landing
Now, you will see Xcode the way we will be using it. So, let us take a small tour of this environment. Look at Figure 1.8.1. This shows the Xcode screen for version 11.x:
Figure 1.8.1: Different panes in Xcode 11
Figure 1.8.2 shows the Xcode screen for version 12.x. There are small differences which we will discuss:
Figure 1.8.2: Different panes in Xcode 12
You can see the different areas in the Xcode. You can hide...

Inhaltsverzeichnis