You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Problem:
Calling convenience initialisers when subclassing OAuth2Swift fails from xcode 11.4 onwards. In my case I was using the convenience init with parameter accessTokenUrl which was fine prior to xcode 11.4
https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes
Convenience initializer inheritance for subclasses defined outside the module that defines the base class now comes with additional restrictions. When these subclasses have a base class with non-public designated initializers, they no longer automatically inherit convenience initializers from their superclasses. To restore this automatic inheritance behavior, the base class must ensure that all of its designated initializers are public or open. (51249311)
Fix/Workaround for 2.0 and 2.1 branch
As OAuth2Swift is a subclass of OAuthSwift, the init() of OAuthSwift , the base class, needs to be made public. That way I can call the convenience initialisers on a subclass of OAuth2Swift from xcode 11.4 onwards.
The version on master works around this by having just a single initialiser (with no convenience initialisers) in OAuth2Swift where accessTokenUrl is an optional default parameter with default value of nil.
Aside:
Reason why I need to subclass is due to an issue when calling the method renewAccessToken() of class OAuth2Swift externally from my Application. It is the same as OAuthSwift/OAuthSwiftAlamofire#11 and the workaround is to override renewAccessToken() to set client.credential.oauthToken = ""
OAuth Provider? (Twitter, Github, ..): Other
OAuth Version:
Version 1
Version 2
OS (Please fill the version) :
iOS :
OSX :
TVOS :
WatchOS :
Installation method:
Carthage
CocoaPods
Swift Package Manager
Manually
Library version:
head
v2.1.0
v2.0.0
v1.4.1
other: (Please fill in the version you are using.)
Xcode version:
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
other: (Please fill in the version you are using.)
objective c
The text was updated successfully, but these errors were encountered:
switching to use swiftpm I can now get 2.1.2 tag which is on the master branch which solves the Convenience initialiser issue (#585). It looks like the 2.1 branch is not used for development anymore.
For CocoaPods we were stuck on earlier version 2.1.0 due to the OAuthSwift.podspec not been updated as was mentioned in #615
Description:
Problem:
Calling convenience initialisers when subclassing
OAuth2Swift
fails from xcode 11.4 onwards. In my case I was using the convenience init with parameteraccessTokenUrl
which was fine prior to xcode 11.4https://developer.apple.com/documentation/xcode_release_notes/xcode_11_4_release_notes
Convenience initializer inheritance for subclasses defined outside the module that defines the base class now comes with additional restrictions. When these subclasses have a base class with non-public designated initializers, they no longer automatically inherit convenience initializers from their superclasses. To restore this automatic inheritance behavior, the base class must ensure that all of its designated initializers are public or open. (51249311)
Fix/Workaround for 2.0 and 2.1 branch
As
OAuth2Swift
is a subclass ofOAuthSwift
, the init() ofOAuthSwift
, the base class, needs to be made public. That way I can call the convenience initialisers on a subclass ofOAuth2Swift
from xcode 11.4 onwards.The version on master works around this by having just a single initialiser (with no convenience initialisers) in
OAuth2Swift
whereaccessTokenUrl
is an optional default parameter with default value of nil.Aside:
Reason why I need to subclass is due to an issue when calling the method
renewAccessToken()
of classOAuth2Swift
externally from my Application. It is the same as OAuthSwift/OAuthSwiftAlamofire#11 and the workaround is to overriderenewAccessToken()
to setclient.credential.oauthToken = ""
OAuth Provider? (Twitter, Github, ..): Other
OAuth Version:
OS (Please fill the version) :
Installation method:
Library version:
Xcode version:
11.4 (Swift 5.2)
11.x (Swift 5.1)
10.x (Swift 5.0)
other: (Please fill in the version you are using.)
objective c
The text was updated successfully, but these errors were encountered: