nsfastenumeration

NSFastEnumeration in Swift 3

僤鯓⒐⒋嵵緔 提交于 2019-12-23 12:17:21
问题 I am trying to iterate over a object of CMSensorDataList class returned by CMSensorRecorder.accelerometerData(from:to:) . This class confirms to NSFastEnumeration protocol. So I tried the trick mentioned in https://stackoverflow.com/a/25872991/5603109. However since I am using Xcode Version 8.0 beta (8S128d), it no longer works. What can I do to make it support for-in loops? 回答1: In Swift 3, SequenceType has been renamed to Sequence (the "Type" suffix has been removed from protocols),