wit-ai / wit-ios

Wit.ai iOS client
Other
222 stars 71 forks source link

Cannot invoke 'start' with no arguments #53

Closed thediary closed 9 years ago

thediary commented 9 years ago

Hi all, I'm currently trying to implement the - (void)start; method as described in the iOS API reference using swift. I'm trying to call it inside of a swift class method with no parameters. The docs indicate it is optional to do - (void)start: (id)customData;

The way I'm writing it is simply Wit.start(), which should work unless I'm missing something obvious. I've properly imported the Swift framework and Delegate and everything else Wit.ai-wise works perfectly. I can substitute the desired functionality with a WITMicButton and it will capture the audio, etc., but I can't call Wit.start().

I also get the same issue with Wit.stop().

Does anybody have any ideas on how to fix it? Let me know any more information I might need to provide. Thanks in advance!

thediary commented 9 years ago

Whoops. Looks like all it needed was a singleton accessor.

Wit.sharedInstance().start()

Sorry guys!