Found 98 Articles for IPhone/iPad

How to add line break for UILabel in iOS/iPhone?

George John
Updated on 29-Jun-2020 13:52:56

2K+ Views

Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the Line break in a UILabel is used to change how the text appears on a label. Suppose a label has text more than two lines but by default the label shows 1 line and wraps/ trims the text that’s more than the label size.This can be done in multiple ways. Three of them are mentioned below.On the storyboard add a label.Give top constraint, trailing and leading constraint.Method One − Editing with ... Read More

How to create NSIndexPath for TableView in iOS?

Chandu yadav
Updated on 30-Jul-2019 22:30:24


Index path is generally a set of two values representing row and section of a table view. Index path can be created in objective C as well as Swift as both are native language of iOS Development.IndexPathForRow is a class method in iOS. To create a index path we need to be sure about the section and row we need to create. Below are the methods of creating an Indexpath.To create an IndexPath in objective C we can use.NSIndexPath *myIP = [NSIndexPath indexPathForRow: Int inSection:Int] ;ExampleNSIndexPath *myIP = [NSIndexPath indexPathForRow: 5 inSection: 2] ;To create an IndexPath in Swift we ... Read More

How to renew distribution certificate for iOS?

Arjun Thakur
Updated on 30-Jul-2019 22:30:24


To renew a distribution certificate on mac we’ll have to go through a series of steps mentioned below.Use spotlight to open keychain access on your macFrom keychain access menu select Certificate Assistant -> Request certificate from certificate Authority.Fill the information there like Name, email and choose “save to disk”.Click continue and save to your desired location. This will generate a .CSR file which we’ll need to upload to the developer portal while generating our certificate.Go to “”, login to your account, select “Certificates, IDs & Profiles”.Go to certificates, select production and click on the “+” on the topSelect "App Store ... Read More

How to use the front camera in Swift?

Ankith Reddy
Updated on 30-Jul-2019 22:30:24


To use the front camera in swift we first need to get a list of cameras available in the device we are using. In this article we’ll see how to get the list of devices and then check if the front camera is available or not. We’ll do it in a series of steps.Import AVFoundationCheck if the list of cameras existsFilter out the front camera if exists.guard let frontCamera = AVCaptureDevice.devices().filter({ $0.position == .front }) .first as? AVCaptureDevice else { fatalError("Front camera not found") }The devices() method of AVCapture returns the list of cameras available. From that ... Read More

Lazy loading of images in table view using Swift

George John
Updated on 30-Jul-2019 22:30:24


To load an image in table view cell we’ll go through a series of steps.Create a table view, table view cell and add an Image view to it.Assign a custom class to the cell we created.In the cell for row at method write the following lines of code.let cell = tblView.dequeueReusableCell(withIdentifier: "CustomCell") as! CustomCell return cellTo download the image we’ll create a function and embed that into an extension.func setImageFromUrl(ImageURL :String) {    URLSession.shared.dataTask( with: NSURL(string:ImageURL)! as URL, completionHandler: {       (data, response, error) -> Void in       DispatchQueue.main.async {          if let ... Read More

What are the specifications of iPhone 7?

Shanmukh Pasumarthy
Updated on 26-Jun-2020 10:22:34


The Design of iPhone 7 is slightly varying from its predecessors. Disposing of the 3.5-millimetre earphone jack has helped Apple make its new iPhone's sleeker and support its battery lifetime. iPhone 7 weighs marginally less than iPhone 6 around 198 grams.For the first time ever, the new home button is made touch sensitive and uses a new Taptic (combination of tap and haptic) engine for better response.CameraThe camera of iPhone 7 has been upgraded. iPhone 7 has a 12-megapixel sensor that is guaranteed to be 60% quicker.iPhone 7 likewise has a quad-LED flash with half light output and can distinguish ... Read More

Corona vs. Phonegap vs. Titanium

Nitya Raut
Updated on 27-Jun-2020 13:16:47


In this article we’ll learn about Corona, PhoneGap and Titanium, though all these technologies are different, the common thing between these is that they all are cross platform. i.e they can be used to write program once and then run that on multiple platforms like iPhones and android devices.Corona − Corona is a free and open source SDK (Software development kit), developed by corona Labs roughly 10 years ago in 2009. Corona is mainly for developing 2D mobile applications for most of the platforms including iOS, Android, Desktop/ Windows Applications. Corona is based on top of C++ and openGL to ... Read More

How to hide Back Button on navigation bar on iPhone/iPad?

Nishtha Thakur
Updated on 27-Jun-2020 13:17:29

4K+ Views

To hide the back button on navigation bar we’ll have to either set the navigation button as nil and then hide it or hide it directly.Let’s create a project, add 2 view controller and Embed them in navigation controller. Let’s see how this project looks when run without any code to remove the navigation bar.This code set’s the navigation bar’s back button as hidden.self.navigationController?.navigationItem.hidesBackButton = trueThis code set’s the navigation bar’s back button as nilself.navigationItem.leftBarButtonItem = nil;A combination of these to approaches would be a better solution and works even if you have set a custom navigation bar.self.navigationItem.leftBarButtonItem = nil ... Read More

How to take a screenshot of my iOS application in the iOS simulator?

Smita Kapse
Updated on 27-Jun-2020 13:18:30

1K+ Views

To take a screenshot of an iOS Application running in Simulator you can you any of the below ways.Capturing device Screen − you can capture your Mac's screen from the area your simulator is running in. to do this you have to press, Command, shift and 4 at the same time, then drag to select the area you want to capture. Alternatively you can press 3 instead of 4 to capture the whole screen.Open simulator, and press Command along with S at the same time, this will take a screenshot and save on desktop can also open simulator, go ... Read More

How to create a Border, Border radius, and shadow to a UIView in iPhone/iOS?

Nancy Den
Updated on 27-Jun-2020 13:19:37


In this article we’ll learn how to create borders and shadows. We’ll do it in two ways, one by directly coding and one by making it designable and an extension of UIView, which can be edited directly in the storyboard.Let’s see how to play around with borders in ios −Method 1 − Creating borders with simple coding –Borders are a property of layer, above which a View is drawn, a border has the following properties, Border color, border width.self.view.layer.borderColor = colorLiteral(red: 0.4392156899, green: 0.01176470611, blue: 0.1921568662, alpha: 1) self.view.layer.borderWidth = 5.0To create corner radius of a view we can useself.view.layer.cornerRadius ... Read More