iOS 7 - UIPickerView over UITableView - ios

I can't find anything else on the internet about this specific topic. Everyone else wants to know how to do inline UIPickerView, but there is nothing on just having a UIPickerView appear over a table.
I have a TableView with a bunch of populated cells. I also have a defunct button in the top left of the screen. What I want is to be able to press the button, bring up a Picker and sort the TableView's cells based on what is selected.
I've been looking around and trying for ages and I just can't find anything detailing a solution to my problem.

I would try using ActionSheetPicker-3.0
It makes it easy to present a UIPickerView over your current view without having to use a delegate as it uses callback blocks.

Related

Custom UIPicker control IOS

im looking for a similar control to this Android Wheel, its very similar to UIPickerView, but i know that Apple use to reject APPs that modify UIPickerView appearance.
I need a control that let me put images on a infinite loop scroll and let the user drag to select one.
I've found some controls here, but most of them only support strings, some support images and are looped but dont let the user scroll.
My purpose is to make a button scroll loop where you can drag any button to the center of the wheel and see a text description on a uilabel, i dont need the buttons to be clickables.
I hope I explained well, and sorry for my bad english.
I would better suggest you to go with the iCarousel here. This enables you a different mode of scrolling & directions & effects which you can project on a Custom view similar (by Sliding-In & Sliding-Out from the bottom of screen) like a UIPickerView. This is not at all made using extending UIPickerView, but you can project it like that. Once you see a demo app of it, you can eventually change your mind to use this over custom UIPickerView.
Just implement the delegate method declared here to know which of the element was clicked. iCarousel comes with a image loading view also. You can look into that too.
But if you want to stick with UIPickerView customization, then please have a look at this stack Overflow post. This is certainly what you want, except that you need to add button instead of images.

UITableViewController with SearchBar

I have tried both ways below to place SearchBar on UITableView.
TabBarController > UITableViewController(Put SearchBar)
TabBarController > UIViewController > UITableViewController(Put SearchBar)
When I try the second way, then it doesn't work.
(SearchBar cannot show on UITableViewController)
Can anyone tell me what happend?
Here is my xcode project file:
http://www2.zshares.net/tg14vowqzvaw
the usual way to do this would be to put the saerch bar in the header-section of the uitableview its supposed to search. you can do this using the
-tableview: viewForHeaderInSection:
method from the UITableViewDelegate-Protocol. his works in both TableViewControllers and regular ViewControllers that just have a TableView on them. see the mail app on the iphone for an example of this.
if you really NEED the search bar to be outside of the tableview, then you will have to use a regular view controller and just place the search bar in a view above/under the tableView.
other than that, i dont know what to tell you. And what is a TabbedViewController? Do you mean TabBarController? What does that have to do with search bars? Im kinda lacking the time to go through your project, so if you rephrase the question, maybe i can give a better answer?
EDIT-----------------------------------------------------
tableviewcontrollers will do that to you. basically, they will allow ONE tableview to be inside them at a time. also, this tableview WILL ALWAYS fill out the entire space available. Now, there is an exception to this that you cam make use of: Elements like a NavigationBar or a TabBar are allowed alongside the tableview, since they are required for navigation. So if you can put your stuff in one of these, its entirely fine. This my seem counterintuitive, since when do i want just a naked tableview on my screen? the answer is: more often than not. Tableviews are HIGHLY customizable using the UITAbleVIewDelegate-Protocol specified here:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html#//apple_ref/occ/intf/UITableViewDelegate
Do yourself a favor and read that doc, i almost guarantee that you will save time in the long run.
For Example: You know the contacts app on your iphone? If you go into the details of one specific contact, you will find a pertty sophisiticated presentation of the data, that will even go into editing mode if you tap edit. It has a header, multiple segments, and a footer.
Surprise: ALL OF THAT is just a single tableview in a tableviewcontroller, customized via the protocol. Let me repeat: you are wasting your own time if you try to do it any other way. tableviewcontrollers exist for a reason. usem them

ios cocoa: How to adjust the size of the popover depending on the number of rows in uitableview

This is related to this question
ios filter options similar to the apple store (dropdown list)
I tried using a uitableviewcontroller instead of a pickerview as I couldn't understand how to use the picker view if I need it popping out (any info on it would be appreciated).
Now this is what I did.
I have a VC that calls out a "FilterVC". I only have one FilterVC that is called by 3 different "filter buttons", and I will just populate the VC depending on the button. The issue is, one button might have just 2 items that is needed to be shown, another one might containg up to 50. Was wondering how do I adjust the height of the popovercontroller that contains the uitableview? Also, is this the right way in dealing with popovers, 3 segues connected to one VC??? (It needed an anchor point)
Here's what it looks like
As a follow up question:
Is this the right way to do it on an ipad? I feel like most people prefer the uipicker. The guy that answered my first question said it's more of a design thing. Now since I'm no designer, as a user, do you think uitableview is more appealing?
Thanks for your time!!
In the view that you're showing in the popover, set self.contentSizeForViewInPopover as soon as you know the size and before the view is displayed.
The main benefit of using a table view over a picker is that it has a scroll indicator so you can see how long the list of options is. Also obviously that you can control exactly how the list is displayed. So the table view should be better if it fits in with your UI style and particularly if the list of options is long.

iOS: Make content (text) in table view cell editable, but only in edit mode

I know this has been asked a lot of times but theres so much different information and different cases, I just don't understand where to begin and cannot get it working in my app.
In my app I have a table view and I'm using a NSFetchedResultsController. In normal mode, the table cells shouldn't be editable but instead each click should be a segue to a new viewcontroller (which works). In edit mode however I want that if you click on the cell, that you edit the text and this gets automatically stored to the database. And here I don't have a clue.
I want it as simple as possible. What I've read so far I guess I have to subclass UITableViewCell and a TextField. Here's already my first question: In each post about this, the TextField is init with a Rect, however how do I know the exact width and height of my cells?
And do I add this cell directly in the cellForRowAtIndexPath? Or only if the mode gets changed to edit? And some posts suggest you have to be the delegate for UITextField, but why?
And is there some sample code for about exact the problem I have? I wasn't able to find it...

Swipe to remove on UIPickerView

Is there a way to implement a "swipe to remove" action on UIPickerView, just like it's done with UITableViewController?
I've been searching for this for some time, but have no solution.
UIPickerView objects are not editable. When in doubt, check the documentation: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIPickerView_Class/Reference/UIPickerView.html
However, there's no reason why you couldn't make a custom UIPickerView using a UITableViewController and a bit of clever code to figure out which cell is in the middle and properly highlight it.

Resources