Mobile Development Articles - Page 151 of 156

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

How to save ArrayList to SharedPreferences on Android?

Nancy Den
Updated on 27-Jun-2020 13:43:48

4K+ Views

Before getting into shared preference to store arraylist example , we should know what is shared preferences in android. Using share preference, we can store or retrieve values as key and value pair. There are five different methods are available in share preference as shown below −Edit() − It going to edit shared preference valuescommit() − it going to commit shared preference values in xml fileapply() − It going to commit back changes from editor to shared preference.remove(String key) − It going to remove key and vales from shared preference use key.Put() − It going to put key and values ... Read More

How to explain Android Shared preferences with example?

Nishtha Thakur
Updated on 27-Jun-2020 07:31:58

572 Views

Using share preference, we can store or retrieve values as key and value pair. There are five different methods are available in share preference as shown below −Edit() − It going to edit shared preference valuescommit() − it going to commit shared preference values in xml fileapply() − It going to commit back changes from editor to shared preference.remove(String key) − It going to remove key and vales from shared preference use key.Put() − It going to put key and values to shared preference xml.A sample example syntax of shared preference as shown below −final SharedPreferences sharedPreferences = getSharedPreferences("USER", MODE_PRIVATE);In ... Read More

Corona vs. Phonegap vs. Titanium

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

267 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

5K+ 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

625 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

How to disable the network in iOS Simulator?

Nishtha Thakur
Updated on 27-Jun-2020 13:23:06

9K+ Views

Sometimes while testing our app on simulator we need to test for case where no internet is available. This can be achieved in multiple ways.Below are some of the possible ways to do itEasiest but not the most correct way is to disconnect your mac from the LAN Cable is you are on a LAN, or turn off the wifi if you are connected on a wifi network. But that will definitely turn off internet for your whole device, not just simulator. So, there are some more ways to do itDownload Hardware IO tools for Xcode.Go to Xcode menu, select ... Read More

How to go through all text fields with the "Next" Button on the iPhone/iOS Keyboard?

Smita Kapse
Updated on 27-Jun-2020 13:24:46

1K+ Views

To go through all the text fields one by one on tap on done or return button, we’ll have to create a logic. Let’s understand it with help of a project.Create a project and on the view controller story board drag Four text fields.Select them one by one and from attribute, inspector set their tags as 1, 2, 3, 4 respectively.Also set their return key to Done from the attribute inspector itself.Create outlets for all four text fields in the View controller class, connect them to their respective outlets.@IBOutlet weak var tf1: UITextField! @IBOutlet weak var tf2: UITextField! @IBOutlet weak ... Read More

What is Xcode error “Could not find Developer Disk Image”?

Nancy Den
Updated on 27-Jun-2020 13:25:20

900 Views

The Xcode error occurs when the xcode version and ios versions don’t match. Usually it happens when the Xcode version is less than the device iOS version. i.e. the Xcode is too old for the device. This is a compatibility issue which can be resolved by performing some steps.Always check if the device you are using has compatible iOS version to the Xcode version, if not Xcode requires an update.If you are not able to update XCode or there is no update being shown for Xcode, please check if the OS needs an update.In some cases you would not like ... Read More

Advertisements