LoginSignup
1
1

More than 3 years have passed since last update.

ログイン時などに開かれる Safari をフルスクリーンにする。例:Googleログイン

Last updated at Posted at 2019-11-28

はじめに

iOSエンジニアのやまたつです!
iOS13で modalPresentationStyle のデフォルトが変更されたため、 modalPresentationStyle = .fullScreen を付加していく作業を行っています。(画面数多いとつらい)

ログインに GIDSignIn を使用していたときに、「どこに .fullScreen 書くんだろう?」となったので解決策のシェアです。

解決策

SFSafariViewController でログイン画面を表示させるもの限定になりますが、
SFSarafiViewController を拡張するとOKです。

SFSafariViewController+.swift

extension  SFSafariViewController {
    override open var modalPresentationStyle: UIModalPresentationStyle {
        get { return .fullScreen}
        set { super.modalPresentationStyle = newValue }
    }
}

さいごに

SFSafariViewController は .fullScreen にせずにハーフモーダルで良いと思ってます。笑

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1