Capacitor 3: iOS / Swift custom plugin some migration questions #4924
-
First off: I'm the worst swift programmer in history and don't do a lot there... But here comes my questions: pre 3.0 I had:
pre 3.0 I had:
I updated this to:
is it ok to assume that viewController always needs to be there? if this is now "really optional" it would mean that I'd have to change my whole "flow" and return or throw an exception if it's null => should I acutally do that? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
For 1, use For 2, bridge and viewController are now weak, which means they are optional in Swift, but it's up to you if you want to force unwrap or check their existence first. |
Beta Was this translation helpful? Give feedback.
For 1, use
call.getObject("hints")
For 2, bridge and viewController are now weak, which means they are optional in Swift, but it's up to you if you want to force unwrap or check their existence first.