Authormayur.bhansali

Page turn effect using UIPageViewController

P

The UIPageViewController class was introduced into the iOS 5 SDK as a mechanism to implement a page turning style of user interface in iOS applications. The UIPageViewController is a highly configurable class that it lets developers to configure: the orientation of the page views – vertical or horizontal the transition style – page turning style or a dot based style the axis (spine) on which the...

Get a list of all contacts on iOS

G

#import <AddressBook/AddressBook.h> #import <AddressBookUI/AddressBookUI.h> CFErrorRef *error = NULL; ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, error); CFArrayRef allPeople = ABAddressBookCopyArrayOfAllPeople(addressBook); CFIndex numberOfPeople = ABAddressBookGetPersonCount(addressBook); for(int i = 0; i < numberOfPeople; i++) { ABRecordRef person =...

How to disable Copy , Paste, selectAll, select etc… action for UITextView

H

Its very simple 🙂 🙂 Step 1: Create SubClass file with name CustomUITextView for UITextView In .m file write below code – (BOOL)canPerformAction:(SEL)action withSender:(id)sender { if (action == @selector(selectAll:) || action == @selector(select:) ||action == @selector(copy:) || action == @selector(paste:)) { return NO; } return NO; } Step 2: Add below code translationLable =...

Tap on UITextView and get exact word from text using UITapGestureRecognizer

T

UITapGestureRecognizer is a concrete subclass of UIGestureRecognizer that looks for single or multiple taps. For the gesture to be recognized, the specified number of fingers must tap the view a specified number of times. Lets see how it work for UITextView. in .h file add below code @interface MMExampleRightSideDrawerViewController : MMExampleSideDrawerViewController in .m file add below code...

How to check Newtwork Reachability in iOS

H

First Download Reachability files from here: Click Here Step 1: write below code in AppDelegate.h file. #import “Reachability.h” @class Reachability; //Rechability int internetconnectioncheck; Reachability *internetReachable; Reachability *hostReachable; UIAlertView *internetalert; BOOL Net_chkFlag; @property BOOL Net_chkFlag; Step 2: write below code in AppDelegate.m file. file in...

Simple way to post on Facebook wall

S

The UIActivityViewController class is a standard view controller that you can use to offer various services from your application. The system provides several standard services, such as copying items to the pasteboard, posting content to social media sites, sending items via email or SMS, and more. Apps can also define custom services. If you want to share some message or image with social...

Loading images in background (Lazy Loading).

L

Some times we need to take images from server and on clicking performing some actions. This code help you how to get one by one images and displaying into the app. Step 1: Decalre NSMutablearray *ImgPathArr in .h file. in .m File add below all methods Step 2: Call below method, use your web service and add all ImagePath into ImgPathArr. -(void)LoaMoreBooksAppImg { ImgPathArr = [[NSMutableArray...

Category