Skip to content

Print(Swift4.2)

   

#Swift4.2
The print statement can be used to output information such as the contents of an array or a string to the console.

import UIKit
let hello = "Hello"
let world = "World"
// HelloWorld
print(hello + world)
// 引数は1つ以上、好きな個数指定でき、異なる型が混在していてもOK
// String 3.14156 42 2018-10-24 14:16:33 +0000
print("String", 3.14156, 42, Date())
// separatorを指定することで、好きな区切り文字を指定できる
// Hello-World-3.1415
print("Hello", "World", separator: "-")
// terminatorを指定することで、好きな区切り文字を指定できる
// Hello World (続けて出力される)
print("Hello", terminator: " ")
print("World")
view raw print.swift hosted with ❤ by GitHub

  1. Search the contents of UITableView with UISearchBar(Swift4)
  2. Obtaining location information while using the app
  3. The interaction of the Lifesum app was nice, so I tried to recreate it.
  4. 押すとクニュっとするボタンを実装する
  5. Docker image that can be SSHed in(Ubuntu14.04)
  6. Obtaining JSON from the API using Alamofire(Swift4.2)
  7. Renaming a project in Xcode10