An iBooks style book shelf
- This code should be compiled with ARC turned on;
- drag & drop
- scroll up/down while draging
- add & remove animation
- custom header (add a search bar or anything you want)
- [NEW 12.04.03] The demo supports oritation changing now, but I'm too lazy to make a new cell image. Just reset the number of books in each cell.(3 when portrait, 4 when landscape).
- Just take a look at the demo.
- bookView and shelfCell are just UIViews. So you can cutomize them almost whatever you want. But the frame of each view is fixed, if you want to have different size of bookView, you can try adding your content on a transparent UIView.
- To enable reusing for bookViews and cells, add the / protocols. (You'd better do this, perfromance will be a lot better).
- [NEW 12.04.03] To support oritation change, you should call the reload method and return different values (if necessary) in the delegate method with different orientation.
- [NEW 12.04.03] For more information about the data GSBookShelf need for layout, take a look at the "comments.png" (also available in the project)
does not support orientation change now, it's fixed Portrait or landscape (doesn't have a convenient method to reload the parameters which was set in the init method.)
the init method need too many parameters now. I will move all of them to GSBookShelfViewDataSource protocol methods, and this will help a lot when orientation changes, but maybe there'll be too many protocol methods.
[NEW 12.04.03] Maybe there should be some animation for cell when the orientation change.
Demo:(Be Patient, some gifs' size > 1M)