Posts

Showing posts from June, 2016

iOS UIScrollView in UIView

Create a UIscrollview IBOutlet in your (.h File) @interface MyViewController : UIViewController {     IBOutlet UIScrollView *Scroll_View;          UIView *View; } @implementation MyViewController - (void) viewDidLoad  {     [super viewDidLoad]; Scroll_view.contentSize = CGSizeMake(view(YOUR UIVIEW OR SOMETHING).frame.size.width, view_inner(YOUR UIVIEW OR SOMETHING).frame.size.height); } When you created a IBOutlet,you should connect to your UIScrollview and UIScrollViewDelegate;
Import Google Analytics In your application and how to track the Screenname and Events. Add app’s libraries : APP--->Build Phases--->Link with Library--->Add Project libGoogleAnalyticsServices.a CoreData.framework SystemConfiguration.framework libz.tbd Add the GA SDK (not the pod file): GAI.h GAIDictionaryBuilder.h GAIEcommerceProduct.h GAIEcommerceProductAction.h GAIEcommercePromotion.h GAIFields.h GAILogger.h GAITrackedViewController.h GAITracker You need to configure —>“GoogleService-Info.plist” After add all the library and files.Add this  //  AppDelegate.h #import "GAI.h" @property ( nonatomic , strong ) id < GAITracker > tracker; //  AppDelegate.m /******* Set your tracking ID here *******/ static NSString * const kTrackingId = @“Your TrackinG Id” ; static NSString * const kAllowTracking = @"allowTracking" ; - ( BOOL )application:( UIApplication *)application didFinishLa...

UITableviewcell custom button is fly like rocket animation.

#pragma mark - Table View - Favorite Click -( IBAction )cell_fav_clicked:( id )sender     UIButton *btn_select = ( UIButton *)sender;     NSInteger row_id= btn_select. tag ;      NSIndexPath *ip = [ NSIndexPath indexPathForRow :row_id inSection : 0 ];         [ self Favorite_Animation :ip button :btn_select]; } -( void )Favorite_Animation:( NSIndexPath *)indexPath button:( UIButton *)btn {      // get the exact location of button     CGRect rect = [btn. superview convertRect :btn. frame fromView : nil ];     rect = CGRectMake (btn. frame . origin . x + 50 , (rect. origin . y *- 1 )- 10 , btn. frame . size . width , btn. frame . size . height );     NSLog ( @"rect is %f,%f,%f,%f" ,rect. origin . x ,rect. origin . y ,rect. size . width ,rect. size . height );          // create new duplicate button    ...

Changing the Array of images for an UIImageView using Backward and Forward button.

UIImageView * img_view1; int currentIndex; UIButton *forward_btn2; UIButton *backward_btn1;   NSMutableArray *arrimg; -( IBAction )backward_btn1:( UIButton *)sender {     forward_btn2 . enabled = YES ;          if ( currentIndex != 0 )     {         currentIndex --;                  if ( currentIndex == 0 )         {             backward_btn1 . enabled = NO ;         }         [ img_view1 setImage :[ UIImage imageNamed :[ arrimg objectAtIndex : currentIndex ]]];     } } -( IBAction )forward_btn2:( UIButton *)sender {     backward_btn1 . enabled = YES ;          if ( currentIndex != arrimg . count - 1 )     {         ...

A UIImage category that loads animated GIFs for iOS.

This project defines a category  animatedGIF  on  UIImage . The category defines two methods. This method creates an animated  UIImage  using the frames of the GIF in  data : +[UIImage animatedImageWithAnimatedGIFData:(NSData *)data duration:(NSTimeInterval)duration] This method creates an animated  UIImage  using the frames of the GIF loaded from  url : +[UIImage animatedImageWithAnimatedGIFURL:(NSURL *)url duration:(NSTimeInterval)duration] To use this category in your own project,  copy  UIImage+animatedGIF.h  and  UIImage+animatedGIF.m  to your project, and add  ImageIO.framework  to the "Link Binary With Libraries" build phase of your target. The implementation of this category is quite simple. It uses the  Image I/O Framework  to do all of the real work. Author: Rob Mayoff 2012-01-27 Check the below link for your reference.Thanks https://github.com/diegopeinador/uiimage-from-...

iPhone Shake animation for Coin(Toss) flip and UILabel

In .h file {       NSArray * flipImages;           int randomImgNum; } @property ( strong , nonatomic ) IBOutlet UIImageView *coin_view; @property ( weak , nonatomic ) IBOutlet UILabel *coin_lbl; In .m file - ( void )motionEnded:( UIEventSubtype )motion withEvent:( UIEvent *)event {     if (motion == UIEventSubtypeMotionShake )     {         [ self showAlert ];     } } -( IBAction )showAlert {     coin_lbl . hidden = YES ;     //get random number    randomImgNum = arc4random_uniform ( 2 );          CATransition * transition = [ CATransition animation ];     transition. startProgress = 0 ;     transition. endProgress = 1.0 ;     transition. type = @"flip" ;     transition. subtype = @"fromRight" ; ...