import UIKit let source = [4,0,1,2,1,2,3,2] let result = NSOrderedSet(array: source) let resultCount = result.count let resultArray = result.array
実行結果
import UIKit let source = [4,0,1,2,1,2,3,2] let result = NSOrderedSet(array: source) let resultCount = result.count let resultArray = result.array