Start a new topic

Wikitude instance in Swift 3

Hi to all.

I'm trying to call the initialiser of the WTArchitectView in swift but I'm getting this error:

"type of expression is ambiguous without more context"

In fact if I try to find the initialiser in the Xcode auto complete code functionality it does not appear.

Is there any way to call that initialiser?

This will be the code in Objective C:  

self.architectView = [[WTArchitectView alloc] initWithFrame:CGRectZero motionManager:nil];

And this my translation to Swift 3:

self.architectView = WTArchitectView(frame:, motionManager: nil)

Where self.architectView is WTArchitectView type and it is View in the storyboard.

I hope this help someone one day

To call the initialisation you have to import core motion first.

    import CoreMotion

Happy coding.

Hello Marco,

As I have mentioned in previous forum posts, officially we do not support Swift. Could you please test your app using only the Wikitude platform without Swift, so that we can investigate if this is a Wikitude related issue or not?



Thanks for the reply Eva, but we can't test it in Objective C because all the project is in Swift and is not possible for us to develop the app with 2 codes at the same time.


Login or Signup to post a comment