iOS/iOS SeSAC 2기 TIL 99

옵저버 & NotificationCenter

옵저버 https://velog.io/@kevinkim2586/iOS-Swift-%EA%B3%B5%EB%B6%80-Observer-Notification-Design-Pattern iOS & Swift 공부 - Observer & Notification Design Pattern Observer & Notification → Observer 가 코드 어딘가에서 서식하며 Notification 을 기다리는 개념 → 특정 이벤트가 발생하면 Notification 을 발동하게끔 할 수 있음. 그때 기다리고 있던 Observer 역시 발동하여, velog.io https://hongssup.tistory.com/196 [Swift iOS] NotificationCenter & Observer Notificati..

[iOS swift] for-in vs. for-each 차이

[iOS swift] for-in vs. for-each 차이 1. 반복문 O / X - break,continue 의 사용 / 사용불가 2. return 문의 동작방식 차이 - 그대로 종료 / 클로저 https://intrepidgeeks.com/tutorial/swift-difference-between-for-in-and-for-each [Swift] for-in과 for-each의 차이 func withForIn() { print(#function) let arr = [1,2,3] for num in arr { print(num) return } } func withForeach() { print(#function) let arr = [1,2,3] arr.forEach { (num) in prin..

[iOS swift] UserDefaults 앱 최초 사용자/ 기존 사용자 구분하여 화면 전환

UserDefaults 앱 최초 사용자/ 기존 사용자 구분하여 화면 전환 Framework 에 Storage.swift 파일 저장하여 public 클래스 안에 public 메서드로 선언한 뒤 프로젝트로 해당 파일에 선언한 메서드를 데리고와서 이용함 Storage.swift 파일 경험한 오류: 해당 메서드 Storage.isFirstTime()을 프로젝트에서 이용하려고하니 오류가 났었는데 public class안에 public으로 메서드를 선언했어야 했다. public 빼먹으면 안됨!!! 그리고 아래처럼 프로젝트에서 위의 메서드를 이용해서 최초 이용자인지 아닌지 판단하여 최초이용자의 경우 해당 뷰 (페이지뷰컨트롤러) 그대로 띄워줌, 기존 이용자의 경우 Netflix뷰 띄워줌. 참조한 문서들 -> https..

[iOS swift] 과제) 날씨 API 통신 및 label에 표시

과제) 날씨 API 통신 및 label에 표시 https://openweathermap.org/weather-conditions Weather Conditions - OpenWeatherMap Weather Conditions Home Weather Conditions openweathermap.org 위의 API이용 파일 3개로 구성 + 이외 스토리보드1개 이용 1) WeatherModel.swift 2) WeatherAPIManager.swift 3) WeatherViewController.swift 1) WeatherModel.swift 2) WeatherAPIManager.swift 코드 부분 하나씩 뜯어서 생각해보기 typealias completionHandler = (WeatherModel,..

Mapkit custom annotation

https://ios-developer-storage.tistory.com/entry/MKMapKit-CLCoreLocation-%EC%98%88%EC%8B%9C%EB%A1%9C-%EC%89%BD%EA%B2%8C-%EC%9D%B4%ED%95%B4%ED%95%98%EA%B8%B0-%EB%8B%A4%EC%9A%B4%EB%A1%9C%EB%93%9C-%EC%A0%9C%EA%B3%B5 [iOS/Swift] MKMapKit, CLCoreLocation 으로 지도앱 만들기- 소스코드 제공 MKMapKit과 CoreLocation을 활용해 간단한 앱 만들기 GitHub - AnnaBaeTofuMom/MapKitPlay: 맵킷을 처음 사용하시는 분들의 이해를 돕는 간단한 지도앱 맵킷을 처음 사용하시는 분들의 이해를 돕는..

CoreLocation

- 지도와 위치 권한은 상관 X - 만약 지도에 현재 위치 등을 표현하고 싶다면? 위치 권한을 등록해주어야 한다. https://hyerios.tistory.com/2 iOS CoreLocation 위치 파악하기 해당 유저의 좌표를 받아 날씨를 파악하여 날씨 기반 추천서비스 앱을 만들고 있어서 CoreLocation에 대해서 복습 겸 다시 공부를 하려합니다. 역시 iOS 공부는 개발 문서(developer documentation)를 살 hyerios.tistory.com https://velog.io/@limwin94/CoreLocation1 Core Location 간단하게 살펴보기 - 1 장치의 지리적 위치와 방향을 가져옵니다.Core Location은 장치의 지리적 위치, 고도 및 방향 또는 근처..