SwiftUI / Day 2

Minsang Kang·2024년 2월 14일
0

100 Days of SwiftUI

목록 보기
3/4
post-thumbnail

https://www.hackingwithswift.com/100/swiftui/2

How to store truth with Booleans

https://www.youtube.com/watch?v=YQPOLBZiGWA

  • true, false
  • ! : 반대값
  • .toggle() : 값 뒤집기

How to join strings together

https://www.youtube.com/watch?v=IpgGhy1QTzw

  • '+' 를 사용하여 문자열을 합칠 수 있음
  • a + b + c 의 경우 a+b가 수행된 후 +c가 수행됨
  • string interpolation(문자열 보간법): '\()' 문을 사용하여 런타임에 문자열 내 변수, 상수를 넣을 수 있음

Summary: Simple data

https://www.youtube.com/watch?v=GUCYgvvxJI0

  • let, var
  • String
  • Int
  • Double
  • Bool

Checkpoint 1

https://www.youtube.com/watch?v=clcA92OLgpI

Playground 에서 섭씨 -> 화씨 변환 만들어보기
1. 섭씨 온도를 일정하게 유지
2. 9를 곱하고 5로 나눈 다음 32를 더하여 화씨로 변환
3. 섭씨와 화씨 값을 모두 표시하여 결과를 표시

Hint

  • let
  • 정수 대신 .0을 사용
  • *, / 사용
  • '()'를 사용
  • print()를 사용

Code

https://github.com/SwiftUIKorea/Minsang/blob/main/Playground/Checkpoint1.playground/Contents.swift

profile
 iOS Developer

0개의 댓글