Latest 0.0.1
License MIT
Platforms ios 10.0, requires ARC


HACycleView is a simple component easily use and extend inherited from UIScrollView.


As a banner.


As a message reporter.

system reporter


  • Download the demo, drag HACycleView folder in your project.

  • Also you can use cocoapods by adding pod 'HACycleView' to your Podfile


You can initialize a cycleView by using init or IBOutlet.

- (void)loadCycleView {    
    HACycleViewConfig *config = [HACycleViewConfig new];
    config.pageDelegate = self;

    HACycleView *cycleView =[[HACycleView alloc] initWithFrame: CGRectMake(0, 0, 100, 80)];

    [self.view addSubview: cycleView];
    [cycleView runWithConfig: config];


HACycleViewConfig is config class.

  • verticalDirection : The scroll direction.

  • cycleScrollEnable : Whether you can cycle scroll the view.

  • autoScrollEnable : Create a timer and automic scroll.

  • autoScrollOrderDescending : Automic scroll direction.

  • autoScrollDuration : Automic scroll duration between each cell.

  • delegate : An object confirms HACycleViewDelegate protocol.

In HACycleViewDelegate protocol.

  • numberOfCellsInCycleView:: You must return the number of cells to calculate contentSize and offset.

  • cycleView:cellAtIndex: : You must return a nonnull view confirm HACycleViewCell protocol.

  • cycleView:didScrollFromIndex:toNewIndex: Will be called when scroll to each cell;

In HACycleViewCell protocol.

  • reuseIdentify: You just need to declare a reuse key to store cell and dequeue it from the reusePool.

HACycleView has a reusePool collecting cells when remove from container.

- ( UIView<HACycleViewCell> * _Nonnull )cycleView: (HACycleView *)cycleView cellAtIndex: (NSUInteger)index {
    NSString *cellId = @"MyLabel";
    MyLabel *cell = (MyLabel *)[cycleView dequeueReusableCellWithIdentifier: cellId];
    if (cell == nil) {
        cell = [[MyLabel alloc] init];
        cell.reuseIdentify = cellId;
    cell.text = self.dataSource[index];
    return cell;

Set cycleView.clipsToBounds = NO, there’re only as much as 3 sub views in the cycleView.

system reporter

HACycleView support to scroll by calling method.

- (void)nextPictureOnPress: (UIButton *)sender {
    if (sender == self.preBtn) {
        [self.cycleView scrollToPreCell: YES];
    if (sender == self.nextBtn) {
        [self.cycleView scrollToNextCell: YES];


HACycleView requires iOS 10.0+


HACycleView is released under the MIT license. See LICENSE file for details.

Latest podspec

    "name": "HACycleView",
    "version": "0.0.1",
    "summary": "A simple cycle view for iOS .",
    "homepage": "",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    "authors": {
        "hahand": "[email protected]"
    "platforms": {
        "ios": "10.0"
    "source": {
        "git": "",
        "tag": "0.0.1"
    "source_files": [
    "requires_arc": true

Pin It on Pinterest

Share This