Created
May 22, 2017 14:12
-
-
Save AlexHedley/c551b417c3e02820a1eae04124003ee6 to your computer and use it in GitHub Desktop.
iCarousel - https://github.com/nicklockwood/iCarousel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)removeItemAtIndex:(NSInteger)index animated:(BOOL)animated { | |
//Amended method below to slide Up/Down | |
} | |
- (void)saveItemAtIndex:(NSInteger)index animated:(BOOL)animated { | |
index = [self clampedIndex:index]; | |
UIView *itemView = [self itemViewAtIndex:index]; | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDuration:1.0]; | |
[UIView setAnimationDelegate:itemView.superview]; | |
[UIView setAnimationDidStopSelector:@selector(removeFromSuperview)]; | |
[self performSelector:@selector(queueItemView:) withObject:itemView afterDelay:0.1]; | |
itemView.superview.layer.opacity = 0.0; | |
itemView.frame = CGRectOffset(itemView.frame, 0, 250); //Swap to -250 to change direction | |
[UIView commitAnimations]; | |
[UIView beginAnimations:nil context:nil]; | |
[UIView setAnimationDelay:0.1]; | |
[UIView setAnimationDuration:INSERT_DURATION]; | |
[UIView setAnimationDelegate:self]; | |
[UIView setAnimationDidStopSelector:@selector(depthSortViews)]; | |
[self removeViewAtIndex:index]; | |
_numberOfItems --; | |
_wrapEnabled = !![self valueForOption:iCarouselOptionWrap withDefault:_wrapEnabled]; | |
[self updateNumberOfVisibleItems]; | |
_scrollOffset = self.currentItemIndex; | |
[self didScroll]; | |
[UIView commitAnimations]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I needed a Carousel like control but swipe up/down actions.