Here is an example Xcode project that uses a Hype project to do this.
The iOS app is setup to listen for the posted messages and runs a callback handler when it gets them.
The callback handler checks which message was sent and runs a function relating to it.
In this example I used one message post from Hype.
The Hype JS uses the buttons ids to determine what the message posted (message body) will be. ( Different URLS )
The message body is then converted to a swift URL object by the iOS application and opened in Safari.
I have also added a badly constructed URL in one button just to show that the URLS coming from the JS can crash the app if the are not constructed properly.
There is swift code that looks out for this. And also shows how to control the hype document from the App.
hypeXCodeCall2.zip (382.6 KB)