본문 바로가기

반응형

IOS

(5)
[iOS] GCD - Main Queue, Global Queue와 동기(sync), 비동기(async) 작업 비교 GCD 개념 돌아보기 더보기1. GCD란 무엇인가?GCD (Grand Central Dispatch)는 iOS에서 멀티스레딩을 간편하게 관리하기 위해 제공되는 기술. 이를 통해 여러 스레드를 쉽게 관리하고, 백그라운드 작업과 UI 업데이트 작업을 구분할 수 있음.메인 큐 (Main Queue)UI 작업을 실행하는 스레드, 메인 스레드에서 실행.글로벌 큐 (Global Queue)메인 스레드를 제외한 백그라운드에서 실행되는 큐로 여러 스레드를 활용해 비동기 작업을 처리함.큐 (Queue)작업을 실행할 순서를 결정하는 객체로, 큐에 담긴 작업은 하나씩 실행. 2.  DispatchQueue.global() 과  DispatchQueue.main .global()전역 큐로, 백그라운드 스레드에서 작업을 실행...
[iOS] GoogleMap 마커, 경로 사용하기 1 ) GoogleMap 추가하기 https://developers.google.com/maps/documentation/ios-sdk/overview?hl=ko GoogleMap을 사용하기 위해선 우선 API 키를 발급 받아야합니다. 위 링크에서 API키를 발급 받았다면, AppDelegate didFinishLaunchingWithOptions 함수에 구글맵을 연동하는 코드를 작성합니다. func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { // Override point for customization..
[Swift] UI - Dynamic TableView 높낮이를 컨텐츠 사이즈에 따라 알아서 맞춰주는 테이블 뷰! CustomView 추가 import Foundation import UIKit class UIDynamicSizeTableView: UITableView { override var intrinsicContentSize: CGSize { let height = self.contentSize.height + self.contentInset.top + self.contentInset.bottom return CGSize(width: self.contentSize.width, height: height) } override func layoutSubviews() { self.invalidateIntrinsicContentSize() super.layo..
[iOS] YoutubePlayer 사용하기 GitHub - youtube/youtube-ios-player-helper: Lightweight helper library that allows iOS developers to add inline playback of YouT Lightweight helper library that allows iOS developers to add inline playback of YouTube videos through a WebView - GitHub - youtube/youtube-ios-player-helper: Lightweight helper library that allows... github.com iOS 에 쉽고 빠르게 동영상 플레이어를 얹는 법 Youtube 플레이어 (YoutubePlayer_i..
[Swift] 프로토콜 지향 제네릭 프로토콜 지향 설계에서는 언제나 프로토콜로 시작한다 protocol List { associatedtype T subscript(indices: E) -> [T] where E.Iterator.Element == Int { get } func length() -> Int func get(at index: Int) -> T? mutating func add(_ item: T) mutating func delete(at index: Int) } 아래는 활용편이다 선언부, 구현부로 분리하여 네트워킹 코드를 작성할 것이다 이 글은 RxSwift를 사용한다 Usecase (선언부) import RxSwift protocol PasswordUsecase: PasswordCheckUsecase, PasswordCha..

반응형