HTML views on iOS

55 views
Skip to first unread message

James Gregory

unread,
Mar 11, 2013, 4:32:24 AM3/11/13
to calatrav...@googlegroups.com
Hi all,

I'm still getting my head around Calatrava, so please excuse my stupid questions.

I've created a project, which has the conversion example in. I'm trying to change the project so there are no native views, and the HTML shell is used everywhere. How can I do this?

If I remove and/or don't have a UIViewController implementation, nothing works. Looking at the code, the TWBridgePageRegistry.ensurePageWithName will always try to create a native view. Am I missing something here?

Cheers,
James

James Gregory

unread,
Mar 11, 2013, 7:04:07 AM3/11/13
to calatrav...@googlegroups.com
The closest I've gotten now is to create a View Controller for each page, and have each one just subclass WebViewController (the Calatrava provided one) and override pageName with the same name as the HAML file. Is this the correct approach?

mkwi...@thoughtworks.com

unread,
Mar 11, 2013, 3:43:25 PM3/11/13
to calatrav...@googlegroups.com
That is correct, you always have to provide a UIViewController. For shell pages you must extend WebViewController and override pageName method.

James Gregory

unread,
Mar 11, 2013, 6:55:35 PM3/11/13
to calatrav...@googlegroups.com
Ok, glad I'm on the right track.

Would it make sense to change this behaviour, so if a custom UIViewController isn't found Calatrava would just spin up a WebViewController instead?


--
You received this message because you are subscribed to the Google Groups "calatrava-mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calatrava-mobi...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.





--
James Gregory
Twitter: @jagregory

James Gregory

unread,
Mar 11, 2013, 7:52:31 PM3/11/13
to calatrav...@googlegroups.com
I put together a pull request with the behaviour I had in mind, if anyone is interested: https://github.com/calatrava/calatrava-ios/pull/7


On Tuesday, March 12, 2013 9:55:35 AM UTC+11, James Gregory wrote:
Ok, glad I'm on the right track.

Would it make sense to change this behaviour, so if a custom UIViewController isn't found Calatrava would just spin up a WebViewController instead?
On Tue, Mar 12, 2013 at 6:43 AM, <mkwi...@thoughtworks.com> wrote:
That is correct, you always have to provide a UIViewController. For shell pages you must extend WebViewController and override pageName method.

On Monday, March 11, 2013 11:04:07 AM UTC, James Gregory wrote:
> The closest I've gotten now is to create a View Controller for each page, and have each one just subclass WebViewController (the Calatrava provided one) and override pageName with the same name as the HAML file. Is this the correct approach?
>
> On Monday, March 11, 2013 7:32:24 PM UTC+11, James Gregory wrote:Hi all,
>
>
> I'm still getting my head around Calatrava, so please excuse my stupid questions.
>
>
> I've created a project, which has the conversion example in. I'm trying to change the project so there are no native views, and the HTML shell is used everywhere. How can I do this?
>
>
> If I remove and/or don't have a UIViewController implementation, nothing works. Looking at the code, the TWBridgePageRegistry.ensurePageWithName will always try to create a native view. Am I missing something here?
>
>
> Cheers,
> James

--
You received this message because you are subscribed to the Google Groups "calatrava-mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to calatrava-mobile+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.


Reply all
Reply to author
Forward
0 new messages