Modal WebView: switch from XIB to Code
After merging the Pull Request #325.
Switch from using the XIB to pure Objective-C code inside ModalViewController.
Maybe using https://github.com/akosma/nib2objc
Ok, I converted everything in my codebase, but I still have some sizing issues that strangely were handled automatically by the XIB but through code not anymore.
Hmm. is this some kind of policy for the Baker framework to have everything constructed in code? Actually this is the first time to have system UI visible in the framework i think.
I thought it might be easier for the intended designers to adapt the 'look and feel' of the modal web view bar, when using interface builder. Once I did the initial 'design' of the modal webview, @ffranke was easily able to adapt the color scheme and button layout to match his needs. I think this wouldn't be possible, if constructing the UI from code.
If you are arguing for speed, I think 10-15% speed-up is not such a big deal: http://cocoawithlove.com/2010/03/load-from-nib-or-construct-views-in.html
No, we'd love to use XIBs, but unfortunately once you need to do thing even slightly more than what's possible in InterfaceBuilder everything gets very very complicated unless it's pure code. :(
i.e. how do you fully customize the toolbar with a specific texture? how do you customize the button with a author-provided texture/image?
Conversion done in Commit ad710a7bae8aeb218979b0f4413faf73ca40c3d5.
Some interesting things:
- nib2objc didn't work much, I had to do everything by hand
- I initialized the
UIViewto the Controller itself, and - more importantly - set itssizeandsizeToFit, in order to allow all the object inside it to work properly withsizeToFitandautoresizingMask.
Testing a bit more before declaring this closed.
i think a jpg background or temporal image while is loadind the page , was good. to tell the user needs internet conection....
"you need internet conection to see this page, if you don´t have click here to back baker"