이런 문제를 해결하기 위해서 클로저 내에서 “capture list”를 정의한다.capture list는 클로저 바디 내에서 다른 reference type (i.e class) 에 접근할 때 어떤 규칙을 가지고 접근할지 정의하는 것이다. 클로저 내에서 self를 캡쳐
Swift 에서는 strong reference cycle를 해결하기 위해서 2가지 방법을 제공한다.weak referenceunowned reference✻ 둘 다 reference cycle에서 하나의 인스턴스가 다른 인스턴스를 “강하게" 참조하지 않게 도와주는 키
ARC에 대한 개념을 다시 확실하게 잡고 싶어 공식 문서를 보고 정리한 내용을 공유한다.공식문서 링크 : https://docs.swift.org/swift-book/LanguageGuide/AutomaticReferenceCounting.htmlSwift는
현재 만들고 있는 앱에 Review Table View Cell 을 만들어야 한다. 사용자들이 맛집을 리뷰할 수 있게 하고, 등록된 리뷰들을 UITableView에 담아 보여줄 예정이다. 만들고자 하는 Review Cell은 아래와 같은 디자인이다.그런데 사용자가 리뷰
앱 프로젝트를 진행하면서 API 통신을 할 일이 정말 많다. 아니, API 통신을 안 하는 부분이 거의 없는 것 같다. 백엔드 담당하시는 팀원이 API 설계를 하시고, Swagger 를 통해 테스트를 할 수 있게 만드셨는데, 처음보는 Content-Type 가 있었다.
앱 개발을 하다가 사용자 앨범에서 사진을 여러 장 받는 그런 기능을 구현해야 했다. 그러나 어떻게 구현하나 알아보고 있는데, 애플에서 기본으로 제공하는 ImagePickerController는 한 번에 여러 장을 고를 수 없게 되어 있다고 한다. 즉, 프로필 이미지 사
간단하고 깔끔한 계산기 모음 앱 (무려 6종)!일반 계산기단위 계산기금 시세 계산기 (재미로 넣어봄)할인 계산기환율 계산기학점 계산기iOS & Swift 공부를 시작한지 한 달째 되던 무렵, 간단한거 뭐라도 좀 만들어봐야 실력이 늘 것 같았다. 스위프트 문법 책을 아무
이쁜 UI를 가진 초간단 투두앱!Realm 을 이용하여 사용자 입력 데이터를 기기에 보존MVC 디자인 패턴 적용Realm 을 이용한 로컬 데이터 저장 방법Realm 에 저장된 다양한 객체들 사이의 관계를 설정하는 법 (1:1 데이터, 1:다 데이터)보존된 데이터 검색하
Updating in Realm is very similar to creating a new item.→ We first have to unwrap the Results container and see if it is not nil.realm.delete ( objec
→ Unlike Core Data, fetching Realm objects is really simple, because it only requires 1 line. If you want to fetch a Category type object, just specif
First, setup the necessary Data files in your project directory.The class you set up must be a subclass of "Object", which is a class used to define R
In the AppDelegate.swift file, don't forget to import RealmSwift and initialize it.→ Use the above code to figure out where your Realm file is. CMD +
Deleting Data from Core Data (Delete in CRUD) The order which we delete and remove matters a huge deal. We first need to delete what we want to delet
How can we load up items from our system container?ex. Entire codecontext.fetch(request) → Since we cannot directly fetch data from the Persistent Con
→ The above code allows you to easily locate where your SQLite file is.Locate the SQLite file and then open it with an SQLite app.We can see that ther
( ToDo App example )We first have to modify the following code:First of all, we have to tap into the context variable from the AppDelegate.swift. But
First and foremost, the "Use Core Data" checkbox must be checked.After creating the project, you notice one different file. Inside here is where we se
It's a good idea to keep a Constants.swift file to store the key stringsYour app would crash if the String is wrongYou should only really be using Use
Observer & Notification → Observer 가 코드 어딘가에서 서식하며 Notification 을 기다리는 개념 → 특정 이벤트가 발생하면 Notification 을 발동하게끔 할 수 있음. 그때 기다리고 있던 Observer 역시 발동하여,
사용자에게 경고 또는 알림 메시지를 표시하기 위해 Alert or ActionSheet 를 사용함TitleMessageAction→ 이 3개로 구성되어 있음사용자에게 표시할 Alert 또는 Action Sheet 의 구성에 관한 메서드와 프로퍼티를 포함하고 있음.구성