UIImageView *SponsorLogo = [[UIImageView alloc] initWithFrame:CGRectMake(15, 90, 40, 40)]; dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^(void) { NSData *data0 = [NSData dataWithContentsOfURL:[NSURL URLWithString:@“your_image_URL_Here”]]; UIImage *image = [UIImage imageWithData:data0]; dispatch_sync(dispatch_get_main_queue(), ^(void) { SponsorLogo.image =...
How to define core location manager method in iOS 8?
Step 1: Add following key and value in Info. plist of your project. 1. Key – NSLocationWhenInUseUsageDescription Value- This will be used to obtain or track your location. 2. Key -NSLocationAlwaysUseUsageDescription value- This will be used to obtain or track your location. Step 2 : add following line where you want to declare or initialise core location . if ([locationManager...
How to set UIDatePicker date from current date to 10 years ?
datePicker is your UIDatePicker
[NSDate date] is your current date
[datePicker setMinimumDate:[NSDate date]];
NSCalendar *calendar = [NSCalendar currentCalendar];
NSDateComponents *comps = [NSDateComponents new];
comps.year = 10;
NSDate *tenYears = [calendar dateByAddingComponents:comps toDate:[NSDate date] options:0];
[datePicker setMaximumDate:tenYears];
Paypal REST API – How does Tokens work.
At the very first User Login: 1. Obtain an Authorization Code { “response_type”: “authorization_code”, “response”: { “code”: “EBYhRW3ncivudQn8UopLp4A28xIlqPDpAoqd7biDLpeGCPvORHjP1Fh4CbFPgKMGCHejdDwe9w1uDWnjPCp1lkaFBjVmjvjpFtnr6z1YeBbmfZYqa9faQT_71dmgZhMIFVkbi4yO7hk0LBHXt_wtdsw”, }, “client”: {...
Adding Event to Native calendar in iOS
Add Eventkit framework to your project //Code Snippet: EKEventStore *store; store=[[EKEventStore alloc] init]; //for iOS 7.0 and above we need to have the permission of user for using eventkit that is the calendar //ask for permission: [store requestAccessToEntityType:EKEntityTypeEvent completion:^(BOOL granted, NSError *error) { // handle access here if(granted) { //configure event: EKEvent...
Speech to text conversion in iOS
There are lots of Speech to text conversion techniques are available but each one have their pros and cons. The Google Speech API is more convenient. I tried lot of ways for the conversion, but Google API is more efficient and quite easy but having insufficient documentation. I found that the API accepts flac encoded audio file, but in iOS the flac format is not supported. Finally I found the...
How to post custom facebook stories to timeline
1.Create a facebook app & setup app id with your project. 2.create your own story from facebook app opengraph section by creating action & object. 3.Post one story to app owner timeline & submit it to the facebook review team so that it will be become public for app user & can be seen publicaly on timeline follwing code shows the how to post the story. -(void)Poststory { NSString...
Moving view along with fingure touch
You can move any view inside your viewcontroller simply adding pangestureRecogniser -(void)ViewDidLoad { //add pangesture recognise to your moving view UIPanGestureRecognizer *mSwipeUpRecognizer = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(handletapgesture:)]; [mSwipeUpRecognizer setMaximumNumberOfTouches:1]; [mSwipeUpRecognizer setMaximumNumberOfTouches:1]; [Yourview...
Handling Push Notification in iOS
The push notification is quite complex part to handle. Get it done in only Three easy steps 1] Register for push notification 2] Get Device token 3] Implement delegate methods to handle push notification 1] Register for push notification – (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // register for remote notification...
Adding multiple uicontrollers on view
If we create multiple controllers programmatically, we generally use for loop but we can add the same controllers by using the methods, example: 1. By using for loop for (int i = 0; i < 3; i++) { UITextField *textField= [[UITextField alloc] initWithFrame:CGRectMake(50, 20+40*i, 117, 30)]; textField.borderStyle = UITextBorderStyleRoundedRect; textField.font = [UIFont...