본문 바로가기

iOS/CS193p - Developing Apps for iOS

(6)
[CS193p] Lecture 11 - Persistence에 대해서 2021 CS193P Lecture 11 : Error Handling Persistence 강의 중에서 persistence 관련 강의 내용을 정리한 것입니다. # 데이터를 영구적으로 저장하는 방법 - 파일 시스템에 저장 : FileManager - SQL DB에 저장 : CoreData - iCloud에 저장 - Cloud db에 저장 : CloudKit - 등등 - 설정값 같은 lightweight data : UserDefaults 해당 강의에서는 FileManager와 UserDefaults에 대해서 알아봅니다. # File System iOS의 file system은 UNIX 파일 시스템을 이용합니다. 앱에서 허용된 공간은 sandbox라고 합니다. 이 sandbox 내에서만 읽기와 쓰기가 가..
[CS193p] GCD를 async/await로 변경하기 CS193p 강의의 lec 9, 10에서 GCD를 사용한 것을 new async await로 변경해보겠습니다. 먼저 강의에서 언급한 Swift's new built-in async API는 async/await를 지칭하는 것 같습니다. 2021 WWDC - Meet async/await in Swift javascript의 async/await 구조와 매우 비슷합니다. nest return 코드가 사라져서 가독성이 향상되었습니다. 기존 코드는 다음과 같습니다. private func fetchBackgroundImageDataIfNecessary() { backgroundImage = nil switch emojiArt.background { case .url(let url): // fetch the u..
[CS193p] Assignment 4 - Animated Set 솔루션 CS193P Assignment #4 Animated Set 각 task 별 solution을 정리했습니다. All code in github Required Task 1. Your assignment this week must still play a solo game of Set. 2. In this version, though, when there is a match showing and the user chooses another card, do not replace the matched cards; instead, discard them (leaving fewer cards in the game). 👉 card를 선택했을 때의 동작을 replaceNewCard에서 discard로 변경했습니다. m..
[CS193p] Assignment 4 - Animated Set 문제 번역 과제 수행 중에 원본이 영어라서 보고도 까먹는 경우가 많아 한글로 번역합니다. 영한 번역이 아니라 이해한 것을 기반으로 작성한 번역입니다. 2021년 Spring 강의입니다 원본 보러 가기 Objective 이번 과제의 목표는 이전 Set 과제에 animation을 추가해보면서 이번 주에 강의한 animation mechanism을 이해하는 것이 목표입니다. 힌트도 확인하시구요. 평가항목도 확인해주세요. Due 생략 Materials 이전 Set 과제 Required Tasks 이번 과제는 싱글 Set 게임을 계속 만듭니다. 이번 버전에서는 match가 표시되고 나서 유저가 다른 카드를 선택해도, match인 카드를 교체하지 않고 버립니다. (카드 수 감소) "deck"과 "discard pile"을 U..
[CS193p] Assignment 3 - Set Game 솔루션 CS193P Assignment #3 Set Game 각 task 별 solution을 정리했습니다. Required Task 1. Implement a game of solo (i.e. one player) Set 👉 All code in github 2. As the game play progresses, try to keep all the cards visible and as large as possible. In other words, cards should get smaller (or larger) as more (or fewer) appear onscreen at the same ti me. It’s okay if you want to enforce a minimum size for your ..
[CS193p] Assignment 3 - Set Game 문제 번역 과제 수행 중에 원본이 영어라서 보고도 까먹는 경우가 많아 한글로 번역합니다. 영한 번역이 아니라 이해한 것을 기반으로 작성한 번역입니다. 2021년 Spring 강의입니다 원본 보러 가기 Objective 이번 과제의 목표는 새로운 애플리케이션을 처음부터 만들어보는 것입니다. 이전 2개의 과제와 매우 유사하지만 전체 경험을 얻기에는 충분히 다릅니다. Due 생략 materials 이전 강의에서 나온 코드를 사용해도 됩니다. 보드게임 Set의 규칙을 잘 확인하세요 Required Tasks 1인용 Set 게임을 구현합니다. 게임이 진행될 때, 모든 카드는 보이는 상태여야 하고 가능한 커야 합니다. 즉, 카드는 크기가 크게(작게) 보일 수도 있고 개수가 많게(적게) 나타날 수 있습니다. 카드에 최소 크기를..