baker icon indicating copy to clipboard operation
baker copied to clipboard

Modal WebView: switch from XIB to Code

Open folletto opened this issue 14 years ago • 5 comments

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

folletto avatar Mar 05 '12 23:03 folletto

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.

folletto avatar Mar 06 '12 13:03 folletto

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

steiny2k avatar Mar 08 '12 08:03 steiny2k

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?

folletto avatar Mar 08 '12 15:03 folletto

Conversion done in Commit ad710a7bae8aeb218979b0f4413faf73ca40c3d5.

Some interesting things:

  1. nib2objc didn't work much, I had to do everything by hand
  2. I initialized the UIView to the Controller itself, and - more importantly - set its size and sizeToFit, in order to allow all the object inside it to work properly with sizeToFit and autoresizingMask.

Testing a bit more before declaring this closed.

folletto avatar Mar 12 '12 23:03 folletto

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"

mutador avatar Mar 18 '12 18:03 mutador