iOS/Swift
회사에서 API를 만들 때 Dynamic Library?, Static Library? 개념에 대하여 이해하기 위해 포스팅해 보았다. Dynamic과 Static의 차이는 여기서 확인할 수 있다. Dynamic Library 처음 Xcode에서 Framework를 선택하면 Dynamic Library로 생성 된다. 아래와 같은 간단한 클래스를 만들었다. open class DynamicClass{ public init(){} open func test1(_ a: Int, _ b: Int) -> Int{ return a + b } } init 사용하지 않으면 사용하려는 프로젝트에서 initializer is inaccessible due to 'internal' protection level 위와 같은 에..
Core Data Core Data | Apple Developer Documentation Persist or cache data on a single device, or sync data to multiple devices with CloudKit. developer.apple.com 단일 장치에서 데이터를 유지 또는 캐시 하거나 CloudKit을 사용하여 여러 장치에 동기화하는 Framework Core Data를 사용하여 오프라인에서 사용하기 위해 Application의 영구정인 데이터를 저장하고, 임시 데이터를 캐시 하고, 단일 기기에서는 앱의 실행 취소 기능을 추가합니다. 단일 iCloud 계정의 여러 장치에서 데이터를 동기화하기 위해 Core Data는 Schema를 CloudKit Cont..
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..
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..
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..