Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

NSTimer In Swift

Hi all, You can use the NSTimer class to create timer objects or, more simply, timers. A timer can wait and call a method or selector after defined period of time. for example :- if you want show a seconds clock and stop when it completed 60 s...

Zoom mapview to show all annotaions

Hi all, If you are adding multiple annotation in your amp and you want to show all annotations initially. then just call this method after adding all annotation to your mapview. There are some globally declare variable such as :- #defin...

Display Splash Screen for longer Time in iOS

Splash Screen is the first screen which appear when we launch an application and disappear when the main screen get loaded. It appear for a few second to show that our app is fast and responsive . In order to display your splash screen more t...

Error Handling in Swift 2

SWIFT Swift is a very powerful and simple programming language which is used for creating the iOS applications.Swift is a language which is designed to work with Apple's Cococa and Objective-C. The advantage of this language is that it is one...

How to play a video file ios

Hello Friends, Create an object of MPMoviePlayerController: MPMoviePlayerViewController *moviePlayerController; NSURL *videoUrl=[NSURL URLWithString:@"String value of your url"]; Initialize the instance of MPmoviePlayerViewControl...

Deleting Cells of tableview ios

Hello friends, To delete a cell at a particular indexpath you may use the following code: -(void)removeItemAtIndexPath:(NSIndexPath *)indexPath{ [(name of table) beginUpdates]; // I am assuming that you're just using a plain NSMut...

Change color of polyline

Hi all, If you want to change the color of a polyline or route on map just change the color in this delegate of map. - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id <MKOverlay>)overlay { MKPolylineRen...

Adding card with braintree

Hi All , These are simple steps to add card to braintree account in iOS. 1.Initialize braintree object with valid client token. BTAPIClient *token = [[BTAPIClient alloc] initWithAuthorization:@"cleintToken received from tree"]; ...

Merge images to make a single image

It is easy to merge different images to make a single image. It is like pasting images to a canvas and taking picture of that canvas. Below I have explained how to do it. -(UIImage*)combineImages:(NSMutableArray *)images{ CGRect frame =...

Slide menu application in iOS.

Hi Friends, I know there are several applications which are using Slide Menu option. You can find several libraries or classes in Objc to build an app like that. Here is the most easy and customizable class to get it. Its name is SKSlideVie...

Listing the videos stored in gallery

Hello friends, The following code can be used to show the videos stored in gallery: UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init]; imagePicker.delegate = self; imagePicker.sourceType = UIImagePicke...

Change UISearchBar Field Text Color in iOS

You can change UISearchField text color in iOS. Use single line of code to do it. [[UILabel appearanceWhenContainedIn:[UISearchBar class], nil] setTextColor:[UIColor whiteColor]]; Happy Coding!!!

Compare two dates in iOS

To compare two dates we can use the following code : NSComparisonResult result = [mydate1 compare:mydate2]; //where mydate1 and mydate2 are two dates we want to compare. if (result == NSOrderedDescending) { //mydate1 is later than myda...

Detect if an Internet Connection exists in iPhone using (ARC and GCD compatible) class

Hi Readers, Below are steps you need to follow when you are checking if their is an Active Internet connection in an Iphone using (ARC and GCD compatible) class. 1) Add SystemConfiguration framework to the project but dont worry about inclu...

How to change the font of SearchBar's Placeholder and TextField

To change placeholder font add the following code: [[UILabel appearanceWhenContainedIn:[UISearchBar class], nil] setFont:[UIFont fontWithName:@"Helvetica" size:12.0]]; and,to change the font for the SearchBar textField add the following lin...

Changing TextField Placeholder Color

Hello friends, We may change the text field placeholder color using either storyboard or using code. Using Storyboard: Choose the text field and under textfield runtime attributes click on the '+' button and add a key: _placeholderLab...

How to display annotation on any Location in MKMapView

If we want to display the annotation point on any coordinates in MKMapView use the following functions- By using the annotation anyone can easily recognize the location.We can also set the Title here which will show when user click on that...

How to set placeholder text in uitextview

