CategoryiOS

How to resize image programmatically in iPhone

H

Hello friends, many times we need to resize the UIImage runtime according to the need of application.  Here is the function which changes the size of the image and returns a new resized image – (UIImage *)reSizeTheImage:(UIImage *)image convertToSize:(CGSize)size { UIGraphicsBeginImageContext(size); [image drawInRect:CGRectMake(0, 0, size.width, size.height)]; UIImage *destImage =...

Add UIButton on UITableView when drag , Swipe or touches moved on Cell Using UIGestureRecognizerDelegate in iPhone

A

//——– .h //Delegate UIGestureRecognizerDelegate UIButton *YourButton; //——– .m – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *SimpleTableIdentifier = @”SimpleTableIdentifier”; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:SimpleTableIdentifier];...

Launch the app store app from your application

L

  Step 1: Create an empty iPhone application with and add the UIViewController subclass to it. Step 2: Create a view just like the one given below and the add the view of this view controller into the iPhone window. Step 3: Create a function for the button and this function will contain the code for launching the app store application of the iOS device from your application. So declare a...

How to create iPhone/iPad’s “Slide to Unlock” animation ?

H

This is how Apple implemented “Slider to Unlock” or “Slide to Power off” animation. In .h file UISlider *slider; BOOL touchIsDown; CALayer *textLayer;     – (void)viewDidLoad { self.view.layer.backgroundColor = [[UIColor grayColor] CGColor]; UIImageView *sliderBackView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@”SliderBack1.png”]]; sliderBackView.frame =...

How to create file and read/write Data in iphone/ipad

H

//Documents Directory Path NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; //Give file Name With Extention to create NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@”FileName.docx”]; [[NSFileManager defaultManager] createFileAtPath:savedImagePath...

Category