Skip to content

Commit 756f99b

Browse files
committed
Added a .clang-format file which conforms to the Google Obj-C style guide: https://google.github.io/styleguide/objcguide.xml
Reformatted code according to it :) Also made a minor change to the FirebaseUIChat example
1 parent 0634747 commit 756f99b

File tree

12 files changed

+640
-417
lines changed

12 files changed

+640
-417
lines changed

.clang-format

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
BasedOnStyle: Google
2+
ColumnLimit: 100
3+
BinPackParameters: false
4+
AllowAllParametersOfDeclarationOnNextLine: true

FirebaseUI/API/FirebaseArray.h

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,27 @@
3636
@class FDataSnapshot;
3737

3838
/**
39-
* FirebaseArray provides an array structure that is synchronized with a Firebase reference or query. It is useful for building custom data structures or sources, and provides the base for FirebaseDataSource.
39+
* FirebaseArray provides an array structure that is synchronized with a Firebase reference or
40+
* query. It is useful for building custom data structures or sources, and provides the base for
41+
* FirebaseDataSource.
4042
*/
4143
@interface FirebaseArray : NSObject
4244

4345
/**
44-
* The delegate object that array changes are surfaced to, which conforms to the [FirebaseArrayDelegate Protocol](FirebaseArrayDelegate).
46+
* The delegate object that array changes are surfaced to, which conforms to the
47+
* [FirebaseArrayDelegate Protocol](FirebaseArrayDelegate).
4548
*/
46-
@property (weak, nonatomic) id<FirebaseArrayDelegate> delegate;
49+
@property(weak, nonatomic) id<FirebaseArrayDelegate> delegate;
4750

4851
/**
4952
* The query on a Firebase reference that provides data to populate the instance of FirebaseArray.
5053
*/
51-
@property (strong, nonatomic) FQuery *query;
54+
@property(strong, nonatomic) FQuery *query;
5255

5356
/**
5457
* The delegate object that array changes are surfaced to.
5558
*/
56-
@property (strong, nonatomic) NSMutableArray __GENERIC(FDataSnapshot *) *snapshots;
59+
@property(strong, nonatomic) NSMutableArray __GENERIC(FDataSnapshot *) * snapshots;
5760

5861
#pragma mark -
5962
#pragma mark Initializer methods
@@ -99,10 +102,13 @@
99102
#pragma mark Private API methods
100103

101104
/**
102-
* Returns an index for a given object's key (that matches the object's key in the corresponding Firebase reference).
105+
* Returns an index for a given object's key (that matches the object's key in the corresponding
106+
* Firebase reference).
103107
* @param key The key of the desired object
104108
* @return The index of the object for which the key matches or -1 if the key is null
105-
* @exception FirebaseArrayKeyNotFoundException Thrown when the desired key is not in the FirebaseArray, likely indicating that the FirebaseArray is no longer being properly synchronized with the Firebase database.
109+
* @exception FirebaseArrayKeyNotFoundException Thrown when the desired key is not in the
110+
* FirebaseArray, likely indicating that the FirebaseArray is no longer being properly synchronized
111+
* with the Firebase database.
106112
*/
107113
- (NSUInteger)indexForKey:(NSString *)key;
108114

FirebaseUI/API/FirebaseArrayDelegate.h

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -27,40 +27,53 @@
2727
*/
2828

2929
/**
30-
* A protocol to allow instances of FirebaseArray to raise events through a delegate. Raises all Firebase events except FEventTypeValue.
30+
* A protocol to allow instances of FirebaseArray to raise events through a delegate. Raises all
31+
* Firebase events except FEventTypeValue.
3132
*/
3233

33-
@protocol FirebaseArrayDelegate <NSObject>
34+
@protocol FirebaseArrayDelegate<NSObject>
3435

3536
@optional
3637

3738
/**
38-
* Delegate method which is called whenever an object is added to a FirebaseArray. On a FirebaseArray synchronized to a Firebase reference, this corresponds to an [FEventTypeChildAdded](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types) event being raised.
39+
* Delegate method which is called whenever an object is added to a FirebaseArray. On a
40+
* FirebaseArray synchronized to a Firebase reference, this corresponds to an
41+
* [FEventTypeChildAdded](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types)
42+
* event being raised.
3943
* @param object The object added to the FirebaseArray
4044
* @param index The index the child was added at
4145
*/
42-
- (void) childAdded:(id)object atIndex:(NSUInteger)index;
46+
- (void)childAdded:(id)object atIndex:(NSUInteger)index;
4347

4448
/**
45-
* Delegate method which is called whenever an object is chinged in a FirebaseArray. On a FirebaseArray synchronized to a Firebase reference, this corresponds to an [FEventTypeChildChanged](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types) event being raised.
49+
* Delegate method which is called whenever an object is chinged in a FirebaseArray. On a
50+
* FirebaseArray synchronized to a Firebase reference, this corresponds to an
51+
* [FEventTypeChildChanged](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types)
52+
* event being raised.
4653
* @param object The object that changed in the FirebaseArray
4754
* @param index The index the child was changed at
4855
*/
49-
- (void) childChanged:(id)object atIndex:(NSUInteger)index;
56+
- (void)childChanged:(id)object atIndex:(NSUInteger)index;
5057

5158
/**
52-
* Delegate method which is called whenever an object is removed from a FirebaseArray. On a FirebaseArray synchronized to a Firebase reference, this corresponds to an [FEventTypeChildRemoved](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types) event being raised.
59+
* Delegate method which is called whenever an object is removed from a FirebaseArray. On a
60+
* FirebaseArray synchronized to a Firebase reference, this corresponds to an
61+
* [FEventTypeChildRemoved](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types)
62+
* event being raised.
5363
* @param object The object removed from the FirebaseArray
5464
* @param index The index the child was removed at
5565
*/
56-
- (void) childRemoved:(id)object atIndex:(NSUInteger)index;
66+
- (void)childRemoved:(id)object atIndex:(NSUInteger)index;
5767

5868
/**
59-
* Delegate method which is called whenever an object is moved within a FirebaseArray. On a FirebaseArray synchronized to a Firebase reference, this corresponds to an [FEventTypeChildMoved](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types) event being raised.
69+
* Delegate method which is called whenever an object is moved within a FirebaseArray. On a
70+
* FirebaseArray synchronized to a Firebase reference, this corresponds to an
71+
* [FEventTypeChildMoved](https://www.firebase.com/docs/ios/guide/retrieving-data.html#section-event-types)
72+
* event being raised.
6073
* @param object The object that has moved locations in the FirebaseArray
6174
* @param fromIndex The index the child is being moved from
6275
* @param toIndex The index the child is being moved to
6376
*/
64-
- (void) childMoved:(id)object fromIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex;
77+
- (void)childMoved:(id)object fromIndex:(NSUInteger)fromIndex toIndex:(NSUInteger)toIndex;
6578

6679
@end

0 commit comments

Comments
 (0)