본문 바로가기 메뉴 바로가기

Where there is a will, there's a way

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Where there is a will, there's a way

검색하기 폼
  • 분류 전체보기 (49)
    • TIL (25)
    • CS (0)
    • C++ (0)
    • iOS (6)
    • Swift (18)
    • Book (0)
  • 방명록

enumerations (1)
[Swift] Enumerations (열거형)

목차 Enumerations (열거형) Raw Values (원시 값) Enumerations (열거형) Enumerations 사용하는 이유 코드의 가독성이 높아진다. 코드의 안전성이 높아진다. // #A // 나쁜 코드, 값이 변할수도 있고, 그 값이 뭔지 알기 힘듦 let left = 0 let center = 1 let right = 2 var alignment = center // #B // #A보다 가독성이 좋아졌으나, 여기에도 문자열이라 오타가 날 수 있음. // swift는 대소문자를 구분하기때문에 정해야한다. let left = "left" let center = "center" let right = "right" var alignment = center if alignment == "C..

Swift 2021. 3. 3. 00:51
이전 1 다음
이전 다음
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
  • Functions
  • 반복문
  • 산술연산자
  • continue
  • enumerations
  • 오토레이아웃
  • labeled
  • 범위연산자
  • datatypes
  • 세자리수마다 콤마넣기
  • conditional
  • 삼항연산자
  • scope
  • Constants
  • RawValues
  • overflow
  • iOS View Life Cycle
  • optional
  • variables
  • 옵셔널
  • 훈련법
  • 흐름제어구문
  • playground
  • swift
  • 구문이름표
  • 전산구문 기초용어
  • 객체지향 생활체조
  • 오버플로우연산자
  • 결합성
  • 비트연산자
more
«   2025/06   »
일 월 화 수 목 금 토
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
글 보관함

Blog is powered by Tistory / Designed by Tistory

티스토리툴바