Full Code of marty-suzuki/HoverConversion for AI

master 2dc49fd6a002 cached
36 files
118.7 KB
31.1k tokens
1 requests
Download .txt
Repository: marty-suzuki/HoverConversion
Branch: master
Commit: 2dc49fd6a002
Files: 36
Total size: 118.7 KB

Directory structure:
gitextract_6qxoyk_h/

├── .gitignore
├── .swift-version
├── HoverConversion/
│   ├── HCContentViewController.swift
│   ├── HCDefaultAnimatedTransitioning.swift
│   ├── HCNavigationController.swift
│   ├── HCNavigationView.swift
│   ├── HCNextHeaderView.swift
│   ├── HCPagingViewController.swift
│   ├── HCRootAnimatedTransitioning.swift
│   ├── HCRootViewController.swift
│   ├── HCViewContentable.swift
│   ├── NSIndexPath+Row.swift
│   ├── UIScrollView+BottomBounceSize.swift
│   └── UITableViewCell+Screenshot.swift
├── HoverConversion.podspec
├── HoverConversionSample/
│   ├── HoverConversionSample/
│   │   ├── AppDelegate.swift
│   │   ├── Assets.xcassets/
│   │   │   └── AppIcon.appiconset/
│   │   │       └── Contents.json
│   │   ├── Base.lproj/
│   │   │   ├── LaunchScreen.storyboard
│   │   │   └── Main.storyboard
│   │   ├── Cell/
│   │   │   ├── HomeTableViewCell.swift
│   │   │   └── HomeTableViewCell.xib
│   │   ├── Info.plist
│   │   ├── Manager/
│   │   │   └── TwitterManager.swift
│   │   ├── Request/
│   │   │   ├── StatusesUserTimelineRequest.swift
│   │   │   ├── TWTRAPIClient+Extra.swift
│   │   │   ├── TWTRRequestable.swift
│   │   │   └── UsersLookUpRequest.swift
│   │   ├── View/
│   │   │   └── NextHeaderView.swift
│   │   └── ViewController/
│   │       ├── HomeViewController.swift
│   │       └── UserTimelineViewController.swift
│   ├── HoverConversionSample.xcodeproj/
│   │   ├── project.pbxproj
│   │   └── project.xcworkspace/
│   │       └── contents.xcworkspacedata
│   ├── HoverConversionSample.xcworkspace/
│   │   └── contents.xcworkspacedata
│   └── Podfile
├── LICENSE
└── README.md

================================================
FILE CONTENTS
================================================

================================================
FILE: .gitignore
================================================
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

# OS X
.DS_Store

## Build generated
build/
DerivedData/

## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/

## Other
*.moved-aside
*.xcuserstate

## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
Pods/

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build

# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output


================================================
FILE: .swift-version
================================================
3.0


================================================
FILE: HoverConversion/HCContentViewController.swift
================================================
//
//  HCContentViewController.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit

public protocol HCContentViewControllerScrollDelegate: class {
    func contentViewController(_ viewController: HCContentViewController, scrollViewWillBeginDragging scrollView: UIScrollView)
    func contentViewController(_ viewController: HCContentViewController, scrollViewDidScroll scrollView: UIScrollView)
    func contentViewController(_ viewController: HCContentViewController, scrollViewDidEndDragging scrollView: UIScrollView, willDecelerate decelerate: Bool)
    func contentViewController(_ viewController: HCContentViewController, handlePanGesture gesture: UIPanGestureRecognizer)
}

public struct PagableHandler {
    public enum Direction {
        case prev, next
    }
    
    private var values: [Direction : Bool] = [
        .prev : true,
        .next : true
    ]
    
    public subscript(direction: Direction) -> Bool {
        get {
            return values[direction] ?? false
        }
        set {
            values[direction] = newValue
        }
    }
}

open class HCContentViewController: UIViewController, HCViewContentable {
    
    open var tableView: UITableView! = UITableView()
    open var navigatoinContainerView: UIView! = UIView()
    open var navigationView: HCNavigationView! = HCNavigationView(buttonPosition: .left)
    let cellImageView = UIImageView(frame: .zero)
    
    open weak var scrollDelegate: HCContentViewControllerScrollDelegate?
    open var canPaging: PagableHandler = PagableHandler()
    
    open override var title: String? {
        didSet {
            navigationView?.titleLabel.text = title
        }
    }
    
    override open func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        automaticallyAdjustsScrollViewInsets = false
        addViews()
        tableView.delegate = self
        view.addSubview(cellImageView)
        
        let panGestureRecognizer = UIPanGestureRecognizer(target: self, action: #selector(HCContentViewController.handleNavigatoinContainerViewPanGesture(_:)))
        navigatoinContainerView.addGestureRecognizer(panGestureRecognizer)
    }

    override open func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    open func navigationView(_ navigationView: HCNavigationView, didTapLeftButton button: UIButton) {
        _ = navigationController?.popViewController(animated: true)
    }
    
    func handleNavigatoinContainerViewPanGesture(_ gesture: UIPanGestureRecognizer) {
        scrollDelegate?.contentViewController(self, handlePanGesture: gesture)
    }
}

extension HCContentViewController: UITableViewDelegate {
    public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
        scrollDelegate?.contentViewController(self, scrollViewWillBeginDragging: scrollView)
    }
    
    public func scrollViewDidScroll(_ scrollView: UIScrollView) {
        scrollDelegate?.contentViewController(self, scrollViewDidScroll: scrollView)
    }
    
    public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
        scrollDelegate?.contentViewController(self, scrollViewDidEndDragging: scrollView, willDecelerate: decelerate)
    }
}


================================================
FILE: HoverConversion/HCDefaultAnimatedTransitioning.swift
================================================
//
//  HCDefaultAnimatedTransitioning.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/09/11.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//
//

import UIKit

class HCDefaultAnimatedTransitioning: NSObject, UIViewControllerAnimatedTransitioning {
    fileprivate struct Const {
        static let defaultDuration: TimeInterval = 0.25
        static let rootDuration: TimeInterval = 0.4
        static let scaling: CGFloat = 0.95
    }
    
    let operation: UINavigationControllerOperation
    fileprivate let alphaView = UIView()
    
    init(operation: UINavigationControllerOperation) {
        self.operation = operation
        super.init()
    }
    
    @objc func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        guard
            let toVC = transitionContext?.viewController(forKey: UITransitionContextViewControllerKey.to),
            let fromVC = transitionContext?.viewController(forKey: UITransitionContextViewControllerKey.from)
        else {
            return 0
        }
        switch (fromVC, toVC) {
        case (_ as HCPagingViewController, _ as HCRootViewController): return Const.rootDuration
        case (_ as HCRootViewController, _ as HCPagingViewController): return Const.rootDuration
        default: return Const.defaultDuration
        }
    }
    
    // This method can only  be a nop if the transition is interactive and not a percentDriven interactive transition.
    @objc func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
        guard
            let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to),
            let fromVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)
        else {
            transitionContext.completeTransition(true)
            return
        }
        
        let containerView = transitionContext.containerView
        containerView.backgroundColor = .black
        alphaView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
        alphaView.frame = containerView.bounds
        
        switch operation {
        case .pop: popAnimation(transitionContext, toVC: toVC, fromVC: fromVC, containerView: containerView)
        case .push: pushAnimation(transitionContext, toVC: toVC, fromVC: fromVC, containerView: containerView)
        case .none: transitionContext.completeTransition(true)
        }
    }
    
    fileprivate func popAnimation(_ transitionContext: UIViewControllerContextTransitioning, toVC: UIViewController, fromVC: UIViewController, containerView: UIView) {
        containerView.insertSubview(toVC.view, belowSubview: fromVC.view)
        containerView.insertSubview(alphaView, belowSubview: fromVC.view)
        
        if let pagingVC = fromVC as? HCPagingViewController, let rootVC = toVC as? HCRootViewController {
            let indexPath = pagingVC.currentIndexPath
            //pagingVC.homeViewTalkContainerView.backgroundColor = .whiteColor()
            if rootVC.tableView?.cellForRow(at: indexPath as IndexPath) == nil {
                //rootVC.tableView?.scrollToRowAtIndexPath(indexPath, atScrollPosition: pagingVC.scrollDirection, animated: false)
            }
            rootVC.tableView?.selectRow(at: indexPath as IndexPath, animated: false, scrollPosition: .none)
        }
        
        alphaView.alpha = 1
        toVC.view.frame = containerView.bounds
        toVC.view.transform = CGAffineTransform(scaleX: Const.scaling, y: Const.scaling)
        
        UIView.animate(withDuration: transitionDuration(using: transitionContext), delay: 0, options: .curveLinear, animations: {
            toVC.view.transform = CGAffineTransform.identity
            fromVC.view.frame.origin.x = containerView.bounds.size.width
            self.alphaView.alpha = 0
        }) { finished in
            let canceled = transitionContext.transitionWasCancelled
            if canceled {
                toVC.view.removeFromSuperview()
            } else {
                fromVC.view.removeFromSuperview()
            }
            
            toVC.view.transform = CGAffineTransform.identity
            self.alphaView.removeFromSuperview()
            
            if let pagingVC = fromVC as? HCPagingViewController, let rootVC = toVC as? HCRootViewController {
                let indexPath = pagingVC.currentIndexPath
                rootVC.tableView?.deselectRow(at: indexPath as IndexPath, animated: true)
            }
            transitionContext.completeTransition(!canceled)
        }
    }
    
    fileprivate func pushAnimation(_ transitionContext: UIViewControllerContextTransitioning, toVC: UIViewController, fromVC: UIViewController, containerView: UIView) {
        containerView.addSubview(alphaView)
        containerView.addSubview(toVC.view)
        
        toVC.view.frame = containerView.bounds
        toVC.view.frame.origin.x = containerView.bounds.size.width
        alphaView.alpha = 0
        
        UIView.animate(withDuration: transitionDuration(using: transitionContext), delay: 0, options: .curveLinear, animations: {
            fromVC.view.transform = CGAffineTransform(scaleX: Const.scaling, y: Const.scaling)
            self.alphaView.alpha = 1
            toVC.view.frame.origin.x = 0
        }) { finished in
            let canceled = transitionContext.transitionWasCancelled
            if canceled {
                toVC.view.removeFromSuperview()
            }
            
            self.alphaView.removeFromSuperview()
            fromVC.view.transform = CGAffineTransform.identity
            
            transitionContext.completeTransition(!canceled)
        }
    }
}


================================================
FILE: HoverConversion/HCNavigationController.swift
================================================
//
//  HCNavigationController.swift
//
//  Created by Taiki Suzuki on 2016/09/11.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//
//

import UIKit

open class HCNavigationController: UINavigationController {
    fileprivate struct Const {
        fileprivate static let queueLabel = "jp.marty-suzuki.HoverConversion.SynchronizationQueue"
        static let synchronizationQueue = DispatchQueue(label: queueLabel, attributes: [])
        static func performBlock(_ block: @escaping () -> ()) {
            synchronizationQueue.async {
                DispatchQueue.main.sync(execute: block)
            }
        }
    }
        
    enum SwipeType {
        case edge, pan, none
        var threshold: CGFloat {
            switch self {
            case .edge: return 0.3
            case .pan: return 0.01
            case .none: return 0
            }
        }
    }
    
    fileprivate let interactiveTransition = UIPercentDrivenInteractiveTransition()
    let interactiveEdgePanGestureRecognizer = UIScreenEdgePanGestureRecognizer()
    let interactivePanGestureRecognizer = UIPanGestureRecognizer()
    
    fileprivate var isPaning = false
    
    
    
    override open func viewDidLoad() {
        super.viewDidLoad()
        
        delegate = self
        interactivePopGestureRecognizer?.isEnabled = false
        
        interactiveEdgePanGestureRecognizer.edges = .left
        interactiveEdgePanGestureRecognizer.addTarget(self, action: #selector(HCNavigationController.handleInteractiveEdgePanGesture(_:)))
        interactiveEdgePanGestureRecognizer.delegate = self
        view.addGestureRecognizer(interactiveEdgePanGestureRecognizer)
        
        interactivePanGestureRecognizer.addTarget(self, action: #selector(HCNavigationController.handleInteractivePanGesture(_:)))
        interactivePanGestureRecognizer.delegate = self
        view.addGestureRecognizer(interactivePanGestureRecognizer)
    }
    
    func interactiveEdgePanGestureRecognizerMakesToFail(gesture: UIGestureRecognizer) {
        gesture.require(toFail: interactiveEdgePanGestureRecognizer)
    }
    
    func interactivePanGestureRecognizerMakesToFail(gesture: UIGestureRecognizer) {
        gesture.require(toFail: interactivePanGestureRecognizer)
    }
    
    func handleInteractiveEdgePanGesture(_ edgePanGestureRecognizer: UIScreenEdgePanGestureRecognizer) {
        handlePanGesture(edgePanGestureRecognizer, swipeType: .edge)
    }
    
    func handleInteractivePanGesture(_ panGestureRecognizer: UIPanGestureRecognizer) {
        handlePanGesture(panGestureRecognizer, swipeType: .pan)
    }
    
    fileprivate func handlePanGesture(_ gesture: UIPanGestureRecognizer, swipeType: SwipeType) {
        let translation = gesture.translation(in: view)
        let velocity = gesture.velocity(in: view)
        let percentage = min(1, max(0, translation.x / view.bounds.size.width))
        
        switch gesture.state {
        case .began:
            Const.performBlock {
                if self.viewControllers.count < 2 { return }
                self.isPaning = true
                self.popViewController(animated: true)
            }
        case .changed:
            Const.performBlock {
                self.interactiveTransition.update(percentage)
            }
        case .ended, .failed, .possible, .cancelled:
            Const.performBlock {
                self.isPaning = false
                if 0 < velocity.x && swipeType.threshold < percentage {
                    self.interactiveTransition.finish()
                } else {
                    self.interactiveTransition.cancel()
                }
            }
        }
    }
}

extension HCNavigationController: UINavigationControllerDelegate {
    public func navigationController(_ navigationController: UINavigationController, interactionControllerFor animationController: UIViewControllerAnimatedTransitioning) -> UIViewControllerInteractiveTransitioning? {
        return isPaning ? interactiveTransition : nil
    }
    
    public func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
        //TODO: initial frame
        switch (fromVC, toVC, isPaning) {
        case (_ as HCRootViewController, _ as HCPagingViewController, _):
            return HCRootAnimatedTransitioning(operation: operation)
        case (_ as HCPagingViewController, _ as HCRootViewController, false):
            return HCRootAnimatedTransitioning(operation: operation)
        default:
            return HCDefaultAnimatedTransitioning(operation: operation)
        }
    }
}

extension HCNavigationController: UIGestureRecognizerDelegate {
    public func gestureRecognizerShouldBegin(_ gestureRecognizer: UIGestureRecognizer) -> Bool {
        if let gestureRecognizer = gestureRecognizer as? UIPanGestureRecognizer ,
               gestureRecognizer === interactivePanGestureRecognizer &&
               gestureRecognizer.velocity(in: navigationController?.view).x < 0 {
            return false
        }
        return true
    }
    
    public func gestureRecognizer(_ gestureRecognizer: UIGestureRecognizer, shouldRequireFailureOf otherGestureRecognizer: UIGestureRecognizer) -> Bool {
        if gestureRecognizer === interactivePanGestureRecognizer &&
           otherGestureRecognizer === interactiveEdgePanGestureRecognizer {
            return true
        }
        return false
    }
}


================================================
FILE: HoverConversion/HCNavigationView.swift
================================================
//
//  HCNavigationView.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import MisterFusion

public protocol HCNavigationViewDelegate: class {
    func navigationView(_ navigationView: HCNavigationView, didTapLeftButton button: UIButton)
    func navigationView(_ navigationView: HCNavigationView, didTapRightButton button: UIButton)
}

open class HCNavigationView: UIView {
    public struct ButtonPosition: OptionSet {
        static let right = ButtonPosition(rawValue: 1 << 0)
        static let left = ButtonPosition(rawValue: 1 << 1)
        
        public let rawValue: UInt
        public init(rawValue: UInt) {
            self.rawValue = rawValue
        }
    }
    
    open static let height: CGFloat = 64
    
    open var leftButton: UIButton?
    open let titleLabel: UILabel = {
        let label = UILabel(frame: .zero)
        label.textAlignment = .center
        label.font = UIFont.boldSystemFont(ofSize: 16)
        return label
    }()
    open var rightButton: UIButton?
    
    weak var delegate: HCNavigationViewDelegate?
    
    public convenience init() {
        self.init(buttonPosition: [])
    }
    
    public init(buttonPosition: ButtonPosition) {
        super.init(frame: .zero)
        if buttonPosition.contains(.left) {
            let leftButton = UIButton(type: .custom)
            addLayoutSubview(leftButton, andConstraints:
                leftButton.left,
                leftButton.bottom,
                leftButton.width |==| leftButton.height,
                leftButton.height |==| 44
            )
            leftButton.setTitle("‹", for: UIControlState())
            leftButton.titleLabel?.font = .systemFont(ofSize: 40)
            leftButton.addTarget(self, action: #selector(HCNavigationView.didTouchDown(_:)), for: .touchDown)
            leftButton.addTarget(self, action: #selector(HCNavigationView.didTouchDragExit(_:)), for: .touchDragExit)
            leftButton.addTarget(self, action: #selector(HCNavigationView.didTouchDragEnter(_:)), for: .touchDragEnter)
            leftButton.addTarget(self, action: #selector(HCNavigationView.didTouchUpInside(_:)), for: .touchUpInside)
            self.leftButton = leftButton
        }
        if buttonPosition.contains(.right) {
            let rightButton = UIButton(type: .custom)
            addLayoutSubview(rightButton, andConstraints:
                rightButton.right,
                rightButton.bottom,
                rightButton.width |==| rightButton.height,
                rightButton.height |==| 44
            )
            rightButton.addTarget(self, action: #selector(HCNavigationView.didTouchDown(_:)), for: .touchDown)
            rightButton.addTarget(self, action: #selector(HCNavigationView.didTouchDragExit(_:)), for: .touchDragExit)
            rightButton.addTarget(self, action: #selector(HCNavigationView.didTouchDragEnter(_:)), for: .touchDragEnter)
            rightButton.addTarget(self, action: #selector(HCNavigationView.didTouchUpInside(_:)), for: .touchUpInside)
            self.rightButton = rightButton
        }
        
        var constraints: [MisterFusion] = []
        if let leftButton = leftButton {
            constraints += [leftButton.right |==| titleLabel.left]
        } else {
            constraints += [titleLabel.left |+| 44]
        }
        
        if let rightButton = rightButton {
            constraints += [rightButton.left |==| titleLabel.right]
        } else {
            constraints += [titleLabel.right |-| 44]
        }
        constraints += [
            titleLabel.height |==| 44,
            titleLabel.bottom
        ]
        addLayoutSubview(titleLabel, andConstraints: constraints)
    }
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func didTouchUpInside(_ sender: UIButton) {
        sender.alpha = 1
        if sender == leftButton {
            delegate?.navigationView(self, didTapLeftButton: sender)
        } else if sender == rightButton {
            delegate?.navigationView(self, didTapRightButton: sender)
        }
    }
    
    func didTouchDown(_ sender: UIButton) {
        sender.alpha = 0.5
    }
    
    func didTouchDragExit(_ sender: UIButton) {
        sender.alpha = 0.5
    }
    
    func didTouchDragEnter(_ sender: UIButton) {
        sender.alpha = 1
    }
}


================================================
FILE: HoverConversion/HCNextHeaderView.swift
================================================
//
//  HCNextHeaderView.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/09/13.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit

open class HCNextHeaderView: UIView {}


================================================
FILE: HoverConversion/HCPagingViewController.swift
================================================
//
//  HCPagingViewController.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import MisterFusion

fileprivate func < <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
  switch (lhs, rhs) {
  case let (l?, r?):
    return l < r
  case (nil, _?):
    return true
  default:
    return false
  }
}

fileprivate func >= <T : Comparable>(lhs: T?, rhs: T?) -> Bool {
  switch (lhs, rhs) {
  case let (l?, r?):
    return l >= r
  default:
    return !(lhs < rhs)
  }
}

public enum HCPagingPosition: Int {
    case upper = 1, center = 0, lower = 2
}

public protocol HCPagingViewControllerDataSource : class {
    func pagingViewController(_ viewController: HCPagingViewController, viewControllerFor indexPath: IndexPath) -> HCContentViewController?
    func pagingViewController(_ viewController: HCPagingViewController, nextHeaderViewFor indexPath: IndexPath) -> HCNextHeaderView?
}

open class HCPagingViewController: UIViewController {
    fileprivate struct Const {
        static let fireDistance: CGFloat = 180
        static let bottomTotalSpace = HCNavigationView.height
        static let nextAnimationDuration: TimeInterval = 0.4
        static let previousAnimationDuration: TimeInterval = 0.3
        static fileprivate func calculateRudderBanding(_ distance: CGFloat, constant: CGFloat, dimension: CGFloat) -> CGFloat {
            return (1 - (1 / ((distance * constant / dimension) + 1))) * dimension
        }
    }
    
    open fileprivate(set) var viewControllers: [HCPagingPosition : HCContentViewController?] = [
        .upper : nil,
        .center : nil,
        .lower : nil
    ]

    let containerViews: [HCPagingPosition : UIView] = [
        .upper : UIView(),
        .center : UIView(),
        .lower : UIView()
    ]
    
    fileprivate var containerViewsAdded: Bool = false
    var currentIndexPath: IndexPath
    open fileprivate(set) var isPaging: Bool = false
    fileprivate var isDragging: Bool = false
    fileprivate var isPanning = false
    fileprivate var beginningContentOffset: CGPoint = .zero
    fileprivate(set) var scrollDirection: UITableViewScrollPosition = .none
    
    fileprivate var _alphaView: UIView?
    fileprivate var alphaView: UIView {
        let alphaView: UIView
        if let _alphaView = _alphaView {
            alphaView = _alphaView
        } else {
            alphaView = createAlphaViewAndAddSubview(containerViews[.center])
            _alphaView = alphaView
        }
        return alphaView
    }
    
    fileprivate var nextHeaderView: HCNextHeaderView?
    
    open weak var dataSource: HCPagingViewControllerDataSource? {
        didSet {
            addContainerViews()
            setupViewControllers()
        }
    }
    
    public init(indexPath: IndexPath) {
        self.currentIndexPath = indexPath
        super.init(nibName: nil, bundle: nil)
    }
    
    required public init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override open func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        automaticallyAdjustsScrollViewInsets = false
        addContainerViews()
    }
    
    open override var preferredStatusBarStyle : UIStatusBarStyle {
        return viewController(.center)?.preferredStatusBarStyle ?? .default
    }
    
    fileprivate func createAlphaViewAndAddSubview(_ view: UIView?) -> UIView {
        let alphaView = UIView()
        alphaView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.6)
        view?.addLayoutSubview(alphaView, andConstraints:
            alphaView.top, alphaView.left, alphaView.bottom, alphaView.right
        )
        alphaView.isUserInteractionEnabled = false
        alphaView.alpha = 0
        return alphaView
    }
    
    fileprivate func clearAlphaView() {
        _alphaView?.removeFromSuperview()
        _alphaView = nil
    }
    
    fileprivate func clearNextHeaderView() {
        nextHeaderView?.removeFromSuperview()
        nextHeaderView = nil
    }
    
    fileprivate func setScrollsTop() {
        viewControllers.forEach { $0.1?.tableView?.scrollsToTop = $0.0 == .center }
    }
    
    fileprivate func viewController(_ position: HCPagingPosition) -> HCContentViewController? {
        guard let nullableViewController = viewControllers[position] else { return nil }
        return nullableViewController
    }
    
    fileprivate func setupViewControllers() {
        setupViewController(indexPath: currentIndexPath.rowPlus(-1), position: .upper)
        setupViewController(indexPath: currentIndexPath, position: .center)
        setupViewController(indexPath: currentIndexPath.rowPlus(1), position: .lower)
        setScrollsTop()
        let tableView = viewController(.center)?.tableView
        if let _ = viewController(.lower) {
            tableView?.contentInset.bottom = Const.bottomTotalSpace
            tableView?.scrollIndicatorInsets.bottom = Const.bottomTotalSpace
        } else {
            tableView?.contentInset.bottom = 0
            tableView?.scrollIndicatorInsets.bottom = 0
        }
        setNeedsStatusBarAppearanceUpdate()
    }
    
    fileprivate func setupViewController(indexPath: IndexPath, position: HCPagingPosition) {
        if (indexPath as NSIndexPath).row < 0 || (indexPath as NSIndexPath).section < 0 { return }
        guard
            let vc = dataSource?.pagingViewController(self, viewControllerFor: indexPath)
        else { return }
        addViewController(vc, to: position)
    }
    
    fileprivate func addViewController(_ viewController: HCContentViewController, to position: HCPagingPosition) {
        viewController.scrollDelegate = self
        addView(viewController.view, to: position)
        addChildViewController(viewController)
        viewController.didMove(toParentViewController: self)
        viewControllers[position] = viewController
    }
    
    fileprivate func addView(_ view: UIView, to position: HCPagingPosition) {
        guard let containerView = containerViews[position] else { return }
        containerView.addLayoutSubview(view, andConstraints:
            view.top, view.right, view.left, view.bottom
        )
    }
    
    fileprivate func addContainerViews() {
        if containerViewsAdded { return }
        containerViewsAdded = true
        containerViews.sorted { $0.0.rawValue < $1.0.rawValue }.forEach {
            let misterFusion: MisterFusion
            switch $0.0 {
            case .upper: misterFusion = $0.1.bottom |==| view.top
            case .center: misterFusion = $0.1.top
            case .lower: misterFusion = $0.1.top |==| view.bottom
            }
            view.addLayoutSubview($0.1, andConstraints:
                misterFusion, $0.1.height, $0.1.left, $0.1.right
            )
        }
    }

    override open func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    func moveToNext(_ scrollView: UIScrollView, offset: CGPoint) {
        guard let _ = viewController(.lower) , viewController(.center)?.canPaging[.next] == true else { return }

        scrollDirection = .bottom
        let value = offset.y - (scrollView.contentSize.height - scrollView.bounds.size.height)
        let headerHeight = HCNavigationView.height
        
        isPaging = true
        scrollView.setContentOffset(scrollView.contentOffset, animated: false)
        
        let relativeDuration = TimeInterval(0.25)
        let lowerViewController = viewController(.lower)
        let centerViewController = viewController(.center)
        UIView.animateKeyframes(withDuration: Const.nextAnimationDuration, delay: 0, options: UIViewKeyframeAnimationOptions(), animations: {
            
            UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 1.0 - relativeDuration) {
                lowerViewController?.view.frame.origin.y = -self.view.bounds.size.height + headerHeight
                centerViewController?.view.frame.origin.y = -self.view.bounds.size.height + value + headerHeight
                centerViewController?.navigationView?.frame.origin.y = self.view.bounds.size.height - value - headerHeight
                self.nextHeaderView?.alpha = 0
            }
            
            UIView.addKeyframe(withRelativeStartTime: 1.0 - relativeDuration, relativeDuration: relativeDuration) {
                lowerViewController?.view.frame.origin.y = -self.view.bounds.size.height
                centerViewController?.view.frame.origin.y = -self.view.bounds.size.height + value
            }
        }) { _ in
            let upperViewController = self.viewController(.upper)
            upperViewController?.view.removeFromSuperview()
            centerViewController?.view.removeFromSuperview()
            lowerViewController?.view.removeFromSuperview()
            
            if let lowerView = lowerViewController?.view {
                self.addView(lowerView, to: .center)
            }
            
            if let centerView = centerViewController?.view {
                self.addView(centerView, to: .upper)
            }
            
            centerViewController?.scrollDelegate = nil
            
            upperViewController?.willMove(toParentViewController: self)
            upperViewController?.removeFromParentViewController()
            
            let nextCenterVC = lowerViewController
            let nextUpperVC = centerViewController
            self.viewControllers[.center] = nextCenterVC
            self.viewControllers[.upper] = nextUpperVC
            self.viewControllers[.lower] = nil
            
            self.currentIndexPath = self.currentIndexPath.rowPlus(1)
            if let newViewController = self.dataSource?.pagingViewController(self, viewControllerFor: self.currentIndexPath.rowPlus(1)) {
                self.addViewController(newViewController, to: .lower)
                self.viewControllers[.lower] = newViewController
                nextCenterVC?.tableView.contentInset.bottom = Const.bottomTotalSpace
                nextCenterVC?.tableView.scrollIndicatorInsets.bottom = Const.bottomTotalSpace
            } else {
                nextCenterVC?.tableView.contentInset.bottom = 0
                nextCenterVC?.tableView.scrollIndicatorInsets.bottom = 0
            }
            
            nextCenterVC?.scrollDelegate = self
            
            if nextUpperVC?.tableView?.contentOffset.y >= scrollView.contentSize.height - scrollView.bounds.size.height {
                if scrollView.contentSize.height > scrollView.bounds.size.height {
                    nextUpperVC?.tableView?.setContentOffset(CGPoint(x: 0, y: scrollView.contentSize.height - scrollView.bounds.size.height), animated: false)
                } else {
                    nextUpperVC?.tableView?.setContentOffset(.zero, animated: false)
                }
            }

            nextUpperVC?.tableView?.reloadData()
            self.setNeedsStatusBarAppearanceUpdate()
            
            self.setScrollsTop()
            self.clearAlphaView()
            self.clearNextHeaderView()
            
            self.isPaging = false
        }
    }
    
    func moveToPrevious(_ scrollView: UIScrollView, offset: CGPoint) {
        guard let _ = viewController(.upper) , viewController(.center)?.canPaging[.prev] == true else { return }

        scrollDirection = .top
        isPaging = true
        
        scrollView.setContentOffset(scrollView.contentOffset, animated: false)
        
        let upperViewController = viewController(.upper)
        let centerViewController = viewController(.center)
        UIView.animate(withDuration: Const.previousAnimationDuration, delay: 0, options: .curveLinear, animations: {
            upperViewController?.view.frame.origin.y = self.view.bounds.size.height
            centerViewController?.view.frame.origin.y = self.view.bounds.size.height + offset.y
        }) { finished in
            let lowerViewController = self.viewController(.lower)
            upperViewController?.view.removeFromSuperview()
            centerViewController?.view.removeFromSuperview()
            lowerViewController?.view.removeFromSuperview()
            
            if let upperView = upperViewController?.view {
                self.addView(upperView, to: .center)
            }
            
            if let centerView = centerViewController?.view {
                self.addView(centerView, to: .lower)
            }
            
            centerViewController?.scrollDelegate = nil
            
            lowerViewController?.willMove(toParentViewController: self)
            lowerViewController?.removeFromParentViewController()
            
            let nextCenterVC = upperViewController
            let nextLowerVC = centerViewController
            self.viewControllers[.center] = nextCenterVC
            self.viewControllers[.lower] = nextLowerVC
            self.viewControllers[.upper] = nil
            
            self.currentIndexPath = self.currentIndexPath.rowPlus(-1)
            if let newViewController = self.dataSource?.pagingViewController(self, viewControllerFor: self.currentIndexPath.rowPlus(-1)) {
                self.addViewController(newViewController, to: .upper)
                self.viewControllers[.upper] = newViewController
            }
            if let _ = nextLowerVC {
                nextCenterVC?.tableView.contentInset.bottom = Const.bottomTotalSpace
                nextCenterVC?.tableView.scrollIndicatorInsets.bottom = Const.bottomTotalSpace
            } else {
                nextCenterVC?.tableView.contentInset.bottom = 0
                nextCenterVC?.tableView.scrollIndicatorInsets.bottom = 0
            }
            
            nextCenterVC?.scrollDelegate = self
            nextLowerVC?.tableView?.reloadData()
            self.setNeedsStatusBarAppearanceUpdate()
            
            self.setScrollsTop()
            self.clearAlphaView()
            self.clearNextHeaderView()
            
            self.isPaging = false
        }
    }
}

extension HCPagingViewController: HCContentViewControllerScrollDelegate {
    public func contentViewController(_ viewController: HCContentViewController, scrollViewDidScroll scrollView: UIScrollView) {
        if isPanning { return }
        
        guard viewController == self.viewController(.center) else { return }
        
        let offset = scrollView.contentOffset
        let contentSize = scrollView.contentSize
        let scrollViewSize = scrollView.bounds.size
        if contentSize.height - scrollViewSize.height <= offset.y {
            guard let lowerViewController = self.viewController(.lower) else { return }
            let delta = offset.y - (contentSize.height - scrollViewSize.height)
            lowerViewController.view.frame.origin.y = min(0, -delta)
            let value: CGFloat = scrollView.bottomBounceSize
            if value > Const.bottomTotalSpace {
                let alpha = min(1, max(0, (value - Const.bottomTotalSpace) / Const.fireDistance))
                alphaView.alpha = alpha
            }
            
            if let _ = self.nextHeaderView {
            } else if let view = self.viewController(.lower)?.view,
                      let nhv = dataSource?.pagingViewController(self, nextHeaderViewFor: currentIndexPath.rowPlus(1)) {
                view.addLayoutSubview(nhv, andConstraints:
                    nhv.top, nhv.right, nhv.left, nhv.height |==| HCNavigationView.height
                )
                self.nextHeaderView = nhv
            }
        } else if offset.y < 0 {
            guard
                let upperViewController = self.viewController(.upper),
                let centerViewController = self.viewController(.center)
            else { return }
            let delta = max(0, -offset.y)
            if (currentIndexPath as NSIndexPath).row > 0 {
                let alpha = min(1, max(0, -offset.y / Const.fireDistance))
                alphaView.alpha = alpha
            }
            clearNextHeaderView()
            upperViewController.view.frame.origin.y = delta
            centerViewController.navigationView.frame.origin.y = delta
        } else {
            viewControllers[.lower]??.view.frame.origin.y = 0
            viewControllers[.upper]??.view.frame.origin.y = 0
            viewControllers[.center]??.navigationView.frame.origin.y = 0
            
            clearAlphaView()
            clearNextHeaderView()
        }
        
        if isDragging { return }
        if scrollView.contentSize.height > scrollView.bounds.size.height {
            if offset.y < -Const.fireDistance {
                moveToPrevious(scrollView, offset: offset)
            } else if offset.y > (scrollView.contentSize.height + Const.fireDistance) - scrollView.bounds.size.height {
                moveToNext(scrollView, offset: offset)
            }
        } else {
            if offset.y < -Const.fireDistance {
                moveToPrevious(scrollView, offset: offset)
            } else if offset.y > Const.fireDistance {
                moveToNext(scrollView, offset: CGPoint(x: offset.x, y: offset.y + (scrollView.contentSize.height - scrollView.bounds.size.height)))
            }
        }
    }
    
    public func contentViewController(_ viewController: HCContentViewController, scrollViewWillBeginDragging scrollView: UIScrollView) {
        guard viewController == self.viewController(.center) else { return }
        isDragging = true
    }
    
    public func contentViewController(_ viewController: HCContentViewController, scrollViewDidEndDragging scrollView: UIScrollView, willDecelerate decelerate: Bool) {
        guard viewController == self.viewController(.center) else { return }
        isDragging = false
    }
    
    public func contentViewController(_ viewController: HCContentViewController, handlePanGesture gesture: UIPanGestureRecognizer) {
        guard let centerViewController = self.viewController(.center)
        , centerViewController == viewController && (currentIndexPath as NSIndexPath).row > 0 && viewController.canPaging[.prev]
        else { return }
        
        let translation = gesture.translation(in: view)
        let velocity = gesture.velocity(in: view)
        let tableView = viewController.tableView
        
        switch gesture.state {
        case .began:
            isPanning = true
            beginningContentOffset = (tableView?.contentOffset)!
            
        case .changed:
            let position = max(0, translation.y)
            let rudderBanding = Const.calculateRudderBanding(position, constant: 0.55, dimension: view.frame.size.height)
            
            let headerPosition = max(0, rudderBanding)
            if viewController.navigationView.frame.origin.y != headerPosition {
                viewController.navigationView.frame.origin.y = headerPosition
            }
            
           let tableViewOffset = beginningContentOffset.y - max(0, rudderBanding)
            tableView?.setContentOffset(CGPoint(x: 0, y: tableViewOffset), animated: false)
            
            self.viewController(.upper)?.view.frame.origin.y = headerPosition
            
            alphaView.alpha = min(1, (rudderBanding / Const.fireDistance))
            
        case .cancelled, .ended:
            if velocity.y  > 0 && translation.y > Const.fireDistance && (currentIndexPath as NSIndexPath).row > 0 {
                isPanning = false
                let rudderBanding = Const.calculateRudderBanding(max(0, translation.y), constant: 0.55, dimension: view.frame.size.height)
                moveToPrevious(tableView!, offset: CGPoint(x: 0, y: -rudderBanding))
            } else {
                UIView.animate(withDuration: 0.25, animations: {
                    viewController.navigationView.frame.origin.y = 0
                    self.viewController(.upper)?.view.frame.origin.y = 0
                    tableView?.setContentOffset(self.beginningContentOffset, animated: false)
                    self.alphaView.alpha = 0
                }, completion: { finished in
                    self.beginningContentOffset = .zero
                    self.isPanning = false
                }) 
            }
            
        case .failed, .possible:
            break
        }
    }
}


================================================
FILE: HoverConversion/HCRootAnimatedTransitioning.swift
================================================
//
//  HCRootAnimatedTransitioning.swift
//
//  Created by Taiki Suzuki on 2016/09/11.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//
//

import UIKit

class HCRootAnimatedTransitioning: NSObject, UIViewControllerAnimatedTransitioning {
    fileprivate struct Const {
        static let duration: TimeInterval = 0.3
        static let scaling: CGFloat = 0.95
    }
    
    let operation: UINavigationControllerOperation
    fileprivate let alphaView = UIView()
    
    init(operation: UINavigationControllerOperation) {
        self.operation = operation
        super.init()
    }
    
    @objc func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
        return Const.duration
    }
    // This method can only  be a nop if the transition is interactive and not a percentDriven interactive transition.
    @objc func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
        guard
            let toVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.to),
            let fromVC = transitionContext.viewController(forKey: UITransitionContextViewControllerKey.from)
        else {
            transitionContext.completeTransition(true)
            return
        }
        
        let containerView = transitionContext.containerView
        containerView.backgroundColor = .black
        alphaView.backgroundColor = UIColor(red: 0, green: 0, blue: 0, alpha: 0.5)
        alphaView.frame = containerView.bounds
        
        switch operation {
        case .pop: popAnimation(transitionContext, toVC: toVC, fromVC: fromVC, containerView: containerView)
        case .push: pushAnimation(transitionContext, toVC: toVC, fromVC: fromVC, containerView: containerView)
        case .none:
            transitionContext.completeTransition(true)
            break
        }
    }
    
    fileprivate func popAnimation(_ transitionContext: UIViewControllerContextTransitioning, toVC: UIViewController, fromVC: UIViewController, containerView: UIView) {
        containerView.insertSubview(toVC.view, belowSubview: fromVC.view)
        containerView.insertSubview(alphaView, belowSubview: fromVC.view)
        
        var initialFrame: CGRect?
        if let rootVC = toVC as? HCRootViewController, let pagingVC = fromVC as? HCPagingViewController {
            let indexPath = pagingVC.currentIndexPath
            if rootVC.tableView?.cellForRow(at: indexPath as IndexPath) == nil {
                rootVC.tableView?.scrollToRow(at: indexPath as IndexPath, at: pagingVC.scrollDirection, animated: false)
            }
            
            if let cell = rootVC.tableView?.cellForRow(at: indexPath as IndexPath) {
                if let nullableVC = pagingVC.viewControllers[.center], let centeVC = nullableVC {
                    centeVC.cellImageView.frame = cell.bounds
                    centeVC.cellImageView.image = cell.screenshot()
                }
                
                if let superview = rootVC.view,
                   let point = cell.superview?.convert(cell.frame.origin, to: superview) {
                    var selectedCellFrame: CGRect = .zero
                    selectedCellFrame.origin = point
                    selectedCellFrame.size = cell.bounds.size
                    initialFrame = selectedCellFrame
                }
            }
            
            rootVC.tableView?.selectRow(at: indexPath as IndexPath, animated: true, scrollPosition: .none)
        }
        
        fromVC.view.clipsToBounds = true
        alphaView.alpha = 1
        toVC.view.transform = CGAffineTransform(scaleX: Const.scaling, y: Const.scaling)
        
        UIView.animateKeyframes(withDuration: transitionDuration(using: transitionContext) , delay: 0, options: UIViewKeyframeAnimationOptions(), animations: {
            UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 0.25) {
                (fromVC as? HCPagingViewController)?.viewControllers[.center]??.cellImageView.alpha = 1
            }
            UIView.addKeyframe(withRelativeStartTime: 0.5, relativeDuration: 0.25) {
                (fromVC as? HCPagingViewController)?.containerViews[.center]?.alpha = 0
            }
            UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 1) {
                if let initialFrame = initialFrame {
                    fromVC.view.frame = initialFrame
                }
                fromVC.view.layoutIfNeeded()
                toVC.view.transform = CGAffineTransform.identity
                self.alphaView.alpha = 0
            }
        }) { finished in
            let canceled = transitionContext.transitionWasCancelled
            if canceled {
                toVC.view.removeFromSuperview()
            } else {
                fromVC.view.removeFromSuperview()
                fromVC.view.clipsToBounds = false
            }
            
            toVC.view.transform = CGAffineTransform.identity
            self.alphaView.removeFromSuperview()
            
            if let pagingVC = fromVC as? HCPagingViewController, let rootVC = toVC as? HCRootViewController {
                let indexPath = pagingVC.currentIndexPath
                rootVC.tableView?.deselectRow(at: indexPath as IndexPath, animated: true)
            }
            transitionContext.completeTransition(!canceled)
        }
    }
    
    fileprivate func pushAnimation(_ transitionContext: UIViewControllerContextTransitioning, toVC: UIViewController, fromVC: UIViewController, containerView: UIView) {
        containerView.addSubview(alphaView)
        containerView.addSubview(toVC.view)
        
        toVC.view.clipsToBounds = true
        
        var earlyAlphaAnimation = false
        if let rootVC = fromVC as? HCRootViewController, let pagingVC = toVC as? HCPagingViewController {
            let indexPath = pagingVC.currentIndexPath
            if let cell = rootVC.tableView?.cellForRow(at: indexPath as IndexPath) {
                if let nullableVC = pagingVC.viewControllers[.center], let centeVC = nullableVC {
                    centeVC.cellImageView.frame = cell.bounds
                    centeVC.cellImageView.image = cell.screenshot()
                }
                if let superview = rootVC.view,
                   let point = cell.superview?.convert(cell.frame.origin, to: superview) {
                    var selectedCellFrame: CGRect = .zero
                    selectedCellFrame.origin = point
                    selectedCellFrame.size = cell.bounds.size
                    toVC.view.frame = selectedCellFrame
                }
                if let superview = rootVC.view,
                   let point = cell.superview?.convert(cell.frame.origin, to: superview) , point.y < containerView.bounds.size.height / 3 {
                    earlyAlphaAnimation = true
                }
            }
        }
        alphaView.alpha = 0
        
        let relativeStartTime = earlyAlphaAnimation ? 0 : 0.25
        UIView.animateKeyframes(withDuration: transitionDuration(using: transitionContext), delay: 0, options: UIViewKeyframeAnimationOptions(), animations: {
            UIView.addKeyframe(withRelativeStartTime: 0, relativeDuration: 1) {
                toVC.view.frame = containerView.bounds
                fromVC.view.transform = CGAffineTransform(scaleX: Const.scaling, y: Const.scaling)
                self.alphaView.alpha = 1
            }
            UIView.addKeyframe(withRelativeStartTime: relativeStartTime, relativeDuration: 0.5) {
                (toVC as? HCPagingViewController)?.viewControllers[.center]??.cellImageView.alpha = 0
            }
        }) { finished in
            let canceled = transitionContext.transitionWasCancelled
            if canceled {
                toVC.view.removeFromSuperview()
                toVC.view.clipsToBounds = false
            }
            
            self.alphaView.removeFromSuperview()
            fromVC.view.transform = CGAffineTransform.identity
            
            transitionContext.completeTransition(!canceled)
        }
    }
}


================================================
FILE: HoverConversion/HCRootViewController.swift
================================================
//
//  HCRootViewController.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit

open class HCRootViewController: UIViewController, HCViewControllable {

    open var tableView: UITableView! = UITableView()
    open var navigatoinContainerView: UIView! = UIView()
    open var navigationView: HCNavigationView! = HCNavigationView()
    
    open override var title: String? {
        didSet {
            navigationView?.titleLabel.text = title
        }
    }
    
    override open func viewDidLoad() {
        super.viewDidLoad()

        // Do any additional setup after loading the view.
        addViews()
        automaticallyAdjustsScrollViewInsets = false
        navigationController?.setNavigationBarHidden(true, animated: false)
    }

    override open func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
}


================================================
FILE: HoverConversion/HCViewContentable.swift
================================================
//
//  HCViewContentable.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import MisterFusion

public protocol HCViewControllable: HCNavigationViewDelegate {
    var navigationView: HCNavigationView! { get set }
    var navigatoinContainerView: UIView! { get set }
    var tableView: UITableView! { get set }
    func addViews()
}

extension HCViewControllable where Self: UIViewController {
    public func addViews() {
        navigationView.delegate = self
        view.addLayoutSubview(navigatoinContainerView, andConstraints:
            navigatoinContainerView.top,
            navigatoinContainerView.right,
            navigatoinContainerView.left,
            navigatoinContainerView.height |==| HCNavigationView.height
        )
        
        navigatoinContainerView.addLayoutSubview(navigationView, andConstraints:
            navigationView.top,
            navigationView.right,
            navigationView.left,
            navigationView.bottom
        )
        
        view.addLayoutSubview(tableView, andConstraints:
            tableView.top |==| navigatoinContainerView.bottom,
            tableView.right,
            tableView.left,
            tableView.bottom
        )
        view.bringSubview(toFront: navigatoinContainerView)
    }
    
    public func navigationView(_ navigationView: HCNavigationView, didTapLeftButton button: UIButton) {}
    public func navigationView(_ navigationView: HCNavigationView, didTapRightButton button: UIButton) {}
}

public protocol HCViewContentable: HCViewControllable {
    weak var scrollDelegate: HCContentViewControllerScrollDelegate? { get set }
}


================================================
FILE: HoverConversion/NSIndexPath+Row.swift
================================================
//
//  NSIndexPath+Row.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/09/11.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//
//

import Foundation

extension IndexPath {
    func rowPlus(_ value: Int) -> IndexPath {
        return IndexPath(row: row + value, section: section)
    }
}


================================================
FILE: HoverConversion/UIScrollView+BottomBounceSize.swift
================================================
//
//  UIScrollView+BottomBounceSize.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/09/12.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit

extension UIScrollView {
    var bottomBounceSize: CGFloat {
        if bounds.size.height < contentSize.height {
            return contentOffset.y - (contentSize.height - bounds.size.height)
        } else {
            return contentOffset.y
        }
    }
}

================================================
FILE: HoverConversion/UITableViewCell+Screenshot.swift
================================================
//
//  UITableViewCell+Screenshot.swift
//  HoverConversion
//
//  Created by Taiki Suzuki on 2016/09/08.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit

extension UITableViewCell {
    func screenshot(_ scale: CGFloat = UIScreen.main.scale) -> UIImage? {
        UIGraphicsBeginImageContextWithOptions(bounds.size, false, scale)
        drawHierarchy(in: self.bounds, afterScreenUpdates: true)
        let image = UIGraphicsGetImageFromCurrentImageContext()
        UIGraphicsEndImageContext()
        return image
    }
}


================================================
FILE: HoverConversion.podspec
================================================
#
# Be sure to run `pod lib lint HoverConversion.podspec' to ensure this is a
# valid spec before submitting.
#
# Any lines starting with a # are optional, but their use is encouraged
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
  s.name             = 'HoverConversion'
  s.version          = '0.3.1'
  s.summary          = 'HoverConversion realized vertical paging. UIViewController will be paging when reaching top or bottom of UITableView content.'

# This description is used to generate tags and improve search results.
#   * Think: What does it do? Why did you write it? What is the focus?
#   * Try to keep it short, snappy and to the point.
#   * Write the description between the DESC delimiters below.
#   * Finally, don't worry about the indent, CocoaPods strips it!

#  s.description      = <<-DESC
# TODO: Add long description of the pod here.
#                       DESC

  s.homepage         = 'https://github.com/marty-suzuki/HoverConversion'
  # s.screenshots     = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2'
  s.license          = { :type => 'MIT', :file => 'LICENSE' }
  s.author           = { 'marty-suzuki' => 's1180183@gmail.com' }
  s.source           = { :git => 'https://github.com/marty-suzuki/HoverConversion.git', :tag => s.version.to_s }
  s.social_media_url = 'https://twitter.com/marty_suzuki'

  s.ios.deployment_target = '8.0'

  s.source_files = 'HoverConversion/*.{swift}'

  # s.resource_bundles = {
  #   'HoverConversion' => ['HoverConversion/Assets/*.png']
  # }

  # s.public_header_files = 'Pod/Classes/**/*.h'
  s.frameworks = 'UIKit'
  s.dependency 'MisterFusion', '~> 2.0.0'
  # s.dependency 'AFNetworking', '~> 2.3'
end


================================================
FILE: HoverConversionSample/HoverConversionSample/AppDelegate.swift
================================================
//
//  AppDelegate.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import Fabric
import TwitterKit
import TouchVisualizer

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

    var window: UIWindow?

    func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
        // Override point for customization after application launch.
        Fabric.with([Twitter.self])
        Visualizer.start()
        return true
    }

    func applicationWillResignActive(_ application: UIApplication) {
        // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
        // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    }

    func applicationDidEnterBackground(_ application: UIApplication) {
        // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
        // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
        Visualizer.stop()
    }

    func applicationWillEnterForeground(_ application: UIApplication) {
        // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
        Visualizer.start()
    }

    func applicationDidBecomeActive(_ application: UIApplication) {
        // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
        Visualizer.start()
    }

    func applicationWillTerminate(_ application: UIApplication) {
        // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
        Visualizer.stop()
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Assets.xcassets/AppIcon.appiconset/Contents.json
================================================
{
  "images" : [
    {
      "idiom" : "iphone",
      "size" : "29x29",
      "scale" : "2x"
    },
    {
      "idiom" : "iphone",
      "size" : "29x29",
      "scale" : "3x"
    },
    {
      "idiom" : "iphone",
      "size" : "40x40",
      "scale" : "2x"
    },
    {
      "idiom" : "iphone",
      "size" : "40x40",
      "scale" : "3x"
    },
    {
      "idiom" : "iphone",
      "size" : "60x60",
      "scale" : "2x"
    },
    {
      "idiom" : "iphone",
      "size" : "60x60",
      "scale" : "3x"
    },
    {
      "idiom" : "ipad",
      "size" : "29x29",
      "scale" : "1x"
    },
    {
      "idiom" : "ipad",
      "size" : "29x29",
      "scale" : "2x"
    },
    {
      "idiom" : "ipad",
      "size" : "40x40",
      "scale" : "1x"
    },
    {
      "idiom" : "ipad",
      "size" : "40x40",
      "scale" : "2x"
    },
    {
      "idiom" : "ipad",
      "size" : "76x76",
      "scale" : "1x"
    },
    {
      "idiom" : "ipad",
      "size" : "76x76",
      "scale" : "2x"
    },
    {
      "idiom" : "ipad",
      "size" : "83.5x83.5",
      "scale" : "2x"
    }
  ],
  "info" : {
    "version" : 1,
    "author" : "xcode"
  }
}

================================================
FILE: HoverConversionSample/HoverConversionSample/Base.lproj/LaunchScreen.storyboard
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8150" systemVersion="15A204g" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
    <dependencies>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8122"/>
    </dependencies>
    <scenes>
        <!--View Controller-->
        <scene sceneID="EHf-IW-A2E">
            <objects>
                <viewController id="01J-lp-oVM" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
                        <viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <animations/>
                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                    </view>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="53" y="375"/>
        </scene>
    </scenes>
</document>


================================================
FILE: HoverConversionSample/HoverConversionSample/Base.lproj/Main.storyboard
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="pgx-Hw-LRH">
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
    </dependencies>
    <scenes>
        <!--Navigation Controller-->
        <scene sceneID="c9q-fL-NSW">
            <objects>
                <navigationController id="pgx-Hw-LRH" customClass="HCNavigationController" customModule="HoverConversion" sceneMemberID="viewController">
                    <navigationBar key="navigationBar" contentMode="scaleToFill" id="qlo-WV-cEu">
                        <rect key="frame" x="0.0" y="0.0" width="320" height="44"/>
                        <autoresizingMask key="autoresizingMask"/>
                    </navigationBar>
                    <connections>
                        <segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="vk6-jI-zkd"/>
                    </connections>
                </navigationController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="dYi-6h-jC2" userLabel="First Responder" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="-72" y="215"/>
        </scene>
        <!--Home View Controller-->
        <scene sceneID="tne-QT-ifu">
            <objects>
                <viewController id="BYZ-38-t0r" customClass="HomeViewController" customModule="HoverConversionSample" customModuleProvider="target" sceneMemberID="viewController">
                    <layoutGuides>
                        <viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
                        <viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
                    </layoutGuides>
                    <view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
                        <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
                        <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
                    </view>
                    <navigationItem key="navigationItem" id="lmn-Z2-ewH"/>
                </viewController>
                <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
            </objects>
            <point key="canvasLocation" x="660" y="215"/>
        </scene>
    </scenes>
</document>


================================================
FILE: HoverConversionSample/HoverConversionSample/Cell/HomeTableViewCell.swift
================================================
//
//  HomeTableViewCell.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/09/04.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import TwitterKit

class HomeTableViewCell: UITableViewCell, IconImageViewLoadable {
    static let Height: CGFloat = 80
    
    @IBOutlet weak var iconImageView: UIImageView!
    @IBOutlet weak var userNameLabel: UILabel!
    @IBOutlet weak var screenNameLabel: UILabel!
    @IBOutlet weak var latestTweetLabel: UILabel!
    @IBOutlet weak var timestampLabel: UILabel!
    
    var userValue: (TWTRUser, TWTRTweet)? {
        didSet {
            guard let value = userValue else { return }
            let user = value.0
            if let url = URL(string: user.profileImageLargeURL) {
                loadImage(url)
            }
            userNameLabel.text = user.name
            screenNameLabel.text = "@" + user.screenName
            let tweet = value.1
            latestTweetLabel.text = tweet.text
            timestampLabel.text = tweet.createdAt.description
        }
    }
    
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
        iconImageView.layer.cornerRadius = iconImageView.bounds.size.height / 2
        iconImageView.layer.borderWidth = 1
        iconImageView.layer.borderColor = UIColor.lightGray.cgColor
        iconImageView.layer.masksToBounds = true
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Cell/HomeTableViewCell.xib
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="10117" systemVersion="15G31" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
    <dependencies>
        <deployment identifier="iOS"/>
        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
    </dependencies>
    <objects>
        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
        <tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" id="KGk-i7-Jjw" customClass="HomeTableViewCell" customModule="HoverConversionSample" customModuleProvider="target">
            <rect key="frame" x="0.0" y="0.0" width="320" height="80"/>
            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
            <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
                <rect key="frame" x="0.0" y="0.0" width="320" height="79.5"/>
                <autoresizingMask key="autoresizingMask"/>
                <subviews>
                    <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="FXZ-DM-Ur9">
                        <rect key="frame" x="10" y="10" width="60" height="60"/>
                        <constraints>
                            <constraint firstAttribute="height" constant="60" id="P7M-Eo-cP0"/>
                            <constraint firstAttribute="width" constant="60" id="RnD-YV-LY6"/>
                        </constraints>
                    </imageView>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="UserName" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="mfI-M1-VK4">
                        <rect key="frame" x="78" y="10" width="77" height="19.5"/>
                        <fontDescription key="fontDescription" type="system" pointSize="16"/>
                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="@ScreenName" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="lwd-HG-mKy">
                        <rect key="frame" x="78" y="31" width="83.5" height="14.5"/>
                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
                        <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Tweet" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="AEX-cR-12k">
                        <rect key="frame" x="78" y="55.5" width="34" height="14.5"/>
                        <fontDescription key="fontDescription" type="system" pointSize="12"/>
                        <color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
                        <nil key="highlightedColor"/>
                    </label>
                    <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="12:00" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bnn-23-jUq">
                        <rect key="frame" x="285.5" y="10" width="26.5" height="12"/>
                        <fontDescription key="fontDescription" type="system" pointSize="10"/>
                        <color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
                        <nil key="highlightedColor"/>
                    </label>
                </subviews>
                <constraints>
                    <constraint firstItem="FXZ-DM-Ur9" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="10" id="2Lh-V3-xco"/>
                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="lwd-HG-mKy" secondAttribute="trailing" constant="12" id="2Yt-9F-YjA"/>
                    <constraint firstAttribute="trailing" relation="greaterThanOrEqual" secondItem="AEX-cR-12k" secondAttribute="trailing" constant="12" id="4QV-vG-jVP"/>
                    <constraint firstAttribute="trailing" secondItem="bnn-23-jUq" secondAttribute="trailing" constant="8" id="4ci-M4-iaY"/>
                    <constraint firstItem="mfI-M1-VK4" firstAttribute="leading" secondItem="FXZ-DM-Ur9" secondAttribute="trailing" constant="8" id="7S9-V7-GsX"/>
                    <constraint firstItem="mfI-M1-VK4" firstAttribute="top" secondItem="FXZ-DM-Ur9" secondAttribute="top" id="8iv-eM-gwE"/>
                    <constraint firstItem="lwd-HG-mKy" firstAttribute="top" secondItem="mfI-M1-VK4" secondAttribute="bottom" constant="2" id="Dz7-ql-1sH"/>
                    <constraint firstItem="AEX-cR-12k" firstAttribute="bottom" secondItem="FXZ-DM-Ur9" secondAttribute="bottom" id="EPE-vP-UuS"/>
                    <constraint firstItem="bnn-23-jUq" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="10" id="SzQ-cD-IQD"/>
                    <constraint firstItem="FXZ-DM-Ur9" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="T1Q-Gl-IKP"/>
                    <constraint firstItem="AEX-cR-12k" firstAttribute="leading" secondItem="FXZ-DM-Ur9" secondAttribute="trailing" constant="8" id="jDb-AP-XyI"/>
                    <constraint firstItem="bnn-23-jUq" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="mfI-M1-VK4" secondAttribute="trailing" constant="8" id="wwc-ve-Wto"/>
                    <constraint firstItem="lwd-HG-mKy" firstAttribute="leading" secondItem="mfI-M1-VK4" secondAttribute="leading" id="xKK-Yt-UDg"/>
                </constraints>
            </tableViewCellContentView>
            <connections>
                <outlet property="iconImageView" destination="FXZ-DM-Ur9" id="FvV-nQ-Zqg"/>
                <outlet property="latestTweetLabel" destination="AEX-cR-12k" id="81e-rX-kC7"/>
                <outlet property="screenNameLabel" destination="lwd-HG-mKy" id="Z9z-Kb-gms"/>
                <outlet property="timestampLabel" destination="bnn-23-jUq" id="Cb4-Tp-CsV"/>
                <outlet property="userNameLabel" destination="mfI-M1-VK4" id="3am-YQ-st6"/>
            </connections>
        </tableViewCell>
    </objects>
</document>


================================================
FILE: HoverConversionSample/HoverConversionSample/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>CFBundleDevelopmentRegion</key>
	<string>en</string>
	<key>CFBundleExecutable</key>
	<string>$(EXECUTABLE_NAME)</string>
	<key>CFBundleIdentifier</key>
	<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
	<key>CFBundleInfoDictionaryVersion</key>
	<string>6.0</string>
	<key>CFBundleName</key>
	<string>$(PRODUCT_NAME)</string>
	<key>CFBundlePackageType</key>
	<string>APPL</string>
	<key>CFBundleShortVersionString</key>
	<string>1.0</string>
	<key>CFBundleSignature</key>
	<string>????</string>
	<key>CFBundleVersion</key>
	<string>1</string>
	<key>Fabric</key>
	<dict>
		<key>APIKey</key>
		<string>17f9b693790022f676a0812ed5b69bf3f93d01ff</string>
		<key>Kits</key>
		<array>
			<dict>
				<key>KitInfo</key>
				<dict>
					<key>consumerKey</key>
					<string>Tqg8V7zKdLsQyEl5V01o80kLj</string>
					<key>consumerSecret</key>
					<string>cMRzcgG08gsYahpLf6RAltA91WvFAQJvGRJ5wi2OK9U5JkYmKi</string>
				</dict>
				<key>KitName</key>
				<string>Twitter</string>
			</dict>
		</array>
	</dict>
	<key>LSRequiresIPhoneOS</key>
	<true/>
	<key>UILaunchStoryboardName</key>
	<string>LaunchScreen</string>
	<key>UIMainStoryboardFile</key>
	<string>Main</string>
	<key>UIRequiredDeviceCapabilities</key>
	<array>
		<string>armv7</string>
	</array>
	<key>UISupportedInterfaceOrientations</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
	</array>
	<key>UISupportedInterfaceOrientations~ipad</key>
	<array>
		<string>UIInterfaceOrientationPortrait</string>
		<string>UIInterfaceOrientationPortraitUpsideDown</string>
		<string>UIInterfaceOrientationLandscapeLeft</string>
		<string>UIInterfaceOrientationLandscapeRight</string>
	</array>
</dict>
</plist>


================================================
FILE: HoverConversionSample/HoverConversionSample/Manager/TwitterManager.swift
================================================
//
//  TwitterManager.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/09/03.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import Foundation
import TwitterKit

class TwitterManager {
    fileprivate let screenNames: [String] = [
        "tim_cook",
        "SwiftLang",
        "BacktotheFuture",
        "realmikefox",
        "marty_suzuki"
    ]
    
    fileprivate(set) var tweets: [String : [TWTRTweet]] = [:]
    fileprivate(set) var users: [TWTRUser] = []
    
    fileprivate lazy var client = TWTRAPIClient()
    
    func sortUsers() {
        let result = users.flatMap { user -> (TWTRUser, TWTRTweet)? in
            guard let tweet = tweets[user.screenName]?.first else {
                return nil
            }
            return (user, tweet)
        }
        let sortedResult = result.sorted { $0.0.1.createdAt.timeIntervalSince1970 > $0.1.1.createdAt.timeIntervalSince1970 }
        users = sortedResult.flatMap { $0.0 }
    }
    
    func fetchUsersTimeline(_ completion: @escaping (() -> ())) {
        let group = DispatchGroup()
        screenNames.forEach {
            group.enter()
            fetchUserTimeline(screenName: $0) {
                group.leave()
            }
        }
        group.notify(queue: DispatchQueue.main) {
            completion()
        }
    }
    
    func fetchUserTimeline(screenName: String, completion: @escaping (() -> ())) {
        let request = StatusesUserTimelineRequest(screenName: screenName, maxId: nil, count: 1)
        client.sendTwitterRequest(request) { [weak self] in
            switch $0.result {
            case .success(let tweets):
                guard let userTweets = self?.tweets[screenName] else {
                    self?.tweets[screenName] = tweets
                    completion()
                    return
                }
                self?.tweets[screenName] = Array([userTweets, tweets].joined())
            case .failure(let error):
                print(error)
            }
            completion()
        }
    }
    
    func fetchUsers(_ completion: @escaping (() -> ())) {
        let request = UsersLookUpRequest(screenNames: screenNames)
        client.sendTwitterRequest(request) { [weak self] in
            switch $0.result {
            case .success(let users):
                self?.users = users
            case .failure(let error):
                print(error)
            }
            completion()
        }
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Request/StatusesUserTimelineRequest.swift
================================================
//
//  StatusesUserTimelineRequest.swift
//  HoverConversionSample
//
//  Created by 鈴木大貴 on 2016/09/08.
//  Copyright © 2016年 szk-atmosphere. All rights reserved.
//

import Foundation
import TwitterKit

struct StatusesUserTimelineRequest: TWTRGetRequestable {
    typealias ResponseType = [TWTRTweet]
    typealias ParseResultType = [[String : NSObject]]
    
    let path: String = "/1.1/statuses/user_timeline.json"
    
    let screenName: String
    let maxId: String?
    let count: Int?
    
    var parameters: [AnyHashable: Any]? {
        var parameters: [AnyHashable: Any] = [
            "screen_name" : screenName
        ]
        if let maxId = maxId {
            parameters["max_id"] = maxId
        }
        if let count = count {
            parameters["count"] = String(count)
        }
        return parameters
    }
    
    static func decode(_ data: Data) -> TWTRResult<ResponseType> {
        switch UsersLookUpRequest.parseData(data) {
        case .success(let parsedData):
            return .success(parsedData.flatMap { TWTRTweet(jsonDictionary: $0) })
        case .failure(let error):
            return .failure(error)
        }
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Request/TWTRAPIClient+Extra.swift
================================================
//
//  TWTRAPIClient+Extra.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/09/04.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import Foundation
import TwitterKit

enum TWTRResult<T> {
    case success(T)
    case failure(NSError)
}

struct TWTRResponse<T> {
    let request: URLRequest?
    let response: HTTPURLResponse?
    let data: Data?
    let result: TWTRResult<T>
}

enum TWTRHTTPMethod: String {
    case GET = "GET"
}

extension TWTRAPIClient {
    func sendTwitterRequest<T: TWTRRequestable>(_ request: T, completion: @escaping (TWTRResponse<T.ResponseType>) -> ()) {
        guard let URL = request.URL else {
            let error = NSError(domain: TWTRAPIErrorDomain, code: -9999, userInfo: nil)
            completion(TWTRResponse(request: nil, response: nil, data: nil, result: .failure(error)))
            return
        }
        let absoluteString = URL.absoluteString
        var error: NSError?
        let request = urlRequest(withMethod: request.method.rawValue, url: absoluteString, parameters: request.parameters, error: &error)
        if let error = error {
            completion(TWTRResponse(request: request, response: nil, data: nil, result: .failure(error)))
            return
        }
        sendTwitterRequest(request) {
            let result: TWTRResult<T.ResponseType>
            if let error = $0.2 {
                result = .failure(error as NSError)
            } else if let data = $0.1 {
                switch T.decode(data) {
                case .success(let decodeData):
                    result = .success(decodeData)
                case .failure(let error):
                    result = .failure(error)
                }
            } else {
                result = .failure(NSError(domain: TWTRAPIErrorDomain, code: -9999, userInfo: nil))
            }
            completion(TWTRResponse(request: request, response: $0.0 as? HTTPURLResponse, data: $0.1, result: result))
        }
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Request/TWTRRequestable.swift
================================================
//
//  TWTRRequestable.swift
//  HoverConversionSample
//
//  Created by 鈴木大貴 on 2016/09/08.
//  Copyright © 2016年 szk-atmosphere. All rights reserved.
//

import Foundation
import TwitterKit

protocol TWTRRequestable {
    associatedtype ResponseType
    associatedtype ParseResultType
    var method: TWTRHTTPMethod { get }
    var baseURL: Foundation.URL? { get }
    var path: String { get }
    var URL: Foundation.URL? { get }
    var parameters: [AnyHashable: Any]? { get }
    static func parseData(_ data: Data) -> TWTRResult<ParseResultType>
    static func decode(_ data: Data) -> TWTRResult<ResponseType>
}

extension TWTRRequestable {
    var baseURL: Foundation.URL? {
        return Foundation.URL(string: "https://api.twitter.com")
    }
    
    var URL: Foundation.URL? {
        return Foundation.URL(string: path, relativeTo: baseURL)
    }
    
    static func parseData(_ data: Data) -> TWTRResult<ParseResultType> {
        do {
            let anyObject = try JSONSerialization.jsonObject(with: data, options: .allowFragments)
            guard let object = anyObject as? ParseResultType else {
                return .failure(NSError(domain: TWTRAPIErrorDomain, code: -9999, userInfo: nil))
            }
            return .success(object)
        } catch let error as NSError {
            return .failure(error)
        }
    }
}

protocol TWTRGetRequestable: TWTRRequestable {}
extension TWTRGetRequestable {
    var method: TWTRHTTPMethod {
        return .GET
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/Request/UsersLookUpRequest.swift
================================================
//
//  UsersLookUpRequest.swift
//  HoverConversionSample
//
//  Created by 鈴木大貴 on 2016/09/08.
//  Copyright © 2016年 szk-atmosphere. All rights reserved.
//

import Foundation
import TwitterKit

struct UsersLookUpRequest: TWTRGetRequestable {
    typealias ResponseType = [TWTRUser]
    typealias ParseResultType = [[String : NSObject]]
    
    let path: String = "/1.1/users/lookup.json"
    
    let screenNames: [String]
    
    var parameters: [AnyHashable: Any]? {
        let screenNameValue: String = screenNames.joined(separator: ",")
        let parameters: [AnyHashable: Any] = [
            "screen_name" : screenNameValue,
            "include_entities" : "true"
        ]
        return parameters
    }
    
    static func decode(_ data: Data) -> TWTRResult<ResponseType> {
        switch UsersLookUpRequest.parseData(data) {
        case .success(let parsedData):
            return .success(parsedData.flatMap { TWTRUser(jsonDictionary: $0) })
        case .failure(let error):
            return .failure(error)
        }
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/View/NextHeaderView.swift
================================================
//
//  NextHeaderView.swift
//  HoverConversionSample
//
//  Created by 鈴木大貴 on 2016/09/13.
//  Copyright © 2016年 szk-atmosphere. All rights reserved.
//

import UIKit
import HoverConversion
import TwitterKit
import MisterFusion

protocol IconImageViewLoadable {
    var iconImageView: UIImageView! { get }
    func loadImage(_ url: URL)
}

extension IconImageViewLoadable {
    func loadImage(_ url: URL) {
        DispatchQueue.global().async {
            guard let data = try? Data(contentsOf: url) else { return }
            DispatchQueue.main.async {
                guard let image = UIImage(data: data) else { return }
                self.iconImageView.image = image
            }
        }
    }
}

class NextHeaderView: HCNextHeaderView, IconImageViewLoadable {
    var user: TWTRUser? {
        didSet {
            guard let user = user else { return }
            setupViews()
            
            titleLabel.numberOfLines = 2
            let attributedText = NSMutableAttributedString()
            attributedText.append(NSAttributedString(string: user.name + "\n", attributes: [
                NSFontAttributeName : UIFont.boldSystemFont(ofSize: 18),
                NSForegroundColorAttributeName : UIColor.white
                ]))
            attributedText.append(NSAttributedString(string: "@" + user.screenName, attributes: [
                NSFontAttributeName : UIFont.systemFont(ofSize: 16),
                NSForegroundColorAttributeName : UIColor(white: 1, alpha: 0.6)
                ]))
            titleLabel.attributedText = attributedText
            
            guard let url = URL(string: user.profileImageLargeURL) else { return }
            loadImage(url)
        }
    }
    
    let iconImageView: UIImageView! = UIImageView(frame: .zero)
    let titleLabel: UILabel = UILabel(frame: .zero)
    
    init() {
        super.init(frame: .zero)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    override func layoutSubviews() {
        super.layoutSubviews()
        iconImageView.layer.cornerRadius = iconImageView.bounds.size.height / 2
    }
    
    fileprivate func setupViews() {
        addLayoutSubview(iconImageView, andConstraints:
            iconImageView.top |+| 8,
            iconImageView.left |+| 8,
            iconImageView.bottom |-| 8,
            iconImageView.width |==| iconImageView.height
        )
        
        iconImageView.layer.borderWidth = 1
        iconImageView.layer.borderColor = UIColor.lightGray.cgColor
        iconImageView.layer.masksToBounds = true
        
        addLayoutSubview(titleLabel, andConstraints:
            titleLabel.top |+| 4,
            titleLabel.right |-| 4,
            titleLabel.left |==| iconImageView.right |+| 16,
            titleLabel.bottom |-| 4
        )
        
        backgroundColor = UIColor(red: 0.25, green: 0.25, blue: 0.25, alpha: 1)
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/ViewController/HomeViewController.swift
================================================
//
//  HomeViewController.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/07/18.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import HoverConversion
import TwitterKit

class HomeViewController: HCRootViewController {

    let twitterManager = TwitterManager()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view, typically from a nib.
        navigationView.backgroundColor = UIColor(red: 85 / 255, green: 172 / 255, blue: 238 / 255, alpha: 1)
        navigationView.titleLabel.textColor = .white
        tableView.delegate = self
        tableView.dataSource = self
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
        tableView.register(UINib(nibName: "HomeTableViewCell", bundle: nil), forCellReuseIdentifier: "HomeTableViewCell")
        title = "Following List"
    }

    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
    
    override func viewDidAppear(_ animated: Bool) {
        super.viewDidAppear(animated)
        
        let group = DispatchGroup()
        group.enter()
        twitterManager.fetchUsersTimeline {
            group.leave()
        }
        group.enter()
        twitterManager.fetchUsers {
            group.leave()
        }
        group.notify(queue: DispatchQueue.main) {
            self.twitterManager.sortUsers()
            self.tableView.reloadData()
        }
    }
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    fileprivate func showPagingViewContoller(indexPath: IndexPath) {
        let vc = HCPagingViewController(indexPath: indexPath)
        vc.dataSource = self
        navigationController?.pushViewController(vc, animated: true)
    }
}

extension HomeViewController: UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        if twitterManager.tweets.count == twitterManager.users.count {
            return twitterManager.users.count
        }
        return 0
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        let user = twitterManager.users[(indexPath as NSIndexPath).row]
        guard let tweet = twitterManager.tweets[user.screenName]?.first else {
            return tableView.dequeueReusableCell(withIdentifier: "UITableViewCell")!
        }
        let cell = tableView.dequeueReusableCell(withIdentifier: "HomeTableViewCell") as! HomeTableViewCell
        cell.userValue = (user, tweet)
        return cell
    }
}

extension HomeViewController: UITableViewDelegate {
    func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
        return HomeTableViewCell.Height
    }
    
    func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
        tableView.deselectRow(at: indexPath, animated: false)
        showPagingViewContoller(indexPath: indexPath)
    }
}

extension HomeViewController: HCPagingViewControllerDataSource {
    func pagingViewController(_ viewController: HCPagingViewController, viewControllerFor indexPath: IndexPath) -> HCContentViewController? {
        guard 0 <= indexPath.row && indexPath.row < twitterManager.users.count else { return nil }
        let vc = UserTimelineViewController()
        vc.user = twitterManager.users[indexPath.row]
        return vc
    }
    
    func pagingViewController(_ viewController: HCPagingViewController, nextHeaderViewFor indexPath: IndexPath) -> HCNextHeaderView? {
        guard 0 <= indexPath.row && indexPath.row < twitterManager.users.count else { return nil }
        let view = NextHeaderView()
        view.user = twitterManager.users[indexPath.row]
        return view
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample/ViewController/UserTimelineViewController.swift
================================================
//
//  UserTimelineViewController.swift
//  HoverConversionSample
//
//  Created by Taiki Suzuki on 2016/09/05.
//  Copyright © 2016年 marty-suzuki. All rights reserved.
//

import UIKit
import HoverConversion
import TwitterKit

class UserTimelineViewController: HCContentViewController {
    var user: TWTRUser?
    
    fileprivate var tweets: [TWTRTweet] = []
    fileprivate var hasNext = true
    fileprivate let client = TWTRAPIClient()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        // Do any additional setup after loading the view.
        navigationView.backgroundColor = UIColor(red: 85 / 255, green: 172 / 255, blue: 238 / 255, alpha: 1)
        
        if let user = user {
            navigationView.titleLabel.numberOfLines = 2
            let attributedText = NSMutableAttributedString()
            attributedText.append(NSAttributedString(string: user.name + "\n", attributes: [
                NSFontAttributeName : UIFont.boldSystemFont(ofSize: 14),
                NSForegroundColorAttributeName : UIColor.white
            ]))
            attributedText.append(NSAttributedString(string: "@" + user.screenName, attributes: [
                NSFontAttributeName : UIFont.systemFont(ofSize: 12),
                NSForegroundColorAttributeName : UIColor(white: 1, alpha: 0.6)
            ]))
            navigationView.titleLabel.attributedText = attributedText
        }
        
        tableView.register(UITableViewCell.self, forCellReuseIdentifier: "UITableViewCell")
        tableView.register(TWTRTweetTableViewCell.self, forCellReuseIdentifier: "TWTRTweetTableViewCell")
        tableView.dataSource = self
        loadTweets()
    }
    
    override var preferredStatusBarStyle: UIStatusBarStyle {
        return .lightContent
    }
    
    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()
        // Dispose of any resources that can be recreated.
    }
    
    fileprivate func loadTweets() {
        guard let user = user , hasNext else { return }
        let oldestTweetId = tweets.first?.tweetID
        let request = StatusesUserTimelineRequest(screenName: user.screenName, maxId: oldestTweetId, count: nil)
        client.sendTwitterRequest(request) { [weak self] in
            switch $0.result {
            case .success(let tweets):
                if tweets.count < 1 {
                    self?.hasNext = false
                    return
                }
                let filterdTweets = tweets.filter { $0.tweetID != oldestTweetId }
                let sortedTweets = filterdTweets.sorted { $0.0.createdAt.timeIntervalSince1970 < $0.1.createdAt.timeIntervalSince1970 }
                guard let storedTweets = self?.tweets else { return }
                self?.tweets = sortedTweets + storedTweets
                self?.tableView.reloadData()
                if let tweets = self?.tweets {
                    let indexPath = IndexPath(row: tweets.count - 2, section: 0)
                    self?.tableView.scrollToRow(at: indexPath, at: .bottom, animated: false)
                }
            case .failure(let error):
                print(error)
                self?.hasNext = false
            }
        }
    }
}

extension UserTimelineViewController {
    func tableView(_ tableView: UITableView, heightForRowAtIndexPath indexPath: IndexPath) -> CGFloat {
        guard (indexPath as NSIndexPath).row < tweets.count else { return 0 }
        let tweet = tweets[(indexPath as NSIndexPath).row]
        let width = UIScreen.main.bounds.size.width
        return TWTRTweetTableViewCell.height(for: tweet, style: .compact, width: width, showingActions: false)
    }
    
    func tableView(_ tableView: UITableView, willDisplayCell cell: UITableViewCell, forRowAtIndexPath indexPath: IndexPath) {
        if (indexPath as NSIndexPath).row < 1 {
            //loadTweets()
        }
    }
}

extension UserTimelineViewController: UITableViewDataSource {
    func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
        return tweets.count
    }
    
    func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
        guard let cell = tableView.dequeueReusableCell(withIdentifier: "TWTRTweetTableViewCell") as? TWTRTweetTableViewCell else {
            return tableView.dequeueReusableCell(withIdentifier: "UITableViewCell")!
        }
        cell.configure(with: tweets[(indexPath as NSIndexPath).row])
        return cell
    }
}


================================================
FILE: HoverConversionSample/HoverConversionSample.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
	archiveVersion = 1;
	classes = {
	};
	objectVersion = 46;
	objects = {

/* Begin PBXBuildFile section */
		376AB1C31D8705C8001A8CD7 /* NextHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376AB1C21D8705C8001A8CD7 /* NextHeaderView.swift */; };
		376B9FC61D7C72B90009CC07 /* UserTimelineViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376B9FC51D7C72B90009CC07 /* UserTimelineViewController.swift */; };
		376B9FC91D80752B0009CC07 /* TWTRAPIClient+Extra.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376B9FC81D80752B0009CC07 /* TWTRAPIClient+Extra.swift */; };
		376B9FCB1D80755A0009CC07 /* UsersLookUpRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376B9FCA1D80755A0009CC07 /* UsersLookUpRequest.swift */; };
		376B9FCD1D8076A10009CC07 /* TWTRRequestable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376B9FCC1D8076A10009CC07 /* TWTRRequestable.swift */; };
		376B9FCF1D808B250009CC07 /* StatusesUserTimelineRequest.swift in Sources */ = {isa = PBXBuildFile; fileRef = 376B9FCE1D808B250009CC07 /* StatusesUserTimelineRequest.swift */; };
		377008E71D3BDAC7007606E8 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 377008E61D3BDAC7007606E8 /* AppDelegate.swift */; };
		377008EC1D3BDAC7007606E8 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 377008EA1D3BDAC7007606E8 /* Main.storyboard */; };
		377008EE1D3BDAC7007606E8 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 377008ED1D3BDAC7007606E8 /* Assets.xcassets */; };
		377008F11D3BDAC7007606E8 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 377008EF1D3BDAC7007606E8 /* LaunchScreen.storyboard */; };
		3799D0D81D7B462400CD339B /* TwitterManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3799D0D31D7B462400CD339B /* TwitterManager.swift */; };
		3799D0DA1D7B462400CD339B /* HomeViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3799D0D71D7B462400CD339B /* HomeViewController.swift */; };
		3799D0DD1D7B468600CD339B /* HomeTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3799D0DB1D7B468600CD339B /* HomeTableViewCell.swift */; };
		3799D0DE1D7B468600CD339B /* HomeTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 3799D0DC1D7B468600CD339B /* HomeTableViewCell.xib */; };
		A19CAA499B1B6C5C98BAF960 /* Pods_HoverConversionSample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 989C93E9FFF664FC7F5DAC59 /* Pods_HoverConversionSample.framework */; };
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
		178E9201DDD007E86236711A /* Pods-HoverConversionSample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HoverConversionSample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HoverConversionSample/Pods-HoverConversionSample.debug.xcconfig"; sourceTree = "<group>"; };
		376AB1C21D8705C8001A8CD7 /* NextHeaderView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NextHeaderView.swift; sourceTree = "<group>"; };
		376B9FC51D7C72B90009CC07 /* UserTimelineViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UserTimelineViewController.swift; sourceTree = "<group>"; };
		376B9FC81D80752B0009CC07 /* TWTRAPIClient+Extra.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "TWTRAPIClient+Extra.swift"; sourceTree = "<group>"; };
		376B9FCA1D80755A0009CC07 /* UsersLookUpRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UsersLookUpRequest.swift; sourceTree = "<group>"; };
		376B9FCC1D8076A10009CC07 /* TWTRRequestable.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TWTRRequestable.swift; sourceTree = "<group>"; };
		376B9FCE1D808B250009CC07 /* StatusesUserTimelineRequest.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StatusesUserTimelineRequest.swift; sourceTree = "<group>"; };
		377008E31D3BDAC6007606E8 /* HoverConversionSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HoverConversionSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
		377008E61D3BDAC7007606E8 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
		377008EB1D3BDAC7007606E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
		377008ED1D3BDAC7007606E8 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
		377008F01D3BDAC7007606E8 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
		377008F21D3BDAC7007606E8 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
		3799D0D31D7B462400CD339B /* TwitterManager.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TwitterManager.swift; sourceTree = "<group>"; };
		3799D0D71D7B462400CD339B /* HomeViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeViewController.swift; sourceTree = "<group>"; };
		3799D0DB1D7B468600CD339B /* HomeTableViewCell.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HomeTableViewCell.swift; sourceTree = "<group>"; };
		3799D0DC1D7B468600CD339B /* HomeTableViewCell.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HomeTableViewCell.xib; sourceTree = "<group>"; };
		989C93E9FFF664FC7F5DAC59 /* Pods_HoverConversionSample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_HoverConversionSample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
		BCBB46B066D4D58B7568C17F /* Pods-HoverConversionSample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HoverConversionSample.release.xcconfig"; path = "Pods/Target Support Files/Pods-HoverConversionSample/Pods-HoverConversionSample.release.xcconfig"; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
		377008E01D3BDAC6007606E8 /* Frameworks */ = {
			isa = PBXFrameworksBuildPhase;
			buildActionMask = 2147483647;
			files = (
				A19CAA499B1B6C5C98BAF960 /* Pods_HoverConversionSample.framework in Frameworks */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXFrameworksBuildPhase section */

/* Begin PBXGroup section */
		376B9FC71D80752B0009CC07 /* Request */ = {
			isa = PBXGroup;
			children = (
				376B9FC81D80752B0009CC07 /* TWTRAPIClient+Extra.swift */,
				376B9FCC1D8076A10009CC07 /* TWTRRequestable.swift */,
				376B9FCA1D80755A0009CC07 /* UsersLookUpRequest.swift */,
				376B9FCE1D808B250009CC07 /* StatusesUserTimelineRequest.swift */,
			);
			path = Request;
			sourceTree = "<group>";
		};
		377008DA1D3BDAC6007606E8 = {
			isa = PBXGroup;
			children = (
				377008E51D3BDAC7007606E8 /* HoverConversionSample */,
				377008E41D3BDAC6007606E8 /* Products */,
				77C3C9ACBF70123F6F82AA62 /* Pods */,
				3BDC8B7EA0C8D8C60EA01922 /* Frameworks */,
			);
			sourceTree = "<group>";
		};
		377008E41D3BDAC6007606E8 /* Products */ = {
			isa = PBXGroup;
			children = (
				377008E31D3BDAC6007606E8 /* HoverConversionSample.app */,
			);
			name = Products;
			sourceTree = "<group>";
		};
		377008E51D3BDAC7007606E8 /* HoverConversionSample */ = {
			isa = PBXGroup;
			children = (
				377008E61D3BDAC7007606E8 /* AppDelegate.swift */,
				377008EA1D3BDAC7007606E8 /* Main.storyboard */,
				3799D0D11D7B462400CD339B /* Cell */,
				3799D0D21D7B462400CD339B /* Manager */,
				376B9FC71D80752B0009CC07 /* Request */,
				3799D0D51D7B462400CD339B /* View */,
				3799D0D61D7B462400CD339B /* ViewController */,
				377008ED1D3BDAC7007606E8 /* Assets.xcassets */,
				377008EF1D3BDAC7007606E8 /* LaunchScreen.storyboard */,
				377008F21D3BDAC7007606E8 /* Info.plist */,
			);
			path = HoverConversionSample;
			sourceTree = "<group>";
		};
		3799D0D11D7B462400CD339B /* Cell */ = {
			isa = PBXGroup;
			children = (
				3799D0DB1D7B468600CD339B /* HomeTableViewCell.swift */,
				3799D0DC1D7B468600CD339B /* HomeTableViewCell.xib */,
			);
			path = Cell;
			sourceTree = "<group>";
		};
		3799D0D21D7B462400CD339B /* Manager */ = {
			isa = PBXGroup;
			children = (
				3799D0D31D7B462400CD339B /* TwitterManager.swift */,
			);
			path = Manager;
			sourceTree = "<group>";
		};
		3799D0D51D7B462400CD339B /* View */ = {
			isa = PBXGroup;
			children = (
				376AB1C21D8705C8001A8CD7 /* NextHeaderView.swift */,
			);
			path = View;
			sourceTree = "<group>";
		};
		3799D0D61D7B462400CD339B /* ViewController */ = {
			isa = PBXGroup;
			children = (
				3799D0D71D7B462400CD339B /* HomeViewController.swift */,
				376B9FC51D7C72B90009CC07 /* UserTimelineViewController.swift */,
			);
			path = ViewController;
			sourceTree = "<group>";
		};
		3BDC8B7EA0C8D8C60EA01922 /* Frameworks */ = {
			isa = PBXGroup;
			children = (
				989C93E9FFF664FC7F5DAC59 /* Pods_HoverConversionSample.framework */,
			);
			name = Frameworks;
			sourceTree = "<group>";
		};
		77C3C9ACBF70123F6F82AA62 /* Pods */ = {
			isa = PBXGroup;
			children = (
				178E9201DDD007E86236711A /* Pods-HoverConversionSample.debug.xcconfig */,
				BCBB46B066D4D58B7568C17F /* Pods-HoverConversionSample.release.xcconfig */,
			);
			name = Pods;
			sourceTree = "<group>";
		};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
		377008E21D3BDAC6007606E8 /* HoverConversionSample */ = {
			isa = PBXNativeTarget;
			buildConfigurationList = 377008F51D3BDAC7007606E8 /* Build configuration list for PBXNativeTarget "HoverConversionSample" */;
			buildPhases = (
				60CE7C4347D44804863A8C57 /* [CP] Check Pods Manifest.lock */,
				377008DF1D3BDAC6007606E8 /* Sources */,
				377008E01D3BDAC6007606E8 /* Frameworks */,
				377008E11D3BDAC6007606E8 /* Resources */,
				3799D0CC1D7AB6B300CD339B /* ShellScript */,
				E091ECB7B854A4215F480250 /* [CP] Embed Pods Frameworks */,
				90CB03264FD0C6DD77F59633 /* [CP] Copy Pods Resources */,
			);
			buildRules = (
			);
			dependencies = (
			);
			name = HoverConversionSample;
			productName = HoverConversionSample;
			productReference = 377008E31D3BDAC6007606E8 /* HoverConversionSample.app */;
			productType = "com.apple.product-type.application";
		};
/* End PBXNativeTarget section */

/* Begin PBXProject section */
		377008DB1D3BDAC6007606E8 /* Project object */ = {
			isa = PBXProject;
			attributes = {
				LastSwiftUpdateCheck = 0730;
				LastUpgradeCheck = 0800;
				ORGANIZATIONNAME = "szk-atmosphere";
				TargetAttributes = {
					377008E21D3BDAC6007606E8 = {
						CreatedOnToolsVersion = 7.3.1;
						LastSwiftMigration = 0800;
					};
				};
			};
			buildConfigurationList = 377008DE1D3BDAC6007606E8 /* Build configuration list for PBXProject "HoverConversionSample" */;
			compatibilityVersion = "Xcode 3.2";
			developmentRegion = English;
			hasScannedForEncodings = 0;
			knownRegions = (
				en,
				Base,
			);
			mainGroup = 377008DA1D3BDAC6007606E8;
			productRefGroup = 377008E41D3BDAC6007606E8 /* Products */;
			projectDirPath = "";
			projectRoot = "";
			targets = (
				377008E21D3BDAC6007606E8 /* HoverConversionSample */,
			);
		};
/* End PBXProject section */

/* Begin PBXResourcesBuildPhase section */
		377008E11D3BDAC6007606E8 /* Resources */ = {
			isa = PBXResourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				377008F11D3BDAC7007606E8 /* LaunchScreen.storyboard in Resources */,
				377008EE1D3BDAC7007606E8 /* Assets.xcassets in Resources */,
				3799D0DE1D7B468600CD339B /* HomeTableViewCell.xib in Resources */,
				377008EC1D3BDAC7007606E8 /* Main.storyboard in Resources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXResourcesBuildPhase section */

/* Begin PBXShellScriptBuildPhase section */
		3799D0CC1D7AB6B300CD339B /* ShellScript */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "\"${PODS_ROOT}/Fabric/run\" 17f9b693790022f676a0812ed5b69bf3f93d01ff e63261495fad4e59db4746e04a9bedd867c4ef814a71a5d3fd4d6e5478288a20";
		};
		60CE7C4347D44804863A8C57 /* [CP] Check Pods Manifest.lock */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "[CP] Check Pods Manifest.lock";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n    # print error to STDERR\n    echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n    exit 1\nfi\n";
			showEnvVarsInLog = 0;
		};
		90CB03264FD0C6DD77F59633 /* [CP] Copy Pods Resources */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "[CP] Copy Pods Resources";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HoverConversionSample/Pods-HoverConversionSample-resources.sh\"\n";
			showEnvVarsInLog = 0;
		};
		E091ECB7B854A4215F480250 /* [CP] Embed Pods Frameworks */ = {
			isa = PBXShellScriptBuildPhase;
			buildActionMask = 2147483647;
			files = (
			);
			inputPaths = (
			);
			name = "[CP] Embed Pods Frameworks";
			outputPaths = (
			);
			runOnlyForDeploymentPostprocessing = 0;
			shellPath = /bin/sh;
			shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HoverConversionSample/Pods-HoverConversionSample-frameworks.sh\"\n";
			showEnvVarsInLog = 0;
		};
/* End PBXShellScriptBuildPhase section */

/* Begin PBXSourcesBuildPhase section */
		377008DF1D3BDAC6007606E8 /* Sources */ = {
			isa = PBXSourcesBuildPhase;
			buildActionMask = 2147483647;
			files = (
				376B9FCF1D808B250009CC07 /* StatusesUserTimelineRequest.swift in Sources */,
				376B9FC61D7C72B90009CC07 /* UserTimelineViewController.swift in Sources */,
				376AB1C31D8705C8001A8CD7 /* NextHeaderView.swift in Sources */,
				376B9FC91D80752B0009CC07 /* TWTRAPIClient+Extra.swift in Sources */,
				3799D0DD1D7B468600CD339B /* HomeTableViewCell.swift in Sources */,
				3799D0DA1D7B462400CD339B /* HomeViewController.swift in Sources */,
				376B9FCB1D80755A0009CC07 /* UsersLookUpRequest.swift in Sources */,
				377008E71D3BDAC7007606E8 /* AppDelegate.swift in Sources */,
				376B9FCD1D8076A10009CC07 /* TWTRRequestable.swift in Sources */,
				3799D0D81D7B462400CD339B /* TwitterManager.swift in Sources */,
			);
			runOnlyForDeploymentPostprocessing = 0;
		};
/* End PBXSourcesBuildPhase section */

/* Begin PBXVariantGroup section */
		377008EA1D3BDAC7007606E8 /* Main.storyboard */ = {
			isa = PBXVariantGroup;
			children = (
				377008EB1D3BDAC7007606E8 /* Base */,
			);
			name = Main.storyboard;
			sourceTree = "<group>";
		};
		377008EF1D3BDAC7007606E8 /* LaunchScreen.storyboard */ = {
			isa = PBXVariantGroup;
			children = (
				377008F01D3BDAC7007606E8 /* Base */,
			);
			name = LaunchScreen.storyboard;
			sourceTree = "<group>";
		};
/* End PBXVariantGroup section */

/* Begin XCBuildConfiguration section */
		377008F31D3BDAC7007606E8 /* Debug */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = dwarf;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				ENABLE_TESTABILITY = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_DYNAMIC_NO_PIC = NO;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_OPTIMIZATION_LEVEL = 0;
				GCC_PREPROCESSOR_DEFINITIONS = (
					"DEBUG=1",
					"$(inherited)",
				);
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 9.3;
				MTL_ENABLE_DEBUG_INFO = YES;
				ONLY_ACTIVE_ARCH = YES;
				SDKROOT = iphoneos;
				SWIFT_OPTIMIZATION_LEVEL = "-Onone";
				TARGETED_DEVICE_FAMILY = "1,2";
			};
			name = Debug;
		};
		377008F41D3BDAC7007606E8 /* Release */ = {
			isa = XCBuildConfiguration;
			buildSettings = {
				ALWAYS_SEARCH_USER_PATHS = NO;
				CLANG_ANALYZER_NONNULL = YES;
				CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
				CLANG_CXX_LIBRARY = "libc++";
				CLANG_ENABLE_MODULES = YES;
				CLANG_ENABLE_OBJC_ARC = YES;
				CLANG_WARN_BOOL_CONVERSION = YES;
				CLANG_WARN_CONSTANT_CONVERSION = YES;
				CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
				CLANG_WARN_EMPTY_BODY = YES;
				CLANG_WARN_ENUM_CONVERSION = YES;
				CLANG_WARN_INFINITE_RECURSION = YES;
				CLANG_WARN_INT_CONVERSION = YES;
				CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
				CLANG_WARN_SUSPICIOUS_MOVE = YES;
				CLANG_WARN_UNREACHABLE_CODE = YES;
				CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
				"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
				COPY_PHASE_STRIP = NO;
				DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
				ENABLE_NS_ASSERTIONS = NO;
				ENABLE_STRICT_OBJC_MSGSEND = YES;
				GCC_C_LANGUAGE_STANDARD = gnu99;
				GCC_NO_COMMON_BLOCKS = YES;
				GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
				GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
				GCC_WARN_UNDECLARED_SELECTOR = YES;
				GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
				GCC_WARN_UNUSED_FUNCTION = YES;
				GCC_WARN_UNUSED_VARIABLE = YES;
				IPHONEOS_DEPLOYMENT_TARGET = 9.3;
				MTL_ENABLE_DEBUG_INFO = NO;
				SDKROOT = iphoneos;
				SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
				TARGETED_DEVICE_FAMILY = "1,2";
				VALIDATE_PRODUCT = YES;
			};
			name = Release;
		};
		377008F61D3BDAC7007606E8 /* Debug */ = {
			isa = XCBuildConfiguration;
			baseConfigurationReference = 178E9201DDD007E86236711A /* Pods-HoverConversionSample.debug.xcconfig */;
			buildSettings = {
				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				INFOPLIST_FILE = HoverConversionSample/Info.plist;
				IPHONEOS_DEPLOYMENT_TARGET = 9.3;
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
				ONLY_ACTIVE_ARCH = YES;
				PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.HoverConversionSample";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_VERSION = 3.0;
			};
			name = Debug;
		};
		377008F71D3BDAC7007606E8 /* Release */ = {
			isa = XCBuildConfiguration;
			baseConfigurationReference = BCBB46B066D4D58B7568C17F /* Pods-HoverConversionSample.release.xcconfig */;
			buildSettings = {
				ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)";
				ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
				INFOPLIST_FILE = HoverConversionSample/Info.plist;
				IPHONEOS_DEPLOYMENT_TARGET = 9.3;
				LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
				ONLY_ACTIVE_ARCH = YES;
				PRODUCT_BUNDLE_IDENTIFIER = "szk-atmosphere.HoverConversionSample";
				PRODUCT_NAME = "$(TARGET_NAME)";
				SWIFT_VERSION = 3.0;
			};
			name = Release;
		};
/* End XCBuildConfiguration section */

/* Begin XCConfigurationList section */
		377008DE1D3BDAC6007606E8 /* Build configuration list for PBXProject "HoverConversionSample" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				377008F31D3BDAC7007606E8 /* Debug */,
				377008F41D3BDAC7007606E8 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
		377008F51D3BDAC7007606E8 /* Build configuration list for PBXNativeTarget "HoverConversionSample" */ = {
			isa = XCConfigurationList;
			buildConfigurations = (
				377008F61D3BDAC7007606E8 /* Debug */,
				377008F71D3BDAC7007606E8 /* Release */,
			);
			defaultConfigurationIsVisible = 0;
			defaultConfigurationName = Release;
		};
/* End XCConfigurationList section */
	};
	rootObject = 377008DB1D3BDAC6007606E8 /* Project object */;
}


================================================
FILE: HoverConversionSample/HoverConversionSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "self:HoverConversionSample.xcodeproj">
   </FileRef>
</Workspace>


================================================
FILE: HoverConversionSample/HoverConversionSample.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
   version = "1.0">
   <FileRef
      location = "group:HoverConversionSample.xcodeproj">
   </FileRef>
   <FileRef
      location = "group:Pods/Pods.xcodeproj">
   </FileRef>
</Workspace>


================================================
FILE: HoverConversionSample/Podfile
================================================
# Uncomment this line to define a global platform for your project
platform :ios, '8.0'
# Uncomment this line if you're using Swift
use_frameworks!

target 'HoverConversionSample' do
pod 'HoverConversion', :path => '../'
pod 'Fabric'
pod 'TwitterKit'
pod 'TwitterCore'
pod 'TouchVisualizer', '~>2.0.1'
end



================================================
FILE: LICENSE
================================================
Copyright (c) 2016 szk-atmosphere <s1180183@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: README.md
================================================
# HoverConversion

[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat
)](https://developer.apple.com/iphone/index.action)
[![Language](http://img.shields.io/badge/language-swift-brightgreen.svg?style=flat
)](https://developer.apple.com/swift)
[![Version](https://img.shields.io/cocoapods/v/HoverConversion.svg?style=flat)](http://cocoapods.org/pods/HoverConversion)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![License](https://img.shields.io/cocoapods/l/HoverConversion.svg?style=flat)](http://cocoapods.org/pods/HoverConversion)

[ManiacDev.com](https://maniacdev.com/) referred.  
[https://maniacdev.com/2016/09/hoverconversion-a-swift-ui-component-for-navigating-between-multiple-table-views](https://maniacdev.com/2016/09/hoverconversion-a-swift-ui-component-for-navigating-between-multiple-table-views)

![](./Images/sample1.gif) ![](./Images/sample2.gif)

HoverConversion realized vertical paging with UITableView. UIViewController will be paging when reaching top or bottom of UITableView's contentOffset.

## Featrue

- [x] Vertical paging with UITableView
- [x] Seamless transitioning
- [x] Transitioning with navigationView pan gesture
- [x] Selected cell that related to UIViewController is highlighting
- [x] Support Swift2.3
- [x] Support Swift3

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Installation

HoverConversion is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod "HoverConversion"
```

## Usage

If you install from cocoapods, You have to write `import HoverConversion`.

#### Storyboard or Xib

![](./Images/storyboard.png)

Set custom class of `UINavigationController` to `HCNavigationController`. In addition, set module to `HoverConversion`.
And set `HCRootViewController` as `navigationController`'s first viewController.

#### Code

Set `HCNavigationController` as `self.window.rootViewController`.
And set `HCRootViewController` as `navigationController`'s first viewController.

#### HCPagingViewController

If you want to show vertical contents, please use `HCPagingViewController`.

```swift
let vc = HCPagingViewController(indexPath: indexPath)
vc.dataSource = self
navigationController?.pushViewController(vc, animated: true)
```

#### HCContentViewController

A content included in `HCPagingViewController` is `HCContentViewController`.  
Return `HCContentViewController` (or subclass)  with this delegate method.

```swift
extension ViewController: HCPagingViewControllerDataSource {
    func pagingViewController(viewController: HCPagingViewController, viewControllerFor indexPath: NSIndexPath) -> HCContentViewController? {
        guard 0 <= indexPath.row && indexPath.row < twitterManager.users.count else { return nil }
        let vc = UserTimelineViewController()
        vc.user = twitterManager.users[indexPath.row]
        return vc
    }
}
```

#### HCNextHeaderView

![](./Images/next_header.png)

Return `HCNextHeaderView` (or subclass)  with this delegate method.

```swift
extension ViewController: HCPagingViewControllerDataSource {
    func pagingViewController(viewController: HCPagingViewController, nextHeaderViewFor indexPath: NSIndexPath) -> HCNextHeaderView? {
        guard 0 <= indexPath.row && indexPath.row < twitterManager.users.count else { return nil }
        let view = NextHeaderView()
        view.user = twitterManager.users[indexPath.row]
        return view
    }
}
```

#### Stop transitioning

If you want to load more contents from server and want to stop transitioning, you can use `canPaging` in `HCContentViewController`.

```swift
//Stop transitioning to previous ViewController
canPaging[.prev] = false //Default true

//Stop transitioning to next ViewController
canPaging[.next] = false //Default true
```

## Requirements

- Xcode 7.3 or greater
- iOS 8.0 or greater
- [MisterFusion](https://github.com/marty-suzuki/MisterFusion) - Swift DSL for AutoLayout

## Special Thanks

Those OSS are used in sample project!

- [TouchVisualizer](https://github.com/morizotter/TouchVisualizer) (Created by [@morizotter](https://github.com/morizotter))
- [TwitterKit](https://docs.fabric.io/apple/twitter/overview.html#)

## Author

marty-suzuki, s1180183@gmail.com

## License

HoverConversion is available under the MIT license. See the LICENSE file for more info.
Download .txt
gitextract_6qxoyk_h/

├── .gitignore
├── .swift-version
├── HoverConversion/
│   ├── HCContentViewController.swift
│   ├── HCDefaultAnimatedTransitioning.swift
│   ├── HCNavigationController.swift
│   ├── HCNavigationView.swift
│   ├── HCNextHeaderView.swift
│   ├── HCPagingViewController.swift
│   ├── HCRootAnimatedTransitioning.swift
│   ├── HCRootViewController.swift
│   ├── HCViewContentable.swift
│   ├── NSIndexPath+Row.swift
│   ├── UIScrollView+BottomBounceSize.swift
│   └── UITableViewCell+Screenshot.swift
├── HoverConversion.podspec
├── HoverConversionSample/
│   ├── HoverConversionSample/
│   │   ├── AppDelegate.swift
│   │   ├── Assets.xcassets/
│   │   │   └── AppIcon.appiconset/
│   │   │       └── Contents.json
│   │   ├── Base.lproj/
│   │   │   ├── LaunchScreen.storyboard
│   │   │   └── Main.storyboard
│   │   ├── Cell/
│   │   │   ├── HomeTableViewCell.swift
│   │   │   └── HomeTableViewCell.xib
│   │   ├── Info.plist
│   │   ├── Manager/
│   │   │   └── TwitterManager.swift
│   │   ├── Request/
│   │   │   ├── StatusesUserTimelineRequest.swift
│   │   │   ├── TWTRAPIClient+Extra.swift
│   │   │   ├── TWTRRequestable.swift
│   │   │   └── UsersLookUpRequest.swift
│   │   ├── View/
│   │   │   └── NextHeaderView.swift
│   │   └── ViewController/
│   │       ├── HomeViewController.swift
│   │       └── UserTimelineViewController.swift
│   ├── HoverConversionSample.xcodeproj/
│   │   ├── project.pbxproj
│   │   └── project.xcworkspace/
│   │       └── contents.xcworkspacedata
│   ├── HoverConversionSample.xcworkspace/
│   │   └── contents.xcworkspacedata
│   └── Podfile
├── LICENSE
└── README.md
Condensed preview — 36 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (130K chars).
[
  {
    "path": ".gitignore",
    "chars": 1435,
    "preview": "# Xcode\n#\n# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore\n\n"
  },
  {
    "path": ".swift-version",
    "chars": 4,
    "preview": "3.0\n"
  },
  {
    "path": "HoverConversion/HCContentViewController.swift",
    "chars": 3430,
    "preview": "//\n//  HCContentViewController.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 2"
  },
  {
    "path": "HoverConversion/HCDefaultAnimatedTransitioning.swift",
    "chars": 5756,
    "preview": "//\n//  HCDefaultAnimatedTransitioning.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/09/11.\n//  Copyri"
  },
  {
    "path": "HoverConversion/HCNavigationController.swift",
    "chars": 5578,
    "preview": "//\n//  HCNavigationController.swift\n//\n//  Created by Taiki Suzuki on 2016/09/11.\n//  Copyright © 2016年 marty-suzuki. Al"
  },
  {
    "path": "HoverConversion/HCNavigationView.swift",
    "chars": 4468,
    "preview": "//\n//  HCNavigationView.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 2016年 ma"
  },
  {
    "path": "HoverConversion/HCNextHeaderView.swift",
    "chars": 210,
    "preview": "//\n//  HCNextHeaderView.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/09/13.\n//  Copyright © 2016年 ma"
  },
  {
    "path": "HoverConversion/HCPagingViewController.swift",
    "chars": 20506,
    "preview": "//\n//  HCPagingViewController.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 20"
  },
  {
    "path": "HoverConversion/HCRootAnimatedTransitioning.swift",
    "chars": 8137,
    "preview": "//\n//  HCRootAnimatedTransitioning.swift\n//\n//  Created by Taiki Suzuki on 2016/09/11.\n//  Copyright © 2016年 marty-suzuk"
  },
  {
    "path": "HoverConversion/HCRootViewController.swift",
    "chars": 1000,
    "preview": "//\n//  HCRootViewController.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 2016"
  },
  {
    "path": "HoverConversion/HCViewContentable.swift",
    "chars": 1717,
    "preview": "//\n//  HCViewContentable.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 2016年 m"
  },
  {
    "path": "HoverConversion/NSIndexPath+Row.swift",
    "chars": 315,
    "preview": "//\n//  NSIndexPath+Row.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/09/11.\n//  Copyright © 2016年 mar"
  },
  {
    "path": "HoverConversion/UIScrollView+BottomBounceSize.swift",
    "chars": 446,
    "preview": "//\n//  UIScrollView+BottomBounceSize.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/09/12.\n//  Copyrig"
  },
  {
    "path": "HoverConversion/UITableViewCell+Screenshot.swift",
    "chars": 551,
    "preview": "//\n//  UITableViewCell+Screenshot.swift\n//  HoverConversion\n//\n//  Created by Taiki Suzuki on 2016/09/08.\n//  Copyright "
  },
  {
    "path": "HoverConversion.podspec",
    "chars": 1751,
    "preview": "#\n# Be sure to run `pod lib lint HoverConversion.podspec' to ensure this is a\n# valid spec before submitting.\n#\n# Any li"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/AppDelegate.swift",
    "chars": 2408,
    "preview": "//\n//  AppDelegate.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © 2016年 m"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Assets.xcassets/AppIcon.appiconset/Contents.json",
    "chars": 1163,
    "preview": "{\n  \"images\" : [\n    {\n      \"idiom\" : \"iphone\",\n      \"size\" : \"29x29\",\n      \"scale\" : \"2x\"\n    },\n    {\n      \"idiom\""
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Base.lproj/LaunchScreen.storyboard",
    "chars": 1664,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Base.lproj/Main.storyboard",
    "chars": 2817,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Cell/HomeTableViewCell.swift",
    "chars": 1601,
    "preview": "//\n//  HomeTableViewCell.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/09/04.\n//  Copyright © 2"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Cell/HomeTableViewCell.xib",
    "chars": 7551,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.XIB\" versi"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Info.plist",
    "chars": 1838,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Manager/TwitterManager.swift",
    "chars": 2479,
    "preview": "//\n//  TwitterManager.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/09/03.\n//  Copyright © 2016"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Request/StatusesUserTimelineRequest.swift",
    "chars": 1173,
    "preview": "//\n//  StatusesUserTimelineRequest.swift\n//  HoverConversionSample\n//\n//  Created by 鈴木大貴 on 2016/09/08.\n//  Copyright ©"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Request/TWTRAPIClient+Extra.swift",
    "chars": 1989,
    "preview": "//\n//  TWTRAPIClient+Extra.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/09/04.\n//  Copyright ©"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Request/TWTRRequestable.swift",
    "chars": 1499,
    "preview": "//\n//  TWTRRequestable.swift\n//  HoverConversionSample\n//\n//  Created by 鈴木大貴 on 2016/09/08.\n//  Copyright © 2016年 szk-a"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/Request/UsersLookUpRequest.swift",
    "chars": 1051,
    "preview": "//\n//  UsersLookUpRequest.swift\n//  HoverConversionSample\n//\n//  Created by 鈴木大貴 on 2016/09/08.\n//  Copyright © 2016年 sz"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/View/NextHeaderView.swift",
    "chars": 2956,
    "preview": "//\n//  NextHeaderView.swift\n//  HoverConversionSample\n//\n//  Created by 鈴木大貴 on 2016/09/13.\n//  Copyright © 2016年 szk-at"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/ViewController/HomeViewController.swift",
    "chars": 3940,
    "preview": "//\n//  HomeViewController.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/07/18.\n//  Copyright © "
  },
  {
    "path": "HoverConversionSample/HoverConversionSample/ViewController/UserTimelineViewController.swift",
    "chars": 4519,
    "preview": "//\n//  UserTimelineViewController.swift\n//  HoverConversionSample\n//\n//  Created by Taiki Suzuki on 2016/09/05.\n//  Copy"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample.xcodeproj/project.pbxproj",
    "chars": 21345,
    "preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 46;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
    "chars": 166,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"self:HoverConversion"
  },
  {
    "path": "HoverConversionSample/HoverConversionSample.xcworkspace/contents.xcworkspacedata",
    "chars": 239,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n   version = \"1.0\">\n   <FileRef\n      location = \"group:HoverConversio"
  },
  {
    "path": "HoverConversionSample/Podfile",
    "chars": 307,
    "preview": "# Uncomment this line to define a global platform for your project\nplatform :ios, '8.0'\n# Uncomment this line if you're "
  },
  {
    "path": "LICENSE",
    "chars": 1079,
    "preview": "Copyright (c) 2016 szk-atmosphere <s1180183@gmail.com>\n\nPermission is hereby granted, free of charge, to any person obta"
  },
  {
    "path": "README.md",
    "chars": 4495,
    "preview": "# HoverConversion\n\n[![Platform](http://img.shields.io/badge/platform-ios-blue.svg?style=flat\n)](https://developer.apple."
  }
]

About this extraction

This page contains the full source code of the marty-suzuki/HoverConversion GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 36 files (118.7 KB), approximately 31.1k tokens. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!