본문 바로가기

분류 전체보기

(354)
URLSession 번역 https://developer.apple.com/documentation/foundation/urlsession URLSession | Apple Developer DocumentationAn object that coordinates a group of related, network data transfer tasks.developer.apple.com  URLSession네트워크 데이터 통신 작업과 관련된 그룹을 조정하는 객체 해당 클래스는 URL로 표시된 엔드포인트에서 데이터를 다운로드하거나 업로드 하기 위한 API를 제공한다.또한 앱이 실행되지 않거나 일시정지된 시점에서도 백그라운드에서 다운로드할 수 있는 기능을 제공URLSessionDelegate와 URLSessionTaskDelegate를 ..
Fetching website data into memory Fetching website data into memoryReceive data directly into memory by creating a data task from a URL sessionURLSession에서 DataTask를 생성하여 데이터를 메모리로 직접 수신한다.For small interactions with remote servers, you can use the URLSessionDataTask class to receive response data into memory (as opposed to using the URLSessionDownloadTask class, which stores the data directly to the file system)원격서버와 소규모 상호 작용의..
URL Loading System 번역 https://developer.apple.com/documentation/foundation/url_loading_system URL Loading System | Apple Developer DocumentationInteract with URLs and communicate with servers using standard Internet protocols.developer.apple.com URL Loading SystemInteract with URLs and communicate with servers using standard Internet protocols표준 인터넷 프로토콜을 사용하여 URL과 상호작용하고 서버와 통신합니다.The URL Loading System provides acc..
SwiftGen 사용 https://github.com/SwiftGen/SwiftGen GitHub - SwiftGen/SwiftGen: The Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all SThe Swift code generator for your assets, storyboards, Localizable.strings, … — Get rid of all String-based APIs! - SwiftGen/SwiftGengithub.com SwiftGenSwiftGen은 프로젝트의 리소스(이미지, 컬러, JSON, 문자열 등)를 Swift코드로 자동 생성해 주어 사용하는 라이브러리입니다. 기존에는 As..
[iOS][버그해결] 이중으로 들어간 CollectionViewCell안 CollectionViewCell이 재사용되는 버그 배경프로젝트를 진행하던 도중..CollectionViewCell안 CollectionViewCell의 내용이 재사용되어 정확한 셀의 내용을 포함하지 않게 되는 버그를 발견하였습니다.#관광지는 아래 해시태그원에 관광지가 포함되어야 하고,#음식은 음식, #숙박은 숙박이 포함되어야 합니다.하지만 처음 검색 후 데이터를 불러왔을 때, 생성된 셀을 바탕으로 재사용된 버그를 발견하였습니다.   시도해 본 방법CollectionViewCell은 커스텀 셀을 사용하기 위해 재사용 셀을 사용했습니다.// 재사용 셀 지정guard let cell = collectionView.dequeueReusableCell(withReuseIdentifier: SearchCollectionViewCell.identifier, for:..
Swift Concurrency 정리 - Swift.org를 참고하여 작성 Swift는 구조화된 방식으로 비동기 및 병렬 코드를 작성하기위해 기본적으로 기능을 제공합니다.Swift의 언어자원을 사용하지 않고도 동시코드를 작성할 수 있지만, 읽기가 더 어렵고 복잡합니다. 사용하지 않은 예listPhotos(inGallery: "Summer Vacation") { photoNames in let sortedNames = photoNames.sorted() let name = sortedNames[0] downloadPhoto(named: name) { photo in show(photo) }}위 예제에서도 코드를 완료 핸들러로 작성해야 하기 때문에 중첩된 클로저를 사용하게 되고, 코드가 더 복잡하여 다루기 힘들..
[iOS] Alamofire 문서번역 Alamofire Document를 번역한 글 입니다.(오타 오역이 많을 수 있습니다)소개Alamofire은 HTTP 네트워크 요청에 대한 우아하고 구성 가능한 인터페이스를 제공합니다. 자체 HTTP 네트워킹 기능을 구현하지 않습니다. 대신 Foundation 프레임워크에서 제공하는 Apple의 URL Loading System을 기반으로 구축됩니다.이 시스템의 핵심은 URLSession 및 URLSessionTask 하위 클래스 라는 것 입니다. Alamofire은 이러한 API를 사용하기 쉬운 인터페이스로 래핑하고 HTTP 네트워킹을 사용하는 최신 애플리케이션 개발에 필요한 다양한 기능을 제공합니다. 그러나 Alamofire의 핵심 동작 중 많은 부분이 어디에서 나오는지 아는 것이 중요하므로 URL ..
iOS - JSON파일 추가해서 불러오기 배경공공데이터 포털에 있는 오픈API를 활용하여 프로젝트를 만들던중 관광지검색을 위해 지역코드를 Key값으로 넣어줘야하는 상황이였습니다. 지역코드는 HTTP통신을 통해 불러오는게 아니라 따로 엑셀파일을 제공해줘서 이를 사용해보고자합니다! 이런식으로 제공해줬는데.. 데이터가 200개가 넘어가는 많은 데이터량입니다.이를 JSON형식으로 바꾸자니 엄청난 노가다가 예상되어 그냥 복사붙여넣기 후 변수로 지정한다음 데이터 가공하여 배열로 담아주었습니다. var text = """ 11 서울특별시 11110 종로구 11 서울특별시 11140 중구 11 서울특별시 11170 용산구 11 서울특별시 11200 성동구 .... ..