iOS/Swift
-
User Notifications User Notifications | Apple Developer Documentation Push user-facing notifications to the user’s device from a server, or generate them locally from your app. developer.apple.com - 사용자 기기에 대면으로 서버나 로컬에서 알림을 전송해 주는 Framework UnUserNotificationCenter UNUserNotificationCenter | Apple Developer Documentation The central object for managing notification-related activities for your a..
[Swift] User NotificationsUser Notifications User Notifications | Apple Developer Documentation Push user-facing notifications to the user’s device from a server, or generate them locally from your app. developer.apple.com - 사용자 기기에 대면으로 서버나 로컬에서 알림을 전송해 주는 Framework UnUserNotificationCenter UNUserNotificationCenter | Apple Developer Documentation The central object for managing notification-related activities for your a..
2023.08.06 -
@dis cardableResult - 함수의 반환 값을 무시해도 된다고 선언할 때 사용 @discardableResult func discardableResultSay(_ something: String) -> String{ print(something) return something } discardableResultSay("hi") // "hi"
[Swift] @discardableResult@dis cardableResult - 함수의 반환 값을 무시해도 된다고 선언할 때 사용 @discardableResult func discardableResultSay(_ something: String) -> String{ print(something) return something } discardableResultSay("hi") // "hi"
2023.07.26 -
Date | Apple Developer Documentation A specific point in time, independent of any calendar or time zone. developer.apple.com Date 날짜와 시간을 다루기 위해 기본적으로 필요한 Date함수 // 현재 시간 출력 let currentDate = Date() print(currentDate) // 2023-07-15 05:31:36 +0000 // Unix 시간(1970년 1월 1일 00:00:00 UTC) let unixDate = Date().timeIntervalSince1970 print(unixDate) //1689403952.721513 // 현재 시간에서 60초(1분)이후 let 1minAfter..
[Swift] Date / DateFormatterDate | Apple Developer Documentation A specific point in time, independent of any calendar or time zone. developer.apple.com Date 날짜와 시간을 다루기 위해 기본적으로 필요한 Date함수 // 현재 시간 출력 let currentDate = Date() print(currentDate) // 2023-07-15 05:31:36 +0000 // Unix 시간(1970년 1월 1일 00:00:00 UTC) let unixDate = Date().timeIntervalSince1970 print(unixDate) //1689403952.721513 // 현재 시간에서 60초(1분)이후 let 1minAfter..
2023.07.15 -
UserDefault 간단한 데이터를 앱 내에 저장하기 위한 메커니즘 앱의 설정, 환경 설정, 사용자 기본값 등과 같은 데이터를 유지하는 데 사용됩니다. → 어느 곳에서나 어디든지 쉽게 읽고 저장 가능 key-value 쌍으로 키값을 저장 let userDefaults = UserDefaults.standard // value 추가 userDefaults.setValue("a", forKey: "test1") // a // 삭제 userDefaults.value(forKey: "test1") // nil 더 많은 사용 용도는 공식문서 참고 https://developer.apple.com/documentation/foundation/userdefaults#1664701 UserDefaults | Appl..
[Swift] UserDefaultUserDefault 간단한 데이터를 앱 내에 저장하기 위한 메커니즘 앱의 설정, 환경 설정, 사용자 기본값 등과 같은 데이터를 유지하는 데 사용됩니다. → 어느 곳에서나 어디든지 쉽게 읽고 저장 가능 key-value 쌍으로 키값을 저장 let userDefaults = UserDefaults.standard // value 추가 userDefaults.setValue("a", forKey: "test1") // a // 삭제 userDefaults.value(forKey: "test1") // nil 더 많은 사용 용도는 공식문서 참고 https://developer.apple.com/documentation/foundation/userdefaults#1664701 UserDefaults | Appl..
2023.07.15 -
Introduction Task, await, async은 Swift5.5에서 비동기 프로그래밍을 위해 도입되었다. 세 가지를 알아보기 전에 간단하게 비동기에 관하여 정리하고 들어가려고 한다. - 비동기(Asynchronus : 동시에 일어나지 않음) 동시에 일어나지 않는다를 의미, 요청과 결과가 동시에 일어나지 않을 거라는 약속 - 요청한 그 자리에서 결과가 주어지지 않음 - 노드 사이의 작업 처리 단위를 동시에 맞추지 않아도 된다. - 동기(Synchronous: 동시에 일어나는) 동시에 일어난다를 의미, 요청과 그 결과가 동시에 일어난다는 약속, 바로 요청을 하면 시간이 얼마가 걸리던지 요청한 자리에서 결과가 주어져야함 - 요청과 결과가 한 자리에서 동시에 일어남 - A노드와 B노드 사이의 작업 처..
[Swift] Task, await, asyncIntroduction Task, await, async은 Swift5.5에서 비동기 프로그래밍을 위해 도입되었다. 세 가지를 알아보기 전에 간단하게 비동기에 관하여 정리하고 들어가려고 한다. - 비동기(Asynchronus : 동시에 일어나지 않음) 동시에 일어나지 않는다를 의미, 요청과 결과가 동시에 일어나지 않을 거라는 약속 - 요청한 그 자리에서 결과가 주어지지 않음 - 노드 사이의 작업 처리 단위를 동시에 맞추지 않아도 된다. - 동기(Synchronous: 동시에 일어나는) 동시에 일어난다를 의미, 요청과 그 결과가 동시에 일어난다는 약속, 바로 요청을 하면 시간이 얼마가 걸리던지 요청한 자리에서 결과가 주어져야함 - 요청과 결과가 한 자리에서 동시에 일어남 - A노드와 B노드 사이의 작업 처..
2023.05.20 -
https://developer.apple.com/documentation/foundation/notificationcenter NotificationCenter | Apple Developer Documentation A notification dispatch mechanism that enables the broadcast of information to registered observers. developer.apple.com NotificationCenter 다른 객체 간에 메세지를 보내고 받을 수 있는 능력을 제공하는 클래스 addObserver(_:selector:name:object:)로 이벤트를 대기 시킴 NotificationCenter.default.post(name: NSNotific..
[Swift] NotificationCenterhttps://developer.apple.com/documentation/foundation/notificationcenter NotificationCenter | Apple Developer Documentation A notification dispatch mechanism that enables the broadcast of information to registered observers. developer.apple.com NotificationCenter 다른 객체 간에 메세지를 보내고 받을 수 있는 능력을 제공하는 클래스 addObserver(_:selector:name:object:)로 이벤트를 대기 시킴 NotificationCenter.default.post(name: NSNotific..
2023.04.16