Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 52 additions & 52 deletions samples/objc/FirebaseUI-demo-objc.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

76 changes: 38 additions & 38 deletions samples/objc/FirebaseUI-demo-objc/Base.lproj/Main.storyboard

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@

#import <UIKit/UIKit.h>

@interface AppDelegate : UIResponder <UIApplicationDelegate>
@interface FUIAppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;

@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
// limitations under the License.
//

#import "AppDelegate.h"
#import "FUIAppDelegate.h"

@import Firebase;
#import <Fabric/Fabric.h>
#import <FirebaseAuthUI/FirebaseAuthUI.h>
#import <TwitterKit/Twitter.h>


@implementation AppDelegate
@implementation FUIAppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Fabric with:@[[Twitter class]]];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// FIRSampleContainer.h
// FUISample.h
//
// Copyright (c) 2016 Google Inc.
//
Expand All @@ -21,7 +21,7 @@

typedef UIViewController *(^FIRControllerBlock)();

@interface FIRSample : NSObject
@interface FUISample : NSObject

+ (instancetype)sampleWithTitle:(NSString *)title
sampleDescription:(NSString *)description
Expand All @@ -32,4 +32,4 @@ typedef UIViewController *(^FIRControllerBlock)();
@property (nonatomic, copy) FIRControllerBlock controllerBlock;


@end
@end
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// FIRSampleContainer.m
// FUISample.m
//
// Copyright (c) 2016 Google Inc.
//
Expand All @@ -16,9 +16,9 @@
// limitations under the License.
//

#import "FIRSample.h"
#import "FUISample.h"

@implementation FIRSample
@implementation FUISample

