Found 208 Articles for IOS

How to use Bold & Non-Bold Text In A Single UILabel in iOS/iPhone?

Vrundesha Joshi
Updated on 29-Jun-2020 13:59:33

3K+ Views

To use a Bold and a regular/Non-Bold text in a single UILabel, we can either use a storyboard editor to achieve the same, or we can do it programmatically. Let’s see both of them.Method One − Editing with StoryboardSelect the label you want to edit, go to it’s attribute inspector.From the first option Text, select Attributes instead of plain.Write the following text in the label “Bold Regular”Double Click on Bold to select it, and then right click on it to see more options.Select font > Bold from that option. It should do the task.Method Two − Programmatically Achieving the result.Add the ... Read More

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

762 Views

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

840 Views

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 “developer.apple.com”, 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

892 Views

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

1K+ Views

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

Corona vs. Phonegap vs. Titanium

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

153 Views

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 generally.you 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

408 Views

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

Advertisements