CategoryiOS

Add iRates in iPhone/iPad application

A

1)Download iRate.bundle form Add iRate.bundle, iRate.h, iRate.m Add StoreKit.framework from Build phases 2)#import “iRate.h” in AppDelegate.h/AppDelegate.m 3)AppDelegate.h/AppDelegate.m #pragma mark – delegate methods for iRates – (void)iRateCouldNotConnectToAppStore:(NSError *)error { } – (void)iRateDidDetectAppUpdate { } –...

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...

Convert non ARC files in ARC application and vice versa

C

1)If your application is ARC (Automatic Reference Counting), and try to use non arc files it will give you error, Then do this – Select Target – > Build phases -> Compile sources Double click on file which you want and write – (-fno-objc-arc) 2)If your application is NonARC, and try to arc files, Then do this – Select Target – > Build phases -> Compile...

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...

Category