iPhone/iPad Enable only horizontal&Vertical swipes in a CoverFlow in TableViewCell - iphone

I have a table view and each cell of it contains a coverFlow (implemented using OpenFlow Lib).
When I swipe(or scroll) left to right to select an item in the coverflow, I have to be very careful, because if I swipe not so horizontally, it will result in the tableView being scrolled(slightly up or down) and the coverFlow delegate won't react to the change of selection.
So I want the view only to detect left and right swipe gesture which will result in changing selection of coverFlow, and Up and Down swipe which will make the table to scroll down!Here is a basic concept of the view I just mentioned
Any Ideas how I can achieve this?

you should check this doc :
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/GestureRecognizers/GestureRecognizers.html
Create homemade event handlers and implement the canBePreventedByGestureRecognizer and canPreventGestureRecognizer methods.

Related

Drag UITableView or all TableViewCells to display a label

I'd like to create make a table view go to left when we swipe with a pan gesture. The goal is to display a label a the right of the table view like Instagram or iMessage for instance. Does anyone have a tip for creating this?
The result I would like to get.
https://i.stack.imgur.com/kDdSa.jpg
As a rough sketch, you may place a subview containing a timestamp inside your cell, below or to the side of the main subviews that display the content. You also will need to write a method that, depending on the pan progression, will show/hide this timestamp. Then you add a pan gesture recognizer to the table view itself, and, once panning, in your handler method you can call this disclosure method on the visible cells.

Overlaying buttons on tableviewcell with collectionview inside

I have implemented a image slider with a UICollectionView inside a UITableViewCell which the user can slide to left and right. I want to create two buttons on this UITableViewCell so the user can also tap on that buttons to slide the images.
I've done this by adding the buttons on the images inside the UICollectionViewCells but with that the buttons also are swiping when the user swipes to left or right or taps the buttons.
I tried to fix the buttons on the UITableViewCell, but anyhow the buttons does not get displayed, when I do it like this.
So how can I achieve this, that the buttons are fixed inside the UITableViewCell and the UICollectionView inside the UITableViewCell can move it cells without effecting these two slider buttons?
At storyboard it looks like this:
Can't rearrange the buttons:
Add the buttons directly to the content view of the table view cell, don't add them to the collection view. That way they will stay in position. If you can't see them it's possible that they were underneath the collection view and were obscured. Change the order of the views in interface builder by dragging and dropping in the document outline. This changes which view is on top.
The document outline is the view you have posted as a screenshot in your question, starting at "brandsCollectionTableViewCell". The outline contains the subviews of the cell. Views with the same parent, like the image view, label and buttons currently shown in the outline, will be ordered "on top" of each other by their position in the list. So you drag the items in that list to change the order, or select the buttons then go to Editor -> Arrange -> Send XX to adjust the position.
Use the Xcode view hierarchy debugger to help you understand what is happening (that's this button on the debugging toolbar):
The 3D view will let you see where your "missing" buttons are.
If you really want to include the buttons in the collection view, then you need to use a custom collection view layout implementing floating views. That's not a straightforward task, but I've written something about it here.

How to Create Slide Up From Bottom Menu With Overlay Swift

I'm building an iPhone app in Swift. I would like my users to have a menu slide up from the bottom when they tap a button on the table view. Instagram has a very good example of what I am trying to do:
You see how when the user taps the button, the menu slides up from the bottom, and the rest of the table view has a black overlay with a low alpha (it's see through)? This is what I would like to implement, but I have no idea how to do it. Do I add two views to my table view, one for the overlay, and one for the menu, and animate them to appear on the button tap? How would I get the views to "Float" above the table view? Or, do I need to add another View Controller and have it partially transition with some sort of custom segue? I'm fairly new to programming so I'm not sure how to go about this. What do I do?
Do you mean just a UIAlertController? If so, refer to https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIAlertController_class/
Here's a tutorial on using a UIAlertController:
http://nshipster.com/uialertcontroller/

How can i make Twitter's row menu in iOS app?

Anybody can tell me how to make Twitter's row menu in iOS app like img below?
This menu appear when i touch down move finger to left (Touch in UITableCell of UITableView). Can i make row menu like it? Thanks :)
That is indeed just a UIView with a background image and some controls/views on it.
If you want to get a similar behavior in which you swipe over the cell to reveal that view, you could use the new iOS4 UIGestureRecognizer to look for a swipe over the cell. Once it detects a swipe you can use a view animation to slide the new view in.
Link: UIGestureRecognizer Class Reference
I found an example project make a "Swipe to Reveal Menu like Tweetie". Look at it if you want to build a Menu like Tweetie.
http://thermoglobalnuclearwar.com/opensource/
Looks like a normal view with a specific background image and some buttons laid out horizontally.

How do you drag-and-drop from a TableView's icon to a stationary icon?

How do we go about coding drag-and-drop (or tap-and-drag) from a cell in a TableView on an iPhone? I'd like to have a set of drop destination icons that are stationary. I've been trying touchesBegan, touchesMoved and touchedEnded methods. These events fire nicely from a View so I can get a swipe to work nicely. Most likely the destination icons will be in a View so I think we are trying to get the drag-and-drop to begin in a TableView cell and end on an icon on a View that is beside the TableView.
Are you trying to drag the entire UITableViewCell, or a UIView inside the cell? Either way, I don't think you'll be able to move the view outside the bounds of its parent, which would be the UITableView.
I have another project where I have a icon or tile (UIImageView) that the user can drag around the screen. After it reaches a certain distance, it snaps back.
Similarly, a possible solution might involve popping up a UIView (perhaps a UIImageView) over top of the table cell when the cell is tapped. The user could drag that around the screen, and you could make it disappear when it's "dropped" on whatever target you have.