Last updated 3 years ago
Was this helpful?
Swift in Depth ⟩
Swift ⟩
- [Element].() 回傳的 iterator
SwiftDoc ⟩
具有 next() 方法的物件就可遵循 ,也就是一個 iterator。
類似 JS 的 iterator protocol。
public protocol IteratorProtocol { associatedtype Element mutating func next() -> Element? }