본문 바로가기

전체 글

(35)
[iOS] Unable to activate constraint with anchors Error 개요 SnapKit을 통해 코드로 레이아웃을 만들고 있다가 오류를 만났습니다. 레이아웃을 잡으면 발생하는 오류이고, 레이아웃을 잡지 않으면 오류가 발생하지 않았습니다. 에러의 원인은 레이아웃이라고 생각했습니다. 에러 본문 Thread 1: "Unable to activate constraint with anchors and because they have no common ancestor. Does the constraint or its anchors reference items in different view hierarchies? That's illegal." 에러 해석 (번역기) 쓰레드 1 : "앵커로 구속을 활성화할 수 없음"Anchor : 0x6000017f0380 "OpenMarket.Item..
[Swift] URLSession으로 multipart/form-data request하기 안녕하세요 wody입니다. 얼마 전에 URLSession에 대해 알아보는 글을 작성했었는데, 오늘은 활용하는 글을 작성하고자 합니다. 이번 공부의 핵심 주제는 다음과 같습니다 HTTP 통신 HTTP 개요 - HTTP | MDN HTTP는 HTML 문서와 같은 리소스들을 가져올 수 있도록 해주는 프로토콜입니다. HTTP는 웹에서 이루어지는 모든 데이터 교환의 기초이며, 클라이언트-서버 프로토콜이기도 합니다. 클라이언트-서버 developer.mozilla.org Apple Developer - URLRequest Apple Developer Documentation developer.apple.com 개요 URLSession을 통해 GET 방식의 통신은 body가 없으므로 API에 맞는 url주소로 요청하..
[Swift] split vs components (Substring) Apple Developer - split Apple Developer - component 빠른 결론 문자열을 특정 구분자를 통해 배열로 반환해야할 땐 components를 사용하는게 좋다. split을 사용할 경우 반환값으로 Substring이 반환되어 메모리 누수 위험이 생길 수 있기 때문이다. split vs components String 타입의 데이터를 주어진 조건에 따라 분할하여 배열을 반환하는 메소드 split & components 는 어떤 차이가 있을까? split func split(separator: Character, maxSplits: Int = Int.max, omittingEmptySubsequences: Bool = true) -> [Substring] separator :..