본문 바로가기
반응형

#모바일 [Mobile]/iOS41

[iOS] 기상청 (Korea Meteorological Administration) Grid XY 📄 기상청 Grid XY란? 한반도와 서해 5도를 포함한 우리나라와 인근 해역으로 남쪽으로는 이어도, 동쪽으로는 독도, 서쪽 끝으로는 백령도 까지 포함하고 있다. 이 영역은 5km×5km의 격자 간격으로 총 37,697개의 격자를 포함한다. (동서 149개 ×남북 253개). 📄 기상청 Grid XY Swift Source Code fileprivate struct lamc_parameter { var Re:Float /* 사용할 지구반경 [Km] */ var grid:Float /* 격자간격 [Km] */ var slat1:Float /* 표준위도 [Degree] */ var slat2:Float /* 표준위도 [Degree] */ var olon:Float /* 기준점의 경도 [Degree] */ v.. 2019. 6. 27.
[iOS] 진동 및 시스템 효과음 (Vibration and System Sound) + System Sound 파일 경로 /System/Library/Audio/UISounds/ 📄 System Sound Play Swift Source Code import AudioToolbox AudioServicesPlaySystemSound(/* SERVICE_NUMBER */ 4095) 🚀 REFERENCE AudioServices - iPhone Development Wiki From iPhone Development Wiki AudioServices is a group of C functions in AudioToolbox for playing short (≤30 seconds) sounds. Predefined sounds There are some predefined system sou.. 2019. 6. 27.
[iOS] UITableView 셀 크기의 맞춰 높이 동적 설정 (Resizing UITableView to fit content) 📄 [iOS] UITableView DataSourceResizing UITableView to fit content Swift Source Code var frame: CGRect = self.movieUserCommentTableView.frame frame.size.height = self.movieUserCommentTableView.contentSize.height self.movieUserCommentTableView.frame = frame 📄 [iOS] UITableView DataSourceResizing UITableView to fit content Objective-C Source Code dispatch_async(dispatch_get_main_queue(), ^{ //This .. 2019. 6. 23.
[iOS] JSONEncoder / JSONDecoder 스위프트 4 버전 이전에는 JSONSerialization을 사용해 JSON 타입의 데이터를 생성했습니다. 그러나 스위프트 4 버전부터 JSONEncoder / JSONDecoder가 Codable 프로토콜을 지원하기 때문에 JSONEncoder / JSONDecode와 Codable 프로토콜을 이용해 손쉽게 JSON 형식으로 인코딩 및 디코딩할 수 있습니다. 즉, JSONEncoder 및 JSONDecoder를 활용하여 스위프트 타입의 인스턴스를 JSON 데이터로 인코딩, JSON 데이터에서 스위프트 타입의 인스턴스로 디코딩할 수 있습니다. 📚 JSON (JavaScript Object Notation) 이란? JSON (제이슨[1], JavaScript Object Notation)은 속성-값 쌍( .. 2019. 5. 1.
반응형