일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- RxCocoa
- Protocol
- rxswift
- map
- Xcode
- Clean Code
- SWIFT
- 애니메이션
- uitableview
- Observable
- uiscrollview
- Refactoring
- UICollectionView
- 리펙토링
- HIG
- ios
- collectionview
- swift documentation
- 리팩토링
- 스위프트
- clean architecture
- swiftUI
- Human interface guide
- 리펙터링
- MVVM
- tableView
- ribs
- 클린 코드
- UITextView
- combine
- Today
- Total
목록array (4)
김종권의 iOS 앱 개발 알아가기
zip array에서 사용하는 결합 연산자 두 원소가 항상 같이 짝짓는 연산자 var array1 = [1,2,3,4,5] var array2 = ["a", "b", "c", "d", "e"] zip(array1, array2) .forEach { value1, value2 in print(value1, value2) } /* 1 a 2 b 3 c 4 d 5 e */ 만약 둘 중 하나가 없다면 짝짓지 못하므로 값 x var array1 = [1,2,3,4,5] var array2 = ["a"] zip(array1, array2) .forEach { value1, value2 in print(value1, value2) } /* 1 a */ merge, merging dictionary에서 사용하는 병합 ..
allSatisfy 연산자 Collection의 모든 요소가 특정 조건을 만족시키는지 알고 싶은 경우 사용 ex) 배열을 순회하면서 원소들이 특정 조건을 모두 만족하는지 확인할 때 사용 Array, Dictionary, Set 타입에 사용 let arr = ["abcdef", "12345", "문자열"] let bool = arr.allSatisfy { $0.count > 2 } print(bool) // true let dict = ["1": 1, "2": 2] let bool2 = dict.allSatisfy { $0.key == String($0.value) } print(bool2) // true var set = Set() set.insert(2) set.insert(4) set.insert(6..
인덱싱으로 배열을 쪼갰을때 SubSequnce(=ArraySlice형) let array = [1,2,3,4,5] // [Int] let first = array[..
Swift 컬렉션은 3가지 Array Set Dictionary Array 갯수와 값을 지정한 초기화 let intArr = [Int](repeating: 0, count: 10) 추가: '+=' 연산자 사용 intArr += [2] 삽입: insert(_:at:) 기존에 at에 있던 값은 오른쪽으로 밀려나는 형태 var intArr = [Int](repeating: 0, count: 3) // [0, 0, 0] intArr.insert(2, at: 1) // [0, 2, 0, 0] 삭제: remove(at:) var intArr = [Int](repeating: 0, count: 3) // [0, 0, 0] intArr.insert(2, at: 1) // [0, 2, 0, 0] let removedVa..