- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2041 Articles for Mobile Development
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
1K+ Views
In this post we will learn how to calculate the distance between two geo locations.We will show the distance between two points on a label.To do so follow the steps belowStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “FindDistance”Step 2 − Open Main.storyboard and add two labels as shown below.Step 3 − Attach one @IBOutlet for the bottom label. Name it distanceLabelStep 4 − Import CoreLocation framework in ViewControllerStep 5 − Add two points between which we want to find the distance as variablesvar firsLocation = CLLocation(latitude:34.54545, longitude:56.64646) var secondLocation = CLLocation(latitude: ... Read More
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
1K+ Views
Disabling scrolling in WebView in iOS is very simple.The ‘scrollView’ property of the WebView is exposed by iOS.You will just need to disable the scrolling of the corresponding scrollView using below code.webView.scrollView.isScrollEnabled = falseThe above code will disable the scrolling on WebView.If you were just looking to disable scrolling in web view above code would do that. If you want to know from scratch how to load WebView and disable scrolling. Follow along.Let’s create a sample project in XCode and learn the WebView loadingStep 1 − Open Xcode → New Project → Single View Application → Let’s name it “WebViewScrollDisabling”Step ... Read More
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
2K+ Views
In this post we will be seeing how to customise iOS button.So let’s get started.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “CustomiseButton”Step 2− Open Main.storyboard and add a button as shown below. We will customize this buttonThere are two ways to customise this buttonUsing StoryboardStep 1 − Click on the buttonStep 2 − In the right panel, in the attribute inspector you can change the text color, text and background color of the button as shown belowRun the project you will see the customise button as belowNow we will see the ... Read More
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
3K+ Views
It’s very easy to check whether text field is empty or not in Swift.You will first need to check whether text is available or not in text field i.e. it’s not nil, then you will need to check if its present then its empty or not. Assuming myTextField is your text field variable name, you can do the followingif let text = myTextField.text, text.isEmpty { // myTextField is not empty here } else { // myTextField is Empty }Above code will check if textField is empty or not.If you want to look at how the text field can ... Read More
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
5K+ Views
In this post we will learn how to add top and bottom border to view.In this example we will take as sample view and add borders to it.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “AddBorderTopAndBottom”Step 2 − Open Main.storyboard add a UIView to it as shown below.Step 3 − Add one @IBOutlet for the view, name it centerView.Step 4 − We will write separate method to add borders to this view. To add borders to this view we will create two layers with desired thickness. We will set the frame of ... Read More
![Sadiqaadil](https://www.tutorialspoint.com/articles/images/user_icon.png)
1K+ Views
In this post we will learn how to change the background color of view with animation.In this example we will change background color of view on click of a button. On clicking the button the background color will change to red, then on next click it would change to blue, on next click to red again.Step 1 − Open Xcode → New Project → Single View Application → Let’s name it “ChangeBGColor”Step 2 − Open Main.storyboard add a button as shown belowStep 3 − Add one @IBAction for touchUpInside of ‘Change Background’ button. Name the function as changeBackgroundClicked.Step 4 − ... Read More
![Azhar](https://www.tutorialspoint.com/assets/profiles/124637/profile/60_166181-1565938637.jpg)
981 Views
This example demonstrates how do I change current theme at runtime in my android app.Step 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. Step 3 − Add the following code to src/MainActivity.javaimport android.support.v7.app.AppCompatActivity; import android.os.Bundle; public class MainActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setTheme(android.R.style.Theme_Black); setContentView(R.layout.activity_main); } }Step 4 − Add the following code to androidManifest.xml ... Read More
![Azhar](https://www.tutorialspoint.com/assets/profiles/124637/profile/60_166181-1565938637.jpg)
4K+ Views
This example demonstrates how do I switch between different activities in android.Step 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. Step 3 − Add the following code to src/MainActivity.javaimport android.content.Intent; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.view.View; import android.widget.Button; public class MainActivity extends AppCompatActivity { Button button; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); button = findViewById(R.id.btnOpenAct2); ... Read More
![Azhar](https://www.tutorialspoint.com/assets/profiles/124637/profile/60_166181-1565938637.jpg)
109 Views
This example demonstrates how do I create TextToSpeech in an android app.Step 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. Step 3 − Add the following code to src/MainActivity.javaimport android.speech.tts.TextToSpeech; import android.support.v7.app.AppCompatActivity; import android.os.Bundle; import android.util.Log; import android.view.View; import android.widget.Button; import android.widget.EditText; import android.widget.SeekBar; import java.util.Locale; public class MainActivity extends AppCompatActivity { private TextToSpeech textToSpeech; private EditText editText; private ... Read More
![Azhar](https://www.tutorialspoint.com/assets/profiles/124637/profile/60_166181-1565938637.jpg)
2K+ Views
This example demonstrates how do I play Youtube video in android.Step 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 following the dependancies in the build.gradle (Module:app)implementation 'com.android.support:recyclerview-v7:28.0.0' implementation 'com.android.support:cardview-v7:28.0.0'Step 3 − Add the following code to res/layout/activity_main.xml. Step 4 – Create a layout resource file (Video_view.xml) and add the following code − Step 5 – Create a java class youTubeVideos.java and the following code −public class youTubeVideos { String videoUrl; public youTubeVideos() ... Read More