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

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

Convert NSString to NSDate and vice versa

HI all, If you want to convert NSString to NSDate ,then you must use NSDateFormatter to convert please follow this code . NSString to NSDate In Objective-C :- NSString *dateString = @"11-11-2015"; NSDateFormatter *dateFormatter = [[...

How to create a UILabel & UIButton programmatically in Swift

hello friends, this is how we can create a UIButton and UILabel in swift. Set a UILabel in swift var label = UILabel(frame: CGRectMake(100, 100, self.view.bounds.size.width, 50)) label.center = self.view.center la...

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

Make a Call using swift

Hi All, To call any number with code using swift you can use this function. private func dialNumber(phoneNumber:String) { let phoneUrl:NSURL = NSURL(string: "tel://\(phoneNumber)")! let application:UIApplication = UIAppli...

Load custom cell(Xib) in UITableView in swift

hello friends, if you would like to Load custom cell(Xib) in UITableView in swift ,you may use the following code -> func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { return array.count; //...

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 declare an Array in Swift

Hi Readers! There are different ways to declare Array in Swift. I will write few examples below: Example 1: let a : Array? = ["hello","hi"] Now in above example this is a constant array. You cannot add/append an element in it. E...

how to merge objc and Swift code in same project

To use swift code in Objective-c project -> 1. Go to your objective-c project -> create a new file -> source -> Cocoa Touch Class -> change language to Swift -> create. 2. Now a alert will pop-up Would you like to configur...

Why to use tuples if we have Arrays in swift language and How it is different from Structures?

Hi Readers, Before Moving ahead with the Topic,Lets us Briefly have a overlook what actually a Tuple is: * In very simple language: A tuple is a group of zero or more values represented as one value. For example ("Pen", "50") ...

What is an Optional meant in Swift?

Hi Readers! An Optional is just an enum in Swift. enum Optional<T> { case None case Some(T) } Here <T> is generic similar to an Array<T> <T> could be anything like Strings, Dictionary, Array etc. ...

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

How to get view controllers from navigation controller in swift

Hi Readers! Please find below the code that you can use to get view controllers stack from Navigation Controller in swift. var vc:NSMutableArray = ((navigationController?.viewControllers as! AnyObject) as! NSArray).mutableCopy() as! NSMuta...

ios automatically converting dialed number

I am writing code to make calls from the app.I am in India. It works fine for non toll free numbers. But for some number such as 18601231000 for BigBasket it is converting the number as +1(860)1231000 which when dialed comes as wrong number.But f...

Custom Check For iPhone , IOS Version , Email And Phone Number in swift

Hello Readers, These are some of the custom checkers to detect iPhone Current IOS Version Email Validation Phone Number Validation For iPhone 4 and 4s :- func isIPHONE4() -> Bool{ let screenSize: CGRect = UIScree...

Redirect to app settings in iPhone

If you want to redirect to app settings from your app then use below code to do it. Apple provides a list of URLs to redirect the app to its setting section. Here is the code :- In a Swift Program:- UIApplication.sharedApplication().ope...

How to convert NSData to NSString or vice versa in Objective C and Swift

Hi Readers! In this blog you can find both versions (Obj C & Swift) for converting NSData to NSString or vice-versa. Objective C NSString * str = @"Hello"; NSData * data =[str dataUsingEncoding:NSUTF8StringEncoding]; NSLog(@"Data = ...

Send mail using iOS

Sometimes we need to send the email from iOS application for that we have to integrate MFMailComposeViewController in our application so that we can send email. This program will help you to send email through your app using swift. Steps Requ...

What is the purpose of using IBOutlet & IBAction?

As you all know that at compile time 1. All IBOutlet keywords are removed entirely. 2. All IBAction keywords are replaced by void because actions invoked by user interface controls are not expected to have a return value. The question then a...

How to show alert view in Swift (iOS8) with OK and Cancel button?

To show an alert view in swift while using iOS8. Here is an example of how to use it: var MyAlert = UIAlertController(title: "Logout", message: "Are you sure?", preferredStyle: UIAlertControllerStyle.Alert) var MyOkayAction = UIAlertAction...

Difference between 'var' and 'let' in swift programming language

In Swift, both defines a variable. The let keyword define a constant like let api_key = 42979 The api_key cannot be changed afterwards; Its value is set once and only once The var define an ordinary variable that hold the data like ...

How to show an alert view in Swift Programming Language?

To show an alert in Swift programming language, you need to first import the UIKit framework then use UIAlertController object. A UIAlertController object displays an alert message to the user. Important: UIAlertView is deprecated in iOS 8....

Tuples in Swift

Tuples is a new concept that is introduced in swift programing. Tuples group the multiple values in a single compound value. It is not necessary that the each tuples value should have the same datatype. The datatype can be different and number of...

Quick reference of swift language comparison with Objective C

Quick reference of swift language comparison with Objective C code
1 3 next
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: