Purpose
--------------
iCarousel is a class designed to simplify the implementation of various types of carousel (paged, scrolling views) on iPhone, iPad and Mac OS. iCarousel implements a number of common effects such as cylindrical, flat and "CoverFlow" style carousels, as well as providing hooks to implement your own bespoke effects. Unlike many other "CoverFlow" libraries, iCarousel can work with any kind of view, not just images, so it is ideal for presenting paged data in a fluid and impressive way in your app. It also makes it extremely easy to swap between different carousel effects with minimal code changes.
*Special thanks go to Sushant Prakash (https://github.com/sushftw) for the Mac port.*
Not all features of iCarousel are currently supported on Mac OS. I hope to address this in future. Please refer to the documentation below for details.
Supported OS & SDK Versions
-----------------------------
* Supported build target - iOS 5.0 / Mac OS 10.7 (Xcode 4.2, Apple LLVM compiler 3.0)
* Earliest supported deployment target - iOS 4.3 / Mac OS 10.7 (Xcode 4.2)
* Earliest compatible deployment target - iOS 3.2 / Mac OS 10.6
NOTE: 'Supported' means that the library has been tested with this version. 'Compatible' means that the library should work on this OS version (i.e. it doesn't rely on any unavailable SDK features) but is no longer being tested for compatibility and may require tweaking or bug fixes to run correctly.
ARC Compatibility
------------------
As of version 1.6.1, iCarousel automatically works with both ARC and non-ARC projects through conditional compilation. There is no need to exclude iCarousel files from the ARC validation process, or to convert iCarousel using the ARC conversion tool.
Thread Safety
--------------
iCarousel is derives from UIView and - as with all UIKit components - it should only be accessed from the main thread. You may wish to use threads for loading or updating carousel contents or items, but always ensure that once your content has loaded, you switch back to the main thread before updating the carousel.
Installation
--------------
To use the iCarousel class in an app, just drag the iCarousel class files (demo files and assets are not needed) into your project and add the QuartzCore framework.
Chameleon Support
-------------------
iCarousel is now compatible with the Chameleon iOS-to-Mac conversion library (https://github.com/BigZaphod/Chameleon). To use iCarousel with Chameleon, add `USING_CHAMELEON` to your project's preprocessor macros. Check out the *Chameleon Demo* example project for how to port your iOS iCarousel app to Mac OS using Chameleon - the example demonstrates how to run the No Nib iPhone example on Mac OS using Chameleon. Note that tap-to-center doesn't currently work, and scrolling must be done using a two-fingered scroll gesture, not click-and-drag (both of these are due to features/limitations of the Chameleon UIGestureRecognizer implementation).
Carousel Types
--------------
iCarousel supports the following built-in display types:
- iCarouselTypeLinear
- iCarouselTypeRotary
- iCarouselTypeInvertedRotary
- iCarouselTypeCylinder
- iCarouselTypeInvertedCylinder
- iCarouselTypeWheel
- iCarouselTypeInvertedWheel
- iCarouselTypeCoverFlow
- iCarouselTypeCoverflow2
- iCarouselTypeTimeMachine
- iCarouselTypeInvertedTimeMachine
You can also implement your own bespoke carousel styles using `iCarouselTypeCustom` and the `carousel:itemTransformForOffset:baseTransform:` delegate method.
NOTE: The difference between `iCarouselTypeCoverFlow` and `iCarouselTypeCoverFlow2` types is quite subtle, however the logic for `iCarouselTypeCoverFlow2` is substantially more complex. If you flick the carousel they are basically identical, but if you drag the carousel slowly with your finger the difference should be apparent. `iCarouselTypeCoverFlow2` is designed to simulate the standard Apple CoverFlow effect as closely as possible and may change subtly in future in the interests of that goal.
Properties
--------------
The iCarousel has the following properties (note: for Mac OS, substitute NSView for UIView when using properties):
@property (nonatomic, assign) IBOutlet id<iCarouselDataSource> dataSource;
An object that supports the iCarouselDataSource protocol and can provide views to populate the carousel.
@property (nonatomic, assign) IBOutlet id<iCarouselDelegate> delegate;
An object that supports the iCarouselDelegate protocol and can respond to carousel events and layout requests.
@property (nonatomic, assign) iCarouselType type;
Used to switch the carousel display type (see above for details).
@property (nonatomic, assign) CGFloat perspective;
Used to tweak the perspective foreshortening effect for the various 3D carousel views. Should be a negative value, less than 0 and greater than -0.01. Values outside of this range will yield very strange results. The default is -1/500, or -0.005;
@property (nonatomic, assign) CGSize contentOffset;
This property is used to adjust the offset of the carousel item views relative to the center of the carousel. It defaults to CGSizeZero, meaning that the carousel items are centered. Changing this value moves the carousel items *without* changing their perspective, i.e. the vanishing point moves with the carousel items, so if you move the carousel items down, it *does not* appear as if you are looking down on the carousel.
@property (nonatomic, assign) CGSize viewpointOffset;
This property is used to adjust the user viewpoint relative to the carousel items. It has the opposite effect to adjusting the contentOffset, i.e. if you move the viewpoint up then the carousel appears to move down. Unlike the contentOffset, moving the viewpoint also changes the perspective vanishing point relative to the carousel items, so if you move the viewpoint up, it will appear as if you are looking down on the carousel.
@property (nonatomic, assign) CGFloat decelerationRate;
The rate at which the carousel decelerates when flicked. Higher values mean slower deceleration. The default value is 0.95. Values should be in the range 0.0 (carousel stops immediately when released) to 1.0 (carousel continues indefinitely without slowing down, unless it reaches the end).
@property (nonatomic, assign) BOOL bounces;
Sets whether the carousel should bounce past the end and return, or stop dead. Note that this has no effect on carousel types that are designed to wrap, or where the carouselShouldWrap delegate method returns YES.
@property (nonatomic, assign) CGFloat bounceDistance;
The maximum distance that a non-wrapped carousel will bounce when it overshoots the end. This is measured in multiples of the itemWidth, so a value of 1.0 would means the carousel will bounce by one whole item width, a value of 0.5 would be half an item's width, and so on. The default value is 1.0;
@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, readonly) NSInteger numberOfItems;
The number of items currently displayed in the carousel (read only). To set this, implement the `numberOfItemsInCarousel:` dataSource method.
@property (nonatomic, readonly) NSInteger numberOfPlaceholders;
The number of placeholder views to display in the carousel (read only). To set this, implement the `numberOfPlaceholdersInCarousel:` dataSource method.
@property (nonatomic, readonly) NSInteger numberOfVisibleItems;
The maximum number of carousel item views to be displayed concurrently on screen (read only). To set this, implement the `numberOfVisibleItemsInCarousel:` dataSource method. If the dataSource method is not implemented, this will be equal to the numberOfItems + numberOfPlaceholders;
@property (nonatomic, retain, readonly) NSArray *indexesForVisibleItems;
An array containing the indexes of all item views currently visibl
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
Cover Flow coverflow time machine ----------------------------- 实现各种各样的cover flow效果。功能十分强大,实现了将近10种cover flow的效果。效果如图所见。用户手指划动图片,图片将不断以3D的形式切换。 注意:请在Mac下解压使用
资源推荐
资源详情
资源评论
收起资源包目录
(0150)-iOS/iPhone/iPAD/iPod源代码-滚动视图(ScrollView)-iCarousel for Cover Flow (619个子文件)
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.gitignore 126B
.gitignore 86B
UIView.h 9KB
iCarousel.h 9KB
UIApplication.h 9KB
UITableView.h 8KB
UIScrollView.h 6KB
UIViewController.h 6KB
UIControl.h 5KB
UITextField.h 5KB
UISearchDisplayController.h 5KB
UITableViewCell.h 4KB
NSFetchedResultsController.h 4KB
UIResponderAppKitIntegration.h 4KB
UIActionSheet.h 4KB
UINavigationController.h 4KB
UIButton.h 4KB
UIBezierPath.h 4KB
UIKit.h 4KB
UIAccessibility.h 4KB
UIPopoverController.h 4KB
UIImage.h 4KB
UITextLayer.h 4KB
UIStringDrawing.h 4KB
UIKitView.h 4KB
UIDevice.h 4KB
UIGestureRecognizer.h 4KB
UITouch.h 4KB
UITextView.h 3KB
UIPickerView.h 3KB
UIWindow.h 3KB
UIAlertView.h 3KB
UIBarButtonItem.h 3KB
UIGeometry.h 3KB
UIWebView.h 3KB
UITransitionView.h 3KB
UIScroller.h 3KB
UINavigationBar.h 3KB
UITextInputTraits.h 3KB
UIKey.h 3KB
UIImage+UIPrivate.h 3KB
UIViewAnimationGroup.h 3KB
UILabel.h 3KB
UIColor.h 3KB
UITabBar.h 3KB
UIMenuController.h 3KB
UISearchBar.h 3KB
UITabBarController.h 3KB
UIApplicationAppKitIntegration.h 3KB
UIPanGestureRecognizer.h 3KB
AVAudioPlayer.h 3KB
UISplitViewController.h 3KB
UIResponder.h 3KB
UIImagePickerController.h 3KB
UITouch+UIPrivate.h 3KB
UISegmentedControl.h 3KB
MFMailComposeViewController.h 3KB
UICustomNSClipView.h 3KB
UIApplication+UIPrivate.h 3KB
UINavigationItem.h 3KB
UIDatePicker.h 3KB
UIScreen.h 3KB
MPMoviePlayerController.h 3KB
MFMessageComposeViewController.h 2KB
UIImageView.h 2KB
UITableViewSection.h 2KB
UIFont.h 2KB
UITabBarItem.h 2KB
UIEvent.h 2KB
SKPaymentTransaction.h 2KB
UICustomNSTextView.h 2KB
UIApplicationDelegate.h 2KB
UIGraphics.h 2KB
UIGestureRecognizerSubclass.h 2KB
UIScreenAppKitIntegration.h 2KB
UIPasteboard.h 2KB
MPMusicPlayerController.h 2KB
UIAccessibilityElement.h 2KB
UIActivityIndicatorView.h 2KB
SKPaymentQueue.h 2KB
UISwipeGestureRecognizer.h 2KB
UIScrollViewAnimationDeceleration.h 2KB
AVAudioSession.h 2KB
UIScrollViewAnimationScroll.h 2KB
UIPopoverView.h 2KB
UIAccelerometer.h 2KB
UINSCellControl.h 2KB
UIView+UIPrivate.h 2KB
UILongPressGestureRecognizer.h 2KB
UIBarItem.h 2KB
UIToolbar.h 2KB
UIInputController.h 2KB
UIInterface.h 2KB
UIAcceleration.h 2KB
UIScrollWheelGestureRecognizer.h 2KB
UITableViewController.h 2KB
共 619 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7
资源评论
- jemmy12013-09-02一个不错的源码,感谢分享
- benxu9992012-10-16代码能用,感谢分享!
逍遥墨君
- 粉丝: 26
- 资源: 632
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功