All Projects → orucanil → Carouselview

orucanil / Carouselview

Licence: mit
Carousel View

Projects that are alternatives of or similar to Carouselview

Scalingcarousel
A super simple carousel view with scaling transitions written in Swift
Stars: ✭ 499 (+2168.18%)
Mutual labels:  carousel
Ngx Bootstrap
Fast and reliable Bootstrap widgets in Angular (supports Ivy engine)
Stars: ✭ 5,343 (+24186.36%)
Mutual labels:  carousel
React Carousel
A pure extendable React carousel, powered by Brainhub (craftsmen who ❤️ JS)
Stars: ✭ 764 (+3372.73%)
Mutual labels:  carousel
React Multi Carousel
A lightweight production-ready Carousel that rocks supports multiple items and server-side rendering with no dependency. Bundle size 2kb.
Stars: ✭ 544 (+2372.73%)
Mutual labels:  carousel
Cardview
CardsView | CarouselView | CoverflowView | CubeView for Xamarin.Forms
Stars: ✭ 587 (+2568.18%)
Mutual labels:  carousel
Motionlayoutcarousel
Simple Carousel built with Android MotionLayout
Stars: ✭ 686 (+3018.18%)
Mutual labels:  carousel
Stateview
UIViews that update themselves when your data changes, like React.
Stars: ✭ 493 (+2140.91%)
Mutual labels:  uiview
Newpagedflowview
电影票卡片式无限自动轮播图
Stars: ✭ 819 (+3622.73%)
Mutual labels:  carousel
Css Components
☕️ A set of common UI Components using the power of CSS and without Javascript.
Stars: ✭ 592 (+2590.91%)
Mutual labels:  carousel
Viewanimator
ViewAnimator brings your UI to life with just one line
Stars: ✭ 6,592 (+29863.64%)
Mutual labels:  uiview
Hooper
🎠 A customizable accessible carousel slider optimized for Vue
Stars: ✭ 561 (+2450%)
Mutual labels:  carousel
Simple Slider
🎠 The 1kb JavaScript Carousel
Stars: ✭ 583 (+2550%)
Mutual labels:  carousel
Swiper
Most modern mobile touch slider with hardware accelerated transitions
Stars: ✭ 29,519 (+134077.27%)
Mutual labels:  carousel
Yourview
YourView is a desktop App in MacOS based on Apple SceneKit. You may use it to view iOS App's view hierarchy 3D.
Stars: ✭ 528 (+2300%)
Mutual labels:  uiview
Splide
Splide is a lightweight, powerful and flexible slider and carousel, written in pure JavaScript without any dependencies.
Stars: ✭ 786 (+3472.73%)
Mutual labels:  carousel
Jt3dscrollview
ScrollView with custom effects during the scroll for iOS
Stars: ✭ 494 (+2145.45%)
Mutual labels:  carousel
Discretescrollview
A scrollable list of items that centers the current element and provides easy-to-use APIs for cool item animations.
Stars: ✭ 5,533 (+25050%)
Mutual labels:  carousel
React Carousel
React carousel component.
Stars: ✭ 16 (-27.27%)
Mutual labels:  carousel
Ppbadgeview
iOS Custom Badge, Support UIView, UITabBarItem, UIBarButtonItem ,Support Objective-C/Swift; iOS自定义Badge组件, 支持UIView, UITabBarItem, UIBarButtonItem, 支持Objective-C/Swift
Stars: ✭ 807 (+3568.18%)
Mutual labels:  uiview
Glide
A dependency-free JavaScript ES6 slider and carousel. It’s lightweight, flexible and fast. Designed to slide. No less, no more
Stars: ✭ 6,256 (+28336.36%)
Mutual labels:  carousel

CarouselView

The component was used in the platinum application : https://itunes.apple.com/tr/app/turkcell-platinum-size-ozel/id671494224?mt=8

Display Visual Example


Visual1

Installation

To use the PLCarouselView class in an app, just drag the PLCarouselView class files (demo files and assets are not needed) into your project and add the QuartzCore framework.

Properties

The PLCarouselView has the following properties (note: for iOS, UIView when using properties):

@property (nonatomic, weak) IBOutlet id<PLCarouselViewDataSource> dataSource;

An object that supports the PLCarouselViewDataSource protocol and can provide views to populate the scroll.

@property (nonatomic, weak) IBOutlet id<PLCarouselViewDelegate> delegate;

An object that supports the PLCarouselViewDelegate protocol and can respond to scroll events and layout requests.

@property (nonatomic, assign) BOOL vertical;

This property toggles whether the carousel is displayed horizontally or vertically on screen. All the built-in carousel types work in both orientations. Switching to vertical changes both the layout of the carousel and also the direction of swipe detection on screen. Note that custom carousel transforms are not affected by this property, however the swipe gesture direction will still be affected. Defaulth value is NO.

@property (nonatomic, assign) BOOL scrollEnabled;

Enables and disables user scrolling of the carousel. The carousel can still be scrolled programmatically if this property is set to NO.

@property (nonatomic, assign, readonly) NSUInteger currentPageIndex;

The index of the currently centered item in the carousel. Setting this property is equivalent to calling scrollToItemAtIndex:animated: with the animated argument set to NO.

Methods

The PLCarouselView class has the following methods (note: for iOS, UIView in method arguments):

+ (instancetype)init;

Custom initialize method.

+ (instancetype)initWithFrame:(CGRect)frame;

Custom initialize method.

- (UIView*)visibleItemWithType:(PLCarouselViewVisibleItem)type;

