├── CHANGELOG ├── README ├── DBChooser.bundle ├── header.png ├── app-icon.png ├── app-icon@2x.png ├── blue_back.png ├── blue_button.png ├── header@2x.png ├── blue_back@2x.png ├── blue_button@2x.png ├── blue_back_pressed.png ├── blue_large_button.png ├── blue_back_pressed@2x.png ├── blue_button_landscape.png ├── blue_button_pressed.png ├── blue_large_button@2x.png ├── blue_button_pressed@2x.png ├── blue_back_button_landscape.png ├── blue_button_landscape@2x.png ├── blue_large_button_pressed.png ├── blue_large_button_pressed@2x.png ├── blue_back_button_landscape@2x.png ├── blue_button_landscape_pressed.png ├── blue_button_landscape_pressed@2x.png ├── blue_back_button_landscape_pressed.png ├── blue_back_button_landscape_pressed@2x.png ├── zh-Hans.lproj │ └── DBChooser.strings ├── zh-Hant.lproj │ └── DBChooser.strings ├── ko.lproj │ └── DBChooser.strings ├── ja.lproj │ └── DBChooser.strings ├── en.lproj │ └── DBChooser.strings ├── id.lproj │ └── DBChooser.strings ├── ms.lproj │ └── DBChooser.strings ├── it.lproj │ └── DBChooser.strings ├── es-ES.lproj │ └── DBChooser.strings ├── es.lproj │ └── DBChooser.strings ├── pt.lproj │ └── DBChooser.strings ├── ru.lproj │ └── DBChooser.strings ├── pl.lproj │ └── DBChooser.strings ├── de.lproj │ └── DBChooser.strings └── fr.lproj │ └── DBChooser.strings ├── DBChooser.framework ├── DBChooser └── Headers │ ├── DBChooserResult.h │ └── DBChooser.h ├── DBChooserExample ├── DBChooserExample │ ├── Default.png │ ├── Default@2x.png │ ├── Default-568h@2x.png │ ├── Localization │ │ ├── de.lproj │ │ │ └── Localizable.strings │ │ ├── en.lproj │ │ │ └── Localizable.strings │ │ ├── es.lproj │ │ │ └── Localizable.strings │ │ ├── fr.lproj │ │ │ └── Localizable.strings │ │ ├── id.lproj │ │ │ └── Localizable.strings │ │ ├── it.lproj │ │ │ └── Localizable.strings │ │ ├── ja.lproj │ │ │ └── Localizable.strings │ │ ├── ko.lproj │ │ │ └── Localizable.strings │ │ ├── ms.lproj │ │ │ └── Localizable.strings │ │ ├── pl.lproj │ │ │ └── Localizable.strings │ │ ├── pt.lproj │ │ │ └── Localizable.strings │ │ ├── ru.lproj │ │ │ └── Localizable.strings │ │ ├── es-ES.lproj │ │ │ └── Localizable.strings │ │ ├── zh-Hans.lproj │ │ │ └── Localizable.strings │ │ └── zh-Hant.lproj │ │ │ └── Localizable.strings │ ├── DBCMainViewController.h │ ├── DBCAppDelegate.h │ ├── DBChooserExample-Prefix.pch │ ├── main.m │ ├── DBCAppDelegate.m │ ├── DBChooserExample-Info.plist │ └── DBCMainViewController.m └── DBChooserExample.xcodeproj │ ├── project.xcworkspace │ └── contents.xcworkspacedata │ └── project.pbxproj ├── DBChooser ├── DBChooser+Private.h ├── DBCLocalization.h ├── DBChooser-Prefix.pch ├── UI │ ├── DBCBlueButton.h │ ├── DBCStyledNavigationController.h │ ├── DBChooserNoDropboxViewController.h │ ├── DBCStyledNavigationController.m │ ├── DBChooserAppearance.h │ ├── DBAppearance.h │ ├── DBCBlueButton.m │ ├── DBCStyledErrorView.h │ ├── DBChooserAppearance.m │ ├── DBAppearance.m │ ├── DBChooserNoDropboxViewController.m │ └── DBCStyledErrorView.m ├── DBCConstants.h ├── DBChooserResult+Private.h ├── DBCConstants.m ├── DBChooserResult.h ├── DBCLocalization.m ├── DBChooserResult.m ├── DBChooser.h └── DBChooser.m ├── DBChooser.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata └── project.pbxproj └── LICENSE /CHANGELOG: -------------------------------------------------------------------------------- 1 | Changes from 1.0 to 1.1 2 | - Updates DBChooser for iOS 7 3 | - Added a CHANGELOG -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | To get started, follow the instructions at https://www.dropbox.com/developers/dropins/chooser/ios -------------------------------------------------------------------------------- /DBChooser.bundle/header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/header.png -------------------------------------------------------------------------------- /DBChooser.bundle/app-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/app-icon.png -------------------------------------------------------------------------------- /DBChooser.framework/DBChooser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.framework/DBChooser -------------------------------------------------------------------------------- /DBChooser.bundle/app-icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/app-icon@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button.png -------------------------------------------------------------------------------- /DBChooser.bundle/header@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/header@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_pressed.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_large_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_large_button.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_pressed@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_landscape.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_pressed.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_large_button@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_large_button@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_pressed@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_button_landscape.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_button_landscape.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_landscape@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_large_button_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_large_button_pressed.png -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooserExample/DBChooserExample/Default.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_large_button_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_large_button_pressed@2x.png -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Default@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooserExample/DBChooserExample/Default@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_button_landscape@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_button_landscape@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_landscape_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_landscape_pressed.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_button_landscape_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_button_landscape_pressed@2x.png -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Default-568h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooserExample/DBChooserExample/Default-568h@2x.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_button_landscape_pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_button_landscape_pressed.png -------------------------------------------------------------------------------- /DBChooser.bundle/blue_back_button_landscape_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dropbox/dropbox-ios-dropins-sdk/master/DBChooser.bundle/blue_back_button_landscape_pressed@2x.png -------------------------------------------------------------------------------- /DBChooser/DBChooser+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooser+Private.h 3 | // DBChooser 4 | // 5 | 6 | /** A generic block type marking the completion of a task */ 7 | typedef void (^DBCBlock)(void); 8 | -------------------------------------------------------------------------------- /DBChooser/DBCLocalization.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCLocalization.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | 8 | extern NSString *DBCLocalizedString(NSString *string, NSString *comment); -------------------------------------------------------------------------------- /DBChooser/DBChooser-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DBChooser' target in the 'DBChooser' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/de.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/es.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/fr.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/id.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/it.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/ja.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/ko.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/ms.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/pl.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/pt.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/ru.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/es-ES.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/Localization/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | /* 2 | Localizable.strings 3 | DBChooserExample 4 | 5 | Created by rich on 6/19/13. 6 | Copyright (c) 2013 Dropbox. All rights reserved. 7 | */ 8 | -------------------------------------------------------------------------------- /DBChooser.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCBlueButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCBlueButton.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | 8 | /** This class allows us to create Dropbox-themed buttons */ 9 | @interface DBCBlueButton : UIButton 10 | @end 11 | -------------------------------------------------------------------------------- /DBChooser/DBCConstants.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCConstants.h 3 | // DBChooser 4 | // 5 | 6 | extern NSString *kDBCProtocol; 7 | extern NSString *kDBCAPIVersion; 8 | 9 | extern NSString *kDBCIPhoneAppStoreURL; 10 | extern NSString *kDBCIPadAppStoreURL; -------------------------------------------------------------------------------- /DBChooser/DBChooserResult+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserResult+Private.h 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooserResult.h" 7 | 8 | @interface DBChooserResult () 9 | 10 | - (id)initWithDictionary:(NSDictionary*)dictionary; 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCStyledNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCStyledNavigationController.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | 8 | /** This class allows us to create Dropbox-themed NavigationControllers */ 9 | @interface DBCStyledNavigationController : UINavigationController 10 | @end 11 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBCMainViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCMainViewController.h 3 | // DBChooser-Example 4 | // 5 | // Created by rich on 6/18/13. 6 | // Copyright (c) 2013 Dropbox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DBCMainViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBCAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBCAppDelegate.h 3 | // DBChooser-Example 4 | // 5 | // Created by rich on 6/18/13. 6 | // Copyright (c) 2013 Dropbox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DBCAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /DBChooser/DBCConstants.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCConstants.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBCConstants.h" 7 | 8 | NSString *kDBCProtocol = @"dbapi-3"; 9 | NSString *kDBCAPIVersion = @"1"; 10 | 11 | NSString *kDBCIPhoneAppStoreURL = @"itms://itunes.apple.com/WebObjects/MZStore.woa/wa/viewSoftware?id=327630330&mt=8&s=143441"; 12 | NSString *kDBCIPadAppStoreURL = @"http://itunes.apple.com/us/app/dropbox/id327630330?mt=8"; 13 | -------------------------------------------------------------------------------- /DBChooser/UI/DBChooserNoDropboxViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserNoDropboxViewController.h 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooser+Private.h" 7 | #import 8 | 9 | /** The is the ViewController for showing a No Dropbox screen that asks the user to install Dropbox */ 10 | @interface DBChooserNoDropboxViewController : UIViewController 11 | 12 | - (id)initWithCompletionBlock:(DBCBlock)done; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCStyledNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCStyledNavigationController.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBCStyledNavigationController.h" 7 | 8 | #import "DBAppearance.h" 9 | 10 | @implementation DBCStyledNavigationController 11 | 12 | + (void)initialize 13 | { 14 | if (self == [DBCStyledNavigationController class]) { 15 | [DBAppearance customizeNavBarForContainer:self]; 16 | } 17 | } 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBChooserExample-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'DBChooser-Example' target in the 'DBChooser-Example' project 3 | // 4 | 5 | #import 6 | 7 | #ifndef __IPHONE_3_0 8 | #warning "This project uses features only available in iOS SDK 3.0 and later." 9 | #endif 10 | 11 | #ifdef __OBJC__ 12 | #import 13 | #import 14 | #endif 15 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DBChooser-Example 4 | // 5 | // Created by rich on 6/18/13. 6 | // Copyright (c) 2013 Dropbox. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "DBCAppDelegate.h" 12 | 13 | int main(int argc, char *argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([DBCAppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /DBChooser/UI/DBChooserAppearance.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBAppearance.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | #import 8 | #import "DBAppearance.h" 9 | 10 | /** This is a container class for all the theming-related code */ 11 | @interface DBChooserAppearance : DBAppearance 12 | 13 | + (UIImage *)noDropboxImage; 14 | 15 | /** Customize all UIButtons of the given class */ 16 | + (void)customizeButton:(Class)cls; 17 | + (void)customizeInstallButton:(UIButton*)btn withWidth:(CGFloat)width; 18 | + (void)customizeTitleLabel:(UILabel*)label; 19 | + (void)customizeSubtitleLabel:(UILabel*)label; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DBChooser/DBChooserResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserResult.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | 8 | @interface DBChooserResult : NSObject 9 | 10 | /** url to the file */ 11 | @property (nonatomic, readonly) NSURL *link; 12 | 13 | /** name of the file */ 14 | @property (nonatomic, readonly) NSString *name; 15 | 16 | /** file size in bytes */ 17 | @property (nonatomic, readonly) long long size; 18 | 19 | /** url to the file icon */ 20 | @property (nonatomic, readonly) NSURL *iconURL; 21 | 22 | /** available thumbnail URLs of this file. key'ed by sizes 23 | (e.g. 64x64, 200x200, 640x480). */ 24 | @property (nonatomic, readonly) NSDictionary *thumbnails; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DBChooser.framework/Headers/DBChooserResult.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserResult.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | 8 | @interface DBChooserResult : NSObject 9 | 10 | /** url to the file */ 11 | @property (nonatomic, readonly) NSURL *link; 12 | 13 | /** name of the file */ 14 | @property (nonatomic, readonly) NSString *name; 15 | 16 | /** file size in bytes */ 17 | @property (nonatomic, readonly) long long size; 18 | 19 | /** url to the file icon */ 20 | @property (nonatomic, readonly) NSURL *iconURL; 21 | 22 | /** available thumbnail URLs of this file. key'ed by sizes 23 | (e.g. 64x64, 200x200, 640x480). */ 24 | @property (nonatomic, readonly) NSDictionary *thumbnails; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DBChooser/UI/DBAppearance.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBAppearance.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | #import 8 | 9 | 10 | #define isIOS7() (NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_6_1) 11 | 12 | 13 | /** This is a container class for all the theming-related code */ 14 | @interface DBAppearance : NSObject 15 | 16 | /** Customize all UINavigationBar contained by the given class */ 17 | + (void)customizeNavBarForContainer:(Class)cls; 18 | 19 | + (UIColor *)dropboxBlue; 20 | + (UIColor *)lightBackgroundColor; 21 | + (UIColor *)darkGrayColor; 22 | + (UIColor *)darkTextColor; 23 | + (UIColor *)lightTextColor; 24 | + (UIColor *)buttonBorderColor; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCBlueButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCBlueButton.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBCBlueButton.h" 7 | 8 | #import "DBChooserAppearance.h" 9 | 10 | @implementation DBCBlueButton 11 | 12 | + (void)initialize 13 | { 14 | if (self == [DBCBlueButton class]) { 15 | [DBChooserAppearance customizeButton:self]; 16 | } 17 | } 18 | 19 | #pragma mark - overriden UIView methods 20 | 21 | - (CGSize)sizeThatFits:(CGSize)size 22 | { 23 | CGSize s = [super sizeThatFits:size]; 24 | if (s.width > 180) { 25 | s.width += 20; // add some padding 26 | } else { 27 | s.width = 200; // min width 28 | } 29 | s.height = 45; // the asset has a static height 30 | return s; 31 | } 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DBChooser/DBCLocalization.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCLocalization.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBCLocalization.h" 7 | 8 | NSBundle *DBChooserStringBundle() { 9 | static NSBundle *bundle = nil; 10 | static dispatch_once_t onceToken; 11 | dispatch_once(&onceToken, ^{ 12 | NSString* path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:@"DBChooser.bundle"]; 13 | bundle = [NSBundle bundleWithPath:path]; 14 | }); 15 | if (!bundle) { 16 | NSLog(@"DBChooser: resource bundle DBChooser.bundle cannot be found!"); 17 | } 18 | return bundle; 19 | } 20 | 21 | NSString *DBCLocalizedString(NSString *string, NSString *comment) { 22 | NSString *localizedString = NSLocalizedStringFromTableInBundle(string, @"DBChooser", DBChooserStringBundle(), comment); 23 | return localizedString ? localizedString : string; 24 | } 25 | -------------------------------------------------------------------------------- /DBChooser.bundle/zh-Hans.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "请安装 Dropbox 应用"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "安装了 Dropbox 之后,您就可以在最喜欢的应用(比如此应用)中访问所有文件了!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "安装 Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "请更新 Dropbox 应用"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "通过新的 Dropbox 应用,您将可以在自己最爱的应用(就像这个!)中访问所有资料。"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "更新 Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "更新"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/zh-Hant.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "請安裝 Dropbox 應用程式"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "只要安裝 Dropbox,您就可以透過您最喜歡的應用程式 (就像這個!),存取您所有的資料。"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "安裝 Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "請更新 Dropbox 應用程式"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "有了新的 Dropbox 應用程式,您就可以透過您最喜歡的應用程式 (就像這個!),存取您所有的資料。"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "更新 Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "更新"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/ko.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Dropbox 앱을 설치하세요."; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Dropbox를 설치하면 자주 사용하는 앱에 있는 모든 파일에 액세스할 수 있습니다."; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Dropbox 설치"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Dropbox 앱을 업데이트하세요."; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "새 Dropbox 앱을 통해 이 앱처럼 즐겨찾는 앱에 있는 모든 자료에 액세스할 수 있습니다."; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Dropbox 업데이트"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "업데이트"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/ja.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Dropbox アプリをインストールしてください"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Dropbox をインストールすれば、お気に入りのアプリから自分のアイテムにアクセスできます!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Dropbox をインストールする"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Dropbox アプリを更新してください"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "新しい Dropbox アプリをお使いになると、こちらのようなお気に入りのアプリにあるすべてのアイテムにアクセスすることができます!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Dropbox の更新"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "更新"; 21 | -------------------------------------------------------------------------------- /DBChooser/DBChooserResult.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserResult.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooserResult.h" 7 | 8 | @implementation DBChooserResult 9 | 10 | - (id)initWithDictionary:(NSDictionary*)dictionary 11 | { 12 | self = [super init]; 13 | if (self) { 14 | _link = [NSURL URLWithString:dictionary[@"link"]]; 15 | _name = dictionary[@"name"]; 16 | _size = [dictionary[@"bytes"] longLongValue]; 17 | _iconURL = [NSURL URLWithString:dictionary[@"icon"]]; 18 | 19 | NSDictionary *thumbnailsStringDict = dictionary[@"thumbnails"]; 20 | NSMutableDictionary *thumbnailsDict = [NSMutableDictionary dictionaryWithCapacity:[thumbnailsStringDict count]]; 21 | [thumbnailsStringDict enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) { 22 | thumbnailsDict[key] = [NSURL URLWithString:obj]; 23 | }]; 24 | _thumbnails = thumbnailsDict; 25 | } 26 | return self; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DBChooser.bundle/en.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Please Install the Dropbox App"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Install Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Please Update the Dropbox App"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Update Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Update"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/id.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Harap instal aplikasi Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Dengan Dropbox yang terinstal, semua file Anda dapat diakses di aplikasi favorit, seperti yang satu ini!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Instal Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Perbarui Aplikasi Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Dengan aplikasi Dropbox yang baru, Anda dapat mengakses semua file pada aplikasi favorit, seperti yang ini!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Perbarui Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Perbarui"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/ms.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Sila pasang apl Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Dengan Dropbox dipasang, anda boleh mengakses semua barang anda dalam apl kegemaran anda, seperti yang ini!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Pasang Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Sila Kemas kini Apl Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Dengan apl Dropbox baru, anda boleh mengakses semua barang anda di dalam apl kegemaran anda, seperti yang ini!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Kemaskini Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Kemaskini"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/it.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Installa l'applicazione Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Con Dropbox installato, puoi accedere a tutti i tuoi file nelle tue applicazioni preferite, come questa."; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Installa Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Aggiorna l'applicazione Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Con la nuova applicazioni Dropbox puoi accedere a tutti i tuoi file nelle tue applicazioni preferite come questa!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Aggiorna Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Aggiorna"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/es-ES.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Instala la aplicación de Dropbox."; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Si instalas Dropbox, podrás acceder a todas tus cosas en tus aplicaciones favoritas... ¡como esta!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Instalar Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Actualiza la aplicación de Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Con la nueva aplicación de Dropbox, podrás acceder a todos tus archivos en tus aplicaciones favoritas, como esta."; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Actualizar Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Actualizar"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/es.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Instala la aplicación de Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Cuando hayas instalado Dropbox, podrás acceder a todos tus archivos en tus aplicaciones favoritas, como esta."; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Instalar Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Actualiza la aplicación de Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Con la nueva aplicación de Dropbox, podrás acceder a todos tus archivos en tus aplicaciones favoritas, como esta."; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Actualizar Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Actualizar"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/pt.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Instale o aplicativo do Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Com o Dropbox instalado você pode acessar todos os seus arquivos em seus aplicativos favoritos, como este!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Instalar Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Atualize o aplicativo do Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Com o novo aplicativo do Dropbox, é possível acessar todos os seus arquivos em seus aplicativos favoritos, como este aqui!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Atualizar Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Atualizar"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/ru.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Пожалуйста, установите приложение Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Приложение Dropbox позволит вам использовать ваши документы во всех ваших любимых приложения! Например, в этом!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Установить Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Пожалуйста, обновите приложение Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Новое приложение Dropbox позволит вам использовать ваши файлы в ваших любимых приложениях, как, например, это!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Обновить Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Обновить"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/pl.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Zainstaluj aplikację Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Mając zainstalowaną aplikację Dropbox, masz dostęp do wszystkich swoich materiałów w ulubionej aplikacji, jak ta!"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Zainstaluj aplikację Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Zaktualizuj aplikację Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Dzięki nowej aplikacji Dropbox możesz mieć dostęp do wszystkich swoich materiałów w ulubionych aplikacjach, jak ta!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Aktualizacja Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Zaktualizuj"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/de.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Bitte installieren Sie die Dropbox-App."; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Wenn Sie Dropbox installieren, können Sie in Ihren Lieblingsapps, wie dieser, auf all Ihre Dateien zugreifen."; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Dropbox installieren"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Aktualisieren Sie die Dropbox-App"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Mit der neuen Dropbox-App können Sie auf all Ihre Dateien in Ihren Lieblings-Apps (wie zum Beispiel dieser) zugreifen!"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Dropbox aktualisieren"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Aktualisieren"; 21 | -------------------------------------------------------------------------------- /DBChooser.bundle/fr.lproj/DBChooser.strings: -------------------------------------------------------------------------------- 1 | /* Call to action telling the user to install the Dropbox app */ 2 | "Please Install the Dropbox App" = "Veuillez installer l'application Dropbox"; 3 | 4 | /* Explanation of why the user should install the Dropbox app */ 5 | "With Dropbox installed, you can access all your stuff in your favorite apps, like this one!" = "Après avoir installé Dropbox, vous pouvez accéder à tous vos fichiers dans vos applications préférées, comme celui-ci !"; 6 | 7 | /* Install the Dropbox app */ 8 | "Install Dropbox" = "Installation de Dropbox"; 9 | 10 | /* Window title (short) */ 11 | "Please Update the Dropbox App" = "Mettez à jour l'application Dropbox"; 12 | 13 | /* Paragraph (no character restrictions) */ 14 | "With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" = "Avec la nouvelle application Dropbox, vous accédez à tous vos fichiers à partir de vos applications favorites, comme celle-ci par exemple !"; 15 | 16 | /* Window title (short) */ 17 | "Update Dropbox" = "Mettre à jour Dropbox"; 18 | 19 | /* Button text (short) */ 20 | "Update" = "Mettre à jour"; 21 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013 Dropbox Inc., http://www.dropbox.com/ 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBCAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCAppDelegate.m 3 | // DBChooser-Example 4 | // 5 | // Created by rich on 6/18/13. 6 | // Copyright (c) 2013 Dropbox. All rights reserved. 7 | // 8 | 9 | #import "DBCAppDelegate.h" 10 | 11 | #import "DBCMainViewController.h" 12 | #import 13 | 14 | @implementation DBCAppDelegate 15 | 16 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 17 | { 18 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 19 | 20 | // Override point for customization after application launch. 21 | 22 | // set our testing view controller as the root 23 | [self.window setRootViewController:[[DBCMainViewController alloc] init]]; 24 | 25 | self.window.backgroundColor = [UIColor whiteColor]; 26 | [self.window makeKeyAndVisible]; 27 | return YES; 28 | } 29 | 30 | - (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation 31 | { 32 | if ([[DBChooser defaultChooser] handleOpenURL:url]) { 33 | // This was a Chooser response and handleOpenURL automatically ran the 34 | // completion block 35 | return YES; 36 | } 37 | return NO; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCStyledErrorView.h: -------------------------------------------------------------------------------- 1 | #import "DBChooser.h" 2 | 3 | // TODO: The DBCStyledErrorView.* files are basically copied from elsewhere. We should try to dedupe 4 | // these files.. 5 | 6 | @class DBCBlueButton; 7 | 8 | @interface DBCStyledErrorView : UIView 9 | 10 | - (id)initWithTitle:(NSString*)title subtitle:(NSString*)subtitle image:(UIImage*)image 11 | buttonTitle:(NSString*)buttonTitle buttonTarget:(id)buttonTarget buttonAction:(SEL)buttonAction 12 | frame:(CGRect)frame; 13 | 14 | @property (nonatomic, retain) NSString *title; 15 | @property (nonatomic, retain) NSString *subtitle; 16 | @property (nonatomic, assign) BOOL buttonEnabled; 17 | @property (nonatomic, assign) UIEdgeInsets edgeInsets; 18 | @property (nonatomic, assign) BOOL loading; 19 | @property (nonatomic, assign) CGFloat padding1PortraitOverride; 20 | @property (nonatomic, assign) CGFloat padding1LandscapeOverride; 21 | @property (nonatomic, assign) CGFloat padding2PortraitOverride; 22 | @property (nonatomic, assign) CGFloat padding2LandscapeOverride; 23 | @property (nonatomic, assign) CGFloat padding3PortraitOverride; 24 | @property (nonatomic, assign) CGFloat padding3LandscapeOverride; 25 | @property (nonatomic, assign) CGFloat topPaddingPortraitOverride; 26 | @property (nonatomic, assign) CGFloat topPaddingLandscapeOverride; 27 | @property (nonatomic, assign) CGFloat bottomPaddingLandscapeOverride; 28 | @property (nonatomic, assign) CGFloat bottomPaddingPortraitOverride; 29 | @property (nonatomic, assign) CGFloat subtitlePaddingOverride; 30 | 31 | @end -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBChooserExample-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | com.dropbox.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleURLTypes 24 | 25 | 26 | CFBundleTypeRole 27 | Editor 28 | CFBundleURLSchemes 29 | 30 | db-bm5irfik7venpom 31 | 32 | 33 | 34 | CFBundleVersion 35 | 1.0 36 | LSRequiresIPhoneOS 37 | 38 | UIRequiredDeviceCapabilities 39 | 40 | armv7 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | UISupportedInterfaceOrientations~ipad 49 | 50 | UIInterfaceOrientationPortrait 51 | UIInterfaceOrientationPortraitUpsideDown 52 | UIInterfaceOrientationLandscapeLeft 53 | UIInterfaceOrientationLandscapeRight 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /DBChooser/UI/DBChooserAppearance.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserAppearance.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooserAppearance.h" 7 | #import 8 | 9 | @implementation DBChooserAppearance 10 | 11 | + (UIImage *)noDropboxImage 12 | { 13 | static UIImage *appIconImage; 14 | if (appIconImage == nil) { 15 | appIconImage = [UIImage imageNamed:@"DBChooser.bundle/app-icon"]; 16 | } 17 | return appIconImage; 18 | } 19 | 20 | + (void)customizeButton:(Class)cls { 21 | if (isIOS7()) { 22 | [[cls appearance] setTitleColor:[self dropboxBlue] forState:UIControlStateNormal]; 23 | return; 24 | } 25 | 26 | UIEdgeInsets buttoninsets = UIEdgeInsetsMake(0, 5, 0, 5); 27 | [[cls appearance] setBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_large_button"] resizableImageWithCapInsets:buttoninsets] 28 | forState:UIControlStateNormal]; 29 | [[cls appearance] setBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_large_button_pressed"] resizableImageWithCapInsets:buttoninsets] 30 | forState:UIControlStateHighlighted]; 31 | } 32 | 33 | + (void)customizeInstallButton:(UIButton*)btn withWidth:(CGFloat)width { 34 | if (isIOS7()) { 35 | [btn setBackgroundColor:[UIColor whiteColor]]; 36 | [btn sizeToFit]; 37 | CGRect frame = btn.frame; 38 | btn.frame = CGRectMake(0, frame.origin.y, width, frame.size.height); 39 | 40 | [btn setAutoresizingMask: UIViewAutoresizingFlexibleWidth]; 41 | 42 | [[btn layer] setBorderWidth:[[UIScreen mainScreen] scale] == 2.00 ? 0.5f : 1.0f]; 43 | [[btn layer] setBorderColor:[self buttonBorderColor].CGColor]; 44 | 45 | return; 46 | } 47 | else { 48 | [btn sizeToFit]; 49 | } 50 | } 51 | 52 | + (void)customizeTitleLabel:(UILabel *)label { 53 | label.textColor = [self darkTextColor]; 54 | if (!isIOS7()) { 55 | label.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]]; 56 | } 57 | } 58 | 59 | 60 | + (void)customizeSubtitleLabel:(UILabel *)label { 61 | if (isIOS7()) { 62 | label.font = [UIFont systemFontOfSize:[UIFont smallSystemFontSize]]; 63 | } 64 | else { 65 | label.font = [UIFont boldSystemFontOfSize:[UIFont smallSystemFontSize]]; 66 | } 67 | } 68 | @end 69 | -------------------------------------------------------------------------------- /DBChooser/DBChooser.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooser.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | #import 8 | #import "DBChooserResult.h" 9 | 10 | /** Block type used for handling results from the Chooser. The results may be nil if the user cancelled 11 | out of the Chooser. Otherwise, this will return an NSArray of DBChooserResults. 12 | */ 13 | typedef void (^DBChooserCompletionBlock)(NSArray *results); 14 | 15 | /** Enum type of the possible link types the app can request for */ 16 | typedef enum { 17 | DBChooserLinkTypePreview, // returns a preview link 18 | DBChooserLinkTypeDirect, // returns a link for downloading the file directly 19 | } DBChooserLinkType; 20 | 21 | /** The DBChooser object is responsible for opening the Chooser interface on the Dropbox app and 22 | handling the results returned from the app. 23 | */ 24 | 25 | @interface DBChooser : NSObject 26 | 27 | /** @name Creating a DBChooser */ 28 | 29 | /** Returns a DBChooser object with your app's app key. Remember to add a URL scheme db-APP_KEY:// to the app's 30 | Info.plist file. You can register your app or find your key at the [apps](https://www.dropbox.com/developers/apps) 31 | page. 32 | NOTE that this class parses your app key from the app's Info.plist's list of URL schemes. If you have multiple 33 | app keys prefixed by "db-", you should initialize your own instance of DBChooser with `initWithAppKey:`. 34 | */ 35 | + (DBChooser*)defaultChooser; 36 | 37 | /** Initializes an instance of DBChooser with the given app key. Make sure to use the same DBChooser instance to invoke 38 | `openChooserForLinkType:` and `handleOpenURL:`. 39 | */ 40 | - (id)initWithAppKey:(NSString*)appKey; 41 | 42 | /** @name Invoking the chooser */ 43 | 44 | /** This method opens the Chooser interface. 45 | @param linkType the linkType specifies the type of link to be returned from the Chooser. 46 | @param topViewController the topmost view controller in your controller hierarchy. 47 | @param completion this is the handler that will be invoked when we returned from the Chooser. 48 | */ 49 | - (void)openChooserForLinkType:(DBChooserLinkType)linkType 50 | fromViewController:(UIViewController *)topViewController 51 | completion:(DBChooserCompletionBlock)blk; 52 | 53 | /** You must call this method in your app delegate's `-application:openURL:sourceApplication:annotation:` 54 | method in order to handle responses from the Dropbox app. 55 | @return YES if the URL is returned from the Dropbox app due to the Chooser flow. 56 | */ 57 | - (BOOL)handleOpenURL:(NSURL *)url; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /DBChooser.framework/Headers/DBChooser.h: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooser.h 3 | // DBChooser 4 | // 5 | 6 | #import 7 | #import 8 | #import "DBChooserResult.h" 9 | 10 | /** Block type used for handling results from the Chooser. The results may be nil if the user cancelled 11 | out of the Chooser. Otherwise, this will return an NSArray of DBChooserResults. 12 | */ 13 | typedef void (^DBChooserCompletionBlock)(NSArray *results); 14 | 15 | /** Enum type of the possible link types the app can request for */ 16 | typedef enum { 17 | DBChooserLinkTypePreview, // returns a preview link 18 | DBChooserLinkTypeDirect, // returns a link for downloading the file directly 19 | } DBChooserLinkType; 20 | 21 | /** The DBChooser object is responsible for opening the Chooser interface on the Dropbox app and 22 | handling the results returned from the app. 23 | */ 24 | 25 | @interface DBChooser : NSObject 26 | 27 | /** @name Creating a DBChooser */ 28 | 29 | /** Returns a DBChooser object with your app's app key. Remember to add a URL scheme db-APP_KEY:// to the app's 30 | Info.plist file. You can register your app or find your key at the [apps](https://www.dropbox.com/developers/apps) 31 | page. 32 | NOTE that this class parses your app key from the app's Info.plist's list of URL schemes. If you have multiple 33 | app keys prefixed by "db-", you should initialize your own instance of DBChooser with `initWithAppKey:`. 34 | */ 35 | + (DBChooser*)defaultChooser; 36 | 37 | /** Initializes an instance of DBChooser with the given app key. Make sure to use the same DBChooser instance to invoke 38 | `openChooserForLinkType:` and `handleOpenURL:`. 39 | */ 40 | - (id)initWithAppKey:(NSString*)appKey; 41 | 42 | /** @name Invoking the chooser */ 43 | 44 | /** This method opens the Chooser interface. 45 | @param linkType the linkType specifies the type of link to be returned from the Chooser. 46 | @param topViewController the topmost view controller in your controller hierarchy. 47 | @param completion this is the handler that will be invoked when we returned from the Chooser. 48 | */ 49 | - (void)openChooserForLinkType:(DBChooserLinkType)linkType 50 | fromViewController:(UIViewController *)topViewController 51 | completion:(DBChooserCompletionBlock)blk; 52 | 53 | /** You must call this method in your app delegate's `-application:openURL:sourceApplication:annotation:` 54 | method in order to handle responses from the Dropbox app. 55 | @return YES if the URL is returned from the Dropbox app due to the Chooser flow. 56 | */ 57 | - (BOOL)handleOpenURL:(NSURL *)url; 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /DBChooser/UI/DBAppearance.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBAppearance.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBAppearance.h" 7 | 8 | @implementation DBAppearance 9 | 10 | static CGFloat NavBarCapWidth = 159; 11 | static CGFloat NavBarCapHeight = 21; 12 | static CGFloat BarButtonCapWidth = 5; 13 | static CGFloat BarButtonCapHeight = 7; 14 | static CGFloat BackBarButtonLeftCap = 15; 15 | static CGFloat BackBarButtonRightCap = 6; 16 | static CGFloat BackBarButtonCapHeight = 0; 17 | 18 | + (void)customizeNavBarForContainer:(Class)cls { 19 | if (isIOS7()) { 20 | [[UINavigationBar appearanceWhenContainedIn:cls, nil] setTintColor:[self dropboxBlue]]; 21 | return; 22 | } 23 | 24 | UIEdgeInsets navInsets = UIEdgeInsetsMake(NavBarCapHeight, NavBarCapWidth, NavBarCapHeight, NavBarCapWidth); 25 | [[UINavigationBar appearanceWhenContainedIn:cls, nil] 26 | setBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/header"] resizableImageWithCapInsets:navInsets] 27 | forBarMetrics:UIBarMetricsDefault]; 28 | UIEdgeInsets button_insets = UIEdgeInsetsMake(BarButtonCapHeight, BarButtonCapWidth, BarButtonCapHeight, BarButtonCapWidth); 29 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 30 | setBackgroundImage:[UIImage imageNamed:@"DBChooser.bundle/blue_button"] 31 | forState:UIControlStateNormal 32 | barMetrics:UIBarMetricsDefault]; 33 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 34 | setBackgroundImage:[UIImage imageNamed:@"DBChooser.bundle/blue_button_pressed"] 35 | forState:UIControlStateHighlighted 36 | barMetrics:UIBarMetricsDefault]; 37 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 38 | setBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_button_landscape"] resizableImageWithCapInsets:button_insets] 39 | forState:UIControlStateNormal 40 | barMetrics:UIBarMetricsLandscapePhone]; 41 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 42 | setBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_button_landscape_pressed"] resizableImageWithCapInsets:button_insets] 43 | forState:UIControlStateHighlighted 44 | barMetrics:UIBarMetricsLandscapePhone]; 45 | 46 | UIEdgeInsets back_insets = UIEdgeInsetsMake(BackBarButtonCapHeight, BackBarButtonLeftCap, BackBarButtonCapHeight, BackBarButtonRightCap); 47 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 48 | setBackButtonBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_back"] resizableImageWithCapInsets:back_insets] 49 | forState:UIControlStateNormal 50 | barMetrics:UIBarMetricsDefault]; 51 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 52 | setBackButtonBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_back_pressed"] resizableImageWithCapInsets:back_insets] 53 | forState:UIControlStateHighlighted 54 | barMetrics:UIBarMetricsDefault]; 55 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 56 | setBackButtonBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_back_button_landscape"] resizableImageWithCapInsets:back_insets] 57 | forState:UIControlStateNormal 58 | barMetrics:UIBarMetricsLandscapePhone]; 59 | [[UIBarButtonItem appearanceWhenContainedIn:[UINavigationBar class], cls, nil] 60 | setBackButtonBackgroundImage:[[UIImage imageNamed:@"DBChooser.bundle/blue_back_button_landscape_pressed"] resizableImageWithCapInsets:back_insets] 61 | forState:UIControlStateHighlighted 62 | barMetrics:UIBarMetricsLandscapePhone]; 63 | 64 | [[UINavigationBar appearance] setTitleTextAttributes:@{ 65 | UITextAttributeTextColor : [UIColor whiteColor], 66 | UITextAttributeTextShadowColor : [[UIColor blackColor] colorWithAlphaComponent:0.9], 67 | UITextAttributeTextShadowOffset : [NSValue valueWithCGSize:CGSizeMake(0, -0.5)] }]; 68 | } 69 | 70 | + (UIColor *)dropboxBlue { 71 | return [UIColor colorWithRed:0 green:126/255.0 blue:230/255.0 alpha:1]; 72 | } 73 | 74 | + (UIColor *)lightBackgroundColor { 75 | if (isIOS7()) { 76 | return [UIColor colorWithRed:240/255.0 green:243/255.0 blue:245/255.0 alpha:1]; 77 | } else { 78 | return [UIColor colorWithRed:244.0/255.0 green:250.0/255.0 blue:255.0/255.0 alpha:1]; 79 | } 80 | } 81 | 82 | + (UIColor *)darkGrayColor { 83 | return [UIColor colorWithRed:61/255.0 green:70/255.0 blue:77/255.0 alpha:1]; 84 | } 85 | 86 | + (UIColor *)lightTextColor { 87 | if (isIOS7()) { 88 | return [UIColor colorWithRed:123/255.0 green:137/255.0 blue:148/255.0 alpha:1]; 89 | } else { 90 | return [UIColor grayColor]; 91 | } 92 | } 93 | 94 | + (UIColor *)darkTextColor { 95 | if (isIOS7()) { 96 | return [DBAppearance darkGrayColor]; 97 | } else { 98 | return [UIColor blackColor]; 99 | } 100 | } 101 | 102 | + (UIColor *)buttonBorderColor { 103 | return [UIColor colorWithRed:0.784 green:0.78 blue:0.8 alpha:1]; /*#c8c7cc*/ 104 | } 105 | 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /DBChooser/UI/DBChooserNoDropboxViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooserNoDropboxViewController.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooserNoDropboxViewController.h" 7 | 8 | #import "DBCConstants.h" 9 | #import "DBChooserAppearance.h" 10 | #import "DBCLocalization.h" 11 | #import "DBCStyledErrorView.h" 12 | 13 | static const CGFloat sNoDropboxViewPadding1Portrait = 54; 14 | static const CGFloat sNoDropboxViewPadding2Portrait = 12; 15 | static const CGFloat sNoDropboxViewPadding3Portrait = 37; 16 | static const CGFloat sNoDropboxViewPadding1Landscape = 18; 17 | static const CGFloat sNoDropboxViewPadding2Landscape = 9; 18 | static const CGFloat sNoDropboxViewPadding3Landscape = 12; 19 | static const CGFloat sNoDropboxViewPadding1Pad = 64; 20 | static const CGFloat sNoDropboxViewPadding2Pad = 12; 21 | static const CGFloat sNoDropboxViewPadding3Pad = 24; 22 | static const CGFloat sNoDropboxViewBottomPaddingPad = 36; 23 | static const CGFloat sNoDropboxViewBottomPaddingPhone = 24; 24 | static const CGFloat sNoDropboxViewSubtitlePaddingPad = 160; 25 | 26 | @implementation DBChooserNoDropboxViewController 27 | { 28 | DBCBlock _completionBlock; 29 | } 30 | 31 | #pragma mark - lifecycle 32 | 33 | - (id)initWithCompletionBlock:(DBCBlock)done 34 | { 35 | self = [super init]; 36 | if (isIOS7()) { 37 | self.edgesForExtendedLayout = UIRectEdgeNone; 38 | } 39 | 40 | if (self) { 41 | _completionBlock = done; 42 | [self setTitle:DBCLocalizedString(@"Dropbox", @"")]; 43 | 44 | UIBarButtonItem *cancelItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemCancel 45 | target:self action:@selector(dbc_didPressCancel:)]; 46 | self.navigationItem.leftBarButtonItem = cancelItem; 47 | [[self navigationController] setNavigationBarHidden:NO animated:NO]; 48 | } 49 | return self; 50 | } 51 | 52 | #pragma mark - overriden UIViewController methods 53 | 54 | - (void)viewDidLoad 55 | { 56 | [[self view] addSubview:[self dbc_noDropboxView]]; 57 | } 58 | 59 | #pragma mark - event handling 60 | 61 | - (void)dbc_didPressCancel:(id)sender 62 | { 63 | [self dbc_finished]; 64 | } 65 | 66 | - (void)dbc_didPressInstall:(id)sender 67 | { 68 | NSString *appStoreURLString = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? 69 | kDBCIPadAppStoreURL : kDBCIPhoneAppStoreURL; 70 | [[UIApplication sharedApplication] openURL:[NSURL URLWithString:appStoreURLString]]; 71 | [self dbc_finished]; 72 | } 73 | 74 | - (void)dbc_finished 75 | { 76 | if (_completionBlock) { 77 | _completionBlock(); 78 | _completionBlock = nil; 79 | } 80 | } 81 | 82 | #pragma mark - private methods 83 | 84 | - (UIView*)dbc_noDropboxView 85 | { 86 | NSString *errorTitle = DBCLocalizedString(@"Please Install the Dropbox App", @""); 87 | NSString *errorSubtitle = DBCLocalizedString(@"With Dropbox installed, you can access all your stuff in your favorite apps, like this one!", @""); 88 | NSString *buttonTitle = DBCLocalizedString(@"Install Dropbox", @""); 89 | 90 | // check if user has some old version of Dropbox installed. If so, ask to "update" instead of "install". 91 | if ([[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:@"dbapi-1://chooser"]]) { 92 | errorTitle = DBCLocalizedString(@"Please Update the Dropbox App", @""); 93 | errorSubtitle = DBCLocalizedString(@"With the new Dropbox app, you can access all your stuff in your favorite apps, like this one!" , @""); 94 | buttonTitle = DBCLocalizedString(@"Update Dropbox", @""); 95 | } 96 | 97 | DBCStyledErrorView *noDropboxView = [[DBCStyledErrorView alloc] 98 | initWithTitle:errorTitle subtitle:errorSubtitle 99 | image:[DBChooserAppearance noDropboxImage] 100 | buttonTitle:buttonTitle 101 | buttonTarget:self 102 | buttonAction:@selector(dbc_didPressInstall:) 103 | frame:self.view.bounds]; 104 | [noDropboxView setBottomPaddingPortraitOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewBottomPaddingPad : sNoDropboxViewBottomPaddingPhone]; 105 | [noDropboxView setBottomPaddingLandscapeOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewBottomPaddingPad : sNoDropboxViewBottomPaddingPhone]; 106 | [noDropboxView setPadding1PortraitOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding1Pad : sNoDropboxViewPadding1Portrait]; 107 | [noDropboxView setPadding1LandscapeOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding1Pad : sNoDropboxViewPadding1Landscape]; 108 | [noDropboxView setPadding2PortraitOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding2Pad : sNoDropboxViewPadding2Portrait]; 109 | [noDropboxView setPadding2LandscapeOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding2Pad : sNoDropboxViewPadding2Landscape]; 110 | [noDropboxView setPadding3PortraitOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding3Pad : sNoDropboxViewPadding3Portrait]; 111 | [noDropboxView setPadding3LandscapeOverride:(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) ? sNoDropboxViewPadding3Pad : sNoDropboxViewPadding3Landscape]; 112 | 113 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 114 | [noDropboxView setSubtitlePaddingOverride:sNoDropboxViewSubtitlePaddingPad]; 115 | } 116 | 117 | [noDropboxView setAutoresizingMask: UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight]; 118 | 119 | [noDropboxView setBackgroundColor:[DBAppearance lightBackgroundColor]]; 120 | return noDropboxView; 121 | } 122 | 123 | @end 124 | -------------------------------------------------------------------------------- /DBChooser/DBChooser.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBChooser.m 3 | // DBChooser 4 | // 5 | 6 | #import "DBChooser.h" 7 | 8 | #import "DBChooserResult+Private.h" 9 | #import "DBCConstants.h" 10 | #import "DBChooserNoDropboxViewController.h" 11 | #import "DBCStyledNavigationController.h" 12 | 13 | @implementation DBChooser 14 | { 15 | NSString *_appKey; 16 | DBChooserCompletionBlock _completionBlock; 17 | UIView *_noDropboxInstalledView; 18 | } 19 | 20 | #pragma mark - lifecycle 21 | 22 | - (id)init 23 | { 24 | NSAssert(NO, @"Please do not initialize DBChooser directly. Use [DBChooser defaultChooser] instead."); 25 | assert(NO); 26 | } 27 | 28 | - (id)initWithAppKey:(NSString*)appKey 29 | { 30 | self = [super init]; 31 | if (self) { 32 | _appKey = [appKey copy]; 33 | } 34 | return self; 35 | } 36 | 37 | #pragma mark - public class methods 38 | 39 | + (DBChooser*)defaultChooser 40 | { 41 | static DBChooser *defaultChooser = nil;; 42 | static dispatch_once_t onceToken; 43 | dispatch_once(&onceToken, ^{ 44 | NSString *appKey = [self dbc_appKeyFromInfoPlist]; 45 | NSAssert(appKey, @"DBChooser: no Dropbox url scheme found in Info.plist!"); 46 | defaultChooser = [[DBChooser alloc] initWithAppKey:appKey]; 47 | }); 48 | return defaultChooser; 49 | } 50 | 51 | #pragma mark - public methods 52 | 53 | - (void)openChooserForLinkType:(DBChooserLinkType)linkType 54 | fromViewController:(UIViewController *)topViewController 55 | completion:(DBChooserCompletionBlock)blk 56 | { 57 | _completionBlock = blk; // save the block into the Chooser object 58 | 59 | NSURL *chooserURL = [[self class] dbc_chooserURLForAppKey:_appKey linkType:linkType]; 60 | if ([[UIApplication sharedApplication] canOpenURL:chooserURL]) { 61 | [[UIApplication sharedApplication] openURL:chooserURL]; 62 | } else { 63 | [self dbc_openNoDropboxInstalledViewFromViewController:topViewController]; 64 | } 65 | } 66 | 67 | - (BOOL)handleOpenURL:(NSURL *)url 68 | { 69 | BOOL handled = NO; 70 | if (_completionBlock) { 71 | NSArray *components = [[url path] pathComponents]; 72 | NSString *methodName = [components count] > 1 ? [components objectAtIndex:1] : nil; 73 | if ([methodName isEqual:@"chooser"]) { 74 | NSDictionary *params = [[self class] dbc_dictionaryFromQueryString:[url query]]; 75 | NSArray *files = [[self class] dbc_parseFilesJson:params[@"files"]]; 76 | 77 | [self dbc_completedWithResult:files]; 78 | handled = YES; // handled a Chooser URL 79 | } else { 80 | // app got opened by something else. in other words, the Chooser flow got interrupted. 81 | [self dbc_completedWithResult:nil]; 82 | } 83 | } 84 | return handled; 85 | } 86 | 87 | #pragma mark - private methods 88 | 89 | + (NSURL*)dbc_chooserURLForAppKey:(NSString*)appKey linkType:(DBChooserLinkType)linkType 90 | { 91 | NSString *baseURL = [NSString stringWithFormat:@"%@://%@/chooser", kDBCProtocol, kDBCAPIVersion]; 92 | NSString *linkTypeString = [[self class] dbc_getLinkTypeString:linkType]; 93 | 94 | return [NSURL URLWithString:[NSString stringWithFormat:@"%@?k=%@&linkType=%@", baseURL, appKey, linkTypeString]]; 95 | } 96 | 97 | + (NSString*)dbc_getLinkTypeString:(DBChooserLinkType)linkType 98 | { 99 | switch (linkType) { 100 | case DBChooserLinkTypeDirect: 101 | return @"direct"; 102 | case DBChooserLinkTypePreview: 103 | return @"preview"; 104 | default: 105 | assert(NO); // unknown link type 106 | } 107 | } 108 | 109 | + (NSDictionary*)dbc_dictionaryFromQueryString:(NSString*)queryString 110 | { 111 | NSMutableDictionary *params = [NSMutableDictionary dictionary]; 112 | for (NSString *pair in [queryString componentsSeparatedByString:@"&"]) { 113 | NSArray *kv = [pair componentsSeparatedByString:@"="]; 114 | if ([kv count] == 2) { 115 | params[kv[0]] = [kv[1] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; 116 | } 117 | } 118 | return params; 119 | } 120 | 121 | + (NSArray*)dbc_parseFilesJson:(NSString*)filesJson 122 | { 123 | if ([filesJson length]) { 124 | NSArray *filesJsonDict = [NSJSONSerialization JSONObjectWithData:[filesJson dataUsingEncoding:NSUTF8StringEncoding] 125 | options:0 error:nil]; 126 | NSMutableArray *results = [NSMutableArray arrayWithCapacity:[filesJsonDict count]]; 127 | for (NSDictionary *fileJson in filesJsonDict) { 128 | DBChooserResult *result = [[DBChooserResult alloc] initWithDictionary:fileJson]; 129 | [results addObject:result]; 130 | } 131 | return results; 132 | } else { 133 | return nil; 134 | } 135 | } 136 | 137 | // look for an app key in the info plist (the app should have a url scheme that looks like "db-(appkey)://" 138 | + (NSString*)dbc_appKeyFromInfoPlist 139 | { 140 | NSDictionary *loadedPlist = [[NSBundle mainBundle] infoDictionary]; 141 | NSArray *urlTypes = loadedPlist[@"CFBundleURLTypes"]; 142 | 143 | NSString *appKey = nil; 144 | for (NSDictionary *urlType in urlTypes) { 145 | NSArray *schemes = urlType[@"CFBundleURLSchemes"]; 146 | for (NSString *scheme in schemes) { 147 | if ([scheme hasPrefix:@"db-"]) { 148 | if (!appKey) { 149 | appKey = [scheme substringFromIndex:3]; // substring after "db-" 150 | } else { 151 | NSAssert(NO, @"DBChooser: WARNING multiple Dropbox url schemes found in Info.plist. Please use the method -initWithAppKey: instead."); 152 | } 153 | } 154 | } 155 | } 156 | return appKey; 157 | } 158 | 159 | - (void)dbc_openNoDropboxInstalledViewFromViewController:(UIViewController*)topViewController 160 | { 161 | __weak UIViewController *weakTopVC = topViewController; 162 | __weak DBChooser *weakSelf = self; 163 | DBChooserNoDropboxViewController *c = [[DBChooserNoDropboxViewController alloc] initWithCompletionBlock:^{ 164 | [weakTopVC dismissViewControllerAnimated:YES completion:^{ 165 | [weakSelf dbc_completedWithResult:nil]; 166 | }]; 167 | }]; 168 | UINavigationController *noDropboxModal = [[DBCStyledNavigationController alloc] initWithRootViewController:c]; 169 | 170 | if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { 171 | noDropboxModal.modalPresentationStyle = UIModalPresentationFormSheet; 172 | } 173 | 174 | [topViewController presentModalViewController:noDropboxModal animated:YES]; 175 | } 176 | 177 | - (void)dbc_completedWithResult:(NSArray*)results 178 | { 179 | if (_completionBlock) { 180 | _completionBlock(results); 181 | _completionBlock = nil; 182 | } 183 | } 184 | 185 | @end 186 | -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample/DBCMainViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // DBCMainViewController.m 3 | // DBChooser-Example 4 | // 5 | // Created by rich on 6/18/13. 6 | // Copyright (c) 2013 Dropbox. All rights reserved. 7 | // 8 | 9 | #import "DBCMainViewController.h" 10 | 11 | #import 12 | #import 13 | 14 | enum { 15 | DBCSectionIndexLinkType = 0, // section for choosing link type 16 | DBCSectionIndexOpener, // section for opening the Chooser 17 | DBCSectionIndexResult, // section for displaying information returned 18 | DBCSectionCount, 19 | } DBSectionIndex; 20 | 21 | enum { 22 | DBCLinkTypeRowIndexPreview = 0, 23 | DBCLinkTypeRowIndexDirect, 24 | DBCLinkTypeRowCount, 25 | } DBCLinkTypeRowIndex; 26 | 27 | enum { 28 | DBCResultRowIndexLink = 0, 29 | DBCResultRowIndexName, 30 | DBCResultRowIndexSize, 31 | DBCResultRowIndexIconURL, 32 | DBCResultRowIndexThumbnail64, 33 | DBCResultRowIndexThumbnail200, 34 | DBCResultRowIndexThumbnail640, 35 | DBCResultRowCount, 36 | } DBCResultRowIndex; 37 | 38 | @implementation DBCMainViewController 39 | { 40 | NSUInteger _linkTypeIndex; 41 | DBChooserResult *_result; // result received from last CHooser call 42 | } 43 | 44 | #pragma mark - lifecycle 45 | 46 | - (id)init 47 | { 48 | return [super initWithStyle:UITableViewStyleGrouped]; 49 | } 50 | 51 | #pragma mark - overriden UITableViewController methods 52 | 53 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView 54 | { 55 | return _result ? DBCSectionCount : DBCSectionCount - 1; 56 | } 57 | 58 | - (NSString*)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section 59 | { 60 | switch (section) { 61 | case DBCSectionIndexLinkType: 62 | return @"Link Type"; 63 | default: 64 | return nil; 65 | } 66 | } 67 | 68 | - (NSString*)tableView:(UITableView *)tableView titleForFooterInSection:(NSInteger)section 69 | { 70 | switch (section) { 71 | case DBCSectionIndexLinkType: 72 | return @"\"Direct\" provides a link pointing directly to the file, while \"Preview\" links to a page showing a preview of the file."; 73 | default: 74 | return nil; 75 | } 76 | } 77 | 78 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 79 | { 80 | switch (section) { 81 | case DBCSectionIndexLinkType: 82 | return DBCLinkTypeRowCount; 83 | case DBCSectionIndexOpener: 84 | return 1; 85 | case DBCSectionIndexResult: 86 | return DBCResultRowCount; 87 | } 88 | return 1; 89 | } 90 | 91 | - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 92 | { 93 | switch (indexPath.section) { 94 | case DBCSectionIndexLinkType: 95 | return [self dbc_cellForLinkTypeRow:indexPath.row]; 96 | case DBCSectionIndexOpener: 97 | return [self dbc_cellForOpenerRow:indexPath.row]; 98 | case DBCSectionIndexResult: 99 | return [self dbc_cellForResultRow:indexPath.row]; 100 | default: 101 | assert(NO); 102 | } 103 | } 104 | 105 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 106 | { 107 | switch (indexPath.section) { 108 | case DBCSectionIndexLinkType: 109 | { 110 | [self dbc_didSelectLinkTypeRow:indexPath.row]; 111 | } 112 | break; 113 | case DBCSectionIndexOpener: 114 | { 115 | [self didPressChoose]; 116 | } 117 | break; 118 | case DBCSectionIndexResult: 119 | { 120 | [self dbc_didSelectResultRow:indexPath.row]; 121 | } 122 | break; 123 | } 124 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 125 | } 126 | 127 | #pragma mark - private methods 128 | 129 | #pragma mark cell management 130 | 131 | - (UITableViewCell*)dbc_standardCellWithStyle:(UITableViewCellStyle)style 132 | { 133 | NSString *reuseId = [NSString stringWithFormat:@"Cell-%d", style]; 134 | UITableViewCell *cell = [self.tableView dequeueReusableCellWithIdentifier:reuseId]; 135 | if (!cell) { 136 | cell = [[UITableViewCell alloc] initWithStyle:style reuseIdentifier:reuseId]; 137 | } 138 | 139 | [cell setAccessoryType:UITableViewCellAccessoryNone]; 140 | [[cell textLabel] setAdjustsFontSizeToFitWidth:YES]; 141 | [[cell detailTextLabel] setFont:[UIFont systemFontOfSize:10]]; 142 | return cell; 143 | } 144 | 145 | - (UITableViewCell*)dbc_cellForLinkTypeRow:(NSInteger)row 146 | { 147 | UITableViewCell *cell = [self dbc_standardCellWithStyle:UITableViewCellStyleDefault]; 148 | switch (row) { 149 | case DBCLinkTypeRowIndexPreview: 150 | [[cell textLabel] setText:@"Preview"]; 151 | break; 152 | case DBCLinkTypeRowIndexDirect: 153 | [[cell textLabel] setText:@"Direct"]; 154 | break; 155 | } 156 | if (row == _linkTypeIndex) { 157 | [cell setAccessoryType:UITableViewCellAccessoryCheckmark]; 158 | } 159 | return cell; 160 | } 161 | 162 | - (UITableViewCell*)dbc_cellForOpenerRow:(NSInteger)row 163 | { 164 | UITableViewCell *cell = [self dbc_standardCellWithStyle:UITableViewCellStyleDefault]; 165 | [[cell textLabel] setText:@"Open Chooser"]; 166 | [[cell textLabel] setTextAlignment:UITextAlignmentCenter]; 167 | return cell; 168 | } 169 | 170 | - (UITableViewCell*)dbc_cellForResultRow:(NSInteger)row 171 | { 172 | UITableViewCell *cell = [self dbc_standardCellWithStyle:UITableViewCellStyleValue2]; 173 | switch (row) { 174 | case DBCResultRowIndexLink: 175 | [[cell textLabel] setText:@"Link"]; 176 | [[cell detailTextLabel] setText:[[_result link] absoluteString]]; 177 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 178 | break; 179 | case DBCResultRowIndexName: 180 | [[cell textLabel] setText:@"Name"]; 181 | [[cell detailTextLabel] setText:[_result name]]; 182 | break; 183 | case DBCResultRowIndexSize: 184 | [[cell textLabel] setText:@"Size"]; 185 | [[cell detailTextLabel] setText:[NSString stringWithFormat:@"%lld", [_result size]]]; 186 | break; 187 | case DBCResultRowIndexIconURL: 188 | [[cell textLabel] setText:@"Icon"]; 189 | [[cell detailTextLabel] setText:[[_result iconURL] absoluteString]]; 190 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 191 | break; 192 | case DBCResultRowIndexThumbnail64: 193 | [[cell textLabel] setText:@"Thumb (64x64)"]; 194 | [[cell detailTextLabel] setText:[[_result thumbnails][@"64x64"] absoluteString]]; 195 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 196 | break; 197 | case DBCResultRowIndexThumbnail200: 198 | [[cell textLabel] setText:@"Thumb (200x200)"]; 199 | [[cell detailTextLabel] setText:[[_result thumbnails][@"200x200"] absoluteString]]; 200 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 201 | break; 202 | case DBCResultRowIndexThumbnail640: 203 | [[cell textLabel] setText:@"Thumb (640x480)"]; 204 | [[cell detailTextLabel] setText:[[_result thumbnails][@"640x480"] absoluteString]]; 205 | [cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator]; 206 | break; 207 | } 208 | return cell; 209 | } 210 | 211 | #pragma mark actions 212 | 213 | - (void)dbc_didSelectLinkTypeRow:(NSInteger)row 214 | { 215 | _linkTypeIndex = row; 216 | [[self tableView] reloadSections:[NSIndexSet indexSetWithIndex:DBCSectionIndexLinkType] 217 | withRowAnimation:UITableViewRowAnimationAutomatic]; 218 | } 219 | 220 | - (void)didPressChoose 221 | { 222 | DBChooserLinkType linkType = (_linkTypeIndex == DBCLinkTypeRowIndexDirect) ? 223 | DBChooserLinkTypeDirect : DBChooserLinkTypePreview; 224 | [[DBChooser defaultChooser] openChooserForLinkType:linkType fromViewController:self 225 | completion:^(NSArray *results) 226 | { 227 | if ([results count]) { 228 | _result = results[0]; 229 | } else { 230 | _result = nil; 231 | [[[UIAlertView alloc] initWithTitle:@"CANCELLED" message:@"user cancelled!" 232 | delegate:nil cancelButtonTitle:@"Okay" otherButtonTitles:nil] 233 | show]; 234 | } 235 | [[self tableView] reloadData]; 236 | }]; 237 | } 238 | 239 | - (void)dbc_didSelectResultRow:(NSInteger)row 240 | { 241 | switch (row) { 242 | case DBCResultRowIndexLink: 243 | [[UIApplication sharedApplication] openURL:[_result link]]; 244 | break; 245 | case DBCResultRowIndexIconURL: 246 | [[UIApplication sharedApplication] openURL:[_result iconURL]]; 247 | break; 248 | case DBCResultRowIndexThumbnail64: 249 | [[UIApplication sharedApplication] openURL:[_result thumbnails][@"64x64"]]; 250 | break; 251 | case DBCResultRowIndexThumbnail200: 252 | [[UIApplication sharedApplication] openURL:[_result thumbnails][@"200x200"]]; 253 | break; 254 | case DBCResultRowIndexThumbnail640: 255 | [[UIApplication sharedApplication] openURL:[_result thumbnails][@"640x480"]]; 256 | break; 257 | } 258 | } 259 | 260 | @end 261 | -------------------------------------------------------------------------------- /DBChooser/UI/DBCStyledErrorView.m: -------------------------------------------------------------------------------- 1 | #import "DBCStyledErrorView.h" 2 | #import "DBChooserAppearance.h" 3 | #import "DBCBlueButton.h" 4 | 5 | /////////////////////////////////////////////////////////////////////////////////////////////////// 6 | 7 | static CGFloat kVPadding1 = 14; 8 | static CGFloat kVPadding2 = 7; 9 | static CGFloat kVPadding3 = 14; 10 | static CGFloat kTopPaddingPortrait = 10; 11 | static CGFloat kTopPaddingLandscape = 50; 12 | static CGFloat KBottomPadding = 14; 13 | static CGFloat kSubtitleWidthPadding = 40; 14 | static CGFloat kTitleWidthPadding = 20; 15 | 16 | /* This is a hack to make the button act the same in 3.1 as it does in 4.* */ 17 | @interface DBCStyledErrorViewButton : UIButton { } 18 | @end 19 | 20 | @implementation DBCStyledErrorViewButton 21 | 22 | - (void)layoutSubviews { 23 | [super layoutSubviews]; 24 | self.imageView.frame = self.bounds; 25 | } 26 | 27 | @end 28 | 29 | 30 | @implementation DBCStyledErrorView { 31 | 32 | UIButton* _button; 33 | UILabel* _titleView; 34 | UILabel* _subtitleView; 35 | UIEdgeInsets edgeInsets; 36 | UIActivityIndicatorView *activityIndicator; 37 | 38 | // TODO: this is added on top of StyledErrorView 39 | DBCBlueButton* _bottomButton; 40 | } 41 | @synthesize edgeInsets; 42 | @synthesize padding1PortraitOverride; 43 | @synthesize padding1LandscapeOverride; 44 | @synthesize padding2PortraitOverride; 45 | @synthesize padding2LandscapeOverride; 46 | @synthesize padding3PortraitOverride; 47 | @synthesize padding3LandscapeOverride; 48 | @synthesize topPaddingPortraitOverride; 49 | @synthesize topPaddingLandscapeOverride; 50 | @synthesize bottomPaddingPortraitOverride; 51 | @synthesize bottomPaddingLandscapeOverride; 52 | @synthesize subtitlePaddingOverride; 53 | 54 | - (id)initWithTitle:(NSString*)title subtitle:(NSString*)subtitle image:(UIImage*)image 55 | buttonTitle:(NSString*)buttonTitle buttonTarget:(id)buttonTarget buttonAction:(SEL)buttonAction 56 | frame:(CGRect)frame 57 | { 58 | if ((self = [super initWithFrame:frame])) { 59 | self.backgroundColor = [UIColor colorWithRed:244.0/255.0 green:250.0/255.0 blue:255.0/255.0 alpha:1]; 60 | _button = [DBCStyledErrorViewButton buttonWithType: UIButtonTypeCustom]; 61 | _button.imageView.contentMode = UIViewContentModeScaleAspectFit; 62 | [_button sizeToFit]; 63 | [self addSubview: _button]; 64 | 65 | _titleView = [[UILabel alloc] initWithFrame:CGRectZero]; 66 | _titleView.backgroundColor = [UIColor clearColor]; 67 | _titleView.textColor = [UIColor colorWithRed:52.0/255.0 green:64.0/255.0 blue:93.0/255.0 alpha:1]; 68 | _titleView.textAlignment = NSTextAlignmentCenter; 69 | _titleView.numberOfLines = 0; 70 | [DBChooserAppearance customizeTitleLabel:_titleView]; 71 | [self addSubview:_titleView]; 72 | 73 | _subtitleView = [[UILabel alloc] initWithFrame:CGRectZero]; 74 | _subtitleView.backgroundColor = [UIColor clearColor]; 75 | _subtitleView.textColor = [UIColor colorWithRed:124.0/255.0 green:135.0/255.0 blue:160.0/255.0 alpha:1]; 76 | _subtitleView.textAlignment = NSTextAlignmentCenter; 77 | _subtitleView.numberOfLines = 0; 78 | [DBChooserAppearance customizeSubtitleLabel:_subtitleView]; 79 | [self addSubview:_subtitleView]; 80 | 81 | if (buttonTitle) { 82 | _bottomButton = [[DBCBlueButton alloc] initWithFrame:CGRectZero]; 83 | [_bottomButton setTitle:buttonTitle forState:UIControlStateNormal]; 84 | 85 | [DBChooserAppearance customizeInstallButton:_bottomButton withWidth:frame.size.width]; 86 | 87 | [self addSubview:_bottomButton]; 88 | 89 | [_bottomButton addTarget:buttonTarget action:buttonAction forControlEvents:UIControlEventTouchUpInside]; 90 | } 91 | 92 | _titleView.text = title; 93 | [_titleView sizeToFit]; 94 | 95 | _subtitleView.text = subtitle; 96 | [_subtitleView sizeToFit]; 97 | 98 | [_button setImage:image forState:UIControlStateNormal]; 99 | [_button sizeToFit]; 100 | // set target for button 101 | _button.userInteractionEnabled = NO; 102 | 103 | [self setPadding1PortraitOverride:kVPadding1]; 104 | [self setPadding2PortraitOverride:kVPadding2]; 105 | [self setPadding3PortraitOverride:kVPadding3]; 106 | [self setPadding1LandscapeOverride:kVPadding1]; 107 | [self setPadding2LandscapeOverride:kVPadding2]; 108 | [self setPadding3LandscapeOverride:kVPadding3]; 109 | [self setTopPaddingPortraitOverride:kTopPaddingPortrait]; 110 | [self setTopPaddingLandscapeOverride:kTopPaddingLandscape]; 111 | [self setBottomPaddingPortraitOverride:KBottomPadding]; 112 | [self setBottomPaddingLandscapeOverride:KBottomPadding]; 113 | [self setSubtitlePaddingOverride:kSubtitleWidthPadding]; 114 | } 115 | return self; 116 | } 117 | 118 | - (void)layoutSubviews { 119 | CGRect tFrame = _titleView.frame; 120 | tFrame.size.width = self.frame.size.width - kTitleWidthPadding; 121 | _titleView.frame = tFrame; 122 | [_titleView sizeToFit]; 123 | CGRect sFrame = _subtitleView.frame; 124 | sFrame.size.width = self.frame.size.width - [self subtitlePaddingOverride]; 125 | _subtitleView.frame = sFrame; 126 | [_subtitleView sizeToFit]; 127 | 128 | BOOL isPortrait = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation]); 129 | CGFloat titlePadding = isPortrait ? [self padding1PortraitOverride] : [self padding1LandscapeOverride]; 130 | CGFloat postTitleViewPadding = isPortrait ? [self padding2PortraitOverride] : [self padding2LandscapeOverride]; 131 | CGFloat postSubtitleViewPadding = isPortrait ? [self padding3PortraitOverride] : [self padding3LandscapeOverride]; 132 | CGFloat bottomPadding = isPortrait ? [self bottomPaddingPortraitOverride] : [self bottomPaddingLandscapeOverride]; 133 | UIEdgeInsets contentInsets = UIEdgeInsetsMake(edgeInsets.top + isPortrait ? [self topPaddingPortraitOverride] : [self topPaddingLandscapeOverride], 0, edgeInsets.bottom + bottomPadding, 0); 134 | 135 | 136 | CGRect contentBounds = UIEdgeInsetsInsetRect(self.bounds, contentInsets); 137 | CGSize imageSize = [_button imageForState:UIControlStateNormal].size; 138 | 139 | CGFloat totalHeight = imageSize.height; 140 | 141 | if (_titleView.text.length) { 142 | totalHeight += (totalHeight ? titlePadding : 0) + _titleView.frame.size.height; 143 | } 144 | if (_subtitleView.text) { 145 | totalHeight += (totalHeight ? postTitleViewPadding : 0) + _subtitleView.frame.size.height; 146 | } 147 | if (_bottomButton) { 148 | totalHeight += (totalHeight ? postSubtitleViewPadding : 0) + _bottomButton.frame.size.height; 149 | } 150 | 151 | if (totalHeight > contentBounds.size.height) { 152 | // Tighten up spacing in landscape on iPhone and leave more space for the image 153 | titlePadding -= 8; 154 | postTitleViewPadding -= 2; 155 | totalHeight -= 10; 156 | 157 | // Make image small enough so everything just fits 158 | imageSize.height -= (totalHeight - contentBounds.size.height); 159 | CGRect buttonFrame = _button.frame; 160 | buttonFrame.size = imageSize; 161 | _button.frame = buttonFrame; 162 | totalHeight = contentBounds.size.height; 163 | } else { 164 | [_button sizeToFit]; 165 | } 166 | 167 | CGFloat top = 70; 168 | 169 | CGRect bFrame = _button.frame; 170 | bFrame.origin = CGPointMake(floor(self.frame.size.width/2 - _button.frame.size.width/2), top); 171 | _button.frame = bFrame; 172 | 173 | top += _button.frame.size.height; 174 | top += titlePadding; 175 | 176 | if (_titleView.text.length) { 177 | CGRect tiFrame = _titleView.frame; 178 | tiFrame.origin = CGPointMake(floor(self.frame.size.width/2 - _titleView.frame.size.width/2), top); 179 | _titleView.frame = tiFrame; 180 | top += _titleView.frame.size.height + postTitleViewPadding; 181 | } 182 | 183 | if (_subtitleView.text) { 184 | CGFloat totalWidth = _subtitleView.frame.size.width; 185 | CGRect stFrame = _subtitleView.frame; 186 | stFrame.origin = CGPointMake(floor(self.frame.size.width/2 - totalWidth/2), top); 187 | _subtitleView.frame = stFrame; 188 | top += _subtitleView.frame.size.height + postSubtitleViewPadding; 189 | } 190 | 191 | if (_bottomButton) { 192 | CGFloat totalWidth = _bottomButton.frame.size.width; 193 | CGRect buttonFrame = _bottomButton.frame; 194 | buttonFrame.origin = CGPointMake(floor(self.frame.size.width/2 - totalWidth/2), top); 195 | _bottomButton.frame = buttonFrame; 196 | } 197 | 198 | if (activityIndicator) { 199 | CGRect frame = activityIndicator.frame; 200 | frame.origin.x = floor(contentBounds.origin.x + contentBounds.size.width/2 - frame.size.width/2); 201 | frame.origin.y = top - 1; 202 | activityIndicator.frame = frame; 203 | } 204 | } 205 | 206 | - (NSString *)title { 207 | return _titleView.text; 208 | } 209 | 210 | - (void)setTitle:(NSString *)title { 211 | if (title == _titleView.text) return; 212 | _titleView.text = title; 213 | [_titleView sizeToFit]; 214 | [self setNeedsLayout]; 215 | } 216 | 217 | - (NSString *)subtitle { 218 | return _subtitleView.text; 219 | } 220 | 221 | - (void)setSubtitle:(NSString *)subtitle { 222 | if (subtitle == _subtitleView.text) return; 223 | _subtitleView.text = subtitle; 224 | [_subtitleView sizeToFit]; 225 | [self setNeedsLayout]; 226 | } 227 | 228 | - (BOOL)buttonEnabled { 229 | return _button.enabled; 230 | } 231 | 232 | - (void)setButtonEnabled:(BOOL)enabled { 233 | _button.enabled = enabled; 234 | } 235 | 236 | - (BOOL)loading { 237 | return [activityIndicator isAnimating]; 238 | } 239 | 240 | - (void)setLoading:(BOOL)loading { 241 | if (loading == self.loading) return; 242 | 243 | if (self.loading) { 244 | [activityIndicator stopAnimating]; 245 | } else { 246 | if (!activityIndicator) { 247 | activityIndicator = [[UIActivityIndicatorView alloc] 248 | initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; 249 | [self addSubview:activityIndicator]; 250 | [self setNeedsLayout]; 251 | } 252 | [activityIndicator startAnimating]; 253 | } 254 | } 255 | 256 | @end -------------------------------------------------------------------------------- /DBChooserExample/DBChooserExample.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9B0311F1177BB2EE006E3771 /* DBChooser.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B0311F0177BB2EE006E3771 /* DBChooser.framework */; }; 11 | 9B0311F3177BB2F8006E3771 /* DBChooser.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 9B0311F2177BB2F8006E3771 /* DBChooser.bundle */; }; 12 | 9B861A8D17716EED00CCB299 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B861A8C17716EED00CCB299 /* UIKit.framework */; }; 13 | 9B861A8F17716EED00CCB299 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B861A8E17716EED00CCB299 /* Foundation.framework */; }; 14 | 9B861A9117716EED00CCB299 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B861A9017716EED00CCB299 /* CoreGraphics.framework */; }; 15 | 9B861A9917716EED00CCB299 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A9817716EED00CCB299 /* main.m */; }; 16 | 9B861A9D17716EED00CCB299 /* DBCAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A9C17716EED00CCB299 /* DBCAppDelegate.m */; }; 17 | 9B861A9F17716EED00CCB299 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B861A9E17716EED00CCB299 /* Default.png */; }; 18 | 9B861AA117716EED00CCB299 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B861AA017716EED00CCB299 /* Default@2x.png */; }; 19 | 9B861AA317716EED00CCB299 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 9B861AA217716EED00CCB299 /* Default-568h@2x.png */; }; 20 | 9B861AC3177170A200CCB299 /* DBCMainViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861AC2177170A200CCB299 /* DBCMainViewController.m */; }; 21 | 9B8CA0F3177192B000450EE7 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 9B8CA0F5177192B000450EE7 /* Localizable.strings */; }; 22 | /* End PBXBuildFile section */ 23 | 24 | /* Begin PBXFileReference section */ 25 | 9B0311F0177BB2EE006E3771 /* DBChooser.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DBChooser.framework; path = ../DBChooser.framework; sourceTree = ""; }; 26 | 9B0311F2177BB2F8006E3771 /* DBChooser.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; name = DBChooser.bundle; path = ../../DBChooser.bundle; sourceTree = ""; }; 27 | 9B861A8917716EED00CCB299 /* DBChooserExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = DBChooserExample.app; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 9B861A8C17716EED00CCB299 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 29 | 9B861A8E17716EED00CCB299 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 30 | 9B861A9017716EED00CCB299 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 31 | 9B861A9817716EED00CCB299 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32 | 9B861A9A17716EED00CCB299 /* DBChooserExample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DBChooserExample-Prefix.pch"; sourceTree = ""; }; 33 | 9B861A9B17716EED00CCB299 /* DBCAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBCAppDelegate.h; sourceTree = ""; }; 34 | 9B861A9C17716EED00CCB299 /* DBCAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBCAppDelegate.m; sourceTree = ""; }; 35 | 9B861A9E17716EED00CCB299 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = ""; }; 36 | 9B861AA017716EED00CCB299 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = ""; }; 37 | 9B861AA217716EED00CCB299 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = ""; }; 38 | 9B861AC1177170A200CCB299 /* DBCMainViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBCMainViewController.h; sourceTree = ""; }; 39 | 9B861AC2177170A200CCB299 /* DBCMainViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBCMainViewController.m; sourceTree = ""; }; 40 | 9B8CA0EF1771922400450EE7 /* DBChooserExample-Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = "DBChooserExample-Info.plist"; sourceTree = ""; }; 41 | 9B8CA0F4177192B000450EE7 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = Localization/en.lproj/Localizable.strings; sourceTree = ""; }; 42 | 9B8CA0F6177192B400450EE7 /* ja */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ja; path = Localization/ja.lproj/Localizable.strings; sourceTree = ""; }; 43 | 9B8CA0F7177194A700450EE7 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "Localization/zh-Hans.lproj/Localizable.strings"; sourceTree = ""; }; 44 | 9B8CA0F8177194AC00450EE7 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "Localization/zh-Hant.lproj/Localizable.strings"; sourceTree = ""; }; 45 | 9B8CA0F9177194B200450EE7 /* fr */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = fr; path = Localization/fr.lproj/Localizable.strings; sourceTree = ""; }; 46 | 9B8CA0FA177194B700450EE7 /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = Localization/de.lproj/Localizable.strings; sourceTree = ""; }; 47 | 9B8CA0FB177194C500450EE7 /* id */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = id; path = Localization/id.lproj/Localizable.strings; sourceTree = ""; }; 48 | 9B8CA0FC177194CD00450EE7 /* it */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = it; path = Localization/it.lproj/Localizable.strings; sourceTree = ""; }; 49 | 9B8CA0FD177194D600450EE7 /* ko */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ko; path = Localization/ko.lproj/Localizable.strings; sourceTree = ""; }; 50 | 9B8CA0FE177194E300450EE7 /* ms */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ms; path = Localization/ms.lproj/Localizable.strings; sourceTree = ""; }; 51 | 9B8CA0FF177194E800450EE7 /* pl */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pl; path = Localization/pl.lproj/Localizable.strings; sourceTree = ""; }; 52 | 9B8CA100177194F200450EE7 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = Localization/pt.lproj/Localizable.strings; sourceTree = ""; }; 53 | 9B8CA101177194F800450EE7 /* ru */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = ru; path = Localization/ru.lproj/Localizable.strings; sourceTree = ""; }; 54 | 9B8CA102177194FD00450EE7 /* es */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = es; path = Localization/es.lproj/Localizable.strings; sourceTree = ""; }; 55 | 9B8CA1031771950B00450EE7 /* es-ES */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "es-ES"; path = "Localization/es-ES.lproj/Localizable.strings"; sourceTree = ""; }; 56 | /* End PBXFileReference section */ 57 | 58 | /* Begin PBXFrameworksBuildPhase section */ 59 | 9B861A8617716EED00CCB299 /* Frameworks */ = { 60 | isa = PBXFrameworksBuildPhase; 61 | buildActionMask = 2147483647; 62 | files = ( 63 | 9B861A8D17716EED00CCB299 /* UIKit.framework in Frameworks */, 64 | 9B861A8F17716EED00CCB299 /* Foundation.framework in Frameworks */, 65 | 9B861A9117716EED00CCB299 /* CoreGraphics.framework in Frameworks */, 66 | 9B0311F1177BB2EE006E3771 /* DBChooser.framework in Frameworks */, 67 | ); 68 | runOnlyForDeploymentPostprocessing = 0; 69 | }; 70 | /* End PBXFrameworksBuildPhase section */ 71 | 72 | /* Begin PBXGroup section */ 73 | 9B861A8017716EED00CCB299 = { 74 | isa = PBXGroup; 75 | children = ( 76 | 9B861A9217716EED00CCB299 /* DBChooserExample */, 77 | 9B861A8B17716EED00CCB299 /* Frameworks */, 78 | 9B861A8A17716EED00CCB299 /* Products */, 79 | ); 80 | sourceTree = ""; 81 | }; 82 | 9B861A8A17716EED00CCB299 /* Products */ = { 83 | isa = PBXGroup; 84 | children = ( 85 | 9B861A8917716EED00CCB299 /* DBChooserExample.app */, 86 | ); 87 | name = Products; 88 | sourceTree = ""; 89 | }; 90 | 9B861A8B17716EED00CCB299 /* Frameworks */ = { 91 | isa = PBXGroup; 92 | children = ( 93 | 9B0311F0177BB2EE006E3771 /* DBChooser.framework */, 94 | 9B861A8C17716EED00CCB299 /* UIKit.framework */, 95 | 9B861A8E17716EED00CCB299 /* Foundation.framework */, 96 | 9B861A9017716EED00CCB299 /* CoreGraphics.framework */, 97 | ); 98 | name = Frameworks; 99 | sourceTree = ""; 100 | }; 101 | 9B861A9217716EED00CCB299 /* DBChooserExample */ = { 102 | isa = PBXGroup; 103 | children = ( 104 | 9B861A9B17716EED00CCB299 /* DBCAppDelegate.h */, 105 | 9B861A9C17716EED00CCB299 /* DBCAppDelegate.m */, 106 | 9B861AC1177170A200CCB299 /* DBCMainViewController.h */, 107 | 9B861AC2177170A200CCB299 /* DBCMainViewController.m */, 108 | 9B861A9317716EED00CCB299 /* Supporting Files */, 109 | ); 110 | path = DBChooserExample; 111 | sourceTree = ""; 112 | }; 113 | 9B861A9317716EED00CCB299 /* Supporting Files */ = { 114 | isa = PBXGroup; 115 | children = ( 116 | 9B861A9817716EED00CCB299 /* main.m */, 117 | 9B0311F2177BB2F8006E3771 /* DBChooser.bundle */, 118 | 9B861A9A17716EED00CCB299 /* DBChooserExample-Prefix.pch */, 119 | 9B8CA0EF1771922400450EE7 /* DBChooserExample-Info.plist */, 120 | 9B861A9E17716EED00CCB299 /* Default.png */, 121 | 9B861AA017716EED00CCB299 /* Default@2x.png */, 122 | 9B861AA217716EED00CCB299 /* Default-568h@2x.png */, 123 | 9B8CA0F5177192B000450EE7 /* Localizable.strings */, 124 | ); 125 | name = "Supporting Files"; 126 | sourceTree = ""; 127 | }; 128 | /* End PBXGroup section */ 129 | 130 | /* Begin PBXNativeTarget section */ 131 | 9B861A8817716EED00CCB299 /* DBChooserExample */ = { 132 | isa = PBXNativeTarget; 133 | buildConfigurationList = 9B861AA617716EED00CCB299 /* Build configuration list for PBXNativeTarget "DBChooserExample" */; 134 | buildPhases = ( 135 | 9B861A8517716EED00CCB299 /* Sources */, 136 | 9B861A8617716EED00CCB299 /* Frameworks */, 137 | 9B861A8717716EED00CCB299 /* Resources */, 138 | ); 139 | buildRules = ( 140 | ); 141 | dependencies = ( 142 | ); 143 | name = DBChooserExample; 144 | productName = DBChooserExample; 145 | productReference = 9B861A8917716EED00CCB299 /* DBChooserExample.app */; 146 | productType = "com.apple.product-type.application"; 147 | }; 148 | /* End PBXNativeTarget section */ 149 | 150 | /* Begin PBXProject section */ 151 | 9B861A8117716EED00CCB299 /* Project object */ = { 152 | isa = PBXProject; 153 | attributes = { 154 | CLASSPREFIX = DBC; 155 | LastUpgradeCheck = 0460; 156 | ORGANIZATIONNAME = Dropbox; 157 | }; 158 | buildConfigurationList = 9B861A8417716EED00CCB299 /* Build configuration list for PBXProject "DBChooserExample" */; 159 | compatibilityVersion = "Xcode 3.2"; 160 | developmentRegion = English; 161 | hasScannedForEncodings = 0; 162 | knownRegions = ( 163 | en, 164 | ja, 165 | "zh-Hans", 166 | "zh-Hant", 167 | fr, 168 | de, 169 | id, 170 | it, 171 | ko, 172 | ms, 173 | pl, 174 | pt, 175 | ru, 176 | es, 177 | "es-ES", 178 | ); 179 | mainGroup = 9B861A8017716EED00CCB299; 180 | productRefGroup = 9B861A8A17716EED00CCB299 /* Products */; 181 | projectDirPath = ""; 182 | projectRoot = ""; 183 | targets = ( 184 | 9B861A8817716EED00CCB299 /* DBChooserExample */, 185 | ); 186 | }; 187 | /* End PBXProject section */ 188 | 189 | /* Begin PBXResourcesBuildPhase section */ 190 | 9B861A8717716EED00CCB299 /* Resources */ = { 191 | isa = PBXResourcesBuildPhase; 192 | buildActionMask = 2147483647; 193 | files = ( 194 | 9B861A9F17716EED00CCB299 /* Default.png in Resources */, 195 | 9B861AA117716EED00CCB299 /* Default@2x.png in Resources */, 196 | 9B861AA317716EED00CCB299 /* Default-568h@2x.png in Resources */, 197 | 9B8CA0F3177192B000450EE7 /* Localizable.strings in Resources */, 198 | 9B0311F3177BB2F8006E3771 /* DBChooser.bundle in Resources */, 199 | ); 200 | runOnlyForDeploymentPostprocessing = 0; 201 | }; 202 | /* End PBXResourcesBuildPhase section */ 203 | 204 | /* Begin PBXSourcesBuildPhase section */ 205 | 9B861A8517716EED00CCB299 /* Sources */ = { 206 | isa = PBXSourcesBuildPhase; 207 | buildActionMask = 2147483647; 208 | files = ( 209 | 9B861A9917716EED00CCB299 /* main.m in Sources */, 210 | 9B861A9D17716EED00CCB299 /* DBCAppDelegate.m in Sources */, 211 | 9B861AC3177170A200CCB299 /* DBCMainViewController.m in Sources */, 212 | ); 213 | runOnlyForDeploymentPostprocessing = 0; 214 | }; 215 | /* End PBXSourcesBuildPhase section */ 216 | 217 | /* Begin PBXVariantGroup section */ 218 | 9B8CA0F5177192B000450EE7 /* Localizable.strings */ = { 219 | isa = PBXVariantGroup; 220 | children = ( 221 | 9B8CA0F4177192B000450EE7 /* en */, 222 | 9B8CA0F6177192B400450EE7 /* ja */, 223 | 9B8CA0F7177194A700450EE7 /* zh-Hans */, 224 | 9B8CA0F8177194AC00450EE7 /* zh-Hant */, 225 | 9B8CA0F9177194B200450EE7 /* fr */, 226 | 9B8CA0FA177194B700450EE7 /* de */, 227 | 9B8CA0FB177194C500450EE7 /* id */, 228 | 9B8CA0FC177194CD00450EE7 /* it */, 229 | 9B8CA0FD177194D600450EE7 /* ko */, 230 | 9B8CA0FE177194E300450EE7 /* ms */, 231 | 9B8CA0FF177194E800450EE7 /* pl */, 232 | 9B8CA100177194F200450EE7 /* pt */, 233 | 9B8CA101177194F800450EE7 /* ru */, 234 | 9B8CA102177194FD00450EE7 /* es */, 235 | 9B8CA1031771950B00450EE7 /* es-ES */, 236 | ); 237 | name = Localizable.strings; 238 | sourceTree = ""; 239 | }; 240 | /* End PBXVariantGroup section */ 241 | 242 | /* Begin XCBuildConfiguration section */ 243 | 9B861AA417716EED00CCB299 /* Debug */ = { 244 | isa = XCBuildConfiguration; 245 | buildSettings = { 246 | ALWAYS_SEARCH_USER_PATHS = NO; 247 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 248 | CLANG_CXX_LIBRARY = "libc++"; 249 | CLANG_ENABLE_OBJC_ARC = YES; 250 | CLANG_WARN_CONSTANT_CONVERSION = YES; 251 | CLANG_WARN_EMPTY_BODY = YES; 252 | CLANG_WARN_ENUM_CONVERSION = YES; 253 | CLANG_WARN_INT_CONVERSION = YES; 254 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 255 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 256 | COPY_PHASE_STRIP = NO; 257 | GCC_C_LANGUAGE_STANDARD = gnu99; 258 | GCC_DYNAMIC_NO_PIC = NO; 259 | GCC_OPTIMIZATION_LEVEL = 0; 260 | GCC_PREPROCESSOR_DEFINITIONS = ( 261 | "DEBUG=1", 262 | "$(inherited)", 263 | ); 264 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 265 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 266 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 267 | GCC_WARN_UNUSED_VARIABLE = YES; 268 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 269 | ONLY_ACTIVE_ARCH = YES; 270 | SDKROOT = iphoneos; 271 | TARGETED_DEVICE_FAMILY = "1,2"; 272 | }; 273 | name = Debug; 274 | }; 275 | 9B861AA517716EED00CCB299 /* Release */ = { 276 | isa = XCBuildConfiguration; 277 | buildSettings = { 278 | ALWAYS_SEARCH_USER_PATHS = NO; 279 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 280 | CLANG_CXX_LIBRARY = "libc++"; 281 | CLANG_ENABLE_OBJC_ARC = YES; 282 | CLANG_WARN_CONSTANT_CONVERSION = YES; 283 | CLANG_WARN_EMPTY_BODY = YES; 284 | CLANG_WARN_ENUM_CONVERSION = YES; 285 | CLANG_WARN_INT_CONVERSION = YES; 286 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 287 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 288 | COPY_PHASE_STRIP = YES; 289 | GCC_C_LANGUAGE_STANDARD = gnu99; 290 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 291 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 292 | GCC_WARN_UNUSED_VARIABLE = YES; 293 | IPHONEOS_DEPLOYMENT_TARGET = 5.1; 294 | OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1"; 295 | SDKROOT = iphoneos; 296 | TARGETED_DEVICE_FAMILY = "1,2"; 297 | VALIDATE_PRODUCT = YES; 298 | }; 299 | name = Release; 300 | }; 301 | 9B861AA717716EED00CCB299 /* Debug */ = { 302 | isa = XCBuildConfiguration; 303 | buildSettings = { 304 | FRAMEWORK_SEARCH_PATHS = ( 305 | "$(inherited)", 306 | "\"$(SRCROOT)/..\"", 307 | ); 308 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 309 | GCC_PREFIX_HEADER = "DBChooserExample/DBChooserExample-Prefix.pch"; 310 | INFOPLIST_FILE = "DBChooserExample/DBChooserExample-Info.plist"; 311 | PRODUCT_NAME = DBChooserExample; 312 | WRAPPER_EXTENSION = app; 313 | }; 314 | name = Debug; 315 | }; 316 | 9B861AA817716EED00CCB299 /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | FRAMEWORK_SEARCH_PATHS = ( 320 | "$(inherited)", 321 | "\"$(SRCROOT)/..\"", 322 | ); 323 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 324 | GCC_PREFIX_HEADER = "DBChooserExample/DBChooserExample-Prefix.pch"; 325 | INFOPLIST_FILE = "DBChooserExample/DBChooserExample-Info.plist"; 326 | PRODUCT_NAME = DBChooserExample; 327 | WRAPPER_EXTENSION = app; 328 | }; 329 | name = Release; 330 | }; 331 | /* End XCBuildConfiguration section */ 332 | 333 | /* Begin XCConfigurationList section */ 334 | 9B861A8417716EED00CCB299 /* Build configuration list for PBXProject "DBChooserExample" */ = { 335 | isa = XCConfigurationList; 336 | buildConfigurations = ( 337 | 9B861AA417716EED00CCB299 /* Debug */, 338 | 9B861AA517716EED00CCB299 /* Release */, 339 | ); 340 | defaultConfigurationIsVisible = 0; 341 | defaultConfigurationName = Release; 342 | }; 343 | 9B861AA617716EED00CCB299 /* Build configuration list for PBXNativeTarget "DBChooserExample" */ = { 344 | isa = XCConfigurationList; 345 | buildConfigurations = ( 346 | 9B861AA717716EED00CCB299 /* Debug */, 347 | 9B861AA817716EED00CCB299 /* Release */, 348 | ); 349 | defaultConfigurationIsVisible = 0; 350 | defaultConfigurationName = Release; 351 | }; 352 | /* End XCConfigurationList section */ 353 | }; 354 | rootObject = 9B861A8117716EED00CCB299 /* Project object */; 355 | } 356 | -------------------------------------------------------------------------------- /DBChooser.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9B861A5017716C3200CCB299 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B861A4F17716C3200CCB299 /* Foundation.framework */; }; 11 | 9B861A5517716C3200CCB299 /* DBChooser.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9B861A5417716C3200CCB299 /* DBChooser.h */; }; 12 | 9B861A5717716C3200CCB299 /* DBChooser.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A5617716C3200CCB299 /* DBChooser.m */; }; 13 | 9B861A5F17716D0F00CCB299 /* DBCConstants.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A5E17716D0F00CCB299 /* DBCConstants.m */; }; 14 | 9B861A7F17716DB600CCB299 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B861A7E17716DB600CCB299 /* UIKit.framework */; }; 15 | 9B861AC41771721500CCB299 /* DBCBlueButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A7317716D3600CCB299 /* DBCBlueButton.m */; }; 16 | 9B861AC51771721500CCB299 /* DBChooserAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A7517716D3600CCB299 /* DBChooserAppearance.m */; }; 17 | 9B861AC61771721500CCB299 /* DBChooserNoDropboxViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A7717716D3600CCB299 /* DBChooserNoDropboxViewController.m */; }; 18 | 9B861AC71771721500CCB299 /* DBCStyledErrorView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A7917716D3600CCB299 /* DBCStyledErrorView.m */; }; 19 | 9B861AC81771721500CCB299 /* DBCStyledNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B861A7B17716D3600CCB299 /* DBCStyledNavigationController.m */; }; 20 | 9BA4A91B177186F50007141A /* DBCLocalization.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BA4A91A177186F50007141A /* DBCLocalization.m */; }; 21 | 9BBE8CCE177282760098BC7B /* DBChooserResult.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BBE8CCD177282760098BC7B /* DBChooserResult.m */; }; 22 | 9BBE8CD317728A5F0098BC7B /* DBChooserResult.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9BBE8CCC177282760098BC7B /* DBChooserResult.h */; }; 23 | D31788D617D7B25000FFCC62 /* DBAppearance.m in Sources */ = {isa = PBXBuildFile; fileRef = D31788D517D7B25000FFCC62 /* DBAppearance.m */; }; 24 | /* End PBXBuildFile section */ 25 | 26 | /* Begin PBXCopyFilesBuildPhase section */ 27 | 9B861A4A17716C3200CCB299 /* CopyFiles */ = { 28 | isa = PBXCopyFilesBuildPhase; 29 | buildActionMask = 12; 30 | dstPath = "include/${PRODUCT_NAME}"; 31 | dstSubfolderSpec = 16; 32 | files = ( 33 | 9BBE8CD317728A5F0098BC7B /* DBChooserResult.h in CopyFiles */, 34 | 9B861A5517716C3200CCB299 /* DBChooser.h in CopyFiles */, 35 | ); 36 | runOnlyForDeploymentPostprocessing = 0; 37 | }; 38 | /* End PBXCopyFilesBuildPhase section */ 39 | 40 | /* Begin PBXFileReference section */ 41 | 9B861A4C17716C3200CCB299 /* libDBChooser.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libDBChooser.a; sourceTree = BUILT_PRODUCTS_DIR; }; 42 | 9B861A4F17716C3200CCB299 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 43 | 9B861A5317716C3200CCB299 /* DBChooser-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DBChooser-Prefix.pch"; sourceTree = ""; }; 44 | 9B861A5417716C3200CCB299 /* DBChooser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBChooser.h; sourceTree = ""; }; 45 | 9B861A5617716C3200CCB299 /* DBChooser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBChooser.m; sourceTree = ""; }; 46 | 9B861A5D17716D0F00CCB299 /* DBCConstants.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBCConstants.h; sourceTree = ""; }; 47 | 9B861A5E17716D0F00CCB299 /* DBCConstants.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBCConstants.m; sourceTree = ""; }; 48 | 9B861A7217716D3600CCB299 /* DBCBlueButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBCBlueButton.h; sourceTree = ""; }; 49 | 9B861A7317716D3600CCB299 /* DBCBlueButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBCBlueButton.m; sourceTree = ""; }; 50 | 9B861A7417716D3600CCB299 /* DBChooserAppearance.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBChooserAppearance.h; sourceTree = ""; }; 51 | 9B861A7517716D3600CCB299 /* DBChooserAppearance.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBChooserAppearance.m; sourceTree = ""; }; 52 | 9B861A7617716D3600CCB299 /* DBChooserNoDropboxViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBChooserNoDropboxViewController.h; sourceTree = ""; }; 53 | 9B861A7717716D3600CCB299 /* DBChooserNoDropboxViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBChooserNoDropboxViewController.m; sourceTree = ""; }; 54 | 9B861A7817716D3600CCB299 /* DBCStyledErrorView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBCStyledErrorView.h; sourceTree = ""; }; 55 | 9B861A7917716D3600CCB299 /* DBCStyledErrorView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBCStyledErrorView.m; sourceTree = ""; }; 56 | 9B861A7A17716D3600CCB299 /* DBCStyledNavigationController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DBCStyledNavigationController.h; sourceTree = ""; }; 57 | 9B861A7B17716D3600CCB299 /* DBCStyledNavigationController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DBCStyledNavigationController.m; sourceTree = ""; }; 58 | 9B861A7E17716DB600CCB299 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 59 | 9BA4A919177186F50007141A /* DBCLocalization.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBCLocalization.h; sourceTree = ""; }; 60 | 9BA4A91A177186F50007141A /* DBCLocalization.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBCLocalization.m; sourceTree = ""; }; 61 | 9BBE8CCC177282760098BC7B /* DBChooserResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBChooserResult.h; sourceTree = ""; }; 62 | 9BBE8CCD177282760098BC7B /* DBChooserResult.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBChooserResult.m; sourceTree = ""; }; 63 | 9BBE8CCF177283200098BC7B /* DBChooser+Private.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "DBChooser+Private.h"; sourceTree = ""; }; 64 | 9BBE8CD2177288650098BC7B /* DBChooserResult+Private.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "DBChooserResult+Private.h"; sourceTree = ""; }; 65 | 9BE7B440177176DC0058055E /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; }; 66 | 9BE7B46F177179910058055E /* DBChooser.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = DBChooser.bundle; sourceTree = ""; }; 67 | D31788D417D7B25000FFCC62 /* DBAppearance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DBAppearance.h; sourceTree = ""; }; 68 | D31788D517D7B25000FFCC62 /* DBAppearance.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DBAppearance.m; sourceTree = ""; }; 69 | /* End PBXFileReference section */ 70 | 71 | /* Begin PBXFrameworksBuildPhase section */ 72 | 9B861A4917716C3200CCB299 /* Frameworks */ = { 73 | isa = PBXFrameworksBuildPhase; 74 | buildActionMask = 2147483647; 75 | files = ( 76 | 9B861A5017716C3200CCB299 /* Foundation.framework in Frameworks */, 77 | 9B861A7F17716DB600CCB299 /* UIKit.framework in Frameworks */, 78 | ); 79 | runOnlyForDeploymentPostprocessing = 0; 80 | }; 81 | /* End PBXFrameworksBuildPhase section */ 82 | 83 | /* Begin PBXGroup section */ 84 | 9B861A4317716C3200CCB299 = { 85 | isa = PBXGroup; 86 | children = ( 87 | 9B861A5117716C3200CCB299 /* DBChooser */, 88 | 9B861A4E17716C3200CCB299 /* Frameworks */, 89 | 9BE7B470177179BE0058055E /* Resources */, 90 | 9B861A4D17716C3200CCB299 /* Products */, 91 | ); 92 | sourceTree = ""; 93 | }; 94 | 9B861A4D17716C3200CCB299 /* Products */ = { 95 | isa = PBXGroup; 96 | children = ( 97 | 9B861A4C17716C3200CCB299 /* libDBChooser.a */, 98 | ); 99 | name = Products; 100 | sourceTree = ""; 101 | }; 102 | 9B861A4E17716C3200CCB299 /* Frameworks */ = { 103 | isa = PBXGroup; 104 | children = ( 105 | 9B861A7E17716DB600CCB299 /* UIKit.framework */, 106 | 9B861A4F17716C3200CCB299 /* Foundation.framework */, 107 | 9BE7B440177176DC0058055E /* CoreFoundation.framework */, 108 | ); 109 | name = Frameworks; 110 | sourceTree = ""; 111 | }; 112 | 9B861A5117716C3200CCB299 /* DBChooser */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 9B861A5D17716D0F00CCB299 /* DBCConstants.h */, 116 | 9B861A5E17716D0F00CCB299 /* DBCConstants.m */, 117 | 9B861A5417716C3200CCB299 /* DBChooser.h */, 118 | 9BBE8CCF177283200098BC7B /* DBChooser+Private.h */, 119 | 9B861A5617716C3200CCB299 /* DBChooser.m */, 120 | 9BBE8CCC177282760098BC7B /* DBChooserResult.h */, 121 | 9BBE8CD2177288650098BC7B /* DBChooserResult+Private.h */, 122 | 9BBE8CCD177282760098BC7B /* DBChooserResult.m */, 123 | 9BA4A919177186F50007141A /* DBCLocalization.h */, 124 | 9BA4A91A177186F50007141A /* DBCLocalization.m */, 125 | 9B861A7117716D3600CCB299 /* UI */, 126 | 9B861A5217716C3200CCB299 /* Supporting Files */, 127 | ); 128 | path = DBChooser; 129 | sourceTree = ""; 130 | }; 131 | 9B861A5217716C3200CCB299 /* Supporting Files */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | 9B861A5317716C3200CCB299 /* DBChooser-Prefix.pch */, 135 | ); 136 | name = "Supporting Files"; 137 | sourceTree = ""; 138 | }; 139 | 9B861A7117716D3600CCB299 /* UI */ = { 140 | isa = PBXGroup; 141 | children = ( 142 | D31788D417D7B25000FFCC62 /* DBAppearance.h */, 143 | D31788D517D7B25000FFCC62 /* DBAppearance.m */, 144 | 9B861A7217716D3600CCB299 /* DBCBlueButton.h */, 145 | 9B861A7317716D3600CCB299 /* DBCBlueButton.m */, 146 | 9B861A7417716D3600CCB299 /* DBChooserAppearance.h */, 147 | 9B861A7517716D3600CCB299 /* DBChooserAppearance.m */, 148 | 9B861A7617716D3600CCB299 /* DBChooserNoDropboxViewController.h */, 149 | 9B861A7717716D3600CCB299 /* DBChooserNoDropboxViewController.m */, 150 | 9B861A7817716D3600CCB299 /* DBCStyledErrorView.h */, 151 | 9B861A7917716D3600CCB299 /* DBCStyledErrorView.m */, 152 | 9B861A7A17716D3600CCB299 /* DBCStyledNavigationController.h */, 153 | 9B861A7B17716D3600CCB299 /* DBCStyledNavigationController.m */, 154 | ); 155 | path = UI; 156 | sourceTree = ""; 157 | }; 158 | 9BE7B470177179BE0058055E /* Resources */ = { 159 | isa = PBXGroup; 160 | children = ( 161 | 9BE7B46F177179910058055E /* DBChooser.bundle */, 162 | ); 163 | name = Resources; 164 | sourceTree = ""; 165 | }; 166 | /* End PBXGroup section */ 167 | 168 | /* Begin PBXNativeTarget section */ 169 | 9B861A4B17716C3200CCB299 /* DBChooser */ = { 170 | isa = PBXNativeTarget; 171 | buildConfigurationList = 9B861A5A17716C3200CCB299 /* Build configuration list for PBXNativeTarget "DBChooser" */; 172 | buildPhases = ( 173 | 9B861A4817716C3200CCB299 /* Sources */, 174 | 9B861A4917716C3200CCB299 /* Frameworks */, 175 | 9B861A4A17716C3200CCB299 /* CopyFiles */, 176 | 9B3CC8CD1772E09600290E0B /* Run Script */, 177 | ); 178 | buildRules = ( 179 | ); 180 | dependencies = ( 181 | ); 182 | name = DBChooser; 183 | productName = DBChooser; 184 | productReference = 9B861A4C17716C3200CCB299 /* libDBChooser.a */; 185 | productType = "com.apple.product-type.library.static"; 186 | }; 187 | /* End PBXNativeTarget section */ 188 | 189 | /* Begin PBXProject section */ 190 | 9B861A4417716C3200CCB299 /* Project object */ = { 191 | isa = PBXProject; 192 | attributes = { 193 | LastUpgradeCheck = 0460; 194 | ORGANIZATIONNAME = Dropbox; 195 | }; 196 | buildConfigurationList = 9B861A4717716C3200CCB299 /* Build configuration list for PBXProject "DBChooser" */; 197 | compatibilityVersion = "Xcode 3.2"; 198 | developmentRegion = English; 199 | hasScannedForEncodings = 0; 200 | knownRegions = ( 201 | en, 202 | ); 203 | mainGroup = 9B861A4317716C3200CCB299; 204 | productRefGroup = 9B861A4D17716C3200CCB299 /* Products */; 205 | projectDirPath = ""; 206 | projectRoot = ""; 207 | targets = ( 208 | 9B861A4B17716C3200CCB299 /* DBChooser */, 209 | ); 210 | }; 211 | /* End PBXProject section */ 212 | 213 | /* Begin PBXShellScriptBuildPhase section */ 214 | 9B3CC8CD1772E09600290E0B /* Run Script */ = { 215 | isa = PBXShellScriptBuildPhase; 216 | buildActionMask = 2147483647; 217 | files = ( 218 | ); 219 | inputPaths = ( 220 | ); 221 | name = "Run Script"; 222 | outputPaths = ( 223 | ); 224 | runOnlyForDeploymentPostprocessing = 0; 225 | shellPath = /bin/sh; 226 | shellScript = "set -e\nset +u\n# Avoid recursively calling this script.\nif [[ $SF_MASTER_SCRIPT_RUNNING ]]\nthen\nexit 0\nfi\nset -u\nexport SF_MASTER_SCRIPT_RUNNING=1\n\n\n#rmdir\nRESULT_PATH=\"${BUILT_PRODUCTS_DIR}/${PRODUCT_NAME}\"\nFRAMEWORK_PATH=\"${RESULT_PATH}/${PRODUCT_NAME}.framework\"\n\nmkdir -p \"${FRAMEWORK_PATH}\"\n\nmkdir -p \"${FRAMEWORK_PATH}/Headers\"\ncp -R \"${BUILT_PRODUCTS_DIR}/include/${PRODUCT_NAME}/\" \"${FRAMEWORK_PATH}/Headers\"\ncp -R \"${SRCROOT}/${PRODUCT_NAME}.bundle\" \"${RESULT_PATH}\"\n\n# The following conditionals come from\n# https://github.com/kstenerud/iOS-Universal-Framework\n\nSF_EXECUTABLE_PATH=\"lib${PRODUCT_NAME}.a\"\nSF_TARGET_NAME=\"${PRODUCT_NAME}\"\n\nif [[ \"$SDK_NAME\" =~ ([A-Za-z]+) ]]\nthen\nSF_SDK_PLATFORM=${BASH_REMATCH[1]}\nelse\necho \"Could not find platform name from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SDK_NAME\" =~ ([0-9]+.*$) ]]\nthen\nSF_SDK_VERSION=${BASH_REMATCH[1]}\nelse\necho \"Could not find sdk version from SDK_NAME: $SDK_NAME\"\nexit 1\nfi\n\nif [[ \"$SF_SDK_PLATFORM\" = \"iphoneos\" ]]\nthen\nSF_OTHER_PLATFORM=iphonesimulator\nelse\nSF_OTHER_PLATFORM=iphoneos\nfi\n\nif [[ \"$BUILT_PRODUCTS_DIR\" =~ (.*)$SF_SDK_PLATFORM$ ]]\nthen\nSF_OTHER_BUILT_PRODUCTS_DIR=\"${BASH_REMATCH[1]}${SF_OTHER_PLATFORM}\"\nelse\necho \"Could not find platform name from build products directory: $BUILT_PRODUCTS_DIR\"\nexit 1\nfi\n\n# Build the other platform.\nxcodebuild -project \"${PROJECT_FILE_PATH}\" -target \"${TARGET_NAME}\" -configuration \"${CONFIGURATION}\" -sdk ${SF_OTHER_PLATFORM}${SF_SDK_VERSION} BUILD_DIR=\"${BUILD_DIR}\" OBJROOT=\"${OBJROOT}\" BUILD_ROOT=\"${BUILD_ROOT}\" SYMROOT=\"${SYMROOT}\" $ACTION\n\n# Smash the two static libraries into one fat binary and store it in the .framework\nlipo -create \"${BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" \"${SF_OTHER_BUILT_PRODUCTS_DIR}/${SF_EXECUTABLE_PATH}\" -output \"${FRAMEWORK_PATH}/${SF_TARGET_NAME}\"\n\n\n"; 227 | }; 228 | /* End PBXShellScriptBuildPhase section */ 229 | 230 | /* Begin PBXSourcesBuildPhase section */ 231 | 9B861A4817716C3200CCB299 /* Sources */ = { 232 | isa = PBXSourcesBuildPhase; 233 | buildActionMask = 2147483647; 234 | files = ( 235 | 9B861A5717716C3200CCB299 /* DBChooser.m in Sources */, 236 | 9B861A5F17716D0F00CCB299 /* DBCConstants.m in Sources */, 237 | D31788D617D7B25000FFCC62 /* DBAppearance.m in Sources */, 238 | 9B861AC41771721500CCB299 /* DBCBlueButton.m in Sources */, 239 | 9B861AC51771721500CCB299 /* DBChooserAppearance.m in Sources */, 240 | 9B861AC61771721500CCB299 /* DBChooserNoDropboxViewController.m in Sources */, 241 | 9B861AC71771721500CCB299 /* DBCStyledErrorView.m in Sources */, 242 | 9B861AC81771721500CCB299 /* DBCStyledNavigationController.m in Sources */, 243 | 9BA4A91B177186F50007141A /* DBCLocalization.m in Sources */, 244 | 9BBE8CCE177282760098BC7B /* DBChooserResult.m in Sources */, 245 | ); 246 | runOnlyForDeploymentPostprocessing = 0; 247 | }; 248 | /* End PBXSourcesBuildPhase section */ 249 | 250 | /* Begin XCBuildConfiguration section */ 251 | 9B861A5817716C3200CCB299 /* Debug */ = { 252 | isa = XCBuildConfiguration; 253 | buildSettings = { 254 | ALWAYS_SEARCH_USER_PATHS = NO; 255 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 256 | CLANG_CXX_LIBRARY = "libc++"; 257 | CLANG_ENABLE_OBJC_ARC = YES; 258 | CLANG_WARN_CONSTANT_CONVERSION = YES; 259 | CLANG_WARN_EMPTY_BODY = YES; 260 | CLANG_WARN_ENUM_CONVERSION = YES; 261 | CLANG_WARN_INT_CONVERSION = YES; 262 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 263 | COPY_PHASE_STRIP = NO; 264 | GCC_C_LANGUAGE_STANDARD = gnu99; 265 | GCC_DYNAMIC_NO_PIC = NO; 266 | GCC_OPTIMIZATION_LEVEL = 0; 267 | GCC_PREPROCESSOR_DEFINITIONS = ( 268 | "DEBUG=1", 269 | "$(inherited)", 270 | ); 271 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 272 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 273 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 274 | GCC_WARN_UNUSED_VARIABLE = YES; 275 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 276 | ONLY_ACTIVE_ARCH = YES; 277 | SDKROOT = iphoneos; 278 | }; 279 | name = Debug; 280 | }; 281 | 9B861A5917716C3200CCB299 /* Release */ = { 282 | isa = XCBuildConfiguration; 283 | buildSettings = { 284 | ALWAYS_SEARCH_USER_PATHS = NO; 285 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 286 | CLANG_CXX_LIBRARY = "libc++"; 287 | CLANG_ENABLE_OBJC_ARC = YES; 288 | CLANG_WARN_CONSTANT_CONVERSION = YES; 289 | CLANG_WARN_EMPTY_BODY = YES; 290 | CLANG_WARN_ENUM_CONVERSION = YES; 291 | CLANG_WARN_INT_CONVERSION = YES; 292 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 293 | COPY_PHASE_STRIP = YES; 294 | GCC_C_LANGUAGE_STANDARD = gnu99; 295 | GCC_WARN_ABOUT_RETURN_TYPE = YES; 296 | GCC_WARN_UNINITIALIZED_AUTOS = YES; 297 | GCC_WARN_UNUSED_VARIABLE = YES; 298 | IPHONEOS_DEPLOYMENT_TARGET = 5.0; 299 | SDKROOT = iphoneos; 300 | VALIDATE_PRODUCT = YES; 301 | }; 302 | name = Release; 303 | }; 304 | 9B861A5B17716C3200CCB299 /* Debug */ = { 305 | isa = XCBuildConfiguration; 306 | buildSettings = { 307 | DSTROOT = /tmp/DBChooser.dst; 308 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 309 | GCC_PREFIX_HEADER = "DBChooser/DBChooser-Prefix.pch"; 310 | OTHER_LDFLAGS = "-ObjC"; 311 | PRODUCT_NAME = "$(TARGET_NAME)"; 312 | SKIP_INSTALL = YES; 313 | }; 314 | name = Debug; 315 | }; 316 | 9B861A5C17716C3200CCB299 /* Release */ = { 317 | isa = XCBuildConfiguration; 318 | buildSettings = { 319 | DSTROOT = /tmp/DBChooser.dst; 320 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 321 | GCC_PREFIX_HEADER = "DBChooser/DBChooser-Prefix.pch"; 322 | OTHER_LDFLAGS = "-ObjC"; 323 | PRODUCT_NAME = "$(TARGET_NAME)"; 324 | SKIP_INSTALL = YES; 325 | }; 326 | name = Release; 327 | }; 328 | /* End XCBuildConfiguration section */ 329 | 330 | /* Begin XCConfigurationList section */ 331 | 9B861A4717716C3200CCB299 /* Build configuration list for PBXProject "DBChooser" */ = { 332 | isa = XCConfigurationList; 333 | buildConfigurations = ( 334 | 9B861A5817716C3200CCB299 /* Debug */, 335 | 9B861A5917716C3200CCB299 /* Release */, 336 | ); 337 | defaultConfigurationIsVisible = 0; 338 | defaultConfigurationName = Release; 339 | }; 340 | 9B861A5A17716C3200CCB299 /* Build configuration list for PBXNativeTarget "DBChooser" */ = { 341 | isa = XCConfigurationList; 342 | buildConfigurations = ( 343 | 9B861A5B17716C3200CCB299 /* Debug */, 344 | 9B861A5C17716C3200CCB299 /* Release */, 345 | ); 346 | defaultConfigurationIsVisible = 0; 347 | defaultConfigurationName = Release; 348 | }; 349 | /* End XCConfigurationList section */ 350 | }; 351 | rootObject = 9B861A4417716C3200CCB299 /* Project object */; 352 | } 353 | --------------------------------------------------------------------------------