Can a UITabBar (not UITabBarController) have multiple selections? - ios

In one of my views I need a control that lets the user multi-pick items on a horizontal, graphical list (tap to select, tap again to deselect...think: locking pushbuttons across the screen).
Rather than laying out a bunch of UISwitch controls side-by-side I want to use something prettier...icons of the elements being chosen. I thought a custom UITabBar might do the trick.
Is there a way to get the buttons on a UITabBar to lock state in a multi-pick fashion? So if my user taps the 1st, 2nd, and 4th buttons they stay selected but the 3rd, 5th, and 6th don't?
(If not, I guess I can build something. Can a standard UISwitch control take on a different look?)
Thanks!

Nope, there’s nothing in the UITabBar API that indicates that you can have multiple selections.
As for customizing UISwitch—that’s not what you want. As of iOS 7 you can no longer set a custom “on” or “off” image. You’re better off customizing UIButton, which isn’t quite as close semantically, but which still provides all of the API you’ll need for your application.

Related

ViewPager (Swipe-able tabs) in iOS

I'm trying to build a tabbed bar with swipe-able pages exactly similar to Android's ViewPager. Each page is supposed to hold one UITableView only.
I don't know what's the better way to achieve this but so far I have 2 ideas. Also the tabs are dynamic. I can have one tabs or 10 tabs. It depends on the API I'm communicating with. (The tabs represent shop categories and the table views represent the products)
The tabs will be a UICollectionView and then I'll use one of the following options:
First approach is to build two UIViews, each of which will hold a UITableView. One UIView will be outside the screen bounds and the other one will be the one being displayed. When the user swipes and the tabs change, the UIView being displayed will move outside the screen bounds, either to the right or left and the other UIView will be displayed. As soon as the swipe action begins, I will change UIView's (the one that's about to be displayed) datasource and reload its data.
Second approach is to have a number of ViewControllers OR UIViewContainers equal to the number of tabs (which is dynamic). I'm not sure how I'd implement this because I'd have to worry about reusing UIViewControllers/UIViewContainers inside of my main UIViewController as well as handling a large number of them.
Using one big UICollectionView to host a UITableView in each UICollectionView cell. It's pretty much the reverse of the old App Store.
UICollectionView in UITableView Tutorial
So, how do most people implement similar UIs? Is there a different approach I should consider? Any other tips that can help me implement it?
EDIT: I may have left a final detail. I actually have 2 sets of tabs (categories and sub categories). They may both be displayed, one of them, or none. It depends on the API's response. For that reason, using a 3rd party library may be hard or even impossible.
EDIT2: Added 3rd approach.

Which UI element is suitable for drop down filter in iOS app?

Right now i am developing app. One of it's ViewControllers has tableview with list of blog posts. I want to put some control so user can select blog's categories and then app will show posts only from those selected categories.
I thought it would be nice if there will be "filter" button in top right corner of my app's viewcontroller. After pressing it dropdown list of category appears and user can select categories.
What custom UI element can handle it?
Really there's a ton of options at your disposal, not including all the custom elements you can probably grab from GitHub
For an iPad, you can use a UIPopoverController https://developer.apple.com/library/prerelease/ios/documentation/UIKit/Reference/UIPopoverController_class/index.html
Depending on the number of filters and the style of the design, a good starting point could even be a UIActionSheet.
If you want to do something really fancy, you could have a second UITableView hidden underneath by your main UITableView containing the blog posts, and then when the "Filter" button gets hit you can animate your blog UITableView slightly over revealing your filters menu (maybe even shaded slightly darker to give a feeling of depth to the app)
I searched for a while and can recommend CZPicker https://github.com/chenzeyu/CZPicker because it very nice and easy picker view for iOS that supports iOS 7 and is well working not only iPhones but whit iPads too.

iOS UIButton or Single Row UITableView For Dropdown Like Thing?

For iOS 7 and iOS 8, we're implementing these things that look like drop-downs, but each just launch a modal window.
What makes more sense, using 3 UIButtons, 3 UITableViews with 1 row, or something else? In the past, there would be more than one of these all lined up, so I would put them in a UITableView and set the accessoryView of the UITableViewCell. Using the cell was nice, but three UITableViews seem like overkill here and a maintenance hassel.
The closest post I found regarding this was one about using an UITableViewCell outside of UITableView
What would make the most sense is to follow the iOS design guidelines. Instead of trying to create custom dropdown menus (or worse: showing a drop down menu, but displaying a modal view when the user is expecting a drop down view), that UI could be replaced with 1 UITableView that has 3 UITableViewCells in it. The text on each cell would be the name of the setting to be changed and selecting the cell would push segue to the next page. This will give the app a uniform iOS UX; allowing users to know exactly how to use your app because it works similarly to other apps on their phone. Check out the Settings app on the simulator to see what I am describing.
I don't see any advantage to using a UITableView or a UITableViewCell. I think this is clearly a case for three UIButtons. You can set constraints to keep them nice and clean. One cool thing that might be worth investigating is using a unicode character for the downward arrow. That way you could have the tap feedback on the whole "thing" as you called it.
When I need to create sort of dropdown menus, I usually take advantages from UITableView, one above all is when you will need to add one or more selections in the dropdown you just need to change the data model.
UITableViewCells are easily customizable that means that you can create almost everything you want.
I think that your design doesn't adapt well to a mobile application, those kind of menu are more web style, with 3 buttons and a UIPickerView you can really improve the user experience and also adapt in a really easy way on the ipad embedding the picker in a UIPopoverController.
as i agree with #keithbhunter, but still if you want then may this links will help you.
http://code4app.net/ios/DXPopover/54741ca3e24741c56db03ca0
https://www.cocoacontrols.com/controls/kxmenu
https://www.cocoacontrols.com/controls/nidropdown

Alt Button On Custom Keyboard in xCode

It's the first time I'm creating a keyboard for iOS. I've created the first page with all the buttons but I don't understand how to add the second page.
For example: first page QWERTY, second page 123.
Is here anyone that can explain all the passages and functions/classes that I have to add on my codes and where precisely?
Thanks a lot
Well I haven't built a custom keyboard personally but I would make seperate views for the "pages" of keyboards and just hide away and unhide the view of the keyboard you want to show when the user presses the "alt" button. You could have as many keyboards as you like with this method and have it pre-built in the backround so that it would function very quickly to swap between them. Or animate them as you like really as views are easy to slide around. Actually sounds like a lot of fun as I have often thought about building a keyboard that has alpha-numeric values all in one, which would make filling in details on a login screen much quicker/more convenient.

UIPickerView alternative for iphone something like combo box?

Are there any alternative controls instead of UIPickerView in XCode. If yes, how do they work? Can anyone suggest an alternative for UIPickerView?
You can see one in action if you download the free One Stop Plus app (women's clothes), drill down on the products until you get a view with Color, Size, etc. Tapping those buttons animates a table out of the button, with choices. Selecting one causes the table to animate back into the button. If you like that post a comment to this answer and I can tell you how to do it.
With iPhone interface, it is not feasible to enable a Combo box like a website. (I believe even Apple Guidelines would say not to do it). What you need to do is the use the UITableView to enable users to pick one option.
One thing you can do is decide whether you want to have the choice in a view shared with other controls. OR if your list if too long you can chose to push in a new view with only the choices on them and when a user selects one, the view will pop back one level.
Here is a screen shot of what i mean (maybe not the best example out there):

Resources