Notice
Recent Posts
Recent Comments
반응형
목록2017/07/17 (2)
오늘도 공부
swift array to Set
extension Array { func mapArray(_ transform: (Array) -> T) -> T { return transform(self) } }Then you can pass in the Set initializer to the new mapArray functionobjectArray .map({ $0.URL }) .mapArray(Set.init)
IOS/예제모음
2017. 7. 17. 12:39
swift 연산자 모음 예제들
출처 : http://codeman77.tistory.com/82 import UIKit; // 홀수 집합let oddNumberSet : Set = [ 1, 3, 5, 7, 9 ];// 짝수 집합let evenNumberSet : Set = [ 0, 2, 4, 6, 8 ];// 소수 집합let primeNumberSet : Set = [ 2, 3, 5, 7 ]; // 연산 결과를 저장할 집합var resultNumberSet : Set = Set(); // 교집합(Intersection) : 두 집합의 공통된 요소print("홀수, 짝수 교집합");resultNumberSet = oddNumberSet.intersection(evenNumberSet);// []for i in resultNumberSe..
IOS/예제모음
2017. 7. 17. 12:34
