Latest | 0.0.1 |
---|---|
Homepage | https://github.com/ultragtx/GSBookShelf |
License | BSD GSBookShelf and all code associated with it is distributed under a BSD license, as listed below
Created by Xinrong Guo Redistribution and use in source and binary forms, with or without Redistributions of source code must retain the above copyright notice, Redistributions in binary form must reproduce the above copyright Neither the name of the project’s author nor the names of its THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
Platforms | ios , requires ARC |
Frameworks | QuartzCore |
An iBooks-inspired bookshelf control.
Supports animated deletion, reordering, and addition.
14.04.08: This project won’t have any update, using UICollectionView with custom layout can be a better solution.
Attention:
- This code should be compiled with ARC turned on;
Features:
- drag & drop
- scroll up/down while draging
- add & remove animation
- custom header (add a search bar or anything you want)5.
- [Update 12.08.26] support orientation change now and the cell has a simple animtaion when orientation change make this more similar to iBooks, to get more info, take a look at the demo
How To:
- 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 "GSBookView" / "GSBookShelfCell" 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).
- [NEW 12.05.18] The books are center-aligend when there are more than one books in a row. If you only have one per row, it’s left-aligend, you can set the "cellMargin" to make it center-aligend manually.
WARNING:
- [12.08.26] Some of the images came from iBooks (a little change to the color). Just to show how the code works. PLEASE use your own image in your project. Check this and learn how to draw a bookshelf using Photoshop, if you are not good at this.
Known Issue:
- Rotation issue part 1 and
part 2(check issue #12 for description)
TODO:
- [NEW 12.05.14] Fix issue 12
- [NEW 12.05.18] Maybe it’s better to support left-aligend center-aligend and right-aligend.
Contribute:
- Anyone who contribute to this project can receive a License of AppCode (Send me a e-mail if you want one).
Updates:
- [12.08.24] merge to master
- [12.08.24] enhance orientation change support
- [12.08.24] bug fix when delete one which index is bigger than the visibles
- [12.08.26] orientation change with cell animation(like what iBooks do to the shelf when orientation change).
- [12.08.26] demo updated
- [12.04.11] fix issue #12 part 2, orientation change issue
- [13.06.02] use CADisplay link to replace NSTimer in customizing scroll speed of UIScrollView
Demo:
(Be Patient, some gifs’ size > 1M)
Latest podspec
{ "name": "GSBookShelf", "version": "0.0.1", "summary": "An iBooks-inspired bookshelf control.Supports animated deletion, reordering, and addition.", "homepage": "https://github.com/ultragtx/GSBookShelf", "authors": "Xinrong Guo", "license": { "type": "BSD", "text": " GSBookShelf and all code associated with it is distributed under a BSD license, as listed belownn Created by Xinrong Guon Copyright (c) 2012 FoOTOo. All rights reserved.nn Redistribution and use in source and binary forms, with or withoutn modification, are permitted provided that the following conditionsn are met:nn Redistributions of source code must retain the above copyright notice,n this list of conditions and the following disclaimer.nn Redistributions in binary form must reproduce the above copyrightn notice, this list of conditions and the following disclaimer in then documentation and/or other materials provided with the distribution.nn Neither the name of the project's author nor the names of itsn contributors may be used to endorse or promote products derived fromn this software without specific prior written permission.nn THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORSn "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTn LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESSn FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHTn HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,n SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED n TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, ORn PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OFn LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDINGn NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISn SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.n" }, "source": { "git": "https://github.com/ultragtx/GSBookShelf.git", "commit": "e6d590ceb40a4dd2dfbef34d353ccae60a56ebe8" }, "platforms": { "ios": null }, "source_files": [ "BookShelf/GS*.{h,m}", "BookShelf/NSMutableArray+Rearrange.{h,m}" ], "frameworks": "QuartzCore", "requires_arc": true }
Tue, 01 Mar 2016 22:05:04 +0000