Found 208 Articles for IOS

How to use giphy keys for ios users

Samual Sam
Updated on 12-May-2022 12:44:41

12K+ Views

You want to say something but someone else says it in the best way. Ever faced this kind of situation? When a post in Facebook needs just a touch of spice by adding few characters, but that’s what you don’t have. Well the wait is over GIPHY is on your rescue.Whenever you have a conversation online, GIPHY is there to help you. The GIF catalog is infinitely loaded with pop culture, original animations and real-time information that you can share on your phone, tablet, laptop etc. Every social site that you use twitter, Facebook, Gmail, tinder everyone has put GIFs.GIPHY ... Read More

Grand Central Dispatch (GCD)

Arnab Chakraborty
Updated on 11-Oct-2019 12:48:37

572 Views

Grand Central Dispatch (GCD) - a technology for Apple’s Mac OS X and iOS operating systems-is a combination of extensions to the C language, an API, and a run-time library that allows application developers to identify sections of code to run in parallel. Like OpenMP, GCD manages most of the details of threading. GCD identifies extensions to the C and C++ languages known as blocks. A block is simply a self-contained unit of work. It is specified by a caret ˆ inserted in front of a pair of braces { }. A simple example of a block is shown below ... Read More

How to programmatically take a screenshot on iOS?

Sadiqaadil
Updated on 11-Sep-2019 08:58:56

693 Views

In this post we will learn how to take screen shot programmatically in iOS.We will add on textField where we will change the value, take the screen shot by press of a button and then show the screen shot in an imageView which we will place just below the button itself.Remember that you can add this functionality on long press or any other gesture, and even save the image if you want. But right now we will just focus on capturing the screen shot and showing it on an image view.So let’s get startedStep 1 − Open Xcode → New ... Read More

How to repeat a task repeatedly after a regular interval in Swift(iOS)?

Sadiqaadil
Updated on 11-Sep-2019 08:57:55

782 Views

In this post we will learn how to repeat a task after a regular interval.In this example we will update a label after a particular interval of time repeatedly.In iOS we user Timer to achieve this task. Lets get startedStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “Timer”Step 2 − Open Main.storyboard and add a label as shown below.Step 3 − Attach one @IBOutlet for the bottom label. Name it timerLabelStep 4 − We will show the seconds since when the app is launched on the label. So, declare two variables in ... Read More

How to make the phone call in iOS 10 using Swift?

Sadiqaadil
Updated on 11-Sep-2019 08:53:12

183 Views

In this post we will learn how to load PDF in UIWebView.Loading PDF in WebView is simple. Just follow the following steps.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “PDFInWebView”Step 2 − Open Main.storyboard and add UIWebView as shown belowStep 3 − Create @IBOutlet for the UIWebView, name it webview.Step 4 − Add as sample PDF project. We will load this PDF in webivew. I am adding a PDF file named sample PDF.Step 5 − Add the following lines in viewDidLoad method of ViewControllerif let pdf = Bundle.main.url(forResource: "sample", withExtension: "pdf", subdirectory: ... Read More

How to open a website in iOS's web browser from my application?

Sadiqaadil
Updated on 11-Sep-2019 08:46:53

184 Views

In this post we will learn how to open website in iOS browser.We will open Facebook in iOS browser.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “OpenBrowser”Step 2 − Open Main.storyboard and add a button as shown below. I have given the button title as “Open Facebook”Step 3 − Attach one @IBAction function in ViewController, name it openBrowserStep 4 − In openBrowserFunction write the code to open URL like shown below@IBAction func openBrowsere(_ sender: Any) {    let url = URL(string: "https://www.facebook.com")!    if UIApplication.shared.canOpenURL(url) {       UIApplication.shared.open(url, options: [:], ... Read More

Launching the App Store from an iOS application

Sadiqaadil
Updated on 11-Sep-2019 08:43:48

880 Views

In this post we will learn how to open app store from iOS application.In this example we will open app store and show Facebook app on store. You can open your app if you want just by changing the ID to your app id.Lets do it.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “OpenAppStore”Step 2 − Open Main.storyboard and add a button as shown below.Step 3 − Attach one @IBAction for the button for click event. Name the function as openAppstoreClicked.Step 4 − In openAppstoreClicked we will write the code to open ... Read More

How to make phone call in iOS 10 using Swift?

Sadiqaadil
Updated on 11-Sep-2019 08:40:24

2K+ Views

In this post we will be seeing how to make phone in iOS programmatically.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “MakeCall”Step 2 − Open Main.storyboard and add one text field and one button as shown belowStep 3 − Create @IBOutlet for the text field, name it phoneNumberTextfield.Step 4 − Create @IBAction method callButtonClicked for call buttonStep 5 − To make a call we can use iOS openURL. In callButtonClicked add following linesif let url = URL(string: "tel://\(phoneNumberTextfield.text!)"), UIApplication.shared.canOpenURL(url) { UIApplication.shared.open(url, options: [:], completionHandler: nil)Step 6 − Run the ... Read More

How to get the build/version number of an iOS App?

Sadiqaadil
Updated on 11-Sep-2019 08:35:25

2K+ Views

In this post we will learn how to fetch and show the iOS build and version numberStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “ShowBuildAndVersion”Step 2 − Open Main.storyboard and add two labels as shown below.Step 3 − Attach @IBOutLets for the two labels@IBOutlet weak var buildLabel: UILabel! @IBOutlet weak var versionLabel: UILabel!Step 4 − Change the build and version from project settings.Step 5 − In viewDidLoad of ViewController get the build and version number for infoDictionary of main bundle. Show it on the corresponding labels.override func viewDidLoad() {    super.viewDidLoad()   ... Read More

How to get the Touch position on iOS device?

Sadiqaadil
Updated on 11-Sep-2019 08:30:35

751 Views

In this post we will be seeing how to get the touch position on device using Swift.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “TouchMe”Step 2 − Open Main.storyboard and add one label as shown below. On this label we will show the touch position.Step 3 − Create @IBOutlet for the label, name it touchPositionLabel.Step 4 − We will be overriding the touchesBegan method in ViewController to get the touch position in the view. Override the method as shown belowoverride func touchesBegan(_ touches: Set, with event: UIEvent?) {   ... Read More

Advertisements