ios 개발자 3

[iOS 스탠포드] Chapter3

Chapter 3 ✔︎ 수정사항 - Computed Progerties : 굳이 메모리에 저장되지 않아도 되는 변수 -> get{}, set{} 메소드를 통해 수정 : 필요시에 해당 메소드가 실행된 값을 반환, 설정하는 구조 //before : 저장된 변수값만 의미를 지닌 상태, 어떻게 사용, 저장하느냐에 따라 에러가 발생할 가능성이 있는 상태 var indexOfOneAndOnlyFaceUpCard: Int? //after : 사용, 저장시에 일종의 규칙을 명시하여 에러상황을 방지한 코드 var indexOfOneAndOnlyFaceUpCard: Int? { get { var foundIndex: Int? for index in cards.indices { if cards[index].isFaceUp ..

[iOS 스탠포드] Assignment 1 : Concentration

Required Tasks 1. Get the Concentration game working as demonstrated in lectures 1 and 2. Type in all the code. Do not copy/paste from anywhere. - 새롭게 제작 2. Add more cards to the game. - 4*4 배열인 16개의 카드로 수정 3. Add a “New Game” button to your UI which ends the current game in progress and begins a brand new game. - 버튼 생성 및 IBAction 연결 코드 @IBAction func newGame(_ sender: UIButton) { emojiChoices[g..

[iOS 스탠포드] Chapter2

Chapter 2 - StoryBoard : View - ViewController : Controller - Concentration : Model - Card : Struct ✔︎ MVC 구조 - M : Model - UI와 관련없는(import Foundation) 코드, 즉 Controller가 명령을 내리면 무엇을 보일지 여부 - V : View - UI만으로 존재 (StoryBoard) - C : Controller - View와 Model 사이의 소통담당(import UIKit), 어떻게 화면에 표시할지 여부 - C -> M, V : 직접적으로 접근 가능 - V -> C - delegate : 행위에 대한 요청 - data source : 데이터에 대한 요청 - M -> C : Notific..