GitXplorerGitXplorer
h

DCScrollView

public
21 stars
2 forks
0 issues

Commits

List of commits on branch master.
Unverified
b8916a9d4119bb1f83240e6f351ef5df641b8e2d

Update README.md

hhirohisa committed 10 years ago
Unverified
2a23ef73e49812cbefae0ad41041b20e480745a9

Update README.md

hhirohisa committed 10 years ago
Unverified
0db75c2c2caa26b71ec02931fa19d446e18c392d

Update README.md

hhirohisa committed 10 years ago
Unverified
bf8267777a60f32d7095bab64525f9b06919c81d

Bumping 1.2.0

hhirohisa committed 10 years ago
Unverified
83aa3133ddd97d405047e9092904c729d61ff391

Merge pull request #5 from YusukeHosonuma/improvement-updateFrame

hhirohisa committed 10 years ago
Unverified
7e67c8010cec1a60d34cd878d0d8024ce38a52c9

Bumping version 1.1.2

hhirohisa committed 10 years ago

README

The README file for this repository.

DCScrollView Build Status

DCScrollView is an extension of UIScrollView that scrolling through the content, the title scrolls with a delay like Etsy app for iOS.

sample

Requirements

  • iOS 4.3+
  • ARC

If your project's target is iOS 8.0+, use PageController. PageController has high performance than DCScrollView. DCScrollView controls [UIView], PageController controls [UIViewController].

Used in Production

Installation

There are two ways to use this in your project:

  • Copy DCScrollView/*.{h.m} into your project

  • Install with CocoaPods to write Podfile

platform :ios
pod 'DCScrollView'

Usage

Set Delegate, DataSource

DCScrollView uses a simple methodology. It defines a delegate and a data source, its client implement. DCScrollViewDelegate and DCScrollViewDataSource are like UITableViewDelegate and UITableViewDatasource.

Reload

Reset cells and redisplays visible cells. Current page keep visible after reloading.

- (void)reloadData;

Remove Cache

If UIViewController received memory warnings, control to clear the memory that DCScrollView has.

- (void)clearData;

Example

  • import DCScrollView.h
  • implement DCScrollViewDataSource and DCScrollViewDelegate's methods

UIViewController

#import "DCScrollView.h"

@interface ExampleViewController ()

<DCScrollViewDataSource, DCScrollViewDelegate>

@end

@implementation ExampleViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
    DCScrollView *scrollView = [[DCScrollView alloc]initWithFrame:self.view.bounds];
    scrollView.dataSource = self;
    scrollView.delegate = self;
}

- (NSInteger)numberOfCellsInDCScrollView:(DCScrollView *)scrollView
{
    return 10;
}

- (DCScrollViewCell *)dcscrollView:(DCScrollView *)scrollView cellAtIndex:(NSInteger)index
{
    NSString *identifier = @"Cell";
    DCScrollViewCell *cell = [scrollView dequeueReusableCellWithIdentifier:identifier];
    if (!cell) {
        cell  = [[DCScrollViewCell alloc] initWithReuseIdentifier:identifier];
    }

    return cell;
}

- (NSString *)titleOfDCScrollViewCellAtIndex:(NSInteger)index
{
    return @"title";
}

License

DCScrollView is available under the MIT license.