I'm working on a custom keyboard for a chat app. This app also has stickers and gifs. The custom keyboard can be used system wide. But the stickers and gifs only within my chat app.
Is there a way to detect the running app so I can toggle stickers/gifs on and off in the keybaord? I did some digging and found this answer on SO. But it doesn't work for me.
override public func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
if let parentViewController = self.parentViewController {
var hostBundleID = parentViewController.valueForKey("_hostBundleID")
println(hostBundleID)
}
}
The viewWillAppear
function doesn't even fire. Then there's the risk of getting the app rejected by Apple when you do hack-ish workarounds.
Is there a better way to do this?