Is is possible to create a tabbarcontroller that does not have elements hidden within "More" section? - uitabbarcontroller

I'm currently running into issues similar to the ones described in this post and am wondering if it is possible in a tabbarcontroller to not show the "More" icon and display all of the view controllers in the tab bar?
The issue of reconciling the show and hide becomes problematic if I assume that some views have navigation bars and that a user may change the order of the tabs, so hiding and showing tab bars becomes another facet of the project I will need to keep track of in appearance and disappearance methods.
Per Apple's documentation, the morenavigationcontroller is something that does not is set in the tabbar's vc array, but is merely a property

Related

iOS Custom Tab Bar

I am looking to implement a custom Tab Bar in iOS where selected item is bigger size than the rest of the tabs and peeks out over the content similar to this screenshot.
Could someone point to a tutorial of how to accomplish this preferably in Swift?
I faced with this task several times. I found a lot of tutorials but I've never found one that gives the ability to create a center button that part of it is out of the tab bar.
At the end, I created an approach to have it done correctly. I implemented a simple example project with instructions how to do that. Please check my Custom Tabbar Center Button repo as an example.
One more benefit of it it's center button hides correctly with the tab bar when you use Hide Button Bar on Push property.
A UITabBar contains an array of UITabBarItems, which inherit from
UIBarItem. But unlike UIBarButtonItem that also inherits from
UIBarItem, there is no API to create a UITabBarItem with a customView.
So instead of trying to create a custom UITabBarItem, we’ll just
create a regular one and then put the custom UIButton on top of the
UITabBar
Not swift, but should be easily translated.
https://github.com/boctor/idev-recipes/tree/master/RaisedCenterTabBar
This one is Swift:
https://github.com/itsKaynine/SwiftRaisedTab
Source code for a similar question, using Swift 3:
https://stackoverflow.com/a/36016377/300897

Resetting Programmatically adding buttons for UITableViewCell Reuse

In my tableview controller. The images are being added as backgrounds to the button. These buttons are then added to the table view cell on user requirement.
If i show/hide the cell. The buttons with background images from the hidden cell are being shown on the enabled row/cell i.e. overlapping. I have read articles regarding prepareforReuse function. Which can be used if i know the existing properties. In my app the buttons are being added based on user selection.
Is there any way to use prepareforReuse to reset every thing even the buttons which have been added programmatically so that when they are called then overlapping issue doesnt appear.
Main Problem: I cannot give names of my buttons to set their values as nil because i dont know how many will be created. While in prepareforReuse (to reset the cell) i need to provide some property names which exist in cells already.

How to expose standard back button in view controller navigation?

I need users to be able to navigate a data hierarchy (master level, detail level) and to create new master and detail objects accordingly. Both master and detail use arrays for their model and TableViews for presentation
The navigation flow for this uses 2 navigation and table controllers like below. The + of the master and detail TableViews create new objects, the forstTableCell navigates to the second TableView using a segue:
While the screenshot shows "Done" right now even when removing that ButtonItem the slot remains empty.
I would like to show the standard back button instead: "< Middlewares" in this case. In the tests I've only been able to get the back button when navigating to a normal ViewController, but not to another NavigationController. Is it possible to have it between Navigation Controllers, too?
Simply remove the second navigation controller. If you use a push segue, your second view controller will still have the navigation bar. As long as you don't use a modal segue all view controllers that are pushed will have a navigation bar.
So your storyboard will look like this:
You will then automatically have a back button. If you want to change the text of it, go to your navigation item of your first view controller and change the back title accordingly as shown in this screenshot
You certainly want to have a title in your second view controller (something like "Add [whatever you want to add]". So simply drag & drop a UINavigationItem on your second view controller then you can also add UIBarButton items in your Interface builder
Controlling the look/feel of the Navigation Bar Buttons
You can achieve the behavior you want by opening the Document Outline and find the existing Done button. If you have a UIBarButtonItem type, you can simply change the type to Custom in the Inspector. Next add a regular button within the UIBarButtonItem (just bring the Navigation bar for the target controller into the zoomed in view of the storyboard/xib). This will allow you to drag a button onto the navigation bar.
Once you have a standard button you can add an image with the back arrow. Then add supporting code to use the pop behavior on the Navigation bar. Since you can have only one root navigation controller, you may want to remove the second UINavigationController and add a UINavigationItem from the objects library and then subsequently add the buttons, titles of your choice. This configuration will allow you to leverage all of the push and pop methods available, while retaining full control of the look/feel/behavior of the navigation stack.
More on customizing the look/feel/behavior of the UINavigation Stack can be found at: Navigation API Docs

Disable only specific list items in a win32 ListView

I am using win32, c++.
I have a ListView & i want to disable (grey out) only some of the items from the list.
Is that possible or only whole ListView can be greyed out?
The ListView control does not have a concept of disabled items. You can simulate that appearance using custom drawing support. This Sample demonstrates how to change the text and background color of items within the list view.
You would need to go further and provide some means of determining when a disabled item is selected within the view (as the selection will continue to work).
The Windows List View Common Control does not have a disabled state for Items. If you want to do that, you will have to implement it yourself.
This is a not-trivial exercise. It's not hard to change the visible appearance using customer draw, but handling hit-testing and selection would be quite complex.

How to show a ‘modal’ view (controller) *in* a tab bar interface without hiding the tab bar

I want to implement a ‘modal’ view like the ‘search’ view of the AppStore on the iPad.
When shown, it should:
Still show the tab bar. Selecting any of the items should take you to their view as normal.
No tab bar item is highlighted (because the search view is ‘modal’).
The closest I’ve come, with existing APIs, is:
On the ‘search’ view controller, set the UIModalPresentationCurrentContext modal presentation style.
Show ‘search’ view controller modal from the active view controller inside the tab bar controller (not from the tab bar controller itself).
However, this does not seem to be the right path:
View controller is shown underneath the status bar. I can work around that from -[UIViewController viewDidAppear:], but when changing the orientation of the device, this leads to all sorts of drawing issues and the controller, again, tucks itself underneath the status bar.
Tab bar item is still highlighted.
to keep showing the search bar just trim the modal view's hight so that it doesn't cover the tab bar.
For orientation changes, you just need to handle that by changing the view size and making sure the modal view is always brought to the front of all the views. You can modify that view's frame and contents programmatically or you can just create nibs for the orientations you want to support and load them up when it changes. Also note if you do change the view's frame programmatically you will probably need to resize/reposition fields as well.
For dealing with the tab bar, you should be able to turn off the highlighted item. So when you pop up the modal also make sure to turn off the highlighted item. If you want to interact with the toolbar from the modal view you can do that with delegates, passing an instance of the parent view (or just accessing parent view... I think you get that for free)