### Install SDWebImage as a Dynamic Framework (CocoaPods) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md If you need to use SDWebImage as a dynamic framework, ensure `use_frameworks!` is present in your Podfile. ```ruby platform :ios, '8.0' use_frameworks! pod 'SDWebImage' ``` -------------------------------- ### Install SDWebImage with Modular Headers (CocoaPods) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md Use this configuration to install SDWebImage with modular headers enabled, which is recommended for newer CocoaPods versions. ```ruby pod 'SDWebImage', :modular_headers => true ``` -------------------------------- ### Install Specific SDWebImage Subspec (CocoaPods) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md To install only specific modules of SDWebImage, such as the MapKit subspec, specify it in your Podfile. ```ruby pod 'SDWebImage/MapKit' ``` -------------------------------- ### CocoaPods Installation (Static Framework) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md Configure CocoaPods to use SDWebImage as a static framework for Swift projects, compatible with CocoaPods 1.5.0+ and Xcode 9+. ```ruby platform :ios, '8.0' # Uncomment the next line when you want all Pods as static framework ``` -------------------------------- ### CocoaPods Installation (iOS 7) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md Specify SDWebImage version 4.0 or higher for iOS 7 projects using CocoaPods. Ensure your platform version is compatible. ```ruby platform :ios, '7.0' pod 'SDWebImage', '~> 4.0' ``` -------------------------------- ### Install SDCycleScrollView with CocoaPods Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Use this command to add SDCycleScrollView to your project via CocoaPods. Ensure you are using version 1.82 or higher for the latest features and bug fixes. ```bash pod 'SDCycleScrollView','>= 1.82' ``` -------------------------------- ### Load Image with Placeholder (Objective-C) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md Load an image from a URL and display a placeholder image while it loads. Requires importing the SDWebImage framework. ```objective-c #import ... [imageView sd_setImageWithURL:[NSURL URLWithString:@"http://www.domain.com/path/to/image.jpg"] placeholderImage:[UIImage imageNamed:@"placeholder.png"]]; ``` -------------------------------- ### Create Network-Image Carousel with Placeholder Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Use this initializer for carousels displaying remote images. Provide a delegate for callbacks and a placeholder image to show while network images load. ```objc #import "SDCycleScrollView.h" @interface HomeViewController () @end @implementation HomeViewController - (void)viewDidLoad { [super viewDidLoad]; // Create carousel with placeholder; images arrive asynchronously SDCycleScrollView *banner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, 200) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]]; // Supply remote URLs after a simulated network delay dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ banner.imageURLStringsGroup = @[ @"https://example.com/banner1.jpg", @"https://example.com/banner2.jpg", @"https://example.com/banner3.jpg" ]; }); [self.view addSubview:banner]; } #pragma mark - SDCycleScrollViewDelegate - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didSelectItemAtIndex:(NSInteger)index { NSLog(@"Tapped banner at index %ld", (long)index); // Navigate to detail page } - (void)cycleScrollView:(SDCycleScrollView *)cycleScrollView didScrollToIndex:(NSInteger)index { NSLog(@"Scrolled to index %ld", (long)index); } @end ``` -------------------------------- ### Add SDWebImage Dependency (Carthage) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md For Carthage users, add the SDWebImage repository to your Cartfile and run `carthage update`. ```plaintext github "SDWebImage/SDWebImage" ``` -------------------------------- ### Load Image with Placeholder (Swift) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md Load an image from a URL and display a placeholder image while it loads. Requires importing the SDWebImage module. ```swift import SDWebImage imageView.sd_setImage(with: URL(string: "http://www.domain.com/path/to/image.jpg"), placeholderImage: UIImage(named: "placeholder.png")) ``` -------------------------------- ### Import SDWebImage Umbrella Header (Objective-C) Source: https://github.com/gsdios/sdcyclescrollview/blob/master/Pods/SDWebImage/README.md In your Objective-C source files, import the main SDWebImage umbrella header to access the library's functionality. ```objective-c #import ``` -------------------------------- ### Create Network-Image Carousel Instantly Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt A one-shot initializer for carousels when all remote image URLs are available immediately. No placeholder is needed. ```objc NSArray *urls = @[ @"https://example.com/img1.jpg", @"https://example.com/img2.jpg" ]; SDCycleScrollView *quickBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 200) imageURLStringsGroup:urls]; [self.view addSubview:quickBanner]; ``` -------------------------------- ### Create Local-Image Carousel Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Instantiate a carousel using local image asset names. Infinite looping is enabled by default. ```objc NSArray *localImages = @[@"banner_home", @"banner_sale", @"banner_new"]; SDCycleScrollView *localBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 150) imageNamesGroup:localImages]; localBanner.autoScrollTimeInterval = 3.0; [self.view addSubview:localBanner]; ``` -------------------------------- ### Initialize Network Image Carousel Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Instantiate a SDCycleScrollView to display images loaded from network URLs. Provide the frame, delegate, placeholder image, and an array of image URLs. ```objective-c SDCycleScrollView *cycleScrollView = [cycleScrollViewWithFrame:frame delegate:delegate placeholderImage:placeholderImage]; cycleScrollView.imageURLStringsGroup = imagesURLStrings; ``` -------------------------------- ### Initialize Local Image Carousel Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Create a SDCycleScrollView to display images from local asset arrays. Pass the frame and the array of local image names or assets. ```objective-c SDCycleScrollView *cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame: imagesGroup:图片数组]; ``` -------------------------------- ### Block-Based Interaction Callbacks Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Use `clickItemOperationBlock` and `itemDidScrollOperationBlock` as alternatives to the delegate protocol for handling item clicks and scroll events inline. ```objc banner.clickItemOperationBlock = ^(NSInteger currentIndex) { NSLog(@"Tapped index %ld", (long)currentIndex); // Push detail VC, open URL, fire analytics event, etc. }; banner.itemDidScrollOperationBlock = ^(NSInteger currentIndex) { NSLog(@"Auto-scrolled to %ld", (long)currentIndex); }; ``` -------------------------------- ### Create Finite Local-Image Carousel Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Create a carousel from local image asset names with explicit control over infinite looping. Set `shouldInfiniteLoop` to `NO` to stop cycling after the last image. ```objc // Finite carousel — stops at last image SDCycleScrollView *finiteBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 150) shouldInfiniteLoop:NO imageNamesGroup:@[@"step1", @"step2", @"step3"]]; [self.view addSubview:finiteBanner]; ``` -------------------------------- ### Toggle Auto-Scroll and Looping Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Control auto-rotation with `autoScroll` and enable looping with `infiniteLoop`. Set `autoScroll` to `NO` to pause rotation while allowing manual swipes. ```objc banner.autoScroll = NO; // pause auto-rotation (user can still swipe) banner.infiniteLoop = YES; // wrap around after the last item (default) ``` -------------------------------- ### +cycleScrollViewWithFrame:delegate:placeholderImage: Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Recommended initializer for network-image carousels. It accepts a delegate for callbacks and a placeholder image to display while remote images load. Images are supplied later via the `imageURLStringsGroup` property. ```APIDOC ## +cycleScrollViewWithFrame:delegate:placeholderImage: ### Description This factory method initializes a `SDCycleScrollView` for displaying remote images. It allows for a delegate to handle user interactions and a placeholder image to be shown during image loading. ### Method `+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame delegate:(nullable id)delegate placeholderImage:(nullable UIImage *)placeholderImage; ` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```objc SDCycleScrollView *banner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, 200) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]]; // ... later update banner.imageURLStringsGroup ``` ### Response #### Success Response (200) Returns an initialized `SDCycleScrollView` instance. #### Response Example None ``` -------------------------------- ### Customize Page Control Style and Colors Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Configure `pageControlStyle` to `SDCycleScrollViewPageContolStyleClassic` or `SDCycleScrollViewPageContolStyleAnimated`. Customize dot colors or images, alignment, size, and offsets. ```objc // Classic style with custom tint colors banner.pageControlStyle = SDCycleCycleScrollViewPageContolStyleClassic; banner.currentPageDotColor = [UIColor orangeColor]; banner.pageDotColor = [UIColor lightGrayColor]; // Animated style with custom dot images banner.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated; banner.currentPageDotImage = [UIImage imageNamed:@"dot_active"]; banner.pageDotImage = [UIImage imageNamed:@"dot_inactive"]; // Layout adjustments banner.pageControlAliment = SDCycleScrollViewPageContolAlimentRight; banner.pageControlDotSize = CGSizeMake(8, 8); banner.pageControlBottomOffset = 4.0; // raise above bottom edge banner.pageControlRightOffset = 8.0; // pull in from right edge // Hide when only one slide exists banner.hidesForSinglePage = YES; ``` -------------------------------- ### Programmatic Navigation to Index Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Use `makeScrollViewScrollToIndex:` to scroll to a specific slide by its zero-based index. The auto-timer is briefly paused and then resumed. ```objc // Jump to the third slide (index 2) [self.heroBanner makeScrollViewScrollToIndex:2]; ``` -------------------------------- ### titlesGroup Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Assign an array of strings to display as captions for each slide. The number of titles must match the number of images. ```APIDOC ## `titlesGroup` — per-slide caption strings Overlay captions rendered in a semi-transparent label at the bottom of each slide. The array count **must** match the image array count. ```objc self.heroBanner.imageURLStringsGroup = @[ @"https://example.com/summer.jpg", @"https://example.com/winter.jpg" ]; self.heroBanner.titlesGroup = @[ @"Summer Collection — 30% Off", @"Winter Essentials — New Arrivals" ]; self.heroBanner.titleLabelTextColor = [UIColor yellowColor]; self.heroBanner.titleLabelBackgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; self.heroBanner.titleLabelHeight = 36.0; self.heroBanner.titleLabelTextAlignment = NSTextAlignmentCenter; ``` ``` -------------------------------- ### autoScroll / infiniteLoop Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Toggle automatic scrolling and looping behavior. `autoScroll` pauses rotation when set to `NO`, while `infiniteLoop` enables wrapping around after the last item. ```APIDOC ## `autoScroll` / `infiniteLoop` — toggle automation and looping ```objc banner.autoScroll = NO; // pause auto-rotation (user can still swipe) banner.infiniteLoop = YES; // wrap around after the last item (default) ``` ``` -------------------------------- ### +cycleScrollViewWithFrame:imageURLStringsGroup: Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt A compact initializer for network-image carousels when all image URLs are available immediately. It does not use a placeholder image. ```APIDOC ## +cycleScrollViewWithFrame:imageURLStringsGroup: ### Description This factory method initializes a `SDCycleScrollView` directly with an array of image URL strings. It's suitable for cases where you have all image URLs readily available at initialization and don't require a placeholder. ### Method `+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageURLStringsGroup:(nullable NSArray *)imageURLStringsGroup; ` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```objc NSArray *urls = @[ @"https://example.com/img1.jpg", @"https://example.com/img2.jpg" ]; SDCycleScrollView *quickBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 200) imageURLStringsGroup:urls]; ``` ### Response #### Success Response (200) Returns an initialized `SDCycleScrollView` instance with remote image URLs. #### Response Example None ``` -------------------------------- ### Implement Custom Cells in SDCycleScrollView Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Use the `SDCycleScrollViewDelegate` methods to provide a custom cell class and configure its content for each index. Ensure your custom cell subclass is defined. ```objc // CustomBannerCell.h @interface CustomBannerCell : UICollectionViewCell @property (nonatomic, strong) UIImageView *heroImage; @property (nonatomic, strong) UILabel *badge; @end ``` ```objc // ViewController.m - (void)viewDidLoad { [super viewDidLoad]; _customBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 64, self.view.bounds.size.width, 180) delegate:self placeholderImage:[UIImage imageNamed:@"placeholder"]]; _customBanner.imageURLStringsGroup = @[ @"https://example.com/a.jpg", @"https://example.com/b.jpg" ]; [self.view addSubview:_customBanner]; } ``` ```objc // Return the custom cell class - (Class)customCollectionViewCellClassForCycleScrollView:(SDCycleScrollView *)view { return [CustomBannerCell class]; } ``` ```objc // Populate the custom cell for each index - (void)setupCustomCell:(UICollectionViewCell *)cell forIndex:(NSInteger)index cycleScrollView:(SDCycleScrollView *)view { CustomBannerCell *myCell = (CustomBannerCell *)cell; NSURL *url = [NSURL URLWithString:_imageURLs[index]]; [myCell.heroImage sd_setImageWithURL:url]; myCell.badge.text = (index == 0) ? @"NEW" : @""; } ``` -------------------------------- ### pageControlStyle / dot colors / dot images Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Customize the appearance of the page control indicator. Options include different styles (`Classic`, `Animated`, `None`), custom dot colors, dot images, and layout adjustments. ```APIDOC ## `pageControlStyle` / dot colors / dot images — style the indicator Three built-in styles: `SDCycleScrollViewPageContolStyleClassic` (system `UIPageControl`), `SDCycleScrollViewPageContolStyleAnimated` (animated `TAPageControl`), `SDCycleScrollViewPageContolStyleNone` (hidden). ```objc // Classic style with custom tint colors banner.pageControlStyle = SDCycleScrollViewPageContolStyleClassic; banner.currentPageDotColor = [UIColor orangeColor]; banner.pageDotColor = [UIColor lightGrayColor]; // Animated style with custom dot images banner.pageControlStyle = SDCycleScrollViewPageContolStyleAnimated; banner.currentPageDotImage = [UIImage imageNamed:@"dot_active"]; banner.pageDotImage = [UIImage imageNamed:@"dot_inactive"]; // Layout adjustments banner.pageControlAliment = SDCycleScrollViewPageContolAlimentRight; banner.pageControlDotSize = CGSizeMake(8, 8); banner.pageControlBottomOffset = 4.0; // raise above bottom edge banner.pageControlRightOffset = 8.0; // pull in from right edge // Hide when only one slide exists banner.hidesForSinglePage = YES; ``` ``` -------------------------------- ### clickItemOperationBlock / itemDidScrollOperationBlock Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Handle user interactions using blocks as an alternative to the delegate protocol. `clickItemOperationBlock` is called when an item is tapped, and `itemDidScrollOperationBlock` is called after auto-scrolling. ```APIDOC ## `clickItemOperationBlock` / `itemDidScrollOperationBlock` — closure alternatives to delegate Use blocks instead of the `SDCycleScrollViewDelegate` protocol for inline handling. ```objc banner.clickItemOperationBlock = ^(NSInteger currentIndex) { NSLog(@"Tapped index %ld", (long)currentIndex); // Push detail VC, open URL, fire analytics event, etc. }; banner.itemDidScrollOperationBlock = ^(NSInteger currentIndex) { NSLog(@"Auto-scrolled to %ld", (long)currentIndex); }; ``` ``` -------------------------------- ### Set Per-Slide Caption Strings Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Assign an array of strings to `titlesGroup` to display captions on each slide. The count must match the image array count. Customize text and background colors, height, and alignment. ```objc self.heroBanner.imageURLStringsGroup = @[ @"https://example.com/summer.jpg", @"https://example.com/winter.jpg" ]; self.heroBanner.titlesGroup = @[ @"Summer Collection — 30% Off", @"Winter Essentials — New Arrivals" ]; self.heroBanner.titleLabelTextColor = [UIColor yellowColor]; self.heroBanner.titleLabelBackgroundColor = [UIColor colorWithWhite:0 alpha:0.6]; self.heroBanner.titleLabelHeight = 36.0; self.heroBanner.titleLabelTextAlignment = NSTextAlignmentCenter; ``` -------------------------------- ### +cycleScrollViewWithFrame:imageNamesGroup: Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Initializes a carousel using local asset names. This method is suitable when all images are stored locally within the application's assets. ```APIDOC ## +cycleScrollViewWithFrame:imageNamesGroup: ### Description This factory method creates a `SDCycleScrollView` populated with images from local asset names. It's a convenient way to set up a carousel using images bundled with your application. ### Method `+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame imageNamesGroup:(nullable NSArray *)imageNamesGroup; ` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```objc NSArray *localImages = @[@"banner_home", @"banner_sale", @"banner_new"]; SDCycleScrollView *localBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 150) imageNamesGroup:localImages]; ``` ### Response #### Success Response (200) Returns an initialized `SDCycleScrollView` instance with local images. #### Response Example None ``` -------------------------------- ### +cycleScrollViewWithFrame:shouldInfiniteLoop:imageNamesGroup: Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Initializes a carousel with local asset names and explicit control over infinite looping. Use this when you need to disable the infinite scroll behavior. ```APIDOC ## +cycleScrollViewWithFrame:shouldInfiniteLoop:imageNamesGroup: ### Description This factory method initializes a `SDCycleScrollView` with local images and allows you to specify whether the carousel should loop infinitely or stop after the last image. ### Method `+ (instancetype)cycleScrollViewWithFrame:(CGRect)frame shouldInfiniteLoop:(BOOL)shouldInfiniteLoop imageNamesGroup:(nullable NSArray *)imageNamesGroup; ` ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```objc SDCycleScrollView *finiteBanner = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 150) shouldInfiniteLoop:NO imageNamesGroup:@[@"step1", @"step2", @"step3"]]; ``` ### Response #### Success Response (200) Returns an initialized `SDCycleScrollView` instance with infinite loop control. #### Response Example None ``` -------------------------------- ### Set Carousel Delegate for Click Events Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Implement the SDCycleScrollViewDelegate protocol to listen for image tap events. Assign your view controller or a custom delegate object to this property. ```objective-c cycleScrollView.delegate = ; ``` -------------------------------- ### Customize Auto Scroll Interval Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Adjust the time interval in seconds between automatic page transitions. The default value is typically 2 seconds. ```objective-c cycleScrollView.autoScrollTimeInterval = ; ``` -------------------------------- ### Update Local Image Names Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Use `localizationImageNamesGroup` to update the carousel with local image assets. Provide full file names (including extension) or bare names for xcassets entries. ```objc self.heroBanner.localizationImageNamesGroup = @[@"promo_a", @"promo_b.png"]; ``` -------------------------------- ### Set Auto-Scroll Speed Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Modify `autoScrollTimeInterval` to change the auto-scroll speed. Assign any positive `CGFloat` value; the timer restarts automatically. Default is 2.0 seconds. ```objc banner.autoScrollTimeInterval = 4.5; // slower rotation ``` -------------------------------- ### autoScrollTimeInterval Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Controls the speed of automatic scrolling. Set a positive `CGFloat` value to change the interval in seconds. The default is 2.0 seconds. ```APIDOC ## `autoScrollTimeInterval` — set auto-scroll speed Default is `2.0` seconds. Assign any positive `CGFloat` to change the interval; the timer is automatically restarted. ```objc banner.autoScrollTimeInterval = 4.5; // slower rotation ``` ``` -------------------------------- ### adjustWhenControllerViewWillAppera Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Call this method in your `viewWillAppear:` to ensure the carousel correctly snaps back to its position after navigation push or pop operations. ```APIDOC ## `-adjustWhenControllerViewWillAppera` — fix half-visible slide on push/pop Call this in `-viewWillAppear:` to snap the carousel back to the correct position after a navigation push/pop cycle. ```objc - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.heroBanner adjustWhenControllerViewWillAppera]; } ``` ``` -------------------------------- ### Fix Half-Visible Slide on ViewWillAppear Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Call `adjustWhenControllerViewWillAppera` within `viewWillAppear:` to ensure the carousel snaps to the correct position after navigation push/pop cycles. ```objc - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; [self.heroBanner adjustWhenControllerViewWillAppera]; } ``` -------------------------------- ### Add Titles to Carousel Images Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Display titles below the carousel images by providing an array of strings. The number of titles must match the number of images. ```objective-c cycleScrollView.titlesGroup = 标题数组(数组元素个数必须和图片数组元素个数保持一致); ``` -------------------------------- ### Set PageControl Alignment Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md Customize the horizontal alignment of the page control dots. The default is center alignment. ```objective-c cycleScrollView.pageControlAliment = SDCycleScrollViewPageContolAlimentRight; ``` -------------------------------- ### localizationImageNamesGroup Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Property to set or update the array of local image names for the carousel. This is used for images bundled with the application, either from xcassets or file system paths. ```APIDOC ## localizationImageNamesGroup ### Description This property is used to set or update the carousel's images using local asset names. It accepts an array of strings, where each string is a file name (with extension if from file system) or an asset name from `Images.xcassets`. ### Property `@property (nonatomic, strong, nullable) NSArray *localizationImageNamesGroup;` ### Parameters None ### Request Example ```objc self.heroBanner.localizationImageNamesGroup = @[@"promo_a", @"promo_b.png"]; ``` ### Response None ``` -------------------------------- ### scrollDirection Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Set the scrolling direction to horizontal or vertical. Vertical scrolling is suitable for text-based announcements. ```APIDOC ## `scrollDirection` — horizontal vs. vertical scrolling ```objc // Vertical ticker-style scroll (good for text announcements) banner.scrollDirection = UICollectionViewScrollDirectionVertical; ``` ``` -------------------------------- ### Clear SDCycleScrollView Image Cache Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Purge the disk cache used by SDCycleScrollView. The class method `+clearImagesCache` is preferred for global cache clearing, while the instance method `-clearCache` can be used on a specific instance. ```objc // Class method (preferred) [SDCycleScrollView clearImagesCache]; ``` ```objc // Instance method (legacy alias) [self.heroBanner clearCache]; ``` -------------------------------- ### imageURLStringsGroup Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Property to set or update the array of remote image URLs for the carousel. Assigning new URLs reloads the data and restarts the auto-scroll timer. ```APIDOC ## imageURLStringsGroup ### Description This property allows you to provide an array of image URLs (as `NSString` or `NSURL`) to be displayed in the carousel. Setting this property will refresh the carousel's content and restart its automatic scrolling. ### Property `@property (nonatomic, strong, nullable) NSArray *imageURLStringsGroup;` ### Parameters None ### Request Example ```objc self.heroBanner.imageURLStringsGroup = @[ @"https://cdn.example.com/promo_a.jpg", @"https://cdn.example.com/promo_b.jpg" ]; ``` ### Response None ``` -------------------------------- ### makeScrollViewScrollToIndex: Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Programmatically scrolls the carousel to a specified zero-based index. The auto-scroll timer is briefly paused and then resumed. ```APIDOC ## `-makeScrollViewScrollToIndex:` — programmatic navigation Scrolls to a specific zero-based index. The auto-timer is briefly paused then resumed. ```objc // Jump to the third slide (index 2) [self.heroBanner makeScrollViewScrollToIndex:2]; ``` ``` -------------------------------- ### Update Remote Image URLs Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Assign an array of `NSString` URL strings or `NSURL` objects to `imageURLStringsGroup` to update the carousel's images. This action triggers a data reload and restarts the auto-scroll timer. ```objc // Can be set (or updated) at any time after initialization self.heroBanner.imageURLStringsGroup = @[ @"https://cdn.example.com/promo_a.jpg", @"https://cdn.example.com/promo_b.jpg" ]; ``` -------------------------------- ### disableScrollGesture Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Disables manual swiping by removing the internal `UIPanGestureRecognizer`. This is useful for read-only tickers. ```APIDOC ## `-disableScrollGesture` — lock manual swiping Removes the internal `UIPanGestureRecognizer` so the user cannot manually swipe. Useful for auto-running text tickers. ```objc SDCycleScrollView *ticker = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 40) delegate:self placeholderImage:nil]; ticker.onlyDisplayText = YES; ticker.scrollDirection = UICollectionViewScrollDirectionVertical; ticker.autoScrollTimeInterval = 2.0; ticker.titlesGroup = @[@"Breaking: Market up 2%", @"Flash sale ends at midnight", @"New items added"]; [ticker disableScrollGesture]; // read-only ticker [self.view addSubview:ticker]; ``` ``` -------------------------------- ### Set Scroll Direction Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Change the scrolling direction using `scrollDirection`. Set to `UICollectionViewScrollDirectionVertical` for a ticker-style vertical scroll. ```objc // Vertical ticker-style scroll (good for text announcements) banner.scrollDirection = UICollectionViewScrollDirectionVertical; ``` -------------------------------- ### Disable Manual Swiping Source: https://context7.com/gsdios/sdcyclescrollview/llms.txt Call `disableScrollGesture` to remove the internal `UIPanGestureRecognizer`, preventing manual swiping. This is useful for read-only text tickers. ```objc SDCycleScrollView *ticker = [SDCycleScrollView cycleScrollViewWithFrame:CGRectMake(0, 0, 375, 40) delegate:self placeholderImage:nil]; ticker.onlyDisplayText = YES; ticker.scrollDirection = UICollectionViewScrollDirectionVertical; ticker.autoScrollTimeInterval = 2.0; ticker.titlesGroup = @[@"Breaking: Market up 2%", @"Flash sale ends at midnight", @"New items added"]; [ticker disableScrollGesture]; // read-only ticker [self.view addSubview:ticker]; ``` -------------------------------- ### Adjust ScrollInsets for iOS 7+ Source: https://github.com/gsdios/sdcyclescrollview/blob/master/README.md If a blank area appears at the top of the carousel on iOS 7 and later, set `automaticallyAdjustsScrollViewInsets` to `NO` on your view controller. This is often necessary when the carousel is the only scrollable view in the controller. ```objective-c self.automaticallyAdjustsScrollViewInsets = NO; ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.