iPhone Mail Composer Appearance Change allowed? - iphone

I seem to remember sometime back reading that changing the appearance of the mail composer view controller was not allowed. However, I also just tried for the first time to implement changes to my navigation bars system wide using the
[[UINavigationBar appearance] setBackgroundImage
method
This changes the navigation bar in the mail composer view controller. So, is this now allowed to make changes? Reason I am doing the appearance call is I have a lot of navigation bars and would like to get them all set at once.

The appearance methods are documented and their effects are intended to be app-wide, so I see no reason why it would be a problem to use them.

Related

Swift navigation bar animation issue

I am at a loss with what is potentially a simple fix.
I have a basic ViewController with a UINavigationController, and a UISearchBar embedded.
Basic view layout
When I PUSH a new UIViewController onto the Nav - I get a brief animation issue where a black background appears, and also the cancel button doesn't disappear.
Animation glitch
It's only brief, but annoying enough.
When I return back using the back button, the search bar reverts to white, and then switches to red.
Back display issue
I wondered if I had configured something wrong, so I created a fresh project and left everything with the defaults. Yet I get the same issue.
Stripped back and the same issue
I'm using xCode 9.3 - with swift 4.1
Any ideas?
Check the extendedLayout settings of your view controllers (these can be set in code or in the storyboard editor). They need to be the same for both view controllers or you'll get this animation glitch.
In your case the problem might be the embedded search bar. It seems to be present only for one of the view controllers. You've got navigation bars with two different heights because of that. The framework doesn't respond well to that...

Change constraints of UINavigationBar in UINavigationController

Apple says in its Documentation:
It is permissible to customize the appearance of the navigation bar using the methods and properties of the UINavigationBar class but you must never change its frame, bounds, or alpha values or modify its view hierarchy directly.
They never strictly mention that changing constraints is not allowed but I'm assuming it falls under the same criteria as of changing the frame.
I would need this for a messages app in order to achieve the translucency effect under the iMessage standard top bar. What I currently have is a UINavigationController embedded in a MSMessagesAppViewController with the topAnchor set underneath the topLayoutGuide. This prevents me from achieving the effect but places the navigation bar below the top bar accordingly. If I set the constraints to just attach to the topAnchor, the Navigation bar is hidden in the extended view. Changing the constraints of the UINavigationBar here could solve the problem.
Am I allowed to change the constraints of the UINavigationBar and if not, any other solutions for this issue? For any further information just tell me.
I don't know how well anyone on Stack Overflow can answer this question, since it ultimately comes down to Apple's opinion/review. I've shipped apps with oversized/modified Navigation Bar and Navigation Controller frames without rejection from Apple, so I would tentatively say that this is safe to modify in your app.
I'm not sure what you're describing (as I don't know what MessagesController is), but it sounds like you have a Navigation Controller embedded inside another Navigation controller, and fixing the issue by hiding one of the bars sounds like a code smell...

MFMessageComposeViewController and UIAppearance, apple says don't customize

Question
In the docs for MFMessageComposeViewController apple says:
Important The message composition interface itself is not customizable and must not be modified by your application.
But navigationbar and barbuttonitems in the MFMessageComposeViewController and the MFMailComposeViewController are inheriting all the styling I've done through UIAppearance.
I tried to revert to default appearance by using UIAppearance containment and setting the navigationbar/barbuttonitem background images to nil, but I couldn't figure out how to restore the default titleTextAttributes for the navigationbar and barbuttonitem.
I tried going the other route and using containment to restrict the styling to my navigation controller, but it seems like MFMessageComposeViewController and MFMailComposeViewController are contained within my navigaton controller anyway, so this isn't helping.
So my questions are:
1) will changing the navbar appearance on MFMessageComposeView and MFMailComposeView be an issue at app store approval? (if it's not an issue I can keep the custom styles.)
2) is there a way to present the ComposeViewController so that it won't be contained within my navigation controller?
3) or simply, how can i restore the default title text attributes for the barButtonItems and navigationBar?
It seems to be a rather old question, but:
1). No, changing appearance of navigation bar will not affect AppStore approval. Mentioned Apple note is related to fields of MFMessageComposeViewController (e.g. To: Cc: ...), not the navigation bar. (We had an approved app with such customized navbar)
2, 3) No need for that =)

Replacing UINavigationControllers NavigationBar with UIView

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?
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.
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.

Alternative to UINavigationController or UINavigationBar, custom height wanted

My goal is to get a navigation bar like the HBO GO app on iPad. Their nav bar has a larger height and a custom background. It seems like they're using a navigation controller since when you press on a show it takes you to a new screen with a back button.
I'm wondering either
1) Can I use an instance of UINavigationBar without a NavigationController and use the navigation bar delegate to handle pushing and popping my views?
or
2)Is there another way that I can implement this?
I am currently trying to do this with a navigation controller and navigation bar but I am running into difficulties and I think its not the best way to do it. Also Apple docs specifically say not to change the frame of the navigation bar in a navcontroller.
Ideas please? Thanks in advance!
From the looks of it, the HBO Go application uses completely custom navigation controls. A basic UINavigationController-alike class is relatively straightforward to build, but you must be careful to consider that UIViewControllers are not intended to be nested on iOS <= 4 and so you will have to pass through several methods such as view{Will,Did}appear:.
I recommend starting from the ground up, as trying to heavily customize the built-in controls will only lead to further frustrations as you run into issues or limitations in their customizability.