Returns the visible item view with the specified PLCarouselViewVisibleItem (PLCarouselViewVisibleItemCurrent, PLCarouselViewVisibleItemNext or PLCarouselViewVisibleItemPrevious).

- (void)scrollToItemAtIndex:(NSInteger)index animated:(BOOL)animated;

This will center the carousel on the specified item, either immediately or with a smooth animation. For wrapped carousels, the carousel will automatically determine the shortest (direct or wraparound) distance to scroll. If you need to control the scroll direction, or want to scroll by more than one revolution, use the scrollByNumberOfItems method instead.

- (void)reloadData;

This reloads all carousel views from the dataSource and refreshes the carousel display.

Protocols

The PLCarouselView follows the Apple convention for data-driven views by providing two protocol interfaces, PLCarouselViewDataSource and PLCarouselViewDelegate. The PLCarouselViewDataSource protocol has the following required methods (note: for iOS, UIView in method arguments):

-(NSUInteger)numberOfItemsInCarousel:(PLCarouselView *)carouselView;

Return the number of items (views) in the carousel.

-(UIView*)carouselView:(PLCarouselView *)carouselView viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view;

Return a view to be displayed at the specified index in the carousel. The reusingView argument works like a UIPickerView, where views that have previously been displayed in the carousel are passed back to the method to be recycled. If this argument is not nil, you can set its properties and return it instead of creating a new view instance, which will slightly improve performance. Unlike UITableView, there is no reuseIdentifier for distinguishing between different carousel view types, so if your carousel contains multiple different view types then you should just ignore this parameter and return a new view each time the method is called. You should ensure that each time the carouselView:viewForItemAtIndex:reusingView: method is called, it either returns the reusingView or a brand new view instance rather than maintaining your own pool of recyclable views, as returning multiple copies of the same view for different carousel item indexes may cause display issues with the carousel.

The PLCarouselViewDelegate protocol has the following optional methods:

-(void)carouselCurrentItemIndexDidChange:(PLCarouselView *)carouselView currentIndex:(NSUInteger)currentIndex previousIndex:(NSUInteger)previousIndex;

This method is called whenever the carousel scrolls far enough for the currentPageIndex property to change. It is called regardless of whether the item index was updated programatically or through user interaction.

-(void)carouselView:(PLCarouselView*)carouselView didSelectItemAtIndex:(NSUInteger)index;

This method will fire if the user taps any carousel item view, including the currently selected view. This method will not fire if the user taps a control within the currently selected view (i.e. any view that is a subclass of UIControl).

-(void)carouselView:(PLCarouselView*)carouselView didScrollDiffrenceRate:(CGFloat)diffRate;

This method is called whenever the carousel scrolls far enough for the contentOffset property to change. It is called regardless of whether the item contentOffset was updated programatically or through user interaction.

-(void)carouselView:(PLCarouselView*)carouselView didMoveToView:(UIView*)view;

This method is called whenever the carousel scrolls far enough for the currentPageIndex property to change and the item move into carousel view. It is called regardless of whether the item view was updated programatically or through user interaction.

-(void)carouselView:(PLCarouselView*)carouselView changedScrollDirection:(PLCarouselViewDirection)direction;

This method is called whenever the carousel scrolls far enough for the contentOffset property to change. It is called regardless of whether the carousel contentOffset was updated programatically or through user interaction. (PLCarouselViewDirectionStatic, PLCarouselViewDirectionUp, PLCarouselViewDirectionDown, PLCarouselViewDirectionLeft or PLCarouselViewDirectionRight)

How to use ?

#import "PLCarouselView.h"

@interface ViewController () <PLCarouselViewDataSource,PLCarouselViewDelegate>

...

- (void)loadView
{
[super loadView];

PLCarouselView *_carousel = [PLCarouselView init];

[_carousel setFrame:[UIScreen mainScreen].bounds];

_carousel.delegate = self;

_carousel.dataSource = self;

_carousel.vertical = YES;

[self.view addSubview:_carousel];

[_carousel reloadData];

}

...

#pragma mark - PLCarouselView delegates & datasources

-(UIView *)carouselView:(PLCarouselView *)carouselView viewForItemAtIndex:(NSUInteger)index reusingView:(UIView *)view
{
    if(view)
    {
        return view;
    }
    else
    {
        return [UIView new];
    }
}

-(NSUInteger)numberOfItemsInCarousel:(PLCarouselView *)carouselView
{
    return 10;
}

-(void)carouselView:(PLCarouselView *)carouselView didMoveToView:(UIView *)view
{

}

-(void)carouselCurrentItemIndexDidChange:(PLCarouselView *)carouselView currentIndex:(NSUInteger)currentIndex previousIndex:(NSUInteger)previousIndex
{

}

-(void)carouselView:(PLCarouselView *)carouselView didSelectItemAtIndex:(NSUInteger)index
{

}

-(void)carouselView:(PLCarouselView *)carouselView changedScrollDirection:(PLCarouselViewDirection)direction
{
switch (direction) {
case PLCarouselViewDirectionDown:
{
[self.navigationController setNavigationBarHidden:YES animated:YES];
}
break;
case PLCarouselViewDirectionUp:
{
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
break;
case PLCarouselViewDirectionLeft:
{
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
break;
case PLCarouselViewDirectionRight:
{
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
break;
case PLCarouselViewDirectionStatic:
{

}
break;
default:
break;
}
}

-(void)carouselView:(PLCarouselView *)carouselView didScrollDiffrenceRate:(CGFloat)diffRate
{

}


Build and run the project files. Enjoy more examples!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].