• Stars
    star
    187
  • Rank 206,464 (Top 5 %)
  • Language
    Objective-C
  • License
    MIT License
  • Created almost 4 years ago
  • Updated 11 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An infinite-scroll banner implemented with two views, includes Swift and Objective-C APIs.

LCInfiniteScrollView

An infinite scroll control implemented with two views, supporting custom reuse of views.

infinite-scroll

Requirements

  • Objective-C

    • iOS 8.0+
  • Swift

    • iOS 9.0+
    • Swift 4.0+

Features

  • Supports infinite scrolling.
  • Reuse with two views.
  • Support for custom reuse views.

Usage

Init

  • Objective-C
LCInfiniteScrollView *v = [[LCInfiniteScrollView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 300)];
v.backgroundColor = UIColor.brownColor;
v.delegate = self;
v.autoScroll = YES;
[self.view addSubview:v];
  • Swift
let banner = LCInfiniteScrollView(frame: CGRect(x: 0, y: 0, width: self.view.frame.size.width, height: 200))
banner.delegate = self
banner.autoScroll = true
self.view.addSubview(banner)

Custom reuse view

  • Objective-C
- (UIView *)reusableViewInInfiniteScrollView:(LCInfiniteScrollView *)infiniteScrollView {
    UILabel *label = [UILabel new];
    label.font = [UIFont boldSystemFontOfSize:30];
    label.textAlignment = NSTextAlignmentCenter;
    return label;
}

- (void)infiniteScrollView:(LCInfiniteScrollView *)infiniteScrollView displayReusableView:(UIView *)reusableView atIndex:(NSInteger)index {
    UILabel *label = (UILabel *)reusableView;
    label.text = @(index).stringValue;
    label.backgroundColor = (UIColor *)self.colors[index];
}
  • Swift
func infiniteScrollView(_ infiniteScrollView: LCInfiniteScrollView, displayReusableView view: UIView, forIndex index: Int) {
    view.backgroundColor = colors[index]
}

func reusableView(in infiniteScrollView: LCInfiniteScrollView) -> UIView {
    return UIView()
}

Installation

CocoaPods

To integrate LCInfiniteScrollView into your Xcode project using CocoaPods, specify it in your Podfile:

  • Objective-C
pod 'LCInfiniteScrollView'
  • Swift
pod 'SwiftInfiniteScrollView'

Manual

  • Objective-C
  1. Download everything in the LCInfiniteScrollView folder;
  2. Add (drag and drop) the source files in LCInfiniteScrollView to your project.
  3. import LCInfiniteScrollView.h.
  • Swift
  1. Download everything in the LCInfiniteScrollView folder;
  2. Add (drag and drop) the source files in SwiftInfiniteScrollView to your project.

License

LCInfiniteScrollView is provided under the MIT license. See LICENSE file for details.

More Repositories

1

LCToast

Simple Objective-C toast notifications
Objective-C
164
star
2

LCWebImage

An asynchronous image loading framework based on AFNetworking.
Objective-C
26
star
3

AHP

层次分析法
Python
17
star
4

KeyboardListener

Prevent keyboard from covering UITextField/UITextView with only one line of code, includes Swift and Objective-C APIs.
Objective-C
13
star
5

LCDownloadManager

多任务断点下载(包括OC和Swift)
Objective-C
12
star
6

LCPullRefresh

Give pull-to-refresh to any UIScrollView.
Objective-C
9
star
7

LCHelper

Some categories in Objective-C
Objective-C
8
star
8

DrawBoardDemo

使用CAShaperLayer做的一个画板,支持删除、撤销、恢复
Swift
6
star
9

SwiftHelper

Some extensions in Swift.
Swift
5
star
10

LCCollectionLayout

自定义Layout布局
Objective-C
3
star
11

LCPhotoBrowser

基于PhotoKit封装的相册多选功能,支持图片多选、预览缩放。
Swift
3
star
12

LCCycleBanner

An infinite scroll control implemented with two views.
Swift
3
star
13

HeadImageDraw

头像图片剪切(支持图片放大,平移)
Swift
3
star
14

HandleLockDemo

模仿网易邮箱大师做的手势解锁。
Swift
2
star
15

PagingMenu

A paging menu controller built from other view controllers placed inside a scroll view
Swift
2
star
16

AutoIPA

iOS 自动化打包上传到蒲公英并通知到钉钉群
Shell
1
star
17

MarginLabel

Swift
1
star
18

AttachmentTextView

Use NSAttributedString to add subviews to UITextView
Swift
1
star
19

Refreshing

An easy way to implement pull-to-refresh feature based on UIScrollView extension.
Swift
1
star
20

ImagePickerViewController

A view controller that manages the system interfaces for taking pictures and choosing items from the user’s media library.
Swift
1
star