iOS

iOS

GCD (Grand Central Dispatch) 간단 정리

GCD (Grand Central Dispatch) 여러 thread가 task를 처리할 수 있도록 Queue(Dispatch Queue)에 들어온 task를 적절하게 분배해주는 시스템 Sync / Async sync: 코드 한 줄씩 작업 다 끝날 때 까지 기다린 다음에 다음 라인 실행 (queue에 들어간 task가 모두 완료 되어야 다음 task를 수행함) async: 기다리는 작업없이 다음 코드라인을 바로 실행 (queue에 들어간 task가 완료 되는지에 관계 없이 바로 다음 task를 수행함) Serial / Concurrent (Queue에서 작업을 분배하는 방법) - Serial: 하나의 thread가 순차적으로 처리하게 된다. - Concurrent: 여러 thread가 queue의 작업을..

iOS

iOS에서 json 처리하기

API 호출해 받은 Data를 json 파일로 저장하기 https://eunjoochoi.github.io/ios/save-json-file API 호출해 받은 Data를 json 파일로 저장하기 개발 공부하는 곳 eunjoochoi.github.io HTML로 내려오는 문자열을 정상 표기로 변환하기 https://eunjoochoi.github.io/ios/html-to-string [Swift] HTML로 내려오는 문자열을 정상 표기로 변환하기 HTML To String eunjoochoi.github.io JSONDecoder 내가 원하는 모양으로 파싱하기 https://eunjoochoi.github.io/ios/swift-json-custom-decoding [Swift] JSONDecoder ..

iOS

View Life Cycle / Frame and Bounds

View Life Cycle https://eunjoochoi.github.io/ios/view-life-cycle [iOS] View Life Cycle View life cycle을 정리해보자. (참고사이트: 애플문서) eunjoochoi.github.io Frame and Bounds https://eunjoochoi.github.io/ios/frame-and-bounds [iOS] Frame and Bounds 둘의 차이는? eunjoochoi.github.io

iOS

UILabel 원하는 범위만 색 변경하기 - NSMutableAttributedString 사용하기

원하는 범위의 문자열에만 색상을 변경하거나 볼드 처리를 하는 등의 작업이 필요할 때가 있다. 요 때 코드상에서 NSMutableAttributedString을 사용해 적용할 수 있는데, 적용할 때마다 찾아보게 돼서 한 번 정리가 필요하다고 느꼈다. NSMutableAttributedString을 원하는 UILabel의 텍스트로 만들어 NSRange를 통해 원하는 부분만 설정해주었다. if let text = self.attributedLabel?.text { // UILabel의 텍스트를 가지고 NSMutableAttributedString 생성 let attributedString = NSMutableAttributedString(string: text) // 원하는 attribute를 dictiona..

eunjuicy
'iOS' 카테고리의 글 목록