Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Firebase 2.5.0, XCode 7.0+, iOS8.0+, Version 1.0.0 #3

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
324 changes: 200 additions & 124 deletions ExampleProject/ExampleProject.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions ExampleProject/ExampleProject/AppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// AppDelegate.h
// ExampleProject
//
// Created by Sean Hess on 5/24/13.
// Copyright (c) 2013 Sean Hess. All rights reserved.
// Created by Felipe Antonio Cardoso on 06/02/16.
// Copyright © 2016 ExampleProject. All rights reserved.
//

#import <UIKit/UIKit.h>
Expand All @@ -13,3 +13,4 @@
@property (strong, nonatomic) UIWindow *window;

@end

66 changes: 22 additions & 44 deletions ExampleProject/ExampleProject/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,66 +2,44 @@
// AppDelegate.m
// ExampleProject
//
// Created by Sean Hess on 5/24/13.
// Copyright (c) 2013 Sean Hess. All rights reserved.
// Created by Felipe Antonio Cardoso on 06/02/16.
// Copyright © 2016 ExampleProject. All rights reserved.
//

#import "AppDelegate.h"
#import <FirebaseObjects/FirebaseCollection.h>
#import <Firebase/Firebase.h>
#import "User.h"

@interface AppDelegate ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];


Firebase * firebase = [[Firebase alloc] initWithUrl:@"https://fake.firebaseio.com/stuff"];
NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
FirebaseCollection * collection = [[FirebaseCollection alloc] initWithNode:firebase dictionary:dictionary type:[User class]];

[collection didAddChild:^(User * user) {
// created remotely or locally, it is called here
NSLog(@"New User %@", user);
}];

User * me = [User new];
me.name = @"me";
[collection addObject:me];

return YES;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
// Override point for customization after application launch.
return YES;
}

- (void)applicationWillResignActive:(UIApplication *)application
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
- (void)applicationWillResignActive:(UIApplication *)application {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}

- (void)applicationDidEnterBackground:(UIApplication *)application
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
- (void)applicationDidEnterBackground:(UIApplication *)application {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}

- (void)applicationWillEnterForeground:(UIApplication *)application
{
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
- (void)applicationWillEnterForeground:(UIApplication *)application {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}

- (void)applicationDidBecomeActive:(UIApplication *)application
{
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
- (void)applicationDidBecomeActive:(UIApplication *)application {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}

- (void)applicationWillTerminate:(UIApplication *)application
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "1x"
},
{
"idiom" : "ipad",
"size" : "76x76",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
27 changes: 27 additions & 0 deletions ExampleProject/ExampleProject/Base.lproj/LaunchScreen.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<animations/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
87 changes: 87 additions & 0 deletions ExampleProject/ExampleProject/Base.lproj/Main.storyboard
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9532" systemVersion="15D21" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Ijh-2H-9GI">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9530"/>
</dependencies>
<scenes>
<!--Firebase Example-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="UserListViewController" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="64" width="320" height="416"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="prototypes" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="28" sectionFooterHeight="28" translatesAutoresizingMaskIntoConstraints="NO" id="BCT-Id-6gK">
<rect key="frame" x="0.0" y="65" width="320" height="351"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="CellIdentifier" id="vdq-WC-IxQ">
<rect key="frame" x="0.0" y="28" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="vdq-WC-IxQ" id="fqA-2h-dd9">
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
<autoresizingMask key="autoresizingMask"/>
</tableViewCellContentView>
</tableViewCell>
</prototypes>
</tableView>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Click on the &quot;+&quot; button to add a user. Try to edit user names on your Firebase Dashboard, the edited name will be updated here." lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="oI9-8G-BvM">
<rect key="frame" x="8" y="8" width="304" height="49"/>
<fontDescription key="fontDescription" name="HelveticaNeue" family="Helvetica Neue" pointSize="14"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="0.90823972230000005" green="0.92638683320000004" blue="0.93171715740000005" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="wfy-db-euE" firstAttribute="top" secondItem="BCT-Id-6gK" secondAttribute="bottom" id="Hrj-QA-g4B"/>
<constraint firstItem="oI9-8G-BvM" firstAttribute="top" secondItem="y3c-jy-aDJ" secondAttribute="bottom" constant="8" id="SWb-kJ-rf5"/>
<constraint firstAttribute="trailing" secondItem="oI9-8G-BvM" secondAttribute="trailing" constant="8" id="StS-Pw-xmI"/>
<constraint firstItem="BCT-Id-6gK" firstAttribute="top" secondItem="oI9-8G-BvM" secondAttribute="bottom" constant="8" id="buY-I4-mc2"/>
<constraint firstItem="oI9-8G-BvM" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" constant="8" id="imx-NH-5bJ"/>
<constraint firstItem="BCT-Id-6gK" firstAttribute="leading" secondItem="8bC-Xf-vdC" secondAttribute="leading" id="uPX-eW-00l"/>
<constraint firstAttribute="trailing" secondItem="BCT-Id-6gK" secondAttribute="trailing" id="voP-Yd-Cqj"/>
</constraints>
</view>
<navigationItem key="navigationItem" title="Firebase Example" id="lLo-WH-bsw">
<barButtonItem key="rightBarButtonItem" systemItem="add" id="LsJ-tm-2sw">
<color key="tintColor" red="0.0" green="0.47843137250000001" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<connections>
<action selector="addUser:" destination="BYZ-38-t0r" id="Lkg-GI-95h"/>
</connections>
</barButtonItem>
</navigationItem>
<connections>
<outlet property="tableView" destination="BCT-Id-6gK" id="0qc-9I-LfX"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="360" y="207"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="1ja-SC-T0k">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="Ijh-2H-9GI" sceneMemberID="viewController">
<toolbarItems/>
<simulatedScreenMetrics key="simulatedDestinationMetrics"/>
<navigationBar key="navigationBar" contentMode="scaleToFill" translucent="NO" id="9Tv-xr-d6Z">
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="Lfh-eQ-GFc"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="agn-dZ-kAt" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-35" y="207"/>
</scene>
</scenes>
</document>
23 changes: 23 additions & 0 deletions ExampleProject/ExampleProject/Controllers/UserListViewController.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// UserListViewController.h
// ExampleProject
//
// Created by Felipe Antonio Cardoso on 06/02/16.
// Copyright © 2016 ExampleProject. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <FirebaseObjects/FirebaseCollection.h>
#import <Firebase/Firebase.h>
#import "User.h"


@interface UserListViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>

@property (weak, nonatomic) IBOutlet UITableView *tableView;

@property(nonatomic, strong) NSMutableDictionary * dictionary;
@property(nonatomic, strong) Firebase * firebase;
@property(nonatomic, strong) FirebaseCollection * collection;

@end
Loading