Notice
														
												
											
												
												
													Recent Posts
													
											
												
												
													Recent Comments
													
											
												
												
													Link
													
											
									| 일 | 월 | 화 | 수 | 목 | 금 | 토 | 
|---|---|---|---|---|---|---|
| 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 | 31 | 
													Tags
													
											
												
												- swift
- MS-SQL
- ASP
- PER
- PyQt5
- MySQL
- urllib
- Unity
- 리눅스
- PyQt
- 날짜
- node.js
- python
- Excel
- javascript
- port
- Linux
- sqlite
- flutter
- 유니티
- ubuntu
- mssql
- tensorflow
- IOS
- 맛집
- pandas
- 다이어트
- 함수
- 라즈베리파이
- GIT
													Archives
													
											
											
											
											아미(아름다운미소)
[문법요약] 열거형(Enumeration) 본문
- 열거형(Enumeration)
            
                    
                            
        import UIKit
// 열거형(Enumeration)
enum CompassPoint {
    case North
    case South
    case East
    case West
}
let point: CompassPoint = CompassPoint.North
let point2: CompassPoint = .East
switch point {
case .North:
    print("북쪽")
case .South:
    print("남쪽")
case .East:
    print("동쪽")
case .West:
    print("서쪽")
}
func printPoint(point: CompassPoint) {
    print(point)
}
printPoint(point: .South)
enum ErrorType: Int {
    case Success = 0,
    TypeError = 10,
    ValueError = 15,
    ParsingError
}
var errorType: ErrorType = .TypeError
print(errorType)
errorType = .ParsingError
print(errorType.rawValue)
'랭귀지 > SWIFT' 카테고리의 다른 글
| [문법요약] 옵셔널 체이닝(Optional Chaining) (0) | 2017.12.14 | 
|---|---|
| [문법요약] Structure (0) | 2017.12.14 | 
| [문법요약] 함수 (0) | 2017.12.13 | 
| [문법요약] 배열, Set(집합), 딕셔너리(Dictionary) (0) | 2017.12.13 | 
| [문법요약] 조건 반복문 (0) | 2017.12.12 | 
			  Comments