This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)pickVideoFromAlbum { | |
UIImagePickerController *videoPicker = [[UIImagePickerController alloc] init]; | |
videoPicker.delegate = self; | |
videoPicker.modalPresentationStyle = UIModalPresentationCurrentContext; | |
videoPicker.mediaTypes =[UIImagePickerController availableMediaTypesForSourceType:UIImagePickerControllerSourceTypePhotoLibrary]; | |
videoPicker.mediaTypes = @[(NSString*)kUTTypeMovie, (NSString*)kUTTypeAVIMovie, (NSString*)kUTTypeVideo, (NSString*)kUTTypeMPEG4]; | |
videoPicker.videoQuality = UIImagePickerControllerQualityTypeHigh; | |
[self presentViewController:videoPicker animated:YES completion:nil]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get the publish permission | |
- (void)getPublishPermission { | |
NSArray* permissions = [[NSArray alloc] initWithObjects: | |
@"publish_stream", nil]; | |
[facebook authorize:permissions delegate:self]; | |
[permissions release]; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#import <Social/Social.h> | |
#import <Accounts/Accounts.h> | |
typedef void(^VideoUploadCompletion)(BOOL success, NSString *errorMessage); | |
typedef void(^ResultAccount)(ACAccount *account); | |
@interface SocialVideoHelper : NSObject | |
+(void)getFirstTwitterAccount:(ResultAccount)complete; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSString *)jsonFromDictionary:(NSDictionary *)dict { | |
NSDictionary *plistDict = nil; | |
if (dict != nil) { | |
plistDict = dict; | |
}else { | |
NSString *path = [[NSBundle mainBundle] pathForResource:@"items.plist" ofType:nil]; | |
NSArray *array = [NSArray arrayWithContentsOfFile:path]; | |
plistDict = [NSDictionary dictionaryWithObject:array forKey:@"list"]; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)removeFile:(NSString *)filename | |
{ | |
NSFileManager *fileManager = [NSFileManager defaultManager]; | |
NSString *documentsPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; | |
NSString *filePath = [documentsPath stringByAppendingPathComponent:filename]; | |
NSError *error; | |
BOOL success = [fileManager removeItemAtPath:filePath error:&error]; | |
if (success) { | |
UIAlertView *removedSuccessFullyAlert = [[UIAlertView alloc] initWithTitle:@"Congratulations:" message:@"Successfully removed" delegate:self cancelButtonTitle:@"Close" otherButtonTitles:nil]; |
OlderNewer