LuxChat  2.0
Instant messenger for iOS
PFQueryCollectionViewController.h
1 /*
2  * Copyright (c) 2014, Parse, LLC. All rights reserved.
3  *
4  * You are hereby granted a non-exclusive, worldwide, royalty-free license to use,
5  * copy, modify, and distribute this software in source code or binary form for use
6  * in connection with the web services and APIs provided by Parse.
7  *
8  * As with any software that integrates with the Parse platform, your use of
9  * this software is subject to the Parse Terms of Service
10  * [https://www.parse.com/about/terms]. This copyright notice shall be
11  * included in all copies or substantial portions of the software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
15  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  *
20  */
21 
22 #import <UIKit/UIKit.h>
23 
24 #import <Parse/PFConstants.h>
25 #import <ParseUI/ParseUIConstants.h>
26 
27 NS_ASSUME_NONNULL_BEGIN
28 
31 @class PFObject;
32 @class PFQuery;
33 
49 @interface PFQueryCollectionViewController : UICollectionViewController <UICollectionViewDelegateFlowLayout>
50 
54 @property (nullable, nonatomic, copy) IBInspectable NSString *parseClassName;
55 
59 @property (nonatomic, assign) IBInspectable BOOL loadingViewEnabled;
60 
64 @property (nonatomic, assign) IBInspectable BOOL pullToRefreshEnabled;
65 
69 @property (nonatomic, assign) IBInspectable BOOL paginationEnabled;
70 
74 @property (nonatomic, assign) IBInspectable NSUInteger objectsPerPage;
75 
79 @property (nonatomic, assign, getter=isLoading) BOOL loading;
80 
84 
93 - (instancetype)initWithClassName:(nullable NSString *)className;
94 
103 - (instancetype)initWithCollectionViewLayout:(UICollectionViewLayout *)layout
104  className:(nullable NSString *)className NS_DESIGNATED_INITIALIZER;
105 
109 
114 - (void)objectsWillLoad NS_REQUIRES_SUPER;
115 
121 - (void)objectsDidLoad:(nullable NSError *)error NS_REQUIRES_SUPER;
122 
126 
130 @property (nonatomic, copy, readonly) NSArray<__kindof PFObject *> *objects;
131 
142 - (nullable PFObject *)objectAtIndexPath:(nullable NSIndexPath *)indexPath;
143 
147 - (void)removeObjectAtIndexPath:(nullable NSIndexPath *)indexPath;
148 
152 - (void)removeObjectsAtIndexPaths:(nullable NSArray<NSIndexPath *> *)indexes;
153 
157 
163 - (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects;
164 
174 - (BFTask<NSArray<__kindof PFObject *> *> *)loadObjects:(NSInteger)page clear:(BOOL)clear;
175 
179 - (void)loadNextPage;
180 
184 - (void)clear;
185 
189 
195 - (PFQuery *)queryForCollection;
196 
200 
212 - (nullable PFCollectionViewCell *)collectionView:(UICollectionView *)collectionView
213  cellForItemAtIndexPath:(NSIndexPath *)indexPath
214  object:(nullable PFObject *)object;
215 
224 - (nullable UICollectionReusableView *)collectionViewReusableViewForNextPageAction:(UICollectionView *)collectionView;
225 
226 @end
227 
228 NS_ASSUME_NONNULL_END
Definition: PFObject+Subclass.h:14
Definition: PFCollectionViewCell.h:35
Definition: PFObject.h:32
Definition: PFImageView.h:32