use printer in swift5 ios code example
Example 1: swift print
print("Hello World")
//printing a value
let num = 5
print(num)
print("a num: " + num) //concatenation
print("a num: \(num)") //interpolation
Example 2: printf in swift
let x = 3.1415926
print(String(format: "%.2f", x)) //3.14
print(String(format: "%2.2f", x)) // 3.14 (two blank spaces in front of 3.