Found 208 Articles for IOS

How to detect a long press in iOS?

Kumar Varma
Updated on 30-Jul-2019 22:30:26

715 Views

Long-press (also known as press-and-hold) gestures detect one or more fingers touching the screen for an extended period of time. You configure the minimum duration required to recognize the press and the number of times the fingers must be touching the screen. (The gesture recognizer is triggered only by the duration of the touches and not by the force associated with them.) You might use a long-press gesture to initiate an action on the object being pressed. For example, you might use it to display a context-sensitive menu.You can read more about it  https://developer.apple.com/documentation/uikit/touches_presses_and_gestures/handling_uikit_gestures/handling_long-press_gesturesHere we will be designing a simple ... Read More

How to show Alert Dialog in iOS?

Rama Giri
Updated on 30-Jul-2019 22:30:26

1K+ Views

Knowing how to play with Alert is very important if you’re designing any iOS Application. Here we will be focusing on how to show Alert using UIAlertController.To read more about UIAlertController refer −  https://developer.apple.com/documentation/uikit/uialertcontrollerIn this, we will be creating a new project where we will have a button, on tapping that button we will show alert with custom message.Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “Alert”Step 2 − Open Main.storyboard and add a button and name it tap. Create @IBAction of that button in ViewController.swit and name the same as tap.There’s ... Read More

How to make dotted/dashed line in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

3K+ Views

Knowing how to make dotted or dashed line is very important. You might develop a page where you ask user to enter fields, there you can represent the same with dotted line. Dotted line can also be used to highlight certain things in an application.The most important use is in the navigation application. While designing the navigation application you must know how to draw the path and you might end up using dotted lines.Let us see how we can achieve this functionality in iOS.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “DottedLine”Step ... Read More

How to add shadow on text swift?

Sharon Christine
Updated on 30-Jul-2019 22:30:26

581 Views

If you’re developing a game or a kids application or an application where you want to make attractive user interface you must know how to add shadow on text. This will not only makes the text attractive but also it will also enhance the user experience.Here we will see how we can add shadow on text.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “ShadowText”Step 2 − Add label in Main.storyboard and create @IBOutlet of the label and name it lblHelloWorld.Step 3 − Add the below code in your ViewController.swift, add the complete ... Read More

How to answer incoming call programmatically in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

314 Views

Apple iPhone SDK doesn’t allow this feature. If you really wish to achieve it you can use some private api such as CTCallAnswer(call);This will result in your app store rejection.

How to create transparent Status Bar and Navigation Bar in iOS?

Sharon Christine
Updated on 30-Jul-2019 22:30:26

1K+ Views

You might have come across many application where the screen extends to complete screen i.e transparent Status Bar and transparent navigation bar.Here we will be seeing how to create an application where the you’ll be having transparent status and navigation bar.So let’s get startedStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “TransparentViews”Step 2 − Embed the View Controller in Navigation Controller. Add Image View and shown and add image.Step 3 − Run the application without adding any piece of code for making status and navigation bar transparent.The screen looks like belowStep 4 ... Read More

How to get the Navigation Bar height in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

3K+ Views

A navigation bar appears at the top of an app screen. To read more about ithttps://developer.apple.com/designhttps://developer.apple.com/documentationGetting height of Navigation bar becomes important if you’ve multiple view controllers having different UI and requirement. It becomes hectic if you’re not aware how to get the height of the same or modify as per need. Let’s see how we can get the height of Navigation bar.import UIKit class ViewController: UIViewController {    override func viewDidLoad() {       super.viewDidLoad()       let navBarHeight = UIApplication.shared.statusBarFrame.size.height +          (navigationController?.navigationBar.frame.height ?? 0.0)       print(navBarHeight)    } }

How to make the corners of a button round in iOS?

Sharon Christine
Updated on 30-Jul-2019 22:30:26

1K+ Views

You might come across a scenarios where you received a UI where the buttons are rounded, and you might wonder how to do that? So here we will see how to make corners of a button round.We will be seeing both the ways to make the button rounded, one using Storyboard and another programmatically.Let’s get started! First we will make the corners of button rounded using Storyboard.Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “RoundedButton”Step 2 − Open Main.storyboard and add a button as show belowStep 3 − Now select the button ... Read More

Disable Scroll View Programmatically in iOS?

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

901 Views

Scroll View is one of the most difficult and complicated topic an iOS Developer come across. Here we will be seeing how to disable Scroll View Programmatically.For disabling the same we need to make the “isScrollEnabled” property of our scroll view to false.Copy the below code in your file.import UIKit class ViewController: UIViewController {    @IBOutlet var scrollView: UIScrollView!    override func viewDidLoad() {       super.viewDidLoad()       scrollView.isScrollEnabled = false    }    override func didReceiveMemoryWarning() {       super.didReceiveMemoryWarning()       // Dispose of any resources that can be recreated.    } }

Change Color of Button in iOS when Clicked

karthikeya Boyini
Updated on 30-Jul-2019 22:30:26

1K+ Views

Imagine you’re playing a song and as soon as you press the stop button, the color of the button should turn to red. This is one of the many scenario where you might need to change the color of button when it is clicked.In this tutorial we will see how to change the background color of a button when it is clicked. So let’s get started!Step 1 − Open Xcode → New Projecr → Single View Application → Let’s name it “ChangeButtonColor”Step 2 − In the Main.storyboard create one button and name it stop.Step 3 − Create @IBAction of the ... Read More

Previous 1 ... 7 8 9 10 11 ... 21 Next
Advertisements