일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 아이폰7
- error
- setting
- Check
- 해몽
- 보라카이
- LG유플러스
- 포켓몬 GO
- 신도림 테크노마트
- simulator
- 앱스토어
- Example
- 공략
- Xcode
- UIView
- Bitcode
- 스마트폰
- 얻는법
- 샘플
- loop
- 포켓볼
- GCD
- afterdelay
- swift
- push
- swift3
- 페이백
- UITableView
- IOS
- 신도림
- Today
- Total
목록loop (2)
도래울
for view in self.view.subviews as! [UIView] { if let textField = view as? UITextField { if textField.text == "" { // show error return } } }See "Downcasting" in the Swift book.Update for Swift 2: As of Swift 2/Xcode 7 this can be simplified.Due to the Objective-C "lightweight generics", self.view.subviews is already declared as [UIView] in Swift, therefore the cast is not necessary anymore.Enume..
For-In LoopsYou use the for-in loop to iterate over a sequence, such as ranges of numbers, items in an array, or characters in a string.This example prints the first few entries in the five-times table:for index in 1...5 { print("\(index) times 5 is \(index * 5)")}// 1 times 5 is 5// 2 times 5 is 10// 3 times 5 is 15// 4 times 5 is 20// 5 times 5 is 25The sequence being iterated over is a range ..