IOS | Techbirds | Page 2

-(void)getAlbumPhotos:(NSString *)albumName { __block BOOL albumWasFound = NO; //search all photo albums in the library [self.library enumerateGroupsWithTypes:ALAssetsGroupAlbum usingBlock:^(ALAssetsGroup *group, BOOL *stop) { if([albumName compare: [group valueForProperty:ALAssetsGroupPropertyName]]==NSOrderedSame) { //target album is found albumWasFound = YES; [group enumerateAssetsUsingBlock:^(ALAsset *result, NSUInteger index, BOOL *stop) { ALAssetRepresentation *representation = [result defaultRepresentation]; if(result){ UIImage *latestPhoto = [UIImage imageWithCGImage:[representation fullScreenImage]]; [mutPhotoArray

Read More →

840 total views, no views today

Posted on: April 29, 2014 /

Categories: IOS / Author Name: Sandeep Ahuja

-(void)extractAudioFromVideo:(NSURL*)videoSrcPath audioFilePath:(NSString*)dstPath{ AVMutableComposition* newAudioAsset = [AVMutableComposition composition]; AVMutableCompositionTrack* dstCompositionTrack; dstCompositionTrack = [newAudioAsset addMutableTrackWithMediaType:AVMediaTypeAudio preferredTrackID:kCMPersistentTrackID_Invalid]; //NSURL *srcURL=[NSURL fileURLWithPath:videoSrcPath]; NSURL *srcURL=videoSrcPath; AVAsset* srcAsset = [AVURLAsset URLAssetWithURL:srcURL options:nil]; AVAssetTrack* srcTrack = [[srcAsset tracksWithMediaType:AVMediaTypeAudio] objectAtIndex:0]; NSArray *formatDescriptions=srcTrack.formatDescriptions; NSString *fileType = nil; NSString *ex = nil; if ([formatDescriptions count] > 0) { CMAudioFormatDescriptionRef formatDesc=(__bridge CMFormatDescriptionRef)[formatDescriptions objectAtIndex:0]; FourCharCode mediaSubType = CMFormatDescriptionGetMediaSubType(formatDesc);

Read More →

1,221 total views, 1 views today

UDID stands for Universal Device Identifier which uniquely identify device, a sequence of 40 hexadecimal character length alphabet. Apple has hidden this UDID from iOS 6 for security purpose. It was accessable before iOS6. iOS developers can access below code :- NSString *udid; if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@”6.0″)) udid = [UIDevice currentDevice].identifierForVendor.UUIDString; else udid = [UIDevice currentDevice].uniqueIdentifier; 1

Read More →

5,709 total views, 2 views today

Apple provide a numerous way to get device iOS version at run time :- 1) Using UIDevice Class float deviceVersion = [[[UIDevice currentDevice] systemVersion] floatValue]; e.g. iOS Version = 6.1 int deviceVersion = [[[UIDevice currentDevice] systemVersion] integerValue]; e.g. iOS Version = 6 2) According to iOS 7 Guideline Document, we can use Foundation Class Predefine

Read More →

836 total views, 2 views today

Apple provide following way to find out the Device Type or Model such we can make application Universal or can change or load User Interface according to iPad or iPhone5 or iPhone dynamically. 1) Using UIDevice Class if([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad){ //iPad }else{ if ([UIScreen mainScreen].bounds.size.height > 500) { //iPhone5 or iPod5 }else{ //iPhone

Read More →

870 total views, 1 views today