Design Patterns by Tutorials by By Joshua Greene & By Jay Strawn

Design Patterns by Tutorials by By Joshua Greene & By Jay Strawn

Author:By Joshua Greene & By Jay Strawn
Language: eng
Format: epub
Publisher: Ray Wenderlich


What should you be careful about?

There is a protocol named IteratorProtocol, which allows you to customize how your object is iterated. You simply implement a next() method that returns the next object in the iteration. However, you’ll probably never need to conform to IteratorProtocol directly.

Even if you need a custom iterator, it’s almost always better to conform to Sequence and provide custom next() logic, instead of conforming to IteratorProtocol directly.

You can find more information about IteratorProtocol and how it works with Sequence at http://bit.ly/iterator-protocol.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.