In: Computer Science
Intro to App Development with Swift by Apple education, Apple Education
ITEC245, iOS App Development Description:
Write a report with your self reflection and learning outcome on below topics: 1. Playground Basics with sample program , Naming and Identifiers with sample program , Strings with sample program , First App with sample program , Functions with sample program
Playground Basics with sample program:
Apple developed a tool named xcode that provides a facility to develop an application using the programming language named swift. xcode will be dowload from app store and get start to program with swift.
open the xcode after dowload swift
Click on Get started with a playground and select blank iOS->Blank->Next
Give the file name Test.Playground and select the location an create.
sample playgrond code:
import Foundation
var message = "Hello! How are you?"
print(message)
sample output:
Naming and Identifiers with sample program
import Foundation
//declare a variable name identifier
var name:String = "John" //string type
var age:Int = 20 //integer type
print("My name is \(name) and \(age) years old") //print the name
and age
sample output:
Strings with sample program
import Foundation
var str1:String = "Hello!" //declare first string
var str2:String = " How are you?" //declare second string
var message = str1 + str2 //concatinate both string
print(message) //print
sample program:
Functions with sample program
import Foundation
func message(name: String) -> String { //function with return
type String
let message = "Hello, " + name + "!"
//message
return message //return
}
print(message(name: "John")) //call the function
sample output:
First App with sample program:
Now create a simple app
Create a new Xcode project click on that and select the iOS->single Viw App->Next
Now give the name of the product selct language swift and user interface storyboard and click Next.
Select the location of the project and save it.
sample output: