Skip to content

Commit d4da24b

Browse files
author
Stephen Cobbe
committed
1.0.5 release. Enumerated subtype bug fix.
1 parent f98742b commit d4da24b

File tree

212 files changed

+2710
-2096
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

212 files changed

+2710
-2096
lines changed

Examples/DBRoulette/DBRoulette/DBRoulette.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
F272AD161D7E915C00E9727D /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F272AD141D7E915C00E9727D /* Main.storyboard */; };
1515
F272AD181D7E915C00E9727D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = F272AD171D7E915C00E9727D /* Assets.xcassets */; };
1616
F272AD1B1D7E915C00E9727D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = F272AD191D7E915C00E9727D /* LaunchScreen.storyboard */; };
17+
F28C577A1D81ECDB009503DA /* PhotoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = F28C57791D81ECDB009503DA /* PhotoViewController.m */; };
1718
/* End PBXBuildFile section */
1819

1920
/* Begin PBXFileReference section */
@@ -30,6 +31,8 @@
3031
F272AD171D7E915C00E9727D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
3132
F272AD1A1D7E915C00E9727D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
3233
F272AD1C1D7E915C00E9727D /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
34+
F28C57781D81ECC1009503DA /* PhotoViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PhotoViewController.h; sourceTree = "<group>"; };
35+
F28C57791D81ECDB009503DA /* PhotoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PhotoViewController.m; sourceTree = "<group>"; };
3336
/* End PBXFileReference section */
3437

3538
/* Begin PBXFrameworksBuildPhase section */
@@ -86,6 +89,8 @@
8689
F272AD0F1D7E915C00E9727D /* AppDelegate.m */,
8790
F272AD111D7E915C00E9727D /* ViewController.h */,
8891
F272AD121D7E915C00E9727D /* ViewController.m */,
92+
F28C57781D81ECC1009503DA /* PhotoViewController.h */,
93+
F28C57791D81ECDB009503DA /* PhotoViewController.m */,
8994
F272AD141D7E915C00E9727D /* Main.storyboard */,
9095
F272AD171D7E915C00E9727D /* Assets.xcassets */,
9196
F272AD191D7E915C00E9727D /* LaunchScreen.storyboard */,
@@ -225,6 +230,7 @@
225230
buildActionMask = 2147483647;
226231
files = (
227232
F272AD131D7E915C00E9727D /* ViewController.m in Sources */,
233+
F28C577A1D81ECDB009503DA /* PhotoViewController.m in Sources */,
228234
F272AD101D7E915C00E9727D /* AppDelegate.m in Sources */,
229235
F272AD0D1D7E915C00E9727D /* main.m in Sources */,
230236
);

Examples/DBRoulette/DBRoulette/DBRoulette/AppDelegate.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99

1010
@interface AppDelegate : UIResponder <UIApplicationDelegate>
1111

12-
@property (strong, nonatomic) UIWindow *window;
13-
12+
@property(strong, nonatomic) UIWindow *window;
1413

1514
@end
16-

Examples/DBRoulette/DBRoulette/DBRoulette/AppDelegate.m

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,32 @@
77

88
#import "AppDelegate.h"
99
#import "DropboxSDKImports.h"
10+
#import "PhotoViewController.h"
11+
#import "ViewController.h"
1012

1113
@interface AppDelegate ()
1214

1315
@end
1416

1517
@implementation AppDelegate
1618

17-
1819
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19-
[DropboxClientsManager setupWithAppKey:@"<APP_KEY>"];
20+
NSString *appKey;
21+
if (!appKey) {
22+
NSString *message = @"You need to set your app key in `AppDelegate.m` before you can use DBRoulette.";
23+
UIAlertController *alertController =
24+
[UIAlertController alertControllerWithTitle:@"Must set app key"
25+
message:message
26+
preferredStyle:(UIAlertControllerStyle)UIAlertControllerStyleAlert];
27+
28+
[self.window makeKeyAndVisible];
29+
[self.window.rootViewController presentViewController:alertController
30+
animated:NO
31+
completion:^{
32+
[NSException raise:@"FatalError" format:@"%@", message];
33+
}];
34+
}
35+
[DropboxClientsManager setupWithAppKey:appKey];
2036
return YES;
2137
}
2238

@@ -25,36 +41,50 @@ - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url {
2541
if (authResult != nil) {
2642
if ([authResult isSuccess]) {
2743
NSLog(@"Success! User is logged into Dropbox.");
44+
45+
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
46+
UINavigationController *navigationController = (UINavigationController *)self.window.rootViewController;
47+
PhotoViewController *photoViewController =
48+
(PhotoViewController *)[storyboard instantiateViewControllerWithIdentifier:@"PhotoViewController"];
49+
[navigationController pushViewController:photoViewController animated:NO];
2850
} else if ([authResult isCancel]) {
2951
NSLog(@"Authorization flow was manually canceled by user!");
3052
} else if ([authResult isError]) {
3153
NSLog(@"Error: %@", authResult);
3254
}
3355
}
56+
3457
return NO;
3558
}
3659

37-
3860
- (void)applicationWillResignActive:(UIApplication *)application {
39-
// 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.
40-
// 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.
61+
// Sent when the application is about to move from active to inactive state. This can occur for certain types of
62+
// temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and
63+
// it begins the transition to the background state.
64+
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use
65+
// this method to pause the game.
4166
}
4267

4368
- (void)applicationDidEnterBackground:(UIApplication *)application {
44-
// 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.
45-
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
69+
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state
70+
// information to restore your application to its current state in case it is terminated later.
71+
// If your application supports background execution, this method is called instead of applicationWillTerminate: when
72+
// the user quits.
4673
}
4774

4875
- (void)applicationWillEnterForeground:(UIApplication *)application {
49-
// 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.
76+
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes
77+
// made on entering the background.
5078
}
5179

5280
- (void)applicationDidBecomeActive:(UIApplication *)application {
53-
// 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.
81+
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was
82+
// previously in the background, optionally refresh the user interface.
5483
}
5584

5685
- (void)applicationWillTerminate:(UIApplication *)application {
57-
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
86+
// Called when the application is about to terminate. Save data if appropriate. See also
87+
// applicationDidEnterBackground:.
5888
}
5989

6090
@end

Examples/DBRoulette/DBRoulette/DBRoulette/Base.lproj/Main.storyboard

Lines changed: 80 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G1004" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="Ob0-66-dtL">
33
<dependencies>
44
<deployment identifier="iOS"/>
55
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
66
</dependencies>
77
<scenes>
8-
<!--View Controller-->
8+
<!--Link Account-->
99
<scene sceneID="tne-QT-ifu">
1010
<objects>
11-
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
11+
<viewController storyboardIdentifier="ViewController" id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
1212
<layoutGuides>
1313
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
1414
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -24,19 +24,96 @@
2424
<action selector="linkDropboxButtonPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="Bcc-7V-IPy"/>
2525
</connections>
2626
</button>
27+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="UFa-9N-Eg3">
28+
<rect key="frame" x="217" y="323" width="166" height="30"/>
29+
<state key="normal" title="Unlink Dropbox Account"/>
30+
<connections>
31+
<action selector="unlinkDropboxButtonPressed:" destination="BYZ-38-t0r" eventType="touchUpInside" id="CtV-uP-JAh"/>
32+
</connections>
33+
</button>
2734
</subviews>
2835
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
2936
<constraints>
3037
<constraint firstItem="Djk-aV-qrp" firstAttribute="centerY" secondItem="8bC-Xf-vdC" secondAttribute="centerY" id="G9Y-7M-r9W"/>
3138
<constraint firstItem="Djk-aV-qrp" firstAttribute="centerX" secondItem="8bC-Xf-vdC" secondAttribute="centerX" id="N19-Se-GCs"/>
39+
<constraint firstItem="UFa-9N-Eg3" firstAttribute="centerX" secondItem="Djk-aV-qrp" secondAttribute="centerX" id="UzI-aW-698"/>
40+
<constraint firstItem="UFa-9N-Eg3" firstAttribute="top" secondItem="Djk-aV-qrp" secondAttribute="bottom" constant="8" symbolic="YES" id="pHg-vV-3jC"/>
3241
</constraints>
3342
</view>
43+
<navigationItem key="navigationItem" title="Link Account" id="ZLu-EY-gul">
44+
<barButtonItem key="rightBarButtonItem" title="Photos" id="RZJ-bz-xzL">
45+
<connections>
46+
<segue destination="sMH-tX-FL0" kind="show" id="PTR-Ig-dEK"/>
47+
</connections>
48+
</barButtonItem>
49+
</navigationItem>
3450
<connections>
3551
<outlet property="linkDropboxButton" destination="Djk-aV-qrp" id="oMj-dW-AFS"/>
52+
<outlet property="unlinkDropboxButton" destination="UFa-9N-Eg3" id="Xlf-l6-jgs"/>
3653
</connections>
3754
</viewController>
3855
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
3956
</objects>
57+
<point key="canvasLocation" x="1310" y="561"/>
58+
</scene>
59+
<!--Photos Roulette-->
60+
<scene sceneID="WOW-La-T07">
61+
<objects>
62+
<viewController storyboardIdentifier="PhotoViewController" id="sMH-tX-FL0" customClass="PhotoViewController" sceneMemberID="viewController">
63+
<layoutGuides>
64+
<viewControllerLayoutGuide type="top" id="fmj-DK-4k8"/>
65+
<viewControllerLayoutGuide type="bottom" id="XsY-t7-g5x"/>
66+
</layoutGuides>
67+
<view key="view" contentMode="scaleToFill" id="KlY-dY-OtI">
68+
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
69+
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
70+
<subviews>
71+
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="ZCt-vW-MkG">
72+
<rect key="frame" x="233" y="435" width="134" height="30"/>
73+
<state key="normal" title="Pick Random Photo"/>
74+
<connections>
75+
<action selector="randomPhotoButtonPressed:" destination="sMH-tX-FL0" eventType="touchUpInside" id="FAV-YI-e1D"/>
76+
</connections>
77+
</button>
78+
<activityIndicatorView opaque="NO" contentMode="scaleToFill" horizontalHuggingPriority="750" verticalHuggingPriority="750" style="white" translatesAutoresizingMaskIntoConstraints="NO" id="cjX-lu-qYf">
79+
<rect key="frame" x="290" y="290" width="20" height="20"/>
80+
</activityIndicatorView>
81+
</subviews>
82+
<color key="backgroundColor" white="0.0" alpha="1" colorSpace="calibratedWhite"/>
83+
<constraints>
84+
<constraint firstItem="ZCt-vW-MkG" firstAttribute="centerY" secondItem="KlY-dY-OtI" secondAttribute="centerY" constant="150" id="8ZJ-Vb-6Fm"/>
85+
<constraint firstItem="ZCt-vW-MkG" firstAttribute="centerX" secondItem="KlY-dY-OtI" secondAttribute="centerX" id="NAB-FG-Ckl"/>
86+
<constraint firstItem="cjX-lu-qYf" firstAttribute="centerY" secondItem="KlY-dY-OtI" secondAttribute="centerY" id="Z1S-3J-yRy"/>
87+
<constraint firstItem="cjX-lu-qYf" firstAttribute="centerX" secondItem="KlY-dY-OtI" secondAttribute="centerX" id="z2q-AI-6Oj"/>
88+
</constraints>
89+
</view>
90+
<navigationItem key="navigationItem" title="Photos Roulette" id="ePp-fB-Ibl"/>
91+
<connections>
92+
<outlet property="indicatorView" destination="cjX-lu-qYf" id="fAA-Xx-b8f"/>
93+
<outlet property="randomPhotoButton" destination="ZCt-vW-MkG" id="hEG-Lt-r7B"/>
94+
</connections>
95+
</viewController>
96+
<placeholder placeholderIdentifier="IBFirstResponder" id="ZAd-Mh-oVr" userLabel="First Responder" sceneMemberID="firstResponder"/>
97+
</objects>
98+
<point key="canvasLocation" x="2046" y="561"/>
99+
</scene>
100+
<!--Navigation Controller-->
101+
<scene sceneID="Lmp-ZE-iCw">
102+
<objects>
103+
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="Ob0-66-dtL" sceneMemberID="viewController">
104+
<toolbarItems/>
105+
<navigationBar key="navigationBar" contentMode="scaleToFill" id="AUh-j5-MyL">
106+
<rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
107+
<autoresizingMask key="autoresizingMask"/>
108+
</navigationBar>
109+
<nil name="viewControllers"/>
110+
<connections>
111+
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="49C-ux-VTv"/>
112+
</connections>
113+
</navigationController>
114+
<placeholder placeholderIdentifier="IBFirstResponder" id="pZ4-Mf-Pek" userLabel="First Responder" sceneMemberID="firstResponder"/>
115+
</objects>
116+
<point key="canvasLocation" x="579" y="561"/>
40117
</scene>
41118
</scenes>
42119
</document>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
//
2+
// PhotoViewController.h
3+
// DBRoulette
4+
//
5+
// Copyright © 2016 Dropbox. All rights reserved.
6+
//
7+
8+
#import <UIKit/UIKit.h>
9+
10+
@interface PhotoViewController : UIViewController
11+
12+
@end

0 commit comments

Comments
 (0)