Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
Help us understand the problem. What is going on with this article?

【備忘録】Swiftでアプリからサファリを起動する方法

More than 5 years have passed since last update.

初投稿だから投稿の仕方や記事の書き方を間違えていたらすみません。
自分用備忘録です。
Objective-Cでアプリからサファリを起動する方法はいろいろと見つかるけど、Swiftでは見つからなかったのでメモ。たぶん私の検索能力が低いだけで、すでに書いてらっしゃる方はいると思いますが。。。

    let url = NSURL(string:"http://qiita.com")
    let app:UIApplication = UIApplication.sharedApplication()
    app.openURL(url)

これだけです。

paAr0
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away