43 lines
1.1 KiB
Objective-C
43 lines
1.1 KiB
Objective-C
//
|
|
// IfishCardScrollView.h
|
|
// ShotViewAnimation
|
|
//
|
|
// Created by imac on 16/10/25.
|
|
// Copyright © 2016年 xiang. All rights reserved.
|
|
//
|
|
|
|
#import <UIKit/UIKit.h>
|
|
typedef NS_ENUM(NSInteger, CardMoveDirection) {
|
|
CardMoveDirectionNone,
|
|
CardMoveDirectionLeft,
|
|
CardMoveDirectionRight
|
|
};
|
|
@protocol CardScrollViewDataSource <NSObject>
|
|
|
|
- (NSInteger)numberOfCards;
|
|
- (UIView *)cardReuseView:(UIView *)reuseView atIndex:(NSInteger)index;
|
|
@optional
|
|
- (void)deleteCardWithIndex:(NSInteger)index;
|
|
|
|
@end
|
|
|
|
@protocol CardScrollViewDelegate <NSObject>
|
|
|
|
- (void)updateCard:(UIView *)card withProgress:(CGFloat)progress direction:(CardMoveDirection)direction;
|
|
|
|
@end
|
|
|
|
|
|
@interface IfishCardScrollView : UIView
|
|
@property (nonatomic, weak) id<CardScrollViewDataSource>cardDataSource;
|
|
@property (nonatomic, weak) id<CardScrollViewDelegate>cardDelegate;
|
|
@property (nonatomic, assign) BOOL canDeleteCard;
|
|
@property (nonatomic, strong) UIScrollView *scrollView;
|
|
|
|
- (void)loadCard;
|
|
- (NSArray *)allCards;
|
|
- (NSInteger)currentCard;
|
|
- (CGPoint)contentOffsetWithIndex:(NSInteger)index;
|
|
|
|
@end
|