iOS) How to add a divider(==separator) between tabbarItems - ios

I searched this question many times but couldn't get enough information.
So I will use UIButton or UIView to replace UITabbar for customizing issue.
I want to put divider(separator) between two tabbarItems and bottom lines like the image below
But What I made now is below:
How can I make it as I want?
I did customize many view components(UIViewcontroller, UIButton, UITextfiled,UITableViewCell,UICollectionViewCell) but I don't know how to customize tabbarItem

I'm afraid there is no specific option to set a divider in UITabBar. But you can always use a custom tab bar. You can check this out, it has a special property for seperator image:
NMBottomTabBarController for iOS
There is also another option. You may like this :) I also used it myself in one of my app. I made an image that looks like a tab bar with seperator as a background image. Then put the items on it. Easy peasy. For example check this image:
Image Link
I hope this helps.

Related

UITabBarItem default with custom title

I am trying this for a while now, I do have a UiTabBar with three elements in my swift iOS app and I would like to use default images every TabBarItem, but combined with a custom title. It is not possible to do this in the StoryBoard, so I try to do this for every element in the ViewControllerClass of every page. Just one example:
self.tabBarItem = UITabBarItem.init(tabBarSystemItem: UITabBarSystemItem.bookmarks, tag: 0)
self.tabBarItem.title = "Test"
Does anybody of you know a trick how to combine both of it? It seems like it's not possible to combine default images and custom titles...
From Apple docs (https://developer.apple.com/documentation/uikit/uitabbaritem/systemitem):
The title and image of system tab bar items cannot be changed.
Presumably, this is because Apple likes apps to be consistent. They don't want users to be confused by seeing a common system Icon that doesn't do what it's expected to do.

Place image on top of all "layers" on iOS screen

What are the constraints/alternatives to place an image that stays on top of all iOS "layers" and windows. Think of it as a lock screen but that still allows you to interact with you phone, meaning browse, answer calls, etc. The image will be displayed in a transparent way (say 40%) and will be launched by an application.
Not really sure what you are asking for but if you are looking for a way to add some code once and it shows everywhere on each of your ViewController then there really is no way to do that.
What you can do is
Use UIToolBar
add buttons to that tool bar
Add that tool bar to each ViewController in storyboard (where you need them)
Create a global function / method that you can call in from any ViewController that has the button actions in it. That way you edit the code once in one place and use it every where.
If you don't like UIToolBar then
you can add your own UIImageView and add a transparent background to it
Add your buttons on the UIImageView. (You will have to add constraints)
then show that on every ViewController
If all this seems to much work then you can use existing controls HERE and see which one fits your needs.
This maybe a good one - FCVerticalMenu

Make custom selected tab bar Item in iOS Swift

I am working on an application using Swift which needs to have a TabBarController and when user will select a tab then that particular tab bar item shows a 3d visual effect (Although it will be an static image I guess) which contains shadow and that tab bar item will be bigger in size as well with different tint colour.
Please see the attached image.
I have searched a lot on internet but no luck. Please someone help :(
Use http://cocoapods.org/pods/M13InfiniteTabBar
For as much as I do not like answers in the tone It can't be done, I feel that the specific of your screenshot, namely going outside of the UITabbar background, can't be done with UITabBarController.
You can use -initWithTitle:image:selectedImage:. Documentation found here

Add icon to SBSearchTableViewCell

I am trying to add an icon to a SBSearchTableViewCell.
I was adding a subview on top of the cell but that still left a border, and the text was underneath the icon.
http://i.imgur.com/tGqWaEa.png
I tried hooking into -[SBSearchModel _imageForDomain:andDisplayID:] but the domain is 0 and the displayID is (null).
Code: http://pastebin.ca/2460380
Resources:
http://theiostream.tumblr.com/post/54339870761/hacking-the-ios-spotlight-v2
https://github.com/theiostream/SearchLoader
Did you try to set image using -(void)setTitleImage:(id)image animated:(BOOL)animated; method (I'm not sure what it does, but that is the only method to set image in the cell you are using...)? And, How about just creating your own labels, and place them on the right places? That should not be that hard, I think. Good Luck!
EDIT
Sorry it seems like the method I mentioned is available only on iOS 7 and higher. I suggest you to use you own UILabels and UIImageView with imitation to the original.
ANOTHER EDIT
It looks like the SBSearchTableViewCell is the subclass of the UITableViewCell, so why don't you use the it's imageView property to set the image (or, icon) to the cell?
You can move the border over by setting cell.sectionHeaderWidth. Then you can add a subview like you already have done.

Customizing UITabbar idea ?

I read many posts on customizing color of selected tabbar item which is actually blue by default.
My idea was to put an UIImageView on each of my button.
Once the user select one button, I would then display the image (which is the same icon but with another colour as a gradient).
What do you think about that ?
Thanks in advance
You could always use this http://idevrecipes.com/2011/01/04/how-does-the-twitter-iphone-app-implement-a-custom-tab-bar/ and change it to include text and modify the colour.
Thankfully, iOS 5 introduced an appearance proxy allowing customisation of most basic UI elements, including the trusty UITabBar. The proxy is used to change ALL instances of a class throughout an application. However, with this came some basic properties available for specific instances.
See the selectedImageTintColor property of UITabBar for your needs.
Other appearance additions for this class are tintColor, backgroundImage and selectionIndicatorImage.

Resources