Posts

Showing posts from July, 2017

AV Player.

View.m #pragma mark -   AV player launch                                    dispatch_async ( dispatch_get_main_queue (), ^( void ){                                            AVAsset *asset = [ AVURLAsset URLAssetWithURL :Song_url options : nil ];                      playerItem = [ AVPlayerItem playerItemWithAsset :asset];                                            [ gp . aPlayer_main replaceCurrentItemWithPlayerItem : playerItem ];                                            self . time...

Collection View

Collection View View.h <UICollectionViewDelegate , UICollectionViewDataSource > IBOutlet UICollectionView *Vw_Collect; View.m   [ Vw_Collect setDelegate : self ];     [ Vw_Collect setDataSource : self ];     [ Vw_Collect setBackgroundColor :[ UIColor groupTableViewBackgroundColor ]];          UINib *cellNib = [ UINib nibWithNibName : @"Task_FloreCollectionViewCell" bundle : nil ];      [ Vw_Collect registerNib :cellNib forCellWithReuseIdentifier : reuseIdentifier ]; #pragma mark -- CollectionViewDataSource //Collectionview Methods - ( NSInteger )numberOfSectionsInCollectionView:( UICollectionView *)collectionView {     return 1 ; } - ( NSInteger )collectionView:( UICollectionView *)collectionView numberOfItemsInSection:( NSInteger )section {     return ValArr2 . count ; } - ( UICollectionViewC...

Rendom Select Background

View.m NSArray *main_background=[[ NSMutableArray alloc ] initWithObjects : @"mainscreen2.png.jpg" , @"background_2.jpg" , @"background_3.jpg" , @"background_4.jpg" , @"background_5.jpg" , @"background_6.jpg" , @"background_7.jpg" , @"background_6.jpg" , @"background_5.jpg" , @"background_3.jpg" , nil ];               bgindx = arc4random () % [main_background count ];     //NSArray *main_img=[[NSArray alloc]initWithObjects:@"mainscreen2.png.jpg", nil];               UIGraphicsBeginImageContext ( self . view . frame . size );     [[ UIImage imageNamed :[main_background objectAtIndex :  bgindx ]] drawInRect : self . view . bounds ];      UIImage *image = UIGraphicsGetImageFromCurrentImageContext ();

Table Style (Border)

How to give table border in iOS yourtblname. layer . borderWidth = 2.0 ; yourtblname . layer . borderColor = [ UIColor redColor ]. CGColor ;

Text field Validation for Password

Validation -( BOOL )validation {     NSLog ( @"lat %@" ,[ AppDelegate sharedAppDelegate ]. latitud );     if ([ txt_username . text isEqualToString : @"" ])     {         [[ AppDelegate sharedAppDelegate ] showAlertWithTitle : ERROR_HEADER message : USERNAME_BLANK_MSG ];         return NO ;     }     else if ([ txt_email . text isEqualToString : @"" ])     {         [[ AppDelegate sharedAppDelegate ] showAlertWithTitle : ERROR_HEADER message : EMAIL_BLANK_MSG ];         return NO ;     }     else if ([[ ApplicationData sharedInstance ] ValidEmail : txt_email . text ] == NO )     {         [[ AppDelegate sharedAppDelegate ] showAlertWithTitle : ERROR_HEADER message : EMAIL_MSG ];         return NO ;     }   ...

Table view with cell

View.h File #import "DefaultTableViewCell.h" take delegetes @interface DefaultSideTableViewController : UIViewController < UITableViewDelegate , UITableViewDataSource > View.m  File #pragma marl - UITableView Data Source - ( NSInteger )tableView:( UITableView *)tableView numberOfRowsInSection:( NSInteger )section {     NSLog ( @"ItemList %@" , ItemList );     if (tableView == rearTableView )     {         return ItemList . count ;     }     else     {         return ItemList . count ;     } } - ( NSInteger )numberOfSectionsInTableView:( UITableView *)tableView {     return 1 ; } - ( UITableViewCell *)tableView:( UITableView *)tableView cellForRowAtIndexPath:( NSIndexPath *)indexPath {     DefaultTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier : Cell...