iOS possible for draggable hide button on UITabbar? - ios

Is it possible to add a custom button ontop of a tabbar which can be used to hide and show the tabbar?
I can hide the tabbar but i want to be able to do it from the tabbar itself (button on it)
Any ideas?

Just for completeness (I know you have found this elsewhere), but you can use my "PeekabooTabBarController" for this:
https://github.com/a1phanumeric/PeekabooTabBarController
It allows you to show and hide a UITabBarController, and even allows more buttons which scroll horizontally.

Related

ios swift How to add images to navigationbar that are not in the center/titleview?

In swift, how do I add an icon to the navigation bar on the side instead of the middle?
I want to do what Slack does with their search icon by having it appear just next to the right menu icon, see picture here: https://static-s.aa-cdn.net/img/ios/618783545/1b2dca063c580767bf28c885e22c61bc
I DO NOT want the icon to be in the center of the navigation bar with the title view property, which is what most people do. How do I have the icon appear next to the right menu? Thanks.
Depending on the complexity of your requirements you have 2 options:
Create your custom navigation bar (is just a UIView subclass)
Create an image ad apply it as a background of the navigation bar
I have not tried this with Swift yet but this works on Objective-C. You can add multiple items to the right by passing an array of UIBarButtonItems to [self.navigationItem setRightBarButtonItems:]
you can subclass it and personalize your navigation bar, this tutorial is good for that:
http://www.ioscreator.com/tutorials/customizing-navigation-bar-ios8-swift

An UITabBar like Tweetbot3

I would like to know if someone have an idea about how Tapbots made Tweetbot3 TabBar?
In my app, there will be many TabItems, and I don't want the "More" Tab (by default), but I'm very interested to have a similar system to Tweetbot, with a "picker" which opens on long press gesture on a TabBarItem.
But, I'm hesitating on the method. It's better to apply a customized UITabBar class, or to totally "deconstruct" the UITabBarController (to use a UIViewController and a custom "tabbar")?
Having created many custom tab bars, I'd start by subclassing UITabBar and UITabBarController. I wouldn't expect any roadblocks with this approach.
You may want to move the default buttons around and then add some custom buttons. Send a message back to the tab bar controller and let it display the popup choices view.

iOS. Navigation controller toolbar - customize example

I'm newbie with Xcode, I'm learning it and trying to make my app.
Now I would like to put Navigation Bar func at the bottom of the screen with some customize.
I turn on "Shows Toolbar" at Navigation Controller and put my button there, but I cannot customize it.
Everything that I found about customizing Navigation Bar at the top of the screen or about customizing TabBar when people are talking about bottom of the screen.
Please, can you give me a code examples to build something like this at the bottom of the screen:
https://dl.dropboxusercontent.com/u/1338320/nav.png
Thanks in advance!
I'm not sure what you are trying to customize (button or bar) but when there is a bar at the bottom of the screen that is not a tab bar it is a tool bar not a navigation bar. The two are related but they each have their own class. Tool bars use UIToolBar not UINavigationBar. The tool bar is independent of the navigation controller and the two work together well. For any views that don't want a tool bar just set it to hidden in -viewDidAppear: (you will need to un hide it in views that use it).
dimimpou is right. You can accomplish this by using a UITabBarViewController and one UIBarButtonItem for "ADD ONE" and "MY STATS".
If you get lost in references(I sometimes get lost too), I may provide a simple example.
Note that if the interface provided by UIKit doesn't meet your need you can:
Use category over UITabBar or UITabBarItem.
If 1. doesn't work sadly you'll have create your own view controller which is simulate UITabBarViewController(requires some time, but it's worth)
Edit:
You can use a UINavigationController inside a UITabBarViewController.
You can easily do this. The way I understand it, you want this "Toolbar" to show from a button in the navigation bar. Just put a tab bar with what you need and make it show when the user presses the button on the navigation bar. on this buttons action put this code: self.tabBar.hidden = NO; and on the storyboard uncheck the bar visibility option. Hope it helps!

Disable other bar button items when one is being touched: Navigation bar

I have a navigation controller, in its navigation bar i've 2 right bar button items, I want to disable one right bar button when the other is being clicked/tapped. How to achieve this??
Thanks in advance.
Unfortunately UIBarButtonItems only have one callback and that's the equivalent of UIButton's UIControlEventTouchUpInside.
If you want to do something when the user presses and releases a button (disable/re-enable other buttons) you might have to get your hands dirty with some custom UIBarButtonItems that have UIButton's as customView and do some careful event handling to know when to enable/disable each.
On a personal note: pressing more than one bar button at the same time is not very common and shouldn't present a problem, whatever implementation you may have.

How to hide the UITabBar and show UIToolBar?

I read several answers to this question but couldn't figure out how to do it. I'm using Xcode 4.2 with ARC and no storyboards.
I'm developing an app based on the TabBar application template and extended it to contain 4 UITabBars. I'm not using UINavigationController but instead using UINavigationBar next to the status bar. When the app is loaded with the first tab shown, I have a button on the UINavigationBar and when I press it, I want to hide the UITabBar and instead show the UIToolBar at the same location where the UITabBar was located.
I tried to hide and show using the hidden property (hiding the UITabBar and showing UIToolBar). What happens is the UITabBar is hidden but the UIToolBar is shown above the location where the UITabBar was shown before. This looks ugly and I want it to be shown at the very bottom of the screen.
I think I can't use hidesBottomBarWhenPushed as I don't use a UINavigationController but instead using Navigation bar directly.
Also, I want to revert back to showing the UITabBar and hide the UIToolBar when pressing the same button on the UINavigationBar.
I am not sure if my idea would work for your scenario. Here it is...
but before, just let me tell you that hiding UITabBar, unlike hiding UINavigationBar is not animated. So to me, hiding tabBar is not a user-friendly approach, unless you create your own subclass of UITabBarController that animates hiding the UITabBar.
You can use presentModalViewController:animated and dismissModalViewControllerAnimated: methods. The viewController that is being shown modally can have a UINavigationBar, it pops out from the bottom of the screen and covers the UITabBar with animation.
Hope that helps.
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIViewController_Class/Reference/Reference.html

Resources