iOS/iOS Swift Udemy - AngelaYu 28

Debug with breakpoint

Debug with breakpoint self.itemArray.append(textField.text!) 전/후로 달라진 itemArray를 보고 싶은 경우 ?? 1) 전 breakpoint 찍고나서, 디버그창에다가 print itemArray 치면 현재의 itemArray를 보여줌 (3가지) 2) 후 breakpoint를 무시하고 그 다음줄까지 쭉 실행시켜보고 싶으면 step over (디버그창의 왼쪽에서 두번째) 를 클릭해서 실행시킨뒤 다시 print itemArray로 출력해보면 됨.

디버깅 5단계

1. What did you expect your code to do? 코드가 무엇을 하기를 기대했는가? ex) 1초마다 eggTimer progress bar가 1칸씩 움직여서 꽉 채워지길 바람 2. What happened instead? 그 대신에 무슨 일이 일어났는가? ex) 0으로 가버림 3. What does your expectation depend upon? 당신의 기대는 실제로 무엇에 달려있습니까? ex) 나눈 값이 십진수이어야. 4. How can we test the things our expectations depend on? 우리의 기대가 의존하는 것들을 어떻게 테스트할 수 있는가? print문 찍어보기 5. Fix our code to make reality match expec..

iOS swift Eggtimer - timer, progress bar

https://easy-coding.tistory.com/92 Swift 타이머(Timer) 사용 60초 카운트다운(CountDown)으로 동작하는 타이머 사용 예제입니다. 예제 코드 //타이머 변수 선언 var timer : Timer? //타이머에 사용할 번호값 var timerNum: Int = 0 //타이머 시작 public func startTimer().. easy-coding.tistory.com https://crazydeer.tistory.com/entry/iOSSwift-Progress-Bar-%EC%82%AC%EC%9A%A9%EB%B2%95 // egg button 클릭시 한번에 progress bar가 다 차게끔 하는 코드 progressbar.progress = 1.0 // How..

iOS switch문 연습

요약: 1. if, else if... 등으로 나타내야 하는 구문이 5개 이상이라면 무조건 switch 구문이 낫다. 2. if, else if.... = switch 같은 역할 위의 switch구문은 아래 if, else if 구문과 의미가 같다. 월 ~ 일요일 switch문으로 출력 (1 ~ 7에 해당하는 각각의 요일 출력) ////Don't change this var aNumber = Int(readLine()!)! func dayOfTheWeek(day: Int) { switch day { case 1: print("Monday") case 2: print("Tuesday") case 3: print("Wednesday") case 4: print("Thursday") case 5: print(..