October 2017 - Swift 4 Tutorials W3Schools

Post Top Ad

30 Oct 2017

Add Placeholder To UITextView in Swift 4 - iOS

10/30/2017 11:21:00 am 0
Swift provides default placeholder property to UITextField but not to UITextView. So if you need a multi-line editable text view, you don’t get a pretty placeholder. Here you will learn how to add placeholder text to UItextView. Here we will show...
Read More

28 Oct 2017

Argument of '#selector' refers to instance method that is not exposed to Objective-C | Add '@objc' to expose this instance method to Objective-C

10/28/2017 08:29:00 am 1
After installing Xcode 9 and migrating to Swift 4 from Swift 3 , @objc inference warning comes like below: The use of Swift 3 @objc inference in Swift 4 mode is deprecated. Please address deprecated @objc inference warnings, test your code with “Use...
Read More

27 Oct 2017

Passing Data Using NotificationCenter in Swift 4

10/27/2017 11:21:00 am 0
Passing data from one view controller to another view controller using Notification Center is an easy way when compared to delegate protocols. Here we need add observer or listeners for getting new data to load. First we need to send data using post...
Read More

26 Oct 2017

Store and Retrieve Image Locally Swift - Image Cache without Libraries

10/26/2017 11:47:00 am 1
Store images locally without using any other libraries. In this article we will store and retrieve images using our own code. We are storing images in a Document Directory. It's different for each app, so we can store image inside Document Directory. Create...
Read More

25 Oct 2017

Adaptive Autolayout Programmatically For iPhone X Using SafeAreaLayoutGuide - Swift 4

10/25/2017 10:46:00 am 0
Adaptive Autolayout mainly used to choose various layouts in different devices with orientations. Here in this article we create two layouts, one is for Portrait orientation and second on is for Landscape orientation. Here we are doing mainly for iPhone...
Read More

23 Oct 2017

Premium Login UI/UX Design using Swift 4 Programmatically With Autolayouts

10/23/2017 11:16:00 am 7
Now a days mobile apps are using premium UI/UX designs. Login screen UI/UX design itself says how the app is gonna look further. In this article we are going to create following login screen. We are not gonna use storyboard. The whole screen developed...
Read More

22 Oct 2017

Latest iOS Interview Questions & Answers 2018

10/22/2017 02:58:00 am 10
Question 1: class Person { var name: String var age: Int init(name: String, age: Int) { self.name = name self.age = age } } let person1 = Person(name: "John", age: 26) var person2 = person1 person2.name = "Mike" What's...
Read More

19 Oct 2017

Delegates Example in swift 4 | Pass Data with Delegation

10/19/2017 02:54:00 am 1
Delegates are a design pattern that allows one object to send messages to another object when a specific event happens. Delegate helps in passing data back from presented view controller(SecondVC) to presenting view controller(FirstVC). Imagine...
Read More

18 Oct 2017

Convert String To Int, Float, Double in Swift 4

10/18/2017 05:48:00 am 0
We can easily convert String to Int, Float, Double using swift language. String to Int: By using Int constructor we can convert as follow: let ageString = "25" if let age = Int(ageString) { print(age) } else { print("Not a valid string...
Read More

17 Oct 2017

How to add TextField to Alert View in swift 4?

10/17/2017 03:19:00 am 0
Adding UITextField to alertview became easy from swift 3 by using UIAlertController. Here we will show step by step. Step 1: First create UIAlertController object with title and message as follow: let alertVC = UIAlertController(title: "Enter...
Read More

16 Oct 2017

Concatenate/Merge Two Arrays into One Array in Swift 4

10/16/2017 08:46:00 am 0
Append two arrays into a new array with Swift standard library's. There are 5 different ways for merging arrays in swift. We may choose one of the five following ways according to your needs and requirements. Sorting Arrays in Swift 1. +(_:_:)...
Read More

14 Oct 2017

Sorting Arrays in Swift 4 - iOS 11

10/14/2017 10:10:00 am 0
Sorting Arrays using swift 4 is a simple using sorted() built-in method. Here is a example for sorting an simple array containing string objects. let friends = ["Sophia", "James", "Olivia", "Mike", "Nina"] print(friends.sorted()) //output is '["James",...
Read More

12 Oct 2017

Convert One Date Format To Another Date Format Swift 4 - iOS

10/12/2017 03:07:00 am 0
Converting a date string from one date format to another date format is an easy by using the following method: Date Formats: Following are the some Date Formats: Thursday, Oct 12, 2017 - EEEE, MMM d, yyyy 10/12/2017 - MM/dd/yyyy 10-12-2017...
Read More

11 Oct 2017

Convert Date To String & Vice-Versa Swift 4 - iOS

10/11/2017 05:54:00 am 0
Date To String: For converting Date to String we are going to create extension for Date as follow: extension Date { func toString( dateFormat format : String ) -> String { let dateFormatter = DateFormatter() dateFormatter.dateFormat...
Read More

10 Oct 2017

Convert UTC Timezone To Local/Device Current Timezone and Vice-Versa Swift 4 - iOS

10/10/2017 11:01:00 am 0
In this article we are going to convert UTC Date format to Current device date format. UTC is the time standard commonly used across the world. The world's timing centers have agreed to keep their time scales closely synchronized - or coordinated -...
Read More

8 Oct 2017

Storing/Downloading/Deleting images or videos Using Firebase Cloud Storage

10/08/2017 10:07:00 am 8
Cloud Storage for Firebase is a powerful, simple, and cost-effective object storage service built for Google scale. Firebase SDK adds Google security to file uploads and downloads for your Firebase apps, either if connectivity is slow or fast. If...
Read More

7 Oct 2017

Safe Area Layout Guides Tutorial iOS 11

10/07/2017 03:39:00 am 0
The layout guide representing the portion of your view that is unobscured by bars and other content. In iOS 11, Apple is deprecating the top and bottom layout guides and replacing them with a single safe area layout guide. Bottom layout guide &...
Read More

5 Oct 2017

Firebase Cloud Firestore Example Project in iOS - Swift

10/05/2017 06:43:00 am 1
Cloud Firestore is a scalable database like Firebase Realtime Database, it keeps your data in sync across client apps through real time listeners and offers offline support for mobile and web so you can build responsive apps that work regardless of...
Read More
Page 1 of 1412345...14Next »Last

Post Top Ad