forked from Awful/Awful.app
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAwfulPostIconPickerController.h
More file actions
57 lines (39 loc) · 1.63 KB
/
AwfulPostIconPickerController.h
File metadata and controls
57 lines (39 loc) · 1.63 KB
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
//
// AwfulPostIconPickerController.h
// Awful
//
// Created by Nolan Waite on 2013-03-04.
// Copyright (c) 2013 Regular Berry Software LLC. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "PSTCollectionView.h"
@protocol AwfulPostIconPickerControllerDelegate;
@interface AwfulPostIconPickerController : PSUICollectionViewController
// Designated initializer.
- (instancetype)initWithDelegate:(id <AwfulPostIconPickerControllerDelegate>)delegate;
@property (weak, nonatomic) id <AwfulPostIconPickerControllerDelegate> delegate;
- (void)reloadData;
// Displays a post icon picker in a popover.
//
// Does nothing on iPhone. On iPhone, present the picker modally.
- (void)showFromRect:(CGRect)rect inView:(UIView *)view;
// Immediately dismiss a picker in a popover.
- (void)dismiss;
// Setting the selectedIndex does not cause any selection-related delegate methods to be called.
// If no icon is selected, returns NSNotFound.
@property (nonatomic) NSInteger selectedIndex;
@end
@protocol AwfulPostIconPickerControllerDelegate <NSObject>
@required
- (NSInteger)numberOfIconsInPostIconPicker:(AwfulPostIconPickerController *)picker;
- (UIImage *)postIconPicker:(AwfulPostIconPickerController *)picker
postIconAtIndex:(NSInteger)index;
@optional
// Sent when a final icon has been chosen.
- (void)postIconPickerDidComplete:(AwfulPostIconPickerController *)picker;
// Sent whenever the selection changes.
- (void)postIconPicker:(AwfulPostIconPickerController *)picker
didSelectIconAtIndex:(NSInteger)index;
// Sent when the icon selection should not occur.
- (void)postIconPickerDidCancel:(AwfulPostIconPickerController *)picker;
@end