본문 바로가기

swiftUI

(3)
[SwiftUI] some View의 some에 대해서 SwiftUI를 처음 시작하면 some 키워드를 접할 수 있습니다. View가 struct라는 것은 알겠는데 앞에 붙은 some이 어떤 역할을 하는 것인지 알아보겠습니다. struct ContentView: View { var body: some View { Text("jsng is here!") .padding() } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } some keyword는 Swift에서 Opaque Types에 해당합니다. 직역하면 불투명한 타입입니다. Opaque Type은 함수나 메서드의 반환 타입을 가리는 역할을 합니다. 특정한 타입을 반환하지 않고 ..
[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 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 ..