Closed JohnnyKehr closed 4 years ago
@JohnnyKehr,
Thanks for reporting.
Could you try the branch, jwoo/ios-swift-input in this PR?
Thank you
Hey Joseph -- I tried out your change and the crash no longer occurs (and inputs are still passed along as expected). I appreciate the quick turnaround!
Johnny
Hey Joseph -- I tried out your change and the crash no longer occurs (and inputs are still passed along as expected). I appreciate the quick turnaround!
Johnny
It's my pleasure
:tada:AdaptiveCards@v1.2.9
has been released which fixes this issue.:tada:
Handy links:
Platform
What platform is your issue or question related to? (Delete other platforms).
Author or host
Host on Webex Teams
Version of SDK
AdaptiveCards@v1.2.6
Details
And then rendering a card with the native text input component, such as the one taken from the examples: https://adaptivecards.io/samples/Inputs.html
Will result in a crash when the card is being rendered (I've sanitized some of these stack traces and have left only the relevant bits):
Hypothesis: When overriding the
render
function from the base class (ACRBaseCardElementRenderer
) in Swift, you are given this signature:However, Swift arrays cannot be cast into NSMutableArrays because Swift arrays are structs. Since swift types like
Tuple
orStruct
have no equivalent in Objective-C they can not be cast to or referenced as AnyObject which NSArray and NSMutableArray constrain their element types to. Indeed, when I put a breakpoint in the first line of therender
function in ACRInputRenderer and print outinputs
I get this:Note that all my examples are using ACRInputRenderer, but this crash should happen in any renderer that modifies/adds to
input
in any way.