do you know how to programing and like to developer Iphone apps software with swift 3 language ?
var num = 100
var str = "sdfsdf"
var str1: String
var num1: Int
var num2 = 3
var num3 = 15.34
var total = Double(num2) + num3
//switch
let speed = 5
switch speed {
case 0...3:
print("it's safe")
default:
break
}
//for loop
//insted of for var i = 0; i <100; i++
//do: for each-item in some-collection
for index in 1...100 {
total
print (index)
}
//** for index in 0 ..<100 -->do 0-99
//function --> totaly different from other languages --> relavent to class also
////////////////////////////////////////////////////
func myFunction(name : String, age : Int){ //all are constent (let) and not varible (var), you can add var before
print("hi \(name), \(age)")
}
myFunction(name: "Person", age: 21)
// function/class return values
func myFunction2() -> String {
return "hi"
}
// function/class default parameter values
func myFunction3( name : String = "John Due") {
print(name)
}
myFunction3() //using the default value
myFunction3(name: "myName") //using my call provide name