GithubHelp home page GithubHelp logo

ultragtx / gsbookshelf Goto Github PK

View Code? Open in Web Editor NEW
425.0 425.0 90.0 5.07 MB

An iBooks-styled book shelf for iOS (Animation of drag & drop, insert, remove...)

License: Other

Ruby 0.40% Objective-C 99.60%

gsbookshelf's People

Contributors

ultragtx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

gsbookshelf's Issues

Book Index

There is currently an issue whereby when you move books to new indexes, the book index will stay the same as it previously was. Also, when you create a new book, it will set the new book's index to '0', but the old book at '0' will also be at index '0' so there will be two 0 indexes.

Anybody with any answers as to why this may be happening can email me at [email protected] - I would greatly appreciate it. Thanks!

problem with integration

hi, i try to use this controll in my application i push the principal control in my navigator , i can see the list book, but when i tap the back button in navigation bar i have a crash in didMoveToSuperview function

Error when remove BookView

Error happen when remove bookview in bookShelf if

_visibleBookViews.count > stepsArray.count (in GSBookViewContainerView.m file) => index is out of stepsArray range

- (void)removeBookViewsAtIndexs:(NSIndexSet *)indexs animate:(BOOL)animate {
....
[UIView animateWithDuration:animate ? 0.15 : 0.0
                          delay:0.0
                        options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionLayoutSubviews
                     animations:^{
                        ......
                     }completion:^(BOOL finished) {
                         //NSLog(@"disappear animation completion");

                         [UIView animateWithDuration:animate ? 0.3 : 0.0
                                               delay:0.01
                                             options:UIViewAnimationOptionCurveLinear
                                          animations:^ {
                                              //NSLog(@"move animation");
                                              for (int i = 0; i < [_visibleBookViews count]; i++) {
                                                UIView *bookView = [_visibleBookViews objectAtIndex:i];
                                                [self moveBookView:bookView steps:[(NSNumber *)[stepsArray objectAtIndex:i] intValue]];
                                              }
                                              return;
                                          }
                                          completion:^(BOOL finished) {
                                             ........
                                          }];
                     }];
....
}

need help to remove the book icons in the book shelf

iOS Simulator Screen shot 21-Jan-2013 1 27 16 PM
hi...... thatz a fantanstic code out there... i am a newbie. i am working on a project which is similar to the bookshelfview, when clicked on each file, it should be downloaded. i hav tried but failed to remove the icons from the view.what i need is just a book shelf view which should be able to scroll. so that i can display my files in each row.
how to rermove the red,green...etc book icons of yours from the view.

How to get the BookView instance just after add one book?

When call - (void)insertBookViewsAtIndexs:(NSIndexSet *)indexs animate:(BOOL)animate; to insert new BookViews, I want to the BookView instance to operation on.

For example, user choose to download a book, the method will be called with parameter [NSMutableIndexSet indexSetWithIndex:0]. Then I want the BookView added to the 0 to operation on, for example, to display the download progress with it.

Now I can not find a simple way to get the correct BookView instance (in case if there is no book, and just download the first one). Hope there will be supporting for this. Like add method:
- (void)insertBookViewAnimation:(BOOL)animate callback:(void(^)(UIView *bookView))callback

Rotation issue part 1 and part 2

Assume there are 100 books

Vertical: 3 books a row, 34 rows total
Landscape: 4 books a row, 25 rows total

Build and run the app in the simulator, turn on slow-motion animation.

Part 1

Issue:
When in vertical mode, scroll to the bottom, then rotate to landscape mode, during the slow animation, you won't see any shelf, just the background, when the rotate animation end, the view will scroll quickly from row 34 to row 25. This is not the visual effect we want.

 2013-03-02 3 12 23
 2013-03-02 3 13 28

Desired:
Before the rotate animation, jump to row 25 without animation, then the visual effect will be better.

Reality:
No matter where I try to set the contentOffset without animation and/or disable UIView animation, it will still animate during the rotation.

Part 2 (This has been fixed)

Issue:
Do the same thing in part 1, and then rotate back to vertical, you will see in the bottom shelf, the the right side board of the shelf behave differently as other shelfs

Reason:
The reused shelf used to be a vertical shelf, so the side board's position will not change from the landscape mode to the vertical mode.

Reality:
Tried to reset the frame of all reused shelf and relayout, but still behave like before.

 2013-03-02 3 12 36

Crash if numOfBooksInCell = 1

If numOfBooksInCell = 1

The app crash on this line: _bookViewSpacingWidth = (cellWidth - 2 * cellMargin - numOfBooksInCell * _bookViewWidth) / (numOfBooksInCell - 1);

because (numOfBooksInCell - 1) = 0.

my workaround:
NSInteger dividend = numOfBooksInCell-1;
if (dividend==0)
dividend=1;

File: GSBookViewContainerView
method: - (void)calculateLayout

WorkPlan.ods

tomoさんへ

WorkPlan.odsにランクAのものだけ予定を追加しました。
比較的ゆっくりの線をひきました。

駒木

[Question] About UISearchBar

Hi ultragtx
How to extend first row and add UISeachBar bar into it?

I've customized your project for the ipad but UISearchBar is too long to display at the top.

use component for ipad

hi, how i can use this component foro ipad native application? must change image? or how?

error when I dismiss the bookshelf view controller

When I dismiss the viewcontroller, didMovetoSuperView is called and then it call reload data....

didMovetoSuperView->reloadData->_headerView = [_dataSource headerViewOfBookShelfView:self];
Then error occured here.

Any suggestion? Maybe i don't close it something properly.

Regards

-(void)addButtonClicked: will crash after delete all books

- (void)addButtonClicked:(id)sender {
    int a[6] = {1, 2, 5, 7, 9, 22};
    NSMutableIndexSet *indexSet = [NSMutableIndexSet indexSet];
    NSMutableArray *arr = [NSMutableArray array];
    NSMutableArray *stat = [NSMutableArray array];
    for (int i = 0; i < 6; i++) {
        [indexSet addIndex:a[i]];
        [arr addObject:[NSNumber numberWithInt:1]];
        [stat addObject:[NSNumber numberWithInt:BOOK_UNSELECTED]];
    }
    [_bookArray insertObjects:arr atIndexes:indexSet];
    [_bookStatus insertObjects:stat atIndexes:indexSet];
    [_bookShelfView insertBookViewsAtIndexs:indexSet animate:YES];

the random number in indexset is bound to beyond bounds _bookArray,change to
int a[6] = {0, 1, 2, 3, 4, 5 } fix it;
thx for ur code ,I learned a lot

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.