Skip to content

Instantly share code, notes, and snippets.

View fel-cesar's full-sized avatar
💻

Felipe Cesar fel-cesar

💻
View GitHub Profile
@fel-cesar
fel-cesar / build.sh
Created September 12, 2016 14:59 — forked from fjcaetano/build.sh
Universal Framework Build Script
#!/bin/sh
exec > /tmp/${PROJECT_NAME}_archive.log 2>&1
UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal
if [ "true" == ${ALREADYINVOKED:-false} ]
then
echo "RECURSION: Detected, stopping"
else
######################
# Options
######################
REVEAL_ARCHIVE_IN_FINDER=false
FRAMEWORK_NAME="${PROJECT_NAME}"
SIMULATOR_LIBRARY_PATH="${BUILD_DIR}/${CONFIGURATION}-iphonesimulator/${FRAMEWORK_NAME}.framework"
//This is the set up code for iOS
//By replacing "CRDropbox" in the lines below you can implement whatever Cloud Storage service you want.
//Example:
//[CRBox alloc]
//[CROneDrive alloc], etc...
self.dropbox = [[CRDropbox alloc] initWithClientId:@"dropboxKey"
clientSecret:@"dropboxSecret"
redirectUri:@"https://www.cloudrailauth.com/auth" //example
state:@"CRSTATE"];// anyStateString will do for iOS
//Assuming already existing "@property (nonatomic) Dropbox* dropbox;"(DropBox,Box,,GoogleDrive,OneDrive...)
UIImage * image = imageSource;
NSData * pngImageData = UIImagePNGRepresentation(image); // loading data from some source. (PNG)
NSInputStream * inputStream = [NSInputStream inputStreamWithData:pngImageData];
[self.service uploadFileToPath:@"/mudkip.jpg" withStream:inputStream size:imageData.length overwrite:YES];