- (id)initWithTitle:(NSString *)title
sampleDescription:(NSString *)description
Expand All @@ -35,12 +35,12 @@ - (id)initWithTitle:(NSString *)title
+ (instancetype)sampleWithTitle:(NSString *)title
sampleDescription:(NSString *)description
controller:(FIRControllerBlock)block {
FIRSample *sample = [(FIRSample *)[self alloc] initWithTitle:title
FUISample *sample = [(FUISample *)[self alloc] initWithTitle:title
sampleDescription:description
controller:block];

return sample;
}


@end
@end
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

#import <UIKit/UIKit.h>

@interface FIRSamplesViewController : UITableViewController
@interface FUISamplesViewController : UITableViewController

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@
// limitations under the License.
//

#import "FIRSample.h"
#import "FIRSamplesViewController.h"
#import "FIRChatViewController.h"
#import "FUISample.h"
#import "FUISamplesViewController.h"
#import "FUIChatViewController.h"

@interface FIRSamplesViewController ()
@interface FUISamplesViewController ()

@property (nonatomic) NSArray *samplesContainer;

@end

@implementation FIRSamplesViewController
@implementation FUISamplesViewController

- (void)viewDidLoad {
[super viewDidLoad];
Expand All @@ -40,7 +40,7 @@ - (void)viewDidLoad {
- (void)populateSamples {
NSMutableArray *samples = [[NSMutableArray alloc] init];

[samples addObject:[FIRSample sampleWithTitle:@"Auth"
[samples addObject:[FUISample sampleWithTitle:@"Auth"
sampleDescription:@"Demonstrates the FirebaseAuthUI flow with customization options"
controller:^UIViewController *{
UIViewController *controller =
Expand All @@ -49,20 +49,20 @@ - (void)populateSamples {
return controller;
}]];

[samples addObject:[FIRSample sampleWithTitle:@"Chat"
[samples addObject:[FUISample sampleWithTitle:@"Chat"
sampleDescription:@"Demonstrates using a FUICollectionViewDataSource to load data from Firebase Database into a UICollectionView for a basic chat app."
controller:^UIViewController *{
UIViewController *controller =
[[UIStoryboard storyboardWithName:@"Main"
bundle:NULL] instantiateViewControllerWithIdentifier:@"ViewController"];
return controller;
}]];
[samples addObject:[FIRSample sampleWithTitle:@"Storage"
[samples addObject:[FUISample sampleWithTitle:@"Storage"
sampleDescription:@"Demonstrates using FirebaseStorageUI to populate an image view."
controller:^UIViewController *{
UIViewController *controller =
[[UIStoryboard storyboardWithName:@"Main"
bundle:NULL] instantiateViewControllerWithIdentifier:@"FIRStorageViewController"];
bundle:NULL] instantiateViewControllerWithIdentifier:@"FUIStorageViewController"];
return controller;
}]];

Expand All @@ -80,18 +80,18 @@ - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellId = @"FIRSampleCell";
static NSString *cellId = @"FUISampleCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath];

FIRSample *sample = _samplesContainer[indexPath.row];
FUISample *sample = _samplesContainer[indexPath.row];
cell.textLabel.text = sample.title;
cell.detailTextLabel.text = sample.sampleDescription;

return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
FIRSample *sample = _samplesContainer[indexPath.row];
FUISample *sample = _samplesContainer[indexPath.row];
UIViewController *viewController = sample.controllerBlock();

[self.navigationController pushViewController:viewController animated:YES];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <Foundation/Foundation.h>

@interface FIRChatMessage : NSObject
@interface FUIChatMessage : NSObject

@property(copy, nonatomic) NSString *name;
@property(copy, nonatomic) NSString *text;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// limitations under the License.
//

#import "FIRChatMessage.h"
#import "FUIChatMessage.h"

@implementation FIRChatMessage
@implementation FUIChatMessage

- (instancetype)init {
return [self initWithName:@"" andText:@"" userId:@""];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
// limitations under the License.
//

#import <FirebaseDatabaseUI/FUITableViewDataSource.h>
#import <FirebaseDatabaseUI/FirebaseDatabaseUI.h>

@interface FIRChatMessageDataSource : FUITableViewDataSource
@interface FUIChatMessageDataSource : FUITableViewDataSource

@end
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@
// limitations under the License.
//

#import "FIRChatMessageDataSource.h"
#import "FUIChatMessageDataSource.h"
@import FirebaseDatabase;

@implementation FIRChatMessageDataSource
@implementation FUIChatMessageDataSource

- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#import <UIKit/UIKit.h>

@interface FIRChatMessageTableViewCell : UITableViewCell
@interface FUIChatMessageTableViewCell : UITableViewCell
@property(weak, nonatomic) IBOutlet UILabel *myMessageLabel;
@property(weak, nonatomic) IBOutlet UILabel *myNameLabel;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
// limitations under the License.
//

#import "FIRChatMessageTableViewCell.h"
#import "FUIChatMessageTableViewCell.h"

@implementation FIRChatMessageTableViewCell
@implementation FUIChatMessageTableViewCell

- (instancetype)initWithFrame:(CGRect)frame {
return [super initWithFrame:frame];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="11201" systemVersion="15G1108" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="11161"/>
Expand All @@ -10,11 +10,11 @@
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="d6M-nO-3us" customClass="FIRChatMessageTableViewCell">
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="d6M-nO-3us" customClass="FUIChatMessageTableViewCell">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="d6M-nO-3us" id="oUR-sj-R1e">
<frame key="frameInset" width="320" height="43"/>
<frame key="frameInset" width="320" height="43.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Other Message" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="5a3-Gg-71z">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@
@import UIKit;
@import FirebaseDatabase;

#import <FirebaseDatabaseUI/FUITableViewDataSource.h>
#import <FirebaseDatabaseUI/FirebaseDatabaseUI.h>

@interface FIRChatViewController : UIViewController <UITableViewDelegate, UITextFieldDelegate>
@interface FUIChatViewController : UIViewController <UITableViewDelegate, UITextFieldDelegate>

@property (strong, nonatomic) FIRDatabaseReference *ref;
@property (strong, nonatomic) FUITableViewDataSource *dataSource;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,31 +17,31 @@
#import <FirebaseAuthUI/FirebaseAuthUI.h>
#import <FirebaseAuth/FirebaseAuth.h>

#import "FIRChatViewController.h"
#import "FIRChatMessage.h"
#import "FIRChatMessageTableViewCell.h"
#import "FIRChatMessageDataSource.h"
#import "FUIChatViewController.h"
#import "FUIChatMessage.h"
#import "FUIChatMessageTableViewCell.h"
#import "FUIChatMessageDataSource.h"

@implementation FIRChatViewController
@implementation FUIChatViewController

- (void)viewDidLoad {
[super viewDidLoad];

self.ref = [[FIRDatabase database].reference child:@"objc_demo-chat"];

NSString *identifier = @"cellReuseIdentifier";
UINib *nib = [UINib nibWithNibName:@"FIRChatMessageTableViewCell" bundle:nil];
UINib *nib = [UINib nibWithNibName:@"FUIChatMessageTableViewCell" bundle:nil];
[self.tableView registerNib:nib forCellReuseIdentifier:identifier];
self.dataSource =
[[FIRChatMessageDataSource alloc] initWithQuery:self.ref
[[FUIChatMessageDataSource alloc] initWithQuery:self.ref
view:self.tableView
populateCell:^UITableViewCell *(UITableView *tableView,
NSIndexPath *indexPath,
FIRDataSnapshot *snap) {
FIRChatMessage *message = [[FIRChatMessage alloc] initWithName:snap.value[@"name"]
FUIChatMessage *message = [[FUIChatMessage alloc] initWithName:snap.value[@"name"]
andText:snap.value[@"text"]
userId:snap.value[@"uid"]];
FIRChatMessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
FUIChatMessageTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identifier];
if ([message.uid isEqualToString:[FIRAuth auth].currentUser.uid]) {
cell.myMessageLabel.text = message.text;
cell.myNameLabel.text = message.name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@

#import <UIKit/UIKit.h>

@interface FIRStorageViewController : UIViewController
@interface FUIStorageViewController : UIViewController

@end
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
// limitations under the License.
//

#import "FIRStorageViewController.h"
#import "FUIStorageViewController.h"

#import <FirebaseStorage/FirebaseStorage.h>
#import <FirebaseStorageUI/FirebaseStorageUI.h>

@interface FIRStorageViewController ()
@interface FUIStorageViewController ()
@property (nonatomic, strong) IBOutlet UIImageView *imageView;
@property (nonatomic, strong) IBOutlet UITextField *textField;

/// Used to move the view's contents when the keyboard appears.
@property (nonatomic, strong) IBOutlet NSLayoutConstraint *bottomConstraint;
@end

@implementation FIRStorageViewController
@implementation FUIStorageViewController

- (void)viewDidLoad {
[super viewDidLoad];
Expand Down
4 changes: 2 additions & 2 deletions samples/objc/FirebaseUI-demo-objc/main.m
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
//

#import <UIKit/UIKit.h>
#import "AppDelegate.h"
#import "FUIAppDelegate.h"

int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
return UIApplicationMain(argc, argv, nil, NSStringFromClass([FUIAppDelegate class]));
}
}
Loading