forked from rFlex/SCRecorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SCSwipeableFilterView.h
71 lines (58 loc) · 2.03 KB
/
SCSwipeableFilterView.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
//
// SCFilterSwitcherView.h
// SCRecorderExamples
//
// Created by Simon CORSIN on 29/05/14.
//
//
#import <UIKit/UIKit.h>
#import "SCPlayer.h"
#import "SCFilterImageView.h"
@class SCSwipeableFilterView;
@protocol SCSwipeableFilterViewDelegate <NSObject>
- (void)swipeableFilterView:(SCSwipeableFilterView *__nonnull)swipeableFilterView didScrollToFilter:(SCFilter *__nullable)filter;
@end
/**
A filter selector view that works like the Snapchat presentation of the available filters.
Filters are swipeable from horizontally.
*/
@interface SCSwipeableFilterView : SCImageView<UIScrollViewDelegate>
/**
The available filterGroups that this SCFilterSwitcherView shows
If you want to show an empty filter (no processing), just add a [NSNull null]
entry instead of an instance of SCFilterGroup
*/
@property (strong, nonatomic) NSArray *__nullable filters;
/**
The currently selected filter group.
This changes when scrolling in the underlying UIScrollView.
This value is Key-Value observable.
*/
@property (strong, nonatomic) SCFilter *__nullable selectedFilter;
/**
A filter that is applied before applying the selected filter
*/
@property (strong, nonatomic) SCFilter *__nullable preprocessingFilter;
/**
The delegate that will receive messages
*/
@property (weak, nonatomic) id<SCSwipeableFilterViewDelegate> __nullable delegate;
/**
The underlying scrollView used for scrolling between filterGroups.
You can freely add your views inside.
*/
@property (readonly, nonatomic) UIScrollView *__nonnull selectFilterScrollView;
/**
Whether the current image should be redraw with the new contentOffset
when the UIScrollView is scrolled. If disabled, scrolling will never
show up the other filters, until it receives a new CIImage.
On some device it seems better to disable it when the SCSwipeableFilterView
is set inside a SCPlayer.
Default is YES
*/
@property (assign, nonatomic) BOOL refreshAutomaticallyWhenScrolling;
/**
Scrolls to a specific filter
*/
- (void)scrollToFilter:(SCFilter *__nonnull)filter animated:(BOOL)animated;
@end