iOS/Swift
-
- info.plist에서 [Information Property List] - [LSApplicationQueriesSchemes] - [Array]로 생성 - Array Element에 string Type에 Scheme 추가 let kakaoTalk = "kakaotalk://" let kakaoTalkURL = NSURL(string: kakaoTalk) if (UIApplication.shared.canOpenURL(kakaoTalkURL! as URL)) { UIApplication.shared.open(kakaoTalkURL! as URL) } else { print("No kakaotalk installed.") } 출처 [iOS] Swift를 사용하여 카카오톡 앱을 실행하는 방법 📲 (U..
[Swift] 다른 앱 실행시키기- info.plist에서 [Information Property List] - [LSApplicationQueriesSchemes] - [Array]로 생성 - Array Element에 string Type에 Scheme 추가 let kakaoTalk = "kakaotalk://" let kakaoTalkURL = NSURL(string: kakaoTalk) if (UIApplication.shared.canOpenURL(kakaoTalkURL! as URL)) { UIApplication.shared.open(kakaoTalkURL! as URL) } else { print("No kakaotalk installed.") } 출처 [iOS] Swift를 사용하여 카카오톡 앱을 실행하는 방법 📲 (U..
2022.12.04 -
URLComponent - URL의 scheme값을 추가 할 때 사용 var componentsURL = URLComponents(string: addressTextField.text!) componentsURL?.path = "접속 주소 이후 값" componentsURL?.queryItems = [ URLQueryItem(name: "userid", value: userID), URLQueryItem(name: "userpw", value: userPW) ] let requestURL = URL(string: (componentsURL?.string!)!)
[Swift] URLComponentURLComponent - URL의 scheme값을 추가 할 때 사용 var componentsURL = URLComponents(string: addressTextField.text!) componentsURL?.path = "접속 주소 이후 값" componentsURL?.queryItems = [ URLQueryItem(name: "userid", value: userID), URLQueryItem(name: "userpw", value: userPW) ] let requestURL = URL(string: (componentsURL?.string!)!)
2022.11.20 -
func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!) completionHandler(.useCredential, urlCredential) }
[Swift] URLSession https 인증서 신뢰func urlSession(_ session: URLSession, didReceive challenge: URLAuthenticationChallenge, completionHandler: @escaping (URLSession.AuthChallengeDisposition, URLCredential?) -> Void) { let urlCredential = URLCredential(trust: challenge.protectionSpace.serverTrust!) completionHandler(.useCredential, urlCredential) }
2022.11.20 -
URLSession - URL이 가리키는 EndPoint로 Data를 다운받거나 업로드하기 위한 API 제공 - 앱이 실행하지 않고 있거나, 앱이 일시정지 상태 일때도 백그라운드 다운로드를 수행할 수 있도록 해줌 - 하나 이상의 Session을 만들고 각 Session은 관련 데이터 전송 작업 그룹을 조절 - 기본적으로 사용자의 시스템 환경 설정에 구성된 프록시 서버 및 SOCKS 게이트웨이에 대한 투명한 지원을 통해 데이터, 파일, FTP, HTTP 및 HTTPS URL 스키마를 지원 - 또한 HTTP/1.1, SPDY, HTTP/2 프로토콜을 지원 → ALPN이나 NPN 둘 중 하나 지원하는 서버를 필요로 함 URLSession Configuration - 하나의 URLSession에 속한 task들..
[Swift] URLSessionURLSession - URL이 가리키는 EndPoint로 Data를 다운받거나 업로드하기 위한 API 제공 - 앱이 실행하지 않고 있거나, 앱이 일시정지 상태 일때도 백그라운드 다운로드를 수행할 수 있도록 해줌 - 하나 이상의 Session을 만들고 각 Session은 관련 데이터 전송 작업 그룹을 조절 - 기본적으로 사용자의 시스템 환경 설정에 구성된 프록시 서버 및 SOCKS 게이트웨이에 대한 투명한 지원을 통해 데이터, 파일, FTP, HTTP 및 HTTPS URL 스키마를 지원 - 또한 HTTP/1.1, SPDY, HTTP/2 프로토콜을 지원 → ALPN이나 NPN 둘 중 하나 지원하는 서버를 필요로 함 URLSession Configuration - 하나의 URLSession에 속한 task들..
2022.11.17 -
Codable - 자신을 변환하거나 외부 표현으로 변환할 수 있는 타입 - Encodable & Decodable(프로토콜)이 합쳐진 개념 - Class, Struct, enum에 모두 사용 가능 - mvvm 패턴에서 사용 Encodable : 인코딩할 수 있는 타입 Decodable : 디코딩할 수 있는 타입 ※ 인코딩 : 사람이 인지하지 못하고 컴퓨터가 이해할 수 있도록 바꿔주는 것 디코딩 : 바이트 형식을 문자(문자열)로 변환 - json data { bkpr = 383; "cur_nm" = "\Uc544\Ub78d\Uc5d0\Ubbf8\Ub9ac\Ud2b8 \Ub514\Ub974\Ud568"; "cur_unit" = AED; "deal_bas_r" = "383.95"; "kftc_bkpr" = 3..
[Swift] Codable vs JSONSerializationCodable - 자신을 변환하거나 외부 표현으로 변환할 수 있는 타입 - Encodable & Decodable(프로토콜)이 합쳐진 개념 - Class, Struct, enum에 모두 사용 가능 - mvvm 패턴에서 사용 Encodable : 인코딩할 수 있는 타입 Decodable : 디코딩할 수 있는 타입 ※ 인코딩 : 사람이 인지하지 못하고 컴퓨터가 이해할 수 있도록 바꿔주는 것 디코딩 : 바이트 형식을 문자(문자열)로 변환 - json data { bkpr = 383; "cur_nm" = "\Uc544\Ub78d\Uc5d0\Ubbf8\Ub9ac\Ud2b8 \Ub514\Ub974\Ud568"; "cur_unit" = AED; "deal_bas_r" = "383.95"; "kftc_bkpr" = 3..
2022.10.15 -
참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 Edition (iBooks)(https://books.apple.com/kr/book/the-swift-programming-language-swift-5-6/id881256329) 접근제어란? - 코드끼리 상호작용을 할 때 파일 간 또는 모듈 간에 접근을 제한할 수 있는 기능 - 접근제어를 통해 코드의 상세 구현은 숨기고, 허용된 기능만 사용하는 인터페이스를 제공 가능 접근제어의 필요성 - 객체지향 프로그래밍 패러다임에서 캡슐화와 은닉화를 구현하는 이유는 외부에서 보거나 접근하면 안 되는 코드가 있기 때문 - 불필요한 접근으로 의도치 않은 ..
[Swift] 접근제어참조 : Swift 스위프트 프로그래밍 3판 Swift 5, 저자 야곰 (한빛미디어) , The Swift Programming Language Swift 5.6 Edition (iBooks)(https://books.apple.com/kr/book/the-swift-programming-language-swift-5-6/id881256329) 접근제어란? - 코드끼리 상호작용을 할 때 파일 간 또는 모듈 간에 접근을 제한할 수 있는 기능 - 접근제어를 통해 코드의 상세 구현은 숨기고, 허용된 기능만 사용하는 인터페이스를 제공 가능 접근제어의 필요성 - 객체지향 프로그래밍 패러다임에서 캡슐화와 은닉화를 구현하는 이유는 외부에서 보거나 접근하면 안 되는 코드가 있기 때문 - 불필요한 접근으로 의도치 않은 ..
2022.09.28