[PR #257] [CLOSED] custom modalPresentationStyle in SafariURLHandler #586

Closed
opened 2026-03-03 16:49:34 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/OAuthSwift/OAuthSwift/pull/257
Author: @teaualune
Created: 8/4/2016
Status: Closed

Base: masterHead: SafariURLHandler-modalPresentationStyle


📝 Commits (1)

  • 56222e7 custom modalPresentationStyle for the SFSafariViewController in SafariURLHandler

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 OAuthSwift/OAuthSwiftURLHandlerType.swift (+4 -0)

📄 Description

While using SafariURLHandler to implement OAuth flow on an landscaped iPad app, the presented SFSafariViewController transients to a new screen from right to left (i.e. the default behavior of UIModalPresentationStyle.FullScreen). In order to make the view controller behaves like a modal view, it would be great if we can customize behaviors of the view controller created from factory(url).

This PR proposes a naïve way to do this by exposing modalPresentationStyle in SafariURLHandler, thus we can customize the presented modal style by doing so:

let handler = SafariURLHandler(viewController: self)
handler.modalPresentationStyle = .FormSheet
oauthswift.authorize_url_handler = handler

Or maybe it is better to make a config block/delegate for clients before the controller is presented in handle(url)? Thanks in advance!


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/OAuthSwift/OAuthSwift/pull/257 **Author:** [@teaualune](https://github.com/teaualune) **Created:** 8/4/2016 **Status:** ❌ Closed **Base:** `master` ← **Head:** `SafariURLHandler-modalPresentationStyle` --- ### 📝 Commits (1) - [`56222e7`](https://github.com/OAuthSwift/OAuthSwift/commit/56222e7fd6a69bb9117df138b63a313d1ba4873d) custom modalPresentationStyle for the SFSafariViewController in SafariURLHandler ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `OAuthSwift/OAuthSwiftURLHandlerType.swift` (+4 -0) </details> ### 📄 Description While using `SafariURLHandler` to implement OAuth flow on an landscaped iPad app, the presented `SFSafariViewController` transients to a new screen from right to left (_i.e._ the default behavior of `UIModalPresentationStyle.FullScreen`). In order to make the view controller behaves like a modal view, it would be great if we can customize behaviors of the view controller created from `factory(url)`. This PR proposes a naïve way to do this by exposing `modalPresentationStyle` in `SafariURLHandler`, thus we can customize the presented modal style by doing so: ``` swift let handler = SafariURLHandler(viewController: self) handler.modalPresentationStyle = .FormSheet oauthswift.authorize_url_handler = handler ``` Or maybe it is better to make a config block/delegate for clients before the controller is presented in `handle(url)`? Thanks in advance! --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-03 16:49:34 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/OAuthSwift#586
No description provided.