iOS 11th Class

  • 네트워크 통신 (URLSession, URLRequest):
    • 로컬 파일 접근
    • 미디어 재생 (AVPlayer, AVAsset)
    • 웹 페이지 로딩 (WKWebView)
      • if let appleWebsite = URL(string: "https://www.apple.com") { UIApplication.shared.open(appleWebsite) }
      • if let url = URL(string: "tel://123-4567") { UIApplication.shared.open(url) }
      • if let google = URL(string: "comgooglemaps://?q=서울역") { UIApplication.shared.open(google)}
guard let url = URL(string: "") else {return}

guard let 사용으로 failable 풀기

Enter 입력

        present(playerViewController, animated: true) {
            player.play()  // 비디오 재생 시작
        }
let onec = {(x: Int) -> return x}

이런 함수 호출시 어규먼트 레이블 적지 않음

func someFun(cl: () -> Void) {
}

// trailing closure를 사용 안하면
someFun(cl: {
//closure’s body
})

// trailing closure 사용
someFun() {
//trailing closure's body goes here
}