Avatar
norio_nomura 4/26/2018 5:40 AM
@swift-4.1.3 @swift-4.2.4 struct A { var strings: AnySequence<String> { return AnySequence { () -> AnyIterator<String> in var buffer = staticStrings ?? [] return AnyIterator { if let first = buffer.popFirst() { return first } return nil } } } } let staticStrings: [String]? = ["1", "2"] (edited)