1

I am developing app that has multiple skins and I have a dilemma on how to implement this.

One of the solutions would be to have separate nib files for every skin, and load it depending on which skin is currently selected. Problem with this is that I can't edit navigation bar of navigation controller (which my app uses), and I have to change it's background image and back button image etc.. I came up with an idea to hide this navigation bar on every screen and replace it with custom UIView in Interface Builder which will act as navigation bar and custom back button with IBAction for popping current View Controller, so that user won't see any difference.

Is this approach acceptable and if I make it this way, will I have problems with rejection in App Store?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
savudin
  • 45
  • 1
  • 7

2 Answers2

3

If you choose to hide & replace the UINavigationBar with your own UIView it's no problem as far as Apple goes.

However, I can tell you that you will have to spend some time trying to replicate some visual effects that come naturally with UINavigationBar.

For example, when you push/pop a new controller, you will see that the navigation bar title will slide & fade beautifully. The same applies for left and right bar items.

Personally I would not completely hide the UINavigationBar, but customize it. In the end it all depends on what you want, but by default the UINavigationBar is pretty customizable.

You can add your own buttons or even entire UIViews as left and right bar items. Also, you can add your own UIView as the title (with your own label, custom font or whatever) or change the background.

EDIT:

To easily customize the looks in your entire application, you can subclass UINavigationController and create your own CustomUINavigationController. Then, in viewDidLoad method you can change whatever you want to the navigation bar and this will be accessible in the entire application.

Andrei Stanescu
  • 6,353
  • 4
  • 35
  • 64
  • Thanks Andrei, I think I'll go with your suggestion. Basically I'll have to do same thing as this is http://idevrecipes.com/2011/01/12/how-do-iphone-apps-instagramreederdailybooth-implement-custom-navigationbar-with-variable-width-back-buttons/ – savudin Nov 04 '11 at 07:40
  • In IOS5 you will have to do a small hack in order to override drawRect for a UINavigationController. Something like this: http://stackoverflow.com/questions/7657465/uinavigationbars-drawrect-is-not-called-in-ios-5-0 – Andrei Stanescu Nov 04 '11 at 09:12
  • I am subclassing UINavigationBar and overrideing it's drawRect. I ve tested in iOS 4.3 and iOS 5 and it's working fine. – savudin Nov 04 '11 at 09:29
  • Oops, I forgot to mention in a category. In a subclass, it's working fine... yes. – Andrei Stanescu Nov 04 '11 at 09:45
  • with ios11 it's only left to replace this damn bar because apple decided to break backward capability – Next Developer Sep 22 '17 at 08:12
0

No way, what you are doing is perfect. This will work & no way it will get rejected from app store (just based on this approach). I too have explored several ways to provide skins & what you wrote seemed to be the least hassle-some. Plus its way more easier to create UI elements in Interface Builder hence the separate nib files for different skins.

I am saying this so confidently 'coz I have done the same thing & app store approved.

Best of luck.

Srikar Appalaraju
  • 71,928
  • 54
  • 216
  • 264