I'm now developing a module for titanium application. I have already created module using proxy. (TiProxy). The new module I'm creating is based on view. So I'm trying to use TiViewProxy.
But I'm confused with some terms:
- What is the major difference between
TiProxy
andTiViewProxy
? - Is there any naming convention for
TiViewProxy
files ? If we are usingTiProxy
, then we add proxy after the file name. Is there anything like for view proxy ?
I referred iOS Module Development Guide but there is nothing about the naming convention.
Please help me. Thanks in advance
TiViewProxy
is special proxy that has "built in magic" for views. It participates, for example, in the UI layout cycle.Assuming your module only has one view it wants to expose to Ti, you should call your view
<ModuleName>View
and your proxy<ModuleName>ViewProxy
. This will have the benefit of participating in the built-in magic, and your ability to usemyModule.createView()
from within JS.In the iOS module development it is mentioned that you should implement
-(void)frameSizeChanged:(CGRect)frame bounds:(CGRect)bounds
(probably by doing something like
[TiUtils setView:myView positionRect:bounds];
) -- that's how Ti lets you know your view has been positioned/resized. If you changed your view's position/size you should let Ti know:[(TiViewProxy*)[self proxy] setHeight:NUMFLOAT(height)];
(if, for example, your view changed its height)