[GH-ISSUE #495] exc_bad_access when setting your own factory on SafariURLHandler #325

Closed
opened 2026-03-03 16:47:43 +03:00 by kerem · 1 comment
Owner

Originally created by @djk12587 on GitHub (Nov 4, 2018).
Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/495

Description:

When i set my own custom factory closure i get an exc_bad_access crash. This does not crash on version 1.2.1.

let urlHandler = SafariURLHandler(viewController: self, oauthSwift: oAuth, modalPresentationStyle: .overFullScreen)
urlHandler.factory = { url in
    Theme.setButtonTintColorForSavariWebView()
    let safariViewController = ChangedColorSafariViewController(url: url)
    safariViewController.preferredBarTintColor = .primaryColor
    safariViewController.preferredControlTintColor = .white
    return safariViewController
}

OAuth Provider? (Twitter, Github, ..):

OAuth Version:

  • Version 1
  • Version 2

OS (Please fill the version) :

  • iOS :
  • OSX :
  • TVOS :
  • WatchOS :

Installation method:

  • Carthage
  • CocoaPods
  • Manually

Library version:

  • head
  • v1.2.2
  • v1.2.1
  • v1.2 (Swift 4.0)
  • v1.0.0
  • v0.6
  • other: (Please fill in the version you are using.)

Xcode version:

  • 10.1 (Swift 4.2)

  • 9.3 (Swift 4.1)

  • 9.0 (Swift 4.0)

  • 9.0 (Swift 3.2)

  • 8.x (Swift 3.x)

  • 8.0 (Swift 2.3)

  • 7.3.1

  • other: (Please fill in the version you are using.)

  • objective c

Originally created by @djk12587 on GitHub (Nov 4, 2018). Original GitHub issue: https://github.com/OAuthSwift/OAuthSwift/issues/495 ### Description: When i set my own custom factory closure i get an exc_bad_access crash. This does not crash on version 1.2.1. ``` let urlHandler = SafariURLHandler(viewController: self, oauthSwift: oAuth, modalPresentationStyle: .overFullScreen) urlHandler.factory = { url in Theme.setButtonTintColorForSavariWebView() let safariViewController = ChangedColorSafariViewController(url: url) safariViewController.preferredBarTintColor = .primaryColor safariViewController.preferredControlTintColor = .white return safariViewController } ``` ### OAuth Provider? (Twitter, Github, ..): ### OAuth Version: - [ ] Version 1 - [x] Version 2 ### OS (Please fill the version) : - [x] iOS : - [ ] OSX : - [ ] TVOS : - [ ] WatchOS : ### Installation method: - [ ] Carthage - [x] CocoaPods - [ ] Manually ### Library version: - [ ] head - [x] v1.2.2 - [ ] v1.2.1 - [ ] v1.2 (Swift 4.0) - [ ] v1.0.0 - [ ] v0.6 - [ ] other: (Please fill in the version you are using.) ### Xcode version: - [x] 10.1 (Swift 4.2) - [ ] 9.3 (Swift 4.1) - [ ] 9.0 (Swift 4.0) - [ ] 9.0 (Swift 3.2) - [ ] 8.x (Swift 3.x) - [ ] 8.0 (Swift 2.3) - [ ] 7.3.1 - [ ] other: (Please fill in the version you are using.) - [ ] objective c
kerem closed this issue 2026-03-03 16:47:43 +03:00
Author
Owner

@djk12587 commented on GitHub (Nov 4, 2018):

Scratch all this, it was an annoying xcode compiling issue. I had to do a deep clean on the project cmd + shift + option + k. After that it worked...

<!-- gh-comment-id:435681547 --> @djk12587 commented on GitHub (Nov 4, 2018): Scratch all this, it was an annoying xcode compiling issue. I had to do a deep clean on the project cmd + shift + option + k. After that it worked...
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#325
No description provided.