karthikeya Boyini

karthikeya Boyini

1,421 Articles Published

Articles by karthikeya Boyini

Page 84 of 143

Plotting Google Map using gmplot package in Python?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 4K+ Views

There are numerous ways you can draw geographical coordinates on Google Maps. However, in case you want to save it in a local file, one better way to accomplish is through a python module called gmplot.Python library gmplot allows us to plot data on google maps. gmplot has a matplotlib-like interface to generate the HTML and javascript to deliver all the additional data on top of Google Maps.InstallationIt is easy to install gmplot using pip incase gmplot is not already installed −pip install gmplotOn running above command, you may see output something like −From above, we can see the latest ...

Read More

How to remove border in navigationBar in swift?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 2K+ Views

To remove the border from a navigation bar in swift, we just need to add a few lines of code. Let’s see how the navigation bar looks when we run it without changing anything.Now let’s try to hide the line/ border shown in the above result.The navigation bar has two things that give it the default view of a grey shadow along with bottom line as shown above. One is the background image, and the other is the shadow image.First, we’ll hide the shadow image, by setting it to empty image and see how it looks.In your viewDidLoad add the ...

Read More

How to use UICollectionView in Swift?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 590 Views

To use collection view in swift, first, we need to create a collection View. We can either drag and drop it to the storyboard, or we can make it programmatically. After that, we need to confirm our class to UICollectionViewDataSource and UICollectionViewDelegate. Also if we need custom cell size and layouts, we need to confirm it to UICollectionViewDelegateFlowLayout.Let’s see the step required to create a collection View programmatically.func initCollection() {    let layout = UICollectionViewFlowLayout()    layout.itemSize = CGSize(width: 50, height: 50)    let collection = UICollectionView.init(frame: self.view.frame, collectionViewLayout: layout)    collection.dataSource = self    collection.delegate = self    collection.backgroundColor ...

Read More

How to create a Custom Dialog box on iOS App using Swift?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 952 Views

To create a dialog box in swift we’ll make use of UIAlertController which is an important part of UIKit. We’ll do this with help of an iOS application and a sample project.First of all, we’ll create an empty project, then inside its default view controller, we’ll perform the following operations.We’ll create an UIAlertController object.let alert = UIAlertController.init(title: title, message: description, preferredStyle: .alert)We’ll create an actionlet okAction = UIAlertAction.init(title: "Ok", style: .default) { _ in    print("You tapped ok")    //custom action here. }We’ll add the action to the alert and present italert.addAction(okAction) self.present(alert, animated: true, completion: nil)Now we’ll convert this ...

Read More

How to handle right-to-left and left-to-right swipe gestures on iOS App?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 2K+ Views

To handle gestures in iOS application we’ll create an application with swift and see with help of an example. This can be done in two ways, with storyboard or programmatically.Method 1 − With storyboardFirst we’ll drag a swipe gesture recognizer from our object library and drop it in our View controller in which we want to add the swipe gesture.Then click on the gesture, press control and drag in your view controller class to create its connection.Make sure the sender of that action is UISwipeGestureRecognizer and the action looks something like this:@IBAction func swipeMade(_ sender: UISwipeGestureRecognizer) { }Now the swipe ...

Read More

How to extract the last 4 characters from NSString?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 1K+ Views

To extract last 4 characters from a string in swift we can use the internal functions of String class in swift.With new release every time methods have been modified, deprecated, added and improved in swift. Swift provides different methods to achieve the same. Let’s see these ways of doing it with a few examples.Method 1 − SubstringsIn swift three we were allowed to use a method called substring in which we could pass the string, it’s last index and the offset from which we wanted to trim the string.Let’s see an example of the same:var Str1 = "12312$$33@" print(Str1.substring(from:Str1.index(Str1.endIndex, offsetBy: ...

Read More

How to access RESTFul services from iOS/iPhone?

karthikeya Boyini
karthikeya Boyini
Updated on 30-Jun-2020 225 Views

To access REST APIs in swift we need to go through a series of steps using the native way of networking in swift, that is using URL sessions and Data Tasks.Rest stands for Representational State Transfer, which defines some set of constraints that are to be used by web services. In swift, we can access web services in the following way.First of all, we need to create a session object, which default configuration.let configuration = URLSessionConfiguration.default let session = URLSession(configuration: configuration)Then we need to create an URL Request of The type we need, it can get, post, delete or put. ...

Read More

How to remove duplications from arraylist for listview in Android?

karthikeya Boyini
karthikeya Boyini
Updated on 29-Jun-2020 221 Views

This example demonstrate about How to remove duplications from arraylist for listview in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                                 In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of listview.Step 3 − Add ...

Read More

How to insert element to arraylist for listview in Android?

karthikeya Boyini
karthikeya Boyini
Updated on 29-Jun-2020 3K+ Views

This example demonstrate about How to insert element to arraylist for listview in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                                 In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on refresh button to get the changes of listview.Step 3 − Add ...

Read More

How to delete all elements from arraylist for listview in Android?

karthikeya Boyini
karthikeya Boyini
Updated on 29-Jun-2020 1K+ Views

This example demonstrate about How to delete all elements from arraylist for listview in AndroidStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.                                             In the above code, we have taken name as Edit text, when user click on save button it will store the data into arraylist. Click on delete ...

Read More
Showing 831–840 of 1,421 articles
« Prev 1 82 83 84 85 86 143 Next »
Advertisements