Posts

Showing posts with the label swift 3

How To Fetch Date & Time In iOS Using Swift 3 & Xcode 8 ?

Image
How To Fetch Date & Time In iOS Hi, In this tutorial, I'll show you how to get the date and time in iOS apps using Swift 3 and Xcode 8. This is very useful to learn and you can easily fetch current date & time just by using a few lines of code. So, let's start and see how to get the date & time in Swift.. You can also watch this tutorial on my YouTube channel here:  How To Get Date & Time in iOS ? First of all, open your Xcode and create a Single View Application. Now give some name to your project and make sure to choose Swift as the language. So, once you're in your Xcode editor, open ViewController.swift file and add these lines of code in your viewDidLoad() method: override func viewDidLoad() {         super . viewDidLoad ()                  let date = Date ()         let calendar = Calendar . current     } Here, we're crea...

How To Hide Keyboard In iOS Applications ?

Image
How To Hide Keyboard In iOS Hi, In this post, I'll show you how to hide keyboard in your iOS apps. So, lets get started and see how to do it. You can also watch this tutorial on my YouTube channel here:  How To Hide Keyboard in iOS using Swift ? First of all, open your Xcode and create a new Single View Application. Now, give some name to your product like "HideYourKeyboard", and make sure to choose Swift as the language. Now, Go to Main.storyboard and drag a text field on it. Add some constraints on this text field as shown in the image below: Now, open the Assistant Editor and make sure both storyboard and view controller files are visible as shown in the picture below: Now, ctrl-drag your text field to viewcontroller.swift file and create its outlet. Once done, then close this section and open your viewcontroller.swift file. Here, first of all add UITextFieldDelegate method as shown in the image below. Now, we'll add 2 funct...

Facebook iOS Tutorial Using Swift 3 + Xcode 8

Image
Facebook iOS Tutorial Using Swift 3 + Xcode 8 Hi, In this post, I'll show you how to use Social Framework in iOS applications. Using the Social Framework, you can easily integrate the services of any supported social network in your iOS apps. Its very easy to implement and you can easily integrate social networks like Facebook, Twitter etc. in your iOS apps. In this tutorial, We'll use Social framework to create a post from our app and send it to Facebook feeds wall. So, let's start and see how to do it.. :) First of all, open your Xcode and create a Single View Application. Click Next. Give some name to your product and fill other details as shown in the image below. Make sure to choose swift as the language and click Next. Now, go to Main.storyboard and drag a button from object library and give it some title like "Post To Facebook".  Its time to add some constraints on the button. So, select your button and click on the Align Auto Layout...

UI Date Picker For UI Text Field With UI Tool Bar (Swift 3 + Xcode 8)

Image
UI Date Picker For UI Text Field With UI Tool Bar In iOS Hi, In this post, I'll show you how to use UI Date Picker for UI Text Field in iOS using Swift 3 and Xcode 8. During this, you'll also get to know about UI tab bar and how to use UITabBar to fetch the details from any picker and set them in desired textfields in your iOS application. FYI, You can also watch this tutorial on my YouTube Channel. You may get a better representation of this swift tutorial over there. Here's the video:                So, let's start and see how to do it.. :) First of all fire up your Xcode and create a new project. Select Single View Application and click Next.  Now, Give some name to your project and choose Swift as language, click Next. Go to Main.storyboard and drag a textfield on the storyboard. Add some constraints on this textfield as shown in the picture below.   After adding these constraints, our storybo...