[swift5] How to transition from the app to an external site by specifying the URL

Posting points

This time, we will introduce the function to transition from the application under development to the developer's SNS and homepage.

Implementation code

ViewController.swift


// url =Specify the URL of the site you want to transition to as a String type
let url = NSURL(string: "")

if UIApplication.shared.canOpenURL(url! as URL) {
  UIApplication.shared.open(url! as URL, options: [:], completionHandler: nil)
}

This is OK! If you tap the button or Cell of TableView to make a transition, it will be simple and easy for the user to understand intuitively.

Recommended Posts

[swift5] How to transition from the app to an external site by specifying the URL
How to transition from the [Swift5] app to the iPhone settings screen
[Swift] Table View Cell, how to jump to an external URL
How to add sound in the app (swift)
[Swift] How to link the app with Firebase
Create an app by specifying the Rails version
Learn how to customize the Navigation Bar from the sample app
How to insert an external library
[Rails] How to get the URL of the transition source and redirect
[Swift] How to display when the quiz app answers correctly [Beginner]
[Swift5] How to get an array and the complement of arrays
How to return a value from Model to Controller using the [Swift5] protocol
[Swift] Summary of how to remove elements from an array (personal note)
How to call Swift 5.3 code from Objective-C
[Swift] How to implement the countdown function
[Swift] How to set an image in the background without using UIImageView.
How to make the schema of the URL generated by Rails URL helper https
[Swift] How to get the number of elements in an array (super basic)
How to connect to lcalhost from your smartphone and use the app under development
How to create a route directly from the URL you want to specify + α
[Rails] How to decide the destination by "rails routes"
Short URL to the App Store developer page
[Swift] How to implement the LINE login function
[swift5] How to implement the Twitter share function
[Swift] How to implement the fade-in / out function
[Java] How to get the redirected final URL
Do you really understand? How to check the library and license used by the app
How to request by passing an array to the query with HTTP Client of Ruby
[Swift] How to play songs from your music library
How to run the SpringBoot app as a service
How to return to the previous screen by Swipe operation
How to push an app developed with Rails to Github
How to write Scala from the perspective of Java
How to remove the underline displayed by Rails link_to
[Java] How to extract the file name from the path
How to move to the details screen by clicking the image
How to output standard from an array with forEach
How to start TOMCAT by specifying JAVA_HOME on Windows
Communicate from the outside to the container launched by docker-compose
How to determine the look-ahead request (Prefetch) from the browser
[Swift] Use UserDefaults to save data in the app
How to write an external reference key in FactoryBot
[Kotlin] Convert ZonedDateTime to String by specifying the format
Kotlin may take the world from App to Web
Send a command to Spigot from an external process
[Swift] How to get the document ID of Firebase
[Rails] How to display an image in the view
[Ruby] How to get the value by specifying the key. Differences between hashes, symbols and fetch
How to dynamically change the column name acquired by MyBatis
How to connect the strings in the List separated by commas
[IOS] How to get the table name from AWS DynamoDB
Android app to select and display images from the gallery
How to retrieve the hash value in an array in Ruby
How to get the longest information from Twitter as of 12/12/2016
How to specify db when creating an app with rails
How to disable Set-Cookie from API on the front side
How to add elements without specifying the length of the array
How to make an app using Tensorflow with Android Studio
[Rails] How to display the list of posts by category
[Integration test code] How to select an element from date_select
[Docker] How to access the host from inside the container. http://host.docker.internal: