Add customView below navigationBar Title - ios

Is it possible to add a custom view below the navigationBar title, such that navigation bar preserves the default translucent effect and also adjust its height to accommodate the custom view?
Apple is doing it in Health App, App Store Connect App and Also in Calendar App.
I have gone through the Sample Provided by Apple:
Customizing Your App’s Navigation Bar.
but it doesn't provide any help.
Found an archived sample code: NavBar: Customizing UINavigationBar's appearance
It has a sample image which shows that a label is added below the title and is also a part of navigationBar but after running the sample project I checked that there is no way to even replicate that.
According to an answer to this similar question:
Adding custom view as title view and setting the prompt text doesn't give ability to change the prompt text font which looks weird.

Related

iOS Launch Storyboard: How can I change a Tab Bar's tint color?

What I'm doing:
Using a 'launch storyboard'. It's quite simple, and contains a default UITabBarController. I've set the tab bar's 'tintColor' to red in the launch storyboard, as well as in my app. I'm using Xcode 7, iOS 9.
What doesn't work:
The launch screen loads the tab bar using the default blue iOS tint color...! Then after loading, the tint color switches to red when the launch screen storyboard is replaced.
How on earth are you meant to set a tab bar's tint color in a storyboard?
Demo Project: http://s000.tinyupload.com/?file_id=73998115878034693063
The right way to go is to confuse Xcode. Xcode should not know that the launch storyboard that is used is actually a launch storyboard. This way you would be able to set some custom User Defined Runtime Attributes. However, you still would NOT be able to run some custom code...
So... To do this, follow these steps:
Create a new Xcode project
Copy your Main.storyboard into desktop and rename it to CustomLaunchScreen.storyboard.
Add this CustomLaunchScreen.storyboard to the project.
Open your Info.plist file and change key Launch screen interface file base name value from LaunchScreen to CustomLaunchScreen.
Open your CustomLaunchScreen.storyboard. Delete the default UIViewController and set the UITabBarController as your initial view controller.
Open the tabBar property of your UITabBarController and navigate to User Defined Runtime Attributes
Add the tintColor property, set type as Color and set some custom value.
You can also watch a full video tutorial Here
Well thanks to #OIDor for his solution, it is a great hack.
To be clear however, you don't need to do all that. All you have to do is:
Edit the source of your Launch Screen storyboard and change
launchScreen="YES" to launchScreen="NO", this enables you to do the
next part...
Add the user-defined attribute tintColor on the Tab Bar
in the storyboard. This is not permitted by Xcode without the first
step
Hey presto it's all working.
I think I've figured this out.
There are quite a few blog posts online about how Launch Storyboards work, but not a lot from Apple. I found from this blog post which discussed that the launch screen images are captured at runtime from the launch storyboard. Digging into my simulator directory revealed that they were in fact there:
I'm not sure why, but the call to set the UITabBar's tintColor does not fire in time when the launch storyboard has loaded, but setting colors for other values such as the barTintColor property works:
All I can say is this: setting the tintColor on a UITabBar on a view controller in a launch storyboard is not supported. There is something going on behind-the-scenes when the launch storyboard is loaded preventing this from working.
TL;DR: you can't do this with a Launch Storyboard. For a workaround that tricks Xcode into treating your launch storyboard as a regular storyboard, see OlDor's answer.
As an alternative, you could take a screenshot of your app with the tab bar loaded properly, tweak it, and use that in a UIImageView on your launch view controller.
If you want to add just the tab bar without any currently selected tabs, add a UITabBar to your launch UIViewController and style the UITabBarItems to your liking:
This UITabBar has two UITabBarItems which can be styled without adding outlets to their view controllers.

IOS Customizing UISearchBar and Search Display

Hey I have been trying to customize a UISearch bar with display controller and have run into some issues customizing certain aspects of the search and display controllers. I'm using storyboard and am developing with the most recent version of IOS 6.
The first issue is eliminating the dark grey gradient overlay that appears when you first click on the search text view. I have tried to use the searchDisplayController:willShowSearchResultsTableView: delegate but am unable to either find the view that is being used as the gradient overlay or a property to disable it. How do I remove this view?
The second is I am having an issue with the initial animation that is triggered when the search view is clicked. The animation is supposed to expand the search bar over the UINavigationBar to allow for a larger space to view the results. This doesn't happen and the search bar stays below the UINavigationBar and the animation doesn't properly show. I have tried setting the displaysSearchBarInNavigationBar and navigationItem properties but couldn't find any way to access or set them. Could this be an issue with the fact that I'm using autolayout in my story board? I have noticed that many issues relating to the UISearchBar animations are due to autolayout being used in the .xib or storyboard file. How can I make it correctly over the navigation bar?
The third issue I am having is with over ridding the searchBarTextDidBeginEditing:(UISearchBar *)searchBar delegate method. I have subclassed the UISearchBar to allow for complete customization. Is there a way to provide a default definition for the searchBarTextDidBeginEditing: delegate method inside my custom UISearchBar subclass. I want to provide a specific style of text in the UITextView when the user clicks on the search bar and don't want to have to redefine this method in every view controller that uses the search bar. Is this possible?
Thanks for the help in solving these issues.

Xcode - Sliding Tab Bar? [duplicate]

I've downloaded an Download Manager from App Store and noticed that the app scrolls an UITabBar,like: When the user press a button the bar walks left and show other option to the user.Is that really possible and does Apple accept these type of customization in UITabBar?If it's possible how can i do that,please provide some sample code or reference.
Yes, possible. but not using usual UITabbar. you have to create custom tabbar that behave the same. there are projects out there that you can use, save a lot of time of your work.
infinitetabbar : A scrolling tab bar with space for infinite items
jsscrollabletabbar : JSScrollableTabBar is a simple, refined tab bar UI control that resembles the TabStrip found in the popular Three20 library but without any of the dependencies.
It is probably a custom-made control (a scroll view with a few child buttons). It's perfectly acceptable at the Store if you don't use any undocumented functions.
Yes, you can implement scrollable tabbar using UITabBar.
Adobe writer maybe thought about using only UITabBar, so he mentioned it can't be implemented, but if you use ScrollView and UITabBar, it can be implemented.
Put tabbar on scrollview, scrollview size is 320,460 (it excludes status bar size).
TabBar size is any size you want, scrollview contentsize must be equal to tabbar size.

How To make custom title bar for rootview controller in splitterView

I wanted to customize the title bar of the root view controller in my splitterView for an iPad application. The title bar required to be transparent and with customized font and size.
I tried on my own but could not find any such methods for the same and was unsuccessful with some googled links.
Any suggestions?
check the below link, its helpful
http://www.raywenderlich.com/2079/core-graphics-101-shadows-and-gloss

iOS - Set UITabBar Icons

I've checked a couple of solutions, saw you can set it in the storyboard but to set the icon you have to set it as a default identifier, and doing so removes the title and sets the default one, if you set the title to your own title it reverts to custom and no icon image once again.
I'd like to use the default iOS icon images for this, instead of downloading some images off the web.
I also tried to set it up in the AppDelegate in didFinishLaunching by getting the TabBar by accessing the rootViewController, but it gives me an undefined selector error when setting the tab bar items. What does seem to work is setting the tabBarItem property in my view controllers, but this way only one is set when the view shows and I want them both to be set already, also same issue as with the identifier in storyboard, it sets the default title of the icon.
It's against the iOS HIG to use the system-provided tab bar icons with non-standard titles. It's not a good idea because the icon/title combinations are part of the common UI language that users come to expect.
So you won't find a way in the standard APIs to set system-provided tab bar icons without also setting the corresponding standard titles.

Resources