var test = [1,2,3,4] let testcon = test.contains { (testData) -> Bool in return testData == 3 } testcon // true 이전에 contains을 사용해서 해당 배열크기만큼 돌면서 체크를 하는 것을 알고있었지만 해당 리턴값이 하나라도 true라면 그 값이 true로 정해지는지 몰랐다. 예시 코드에서 리턴값은 false, false, true, false 값이지만 결국 true가 하나라도 존재하기 때문에 testcon이라는 변수는 true가 된다.
class AlarmInfo: NSObject, NSCoding { var sound : eSound = .talkCM init(sound : eSound){ self.sound = sound } } enum eSound : Int { case talkCM case twoSecond case original case first var name: String { switch self { case .first : return "1위" } } var songName: String { switch self { case .first : return "alarm_6_china.mp3" } } } -------- fun test(info: [AlarmInfo]) { info.forEach { (data) in dat..