We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Xcode Version 8.3.2 (8E2002)
md5: a50249dc71b60ab4d535b34b59da4998
duplicates:
Issue Description:
I found out a very strange issue which is happening when calling the `performSegue` method in UIKit
I have a structure like following
protocol MyProtocol {} struct MyStruct: MyProtocol {}
By passing the structure as sender in the performSegue like following `vc.performSegue(withIdentifier: "id", sender: myStructInstance)`
In the `preparForSegue` method, the sender instance cannot be converted to `MyProtocol`
sender! is MyProtocol // return false sender as! MyProtocol // crashes sender! is MyStruct // return true sender as! MyStruct // return true
I fixed this problem by wrapping `MyProtocol` inside an another structure and then I can easily access the value as below
struct Wrapper { let myProtocol: MyProtocol } (sender as! Wrapper).myProtocol is MyProtocol // return true
The text was updated successfully, but these errors were encountered:
Comment by James Froggatt (JIRA)
related: https://bugs.swift.org/browse/SR-5489
Sorry, something went wrong.
Yeah, it's the same issue.
No branches or pull requests
Environment
Xcode Version 8.3.2 (8E2002)
Additional Detail from JIRA
md5: a50249dc71b60ab4d535b34b59da4998
duplicates:
Issue Description:
I found out a very strange issue which is happening when calling the `performSegue` method in UIKit
I have a structure like following
By passing the structure as sender in the performSegue like following
`vc.performSegue(withIdentifier: "id", sender: myStructInstance)`
In the `preparForSegue` method, the sender instance cannot be converted to `MyProtocol`
I fixed this problem by wrapping `MyProtocol` inside an another structure and then I can easily access the value as below
The text was updated successfully, but these errors were encountered: