Box iOS Preview SDK
This SDK makes it easy to present Box files in your iOS application.
- Ensure you have the latest version of XCode installed.
- We encourage you to use Cocoa Pods to import the SDK into your project. Cocoa Pods is a simple, but powerful dependency management tool. If you do not already use Cocoa Pods, it's very easy to get started.
Step 1: Add to your Podfile
Step 2: Install
Step 3: Import
Step 4: Set the Box Client ID and Client Secret that you obtain from creating a developer account
[BOXContentClient setClientID:@"your-client-id" clientSecret:@"your-client-secret"];
Step 5: Present a file
BOXFile *file = ... // A BOXFile that you retrieved through the Content SDK or Browse SDK. See the Sample Application for an example. BOXFilePreviewController *filePreviewController = [[BOXFilePreviewController alloc] initWithContentClient:[BOXContentClient defaultClient] file:file]; [self.navigationController pushViewController:filePreviewController animated:YES completion:nil];
Using an existing Content Client to initialize a BOXFilePreviewController will create a Preview Client behind the scenes with the default caching policy. To customize caching settings, you can explicitly create a Preview Client to pass in.
A sample app can be found in the BoxPreviewSDKSampleApp folder. To execute the sample app:
Step 1: Install Pods
cd BoxPreviewSDKSampleApp pod install
Step 2: Open Workspace
You can find guides and tutorials in the
This SDK is currently not open source. Please submit issues in GitHub to report bugs and suggest improvements.
Copyright and License
Copyright 2015 Box, Inc. All rights reserved.
Licensed under the Box Terms of Service; you may not use this file except in compliance with the License.