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

Featured

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

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

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: