iOS : Sliding tab layout with UITableview in swift - ios

I am developing Sliding tab layout with the help of Swift 1.2. Sliding tab must have single UITableView.
UITableView will be refresh when I slide / move the tab.
I have tried many tutorials from other sources, but could not get proper hint as most of tutorial used separate ViewControllers for each tab. What i want is, to use single ViewController with one UITableView for all tabs.
How to achieve this in iOS - Swift?

Implement a pan gesture recognizer on your tab view, track the movement to next tab on that view. When it does, reload your tableview's data.

Related

Obj-C - Drag cell from one tableview into another tableview?

I have two UITableViews but they appear in the same UIViewController. That said, one acts as a reveal (slide out) side menu, and its code is housed inside SideMenuViewController.h/.m, and the other TableView is constantly visible in the ViewController.
I'm trying to make it so that I can long press on a cell in the side menu, and drag the selected cell into the TableView on ViewController.
Is this do-able? I've been searching high and low for tutorials, but this doesn't seem like a common ask. Open to all assistance.

My UITableView Gets ShiftedDown

I have a UITableView that when first displayed it displays correctly with the first row appearing on top. When I select a cell another UITableView is presented. If I used the back button on the UINavigation Bar the original UITableView is shifted down with a blank space between the UINavigation Bar and the UITableView.
I am not using story boards. I am using XIB files. I am also using a sliding menu that I got the code for from Ray Wenderlich's web site.
When I slide back the main screen over the first UITableView it goes back to its proper position. But then when I select an entry again the issue described above appears.
I found another post that seems to provide an answer to the issue. This post says to make some adjustments like to the translucent settings or the auto-layout settings but doesn't give specifics.
Here is that post: Container View getting pushed down as if it had a UINavigationBar?
Thanks,
Glenn
Add
self.automaticallyAdjustsScrollViewInsets = NO;
in viewDidLoad, of the UIViewController where you have the shifting table view

Detect swipe events on UIPageView below UITableView

So my problem is the following:
I have a UIViewController, in it I have defined a UIPageViewController and added its view to the hierarchy and on top of that I have added an UITableView.
What I would like is to be able to scroll my UITableView (that part works) but also to be able to swipe to change the slides of my UIPageViewController.
My problem is that the UIPageViewController doesn't detect the swipe gesture at all. If I remove the UITableView it works all right of course.
My question is the following: is there any way to pass the swipe events from the UITableView to the UIPageViewController so both would receive their intended gestures ?
You would need to have the tableView inside your page view (in the content view controller for a specific page).
If you have two views on top of each other the front one will intercept all the touches and no actions will make it through to the lower views.
Try setting user interaction on the tableView to false to see what I am talking about. Of course this will cause the tableView to become unresponsive. You will need to implement this a different way.

iOS Snapchat Style - UIPanGestureRecognizer Within UITableViewCell And UIPageViewController

I'd like to give a go at implementing the same functionality of Snapchat specific to the way you get into a text chat with a friend in that app.
I have three view controllers in a UIPageViewController. The middle view controller is a UITableViewController with an expandable cell and five subcells that appear when the cell is expanded. I have a UIPanGestureRecognizer in each of the subcells where as you slide to the left on a cell, a button is revealed. However, both the pan gesture recognizer and the UIPageController sliding to another view controller are happening at the same time. How do I disable the UIPageViewController sliding until a user is sliding the UITableViewCell?
I'd like to have it just like Snapchat by doing the following:
Disable the UIPageViewController sliding. Then, as a user is sliding a UITableViewCell with the UIPanGestureRecognizer, when the button is fully revealed, THEN switch the UIPageViewController sliding back ON so when the user slides further, it starts to slide to the next view controller.
I think that I'll have to put some of this in the CustomTableViewCellDelegate of my CustomTableViewCell. Any ideas on how to implement this? I can email my Xcode project to recreate the problem if need be. Thanks.
EDIT: Finally learned how to upload my Xcode Project to GitHub. My project can be found on this link https://github.com/cnowak7/PanGestureTest to recreate the problem.

Expand/collapse UITableViewCell to achieve Evernote-like transition

I'm interested in achieving a transition between view controllers very similar to the transition in Evernote's iOS app:
When "Places" is tapped, it smoothly expands into what looks like UINavigationController with a green border around it. To collapse it, I can either tap "Back" or swipe from the left side of the screen to gradually transition to the home screen.
I'm not looking for exact code samples to copy-paste, bur rather for high-level guidance on which concepts and Apple APIs to leverage. More specifically,
Which transition/animation APIs does this likely use?
How can I achieve the green border around the entire view controller once "Places" is expanded?
I think it uses a custom transition for the zoom in effect. It can be achieved by using this 3rd party framework: https://github.com/mluisbrown/LCZoomTransition as a pattern since the destination view controller looks like a modal and not a destination view controller.
An approach to consider: you can use a UICollectionView with two different layouts. The unexpanded layout can just be a UICollectionViewFlowLayout and the expanded layout can be a subclass that shrinks/fades all the cells except the one you want expanded. Then you can use setCollectionViewLayout:animated: to switch between them.
The green border would just be the background of the parent view, since this wouldn't involve a UINavigationController.
And if you want the interactive swipe gesture for going back from the expanded layout, you hook up a UIScreenEdgePanGestureRecognizer to an interactive collection view layout animation (see startInteractiveTransitionToCollectionViewLayout:completion:).
Judging by that border around places in full screen I would say it's not a UINavigationController but rather two view controllers with custom transition between them.
This was introduced with iOS7 and you can find few tutorials online to implement any custom transitions:
http://www.objc.io/issue-12/custom-container-view-controller-transitions.html
https://developer.apple.com/library/IOs/documentation/UIKit/Reference/UIViewControllerTransitioningDelegate_protocol/index.html

Resources