If we want to set the placehoder text in uitextview then we have to use the delegates methods of textview because there is not an option to set the placeholder directly in xcode. Here is the methods-- - (void)viewDidLoad { [super vi...

How to Show a pdf File from URL in a UIWebview in iOS

when we want to open the pdf file from a URL string then we use the UIWebView. In webview we can directly open the file by loading the url request.use the following function-- -(void)addWebViewOverLay:(UIWebView *)webView { webView = [[UI...

How to create first iOS application in Xcode?

How to create first iOS application in Xcode for iPhone with no programming experience where Ill help even the non-programmer to enjoy coding as an iOS developer. This is an XCode tutorial for beginners so Ill be going through where to downlo...

How to show a overlay view in ios

Sometimes we need to show a overlay view over the main view so that user not able to click on the background view assets like button click. in order to display the overlay view use the following function-- - (void)getOverlayView{ overlay...

Seat Selector For iOS

Hi All, Now days , we start booking seats online so if you also want to implement seat selection functionality than follow these steps . Download ZSeatSelector from this link https://github.com/richzertuche/ZSeatSelector Now drag two fil...

Show a route between two coordinates using MKMap view in iOS

In ios when we want to show a route or poly line between two coordinate then we use the following function. most of time we use this when we want to dislplay the route from current location to destination address. Here mapView is the property...

How to change default search bar text and icon

Hello Friends, Changing the default text of search bar: Using storyboard: The search bar has a placeholder property, you may give it any text value as per your requirement. Using code: ObjectofSearchBar.placeholder = @"Your Value"; ...

Get contact name and phone number

Hi all, If you want to get contact name and contact number from your iphone contact list then below two methods can help you to get contact name and contact phone number . Note: In this you will only get those contacts,which contain phone ...

Sorting an array containing mantle model as object

Hi all, To sort an mantle array containing mantle model as object ,You can easily sort by multiple keys by adding more than one to the array. Using custom comparator-methods is possible as well. NSSortDescriptor *sortDescriptor; s...

Bounds and Frames in iOS

Hi Readers, This Post is to tell about the BOUND and FRAME in ios. BOUND: The bounds property of a view defines the size of the view and its position in the view's own coordinate system. This means that in most cases the origin of...

Save and retreive text from text file

Hi all, If you want to save anything in text file or any kind of file than you can follow this code. This code will save text to textfile in your application directory.You can retrieve text from save file later on . NSError *error; NSStrin...

Chaneg Textview height according to text

Hi All, If you want to change height of textView according to content height than you can follow this code. Use auto layout to set view in story board and make IBOutlet for textview . Assign delegate to textview and dont give height constra...

MFMessageCompose ViewController in swift

Step1: Import the MessageUI using :- import MessageUI Step 2: class ViewController: UIViewController, MFMessageComposeViewControllerDelegate Step 3: when you tap on the button the list of contact will appear and you can choose the contact ...

Show flags using Unicode

Hi All, If you want to show flags in using unicode hex coding (U+XXXX) than you can follow this code . UNICODE:- Unicode is a computing industry standard for the consistent encoding, representation, and handling of text expressed in most of...

How to get data from dictionary and add them into an array in ios

If you want to get data from dictionary and add them into an array below code will help you, In this blog firstly i have created a NSMutableAarray and after that created a NSArray which contain the value like ram,13 etc then i created a NSMutable...

add touch event to UIView

To provide some action on touch of any view ,UITapGestureRecognizer is used. Write this code in viewDidLoad - (void)viewDidLoad { [super viewDidLoad]; myView.userInteractionEnabled = YES; UITapGestureRecognizer *singleFingerTap = ...

Caputre Screen Shot in IPhone

if you want to capture the screen shot of the screen in swift use the code below. this function will return an image that can be used as background image of a view The size of the captured image is same as the size of device. func caputreSc...

Delete object from Parse table in iOS.

If you want to delete an object from Parse DB then you have to run a query to fetch that object and then run a loop to delete it. If you already have that object then just call delete method. Here is the complete code. PFQuery *query = [PFQuer...

Get thumbnail image from a recorded video in iOS

If you want to get thumbnail image from the recorded video in iOS then you can cut a small frame from that video to generate an image. You just need to send video output URL to below method as a parameter. This method willl return you NSData. Lat...

Property List of MPMoviePlayerController for iOS

There are several properties available for MPMoviePlayerController in iOS. We just need to use them to play the movie according to our need. You can access these properties like this:- Create property in .h file @property (strong, n...

Create a PIe Chart in iOS

The main use of a pie chart is to show comparison. When items are presented on a pie chart, you can easily see which item is the most popular and which is the least popular. you can create the pie chart in iOS by using the following methods...

How to use NSMutableAttributedString

Hello Friends, NSMutableAttributedString allows to set different attributes(font size,font color) for different parts of the string. To use NSMutableString you may use the following code: //Create an object of NSMutableAttrinbuteString and ass...

To call and send parameters to java Script function from Objective C

To call javascript function write the following lines : NSString *getStringvalue=[webView stringByEvaluatingJavaScriptFromString:@"getName()]; Where getName() is a JavaScript function which return a String value. and to send Objective C...

test if an NSString is empty in Objective C

You can check if( [empName length]==0 || [[empName stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) this will return 1 else 0 NSString *empName; if ([empName length]==0 || [[empName stringByTrimmingCharac...

Check for the iPhone Models

To know On which hardware iOS is ruining like iPhone4 , iPhone5 etc below is the code for that #import <sys/utsname.h> -(NSString*) deviceName { struct utsname systemInfo; uname(&systemInfo); r...

Audio Playing while App is in Background Mode

In order to continue your audio running while the app is in Background mode(like in the case of live Streaming), we just have to add this line in our AppDelegate method application didFinishLaunchingWithOptions: [[AVAudioSession sharedInstanc...

TableView in Swift

To create a tableView in swift please follow following steps: Step 1: Add a tableView in viewController. Step 2: set the dataSource and delegate Step 3: Create a prototype cell Step 4: Change the class of prototypecell to "TableView...

How to implement the Auto Layout Contraint through Code

Hi Readers, This Post is just a brief introduction about How we can implement Autolayout Contraints through coding. Now,Before moving ahead with the topic let us have a brief about AutoLayout. WHAT IS AUTOLAYOUT...?? Auto Layout is a ...

NSTimer in IPhone SDK

Here is the code for: calling a method after a time interval delay. we use the NSTimer to implement this. NSTimer *timer= [NSTimer scheduledTimerWithTimeInterval:3.0 target:self ...

Find the country of the user

To find out the country of the user please use the code below: 1- Add the coreLocation Framework to your project and import #import <corelocation corelocation.h=""> 2- Set the CLLocationManagerDelegate as UIViewController @interface...

Check Wifi Network reachability in Swift

In Swift if you want to check the Wifi connection in your device then use following code. This is a function which returns Reachability instance (reachability class object) value as a returnvalue for wifi connection availability. + (instan...

Search a location in ios SDK

if you want to search a particular location using the google api so you can use this . Step 1: Get the serverKey From the http://console.developers.google.com/ and write the server key as below. Step 2: #define kGOOGLE_SERVER_KEY @"dsjfdsuiodfd...

Fetch Parse PFUser data in iOS

If you are querying on Parse User class and not getting the user data of custom columns then use below code. PFQuery *query= [PFUser query]; [query whereKey:@"username" equalTo:[[PFUser currentUser]username]]; [query getFirstObjectIn...
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: