-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Expand file tree
/
Copy pathFLEXUserGlobalEntriesContainer.h
More file actions
121 lines (106 loc) · 6.95 KB
/
Copy pathFLEXUserGlobalEntriesContainer.h
File metadata and controls
121 lines (106 loc) · 6.95 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
//
// FLEXUserGlobalEntriesContainer.h
// FLEX
//
// Created by Iulian Onofrei on 2023-02-10.
// Copyright © 2023 FLEX Team. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "FLEXGlobalsEntry.h"
NS_ASSUME_NONNULL_BEGIN
@interface FLEXUserGlobalEntriesContainer : NSObject
/// Adds an entry at the top of the list of Global State items.
/// Call this method before this view controller is displayed.
/// @param entryName The string to be displayed in the cell.
/// @param objectFutureBlock When you tap on the row, information about the object returned
/// by this block will be displayed. Passing a block that returns an object allows you to display
/// information about an object whose actual pointer may change at runtime (e.g. +currentUser)
/// @note This method must be called from the main thread.
/// The objectFutureBlock will be invoked from the main thread and may return nil.
/// @note The passed block will be copied and retain for the duration of the application,
/// you may want to use __weak references.
- (void)registerGlobalEntryWithName:(NSString *)entryName objectFutureBlock:(id (^)(void))objectFutureBlock;
/// Adds an entry at the top of the list of Global State items.
/// Call this method before this view controller is displayed.
/// @param entryName The string to be displayed in the cell.
/// @param cellAccessoryType The accessory type to be used for the cell.
/// @param objectFutureBlock When you tap on the row, information about the object returned
/// by this block will be displayed. Passing a block that returns an object allows you to display
/// information about an object whose actual pointer may change at runtime (e.g. +currentUser)
/// @note This method must be called from the main thread.
/// The objectFutureBlock will be invoked from the main thread and may return nil.
/// @note The passed block will be copied and retain for the duration of the application,
/// you may want to use __weak references.
- (void)registerGlobalEntryWithName:(NSString *)entryName
cellAccessoryType:(UITableViewCellAccessoryType)cellAccessoryType
objectFutureBlock:(id (^)(void))objectFutureBlock;
/// Adds an entry at the top of the list of Global State items.
/// Call this method before this view controller is displayed.
/// @param entryName The string to be displayed in the cell.
/// @param viewControllerFutureBlock When you tap on the row, view controller returned
/// by this block will be pushed on the navigation controller stack.
/// @note This method must be called from the main thread.
/// The viewControllerFutureBlock will be invoked from the main thread and may not return nil.
/// @note The passed block will be copied and retain for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerGlobalEntryWithName:(NSString *)entryName
viewControllerFutureBlock:(UIViewController * (^)(void))viewControllerFutureBlock;
/// Adds an entry at the top of the list of Global State items.
/// Call this method before this view controller is displayed.
/// @param entryName The string to be displayed in the cell.
/// @param cellAccessoryType The accessory type to be used for the cell.
/// @param viewControllerFutureBlock When you tap on the row, view controller returned
/// by this block will be pushed on the navigation controller stack.
/// @note This method must be called from the main thread.
/// The viewControllerFutureBlock will be invoked from the main thread and may not return nil.
/// @note The passed block will be copied and retain for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerGlobalEntryWithName:(NSString *)entryName
cellAccessoryType:(UITableViewCellAccessoryType)cellAccessoryType
viewControllerFutureBlock:(UIViewController * (^)(void))viewControllerFutureBlock;
/// Adds an entry at the top of the list of Global State items.
/// @param entryName The string to be displayed in the cell.
/// @param rowSelectedAction When you tap on the row, this block will be invoked
/// with the host table view view controller. Use it to deselect the row or present an alert.
/// @note This method must be called from the main thread.
/// The rowSelectedAction will be invoked from the main thread.
/// @note The passed block will be copied and retained for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerGlobalEntryWithName:(NSString *)entryName action:(FLEXGlobalsEntryRowAction)rowSelectedAction;
/// Adds an entry at the top of the list of Global State items.
/// @param entryName The string to be displayed in the cell.
/// @param cellAccessoryType The accessory type to be used for the cell.
/// @param rowSelectedAction When you tap on the row, this block will be invoked
/// with the host table view view controller. Use it to deselect the row or present an alert.
/// @note This method must be called from the main thread.
/// The rowSelectedAction will be invoked from the main thread.
/// @note The passed block will be copied and retained for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerGlobalEntryWithName:(NSString *)entryName
cellAccessoryType:(UITableViewCellAccessoryType)cellAccessoryType
action:(FLEXGlobalsEntryRowAction)rowSelectedAction;
/// Adds an entry at the top of the list of Global State items.
/// @param entryName The string to be displayed in the cell.
/// @param nestedEntriesHandler When you tap on the row, this block will be invoked
/// with the container object. Use it to register nested entries.
/// @note This method must be called from the main thread.
/// The nestedEntriesHandler will be invoked from the main thread.
/// @note The passed block will be copied and retained for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerNestedGlobalEntryWithName:(NSString *)entryName handler:(FLEXNestedGlobalEntriesHandler)nestedEntriesHandler;
/// Adds an entry at the top of the list of Global State items.
/// @param entryName The string to be displayed in the cell.
/// @param cellAccessoryType The accessory type to be used for the cell.
/// @param nestedEntriesHandler When you tap on the row, this block will be invoked
/// with the container object. Use it to register nested entries.
/// @note This method must be called from the main thread.
/// The nestedEntriesHandler will be invoked from the main thread.
/// @note The passed block will be copied and retained for the duration of the application,
/// you may want to use __weak references as needed.
- (void)registerNestedGlobalEntryWithName:(NSString *)entryName
cellAccessoryType:(UITableViewCellAccessoryType)cellAccessoryType
handler:(FLEXNestedGlobalEntriesHandler)nestedEntriesHandler;
/// Removes all registered global entries.
- (void)clearGlobalEntries;
@end
NS_ASSUME_NONNULL_END