Hello guys here in this article we are going to learn about converting Hex to UIColor.
First we are creating extension to UIColor as following:
extension UIColor {
// Code
}
Next add the following two methods inside the color extension as below:
//...
Post Top Ad
24 Dec 2017
27 Nov 2017
How to Record and Play Audio in iPhone using swift 4
In this article we are going to learn about recording sound using Swift 4. Not only recording but also playing the recorded file.
Here we are using AVAudioRecorder for recording audio and AVAudioPlayer for playing the sound.
It's an easy to record...
20 Nov 2017
How to convert Range to NSRange and Viceversa
NSRange contains two properties.
1. location
2. length
For example:
Get the range of word "find" from the following string.
let originalString = "Hello let's find range"
"find" located at position 12, and is length of 4. So range should be...
18 Nov 2017
UIRotationGestureRecognizer - Rotate image with Two Fingers in swift
In this tutorial we will learn how to rotate an imageView using UIRotationGestureRecognizer.
A rotation gesture is a continuous gesture that occurs when the first two fingers that touch the screen rotate around each other
The iOS UIRotationGestureRecognizer...
16 Nov 2017
UILongPressGestureRecognizer - Image zoom in and out example on Long Press Gesture in swift
In this tutorial we will learn how to zoom in and out an imageView using UILongPressGestureRecognizer.
The iOS UILongPressGestureRecognizer class has a built-in way to detect long press gesture on any view.
Other Gestures in iOS:
Single Tap &...
15 Nov 2017
Download Xcode dmg file for iOS development | Download all versions of Xcode dmg file
Here we are providing all direct links for downloading Xcode.
You can download any version from the following links based on your requirement.
Xcode 9
Xcode 9.2 (Beta)
Xcode 9.0
Xcode 9.0 (Beta 6)
Xcode 9.0 (Beta)
Xcode...
UIPanGestureRecognizer - Dragging View Example in Swift
In this tutorial we will learn how to drag a view using UIPanGestureRecognizer.
The iOS UIPanGestureRecognizer class has a built-in way to detect pan gesture on any view.
Other Gestures in iOS:
Single Tap & Double Tap Gesture - UITapGestureRecognizer
Swipe...
14 Nov 2017
Set Up Multiple Colors and Fonts in a Single Label Swift
In this article we learn setting up different colors in one label using NSAttributedString.
Label has text property and attributedText property.
Here we are going to use attributedText property for customization.
Add the following code:
override...
13 Nov 2017
Limit characters in TextField or TextView Swift
In this article we will learn how to set maximum character length to a UITextField and UITextView.
We go through each one separately.
UITextField:
First add UITextField to the view and conform to UITextFieldDelegate.
Next add the following delegate...
12 Nov 2017
UIPinchGestureRecognizer - Pinch Gesture Example on ImageView in Swift 4
The iOS UIPinchGestureRecognizer class has a built-in way to detect pinch gesture on any view.
In this tutorial we will learn Pinch Gesture Recognizer on ImageView.
Other Gestures in iOS:
Single Tap & Double Tap Gesture - UITapGestureRecognizer
Swipe...
11 Nov 2017
UITapGestureRecognizer - Single Tap & Double Tap Example in Swift 4
The iOS UITapGestureRecognizer class has a built-in way to detect taps on any view. We can set the required taps based on our usage.
Other Gestures in iOS:
Swipe Gesture Recognizer - UISwipeGestureRecognizer
Pinch Gesture Recognizer - UIPinchGestureRecognizer...
10 Nov 2017
Add Search Bar in Navigation Bar swift | Customize Search Bar
In this article we will learn how to add search controller in navigation bar. Customizing search bar like placeholder text, title text, clear button.
Here we are going to use Large Title Navigation bar.
Adding Search Bar In Navigation Bar:
Add the...
9 Nov 2017
Swipe Gesture Recognizer On ImageView swift 4
Swipe Gesture Recognizer is the one of the important gesture for the iOS users. It's really easy to implement, here we will show implementation to swipe gesture with an example project.
In this example project we are going to swipe image to left, right,...
8 Nov 2017
UILabel Left and Right margin Padding with Round Corners in Swift 4
In this article we will learn how to add margins/padding to the label using custom UIEdgeInsets.
In the above image we can clearly see "without padding" and "with padding".
"Without padding" is not looking great, so usually developers prefer labels...