UIViewController subclass inspired by "Inbox by google" animated transitioning.

Overview

SAInboxViewController

Platform Language Version License

SAInboxViewController realizes Inbox like view transitioning.

You can launch sample project on web browser from here.

Features

  • Inbox like view transitioning
  • Scrolling up to begining of contents transitioning
  • Scrolling down to end of contents transitioning
  • Header dragging transitioning
  • Left edge swiping transitioning
  • HeaderView hide animation
  • Change StatusBar color with scrolling
  • Support Swift3
  • Support Siwft3.1

Installation

CocoaPods

SAHistoryNavigationViewController is available through CocoaPods. If you have cocoapods 1.2.0 or greater, you can install it, simply add the following line to your Podfile:

pod "SAInboxViewController"

Manually

Add the SAInboxViewController directory to your project.

Usage

If you install from cocoapods, you have to write import SAInboxViewController.

First of all, please use SAInboxViewController with UINavigationController.

There are two ViewControllers to realize Inbox transitioning. Please extend those ViewControllers.

  1. SAInboxViewController... using as rootViewController
  2. SAInboxDetailViewController... using as second ViewController

Those ViewControllers have UITableView, so implement ordinary UITableView behavior with that tableView.

If you use UITableViewDelegate in ViewController which extends SAInboxDetailViewController, please call super methods for below two methods.

override func scrollViewDidEndDragging(scrollView: UIScrollView, willDecelerate decelerate: Bool) {
    super.scrollViewDidEndDragging(scrollView, willDecelerate: decelerate)
}

override func scrollViewDidScroll(scrollView: UIScrollView) {
	super.scrollViewDidScroll(scrollView)
}

If you want to present ViewController from rootViewController, implement func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) like this.

@objc(tableView:didSelectRowAtIndexPath:)
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
    let viewController = SAInboxDetailViewController()
    if let cell = tableView.cellForRow(at: indexPath), let image = headerView.screenshotImage() {
        SAInboxAnimatedTransitioningController.shared.configureCotainerView(self, cell: cell, cells: tableView.visibleCells, headerImage: image)
    }
    navigationController?.pushViewController(viewController, animated: true)
}

Implement UINavigationControllerDelegate methods, like this.

func navigationController(_ navigationController: UINavigationController, animationControllerFor operation: UINavigationControllerOperation, from fromVC: UIViewController, to toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
    return SAInboxAnimatedTransitioningController.shared.setOperation(operation)
}

Customize

You can change HeaderView barTintColor, tintColor and titleTextAttributes.
There are 2 ways to change HeaderView Appearance.

Application Base Appearance

SAInboxViewController class has Appearance property

SAInboxViewController.appearance.barTintColor = .black
SAInboxViewController.appearance.tintColor = .white
SAInboxViewController.appearance.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.white]

ViewController Base Appearance

SAInboxViewController instance has Appearance property.

override func viewDidLoad() {
    super.viewDidLoad()
    appearance.barTintColor = .white
    appearance.tintColor = .black
    appearance.titleTextAttributes = [NSForegroundColorAttributeName : UIColor.black]

    //Do not forget to set true
    enabledViewControllerBasedAppearance = true
}

Requirements

  • Xcode 8.0 or greater
  • iOS 8.0 or greater
  • MisterFusion (Swift DSL for AutoLayout)

Author

Taiki Suzuki, [email protected]

License

SAInboxViewController is available under the MIT license. See the LICENSE file for more info.

You might also like...
Enhanced transitioning between UICollectionView layouts in iOS.

TLLayoutTransitioning Enhanced transitioning between UICollectionView layouts in iOS. ##Overview TLLayoutTransitioning provides a TLLayoutTransition t

Painless custom transitioning. Easy extend, easy setup, just focus on animations.

TransitionManager Painless custom transitioning. Easy extend, easy setup, just focus on animations. Installation CocoaPods You can use CocoaPods to in

Animated Subclass of UITextField created with CABasicAnimation and CAShapeLayer
Animated Subclass of UITextField created with CABasicAnimation and CAShapeLayer

JDAnimatedTextField JDAnimatedTextField is animateable UITextField that can significantly enhance your user's experiences and set your app apart from

A small and flexible (well documented)  UIButton subclass with animated loading progress, and completion animation.
A small and flexible (well documented) UIButton subclass with animated loading progress, and completion animation.

ButtonProgressBar-iOS Example For LIVE PREVIEW on Appetize in your browser itself, click here. To run the example project, clone the repo, and run pod

A simple way to create custom interactive UIViewController transitions
A simple way to create custom interactive UIViewController transitions

EasyTransitions is a library that helps developers create custom interactive transitions using simple functions defined in a protocol and avoid handli

Use PanGesture to dismiss view on UIViewController and UIView
Use PanGesture to dismiss view on UIViewController and UIView

PanSlip Use PanGesture to dismiss view on UIViewController and UIView. Introduction PanSlip to UIViewController left to right right to left top to bot

A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.
A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your most suitable time zone.

TimeZonePicker A TimeZonePicker UIViewController similar to the iOS Settings app. Search and select from a range of cities and countries to find your

UIViewController drop in replacement with much more customisation
UIViewController drop in replacement with much more customisation

PopupViewController UIAlertController drop in replacement with much more customization You can literally replace UIAlertController by PopupViewControl

Showing / dismissing keyboard animation in simple UIViewController category.
Showing / dismissing keyboard animation in simple UIViewController category.

RSKKeyboardAnimationObserver Easy way to handle iOS keyboard showing/dismissing. Introduction Working with iOS keyboard demands a lot of duplicated co

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

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

VideoSplashKit - UIViewController library for creating easy intro pages with background videos
VideoSplashKit - UIViewController library for creating easy intro pages with background videos

VideoSplashKit - Video based UIViewController Introduction Requires iOS 8 or later and Xcode 6.1+ Swift support uses dynamic frameworks and is therefo

UIViewController drop in replacement with much more customisation
UIViewController drop in replacement with much more customisation

PopupViewController UIAlertController drop in replacement with much more customization You can literally replace UIAlertController by PopupViewControl

Completion Block for UINavigationController Push/Pop UIViewController

JNAPushPopCompletionBlock Synopsis Completion block for [self.navigationController pushViewController:(nonnull UIViewController *) animated:(BOOL)] an

UIViewController extension to present view / view controller as bottom-half modal.
UIViewController extension to present view / view controller as bottom-half modal.

UIViewController extension to present view / view controller as bottom-half modal. Installation CocoaPods pod 'SemiModalViewController' Swift Package

Animated Mask Label is a nice gradient animated label.
Animated Mask Label is a nice gradient animated label.

Animated Mask Label Demo Screen Screenshot Demo/Example For demo: $ pod try AnimatedMaskLabel To run the example project, clone the repo, and run pod

EVURLCache - a NSURLCache subclass for handling all web requests that use NSURLRequest

EVURLCache What is this? This is a NSURLCache subclass for handeling all web requests that use NSURLRequest. (This includes UIWebView) The EVURLCache

RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.
RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing.

RichEditorView RichEditorView is a simple, modular, drop-in UIView subclass for Rich Text Editing. Written in Swift 4 Supports iOS 8+ through Cocoapod

A UINavigationController subclass that support pop interactive UINavigationbar with hidden or show.
A UINavigationController subclass that support pop interactive UINavigationbar with hidden or show.

KDInteractiveNavigationController Features ✨ UINavigationController interactive with UINavigationBar hidden or show Hide all UINavigationController ba

A UITextView subclass that adds support for multiline placeholder written in Swift.
A UITextView subclass that adds support for multiline placeholder written in Swift.

KMPlaceholderTextView A UITextView subclass that adds support for multiline placeholder written in Swift. Usage You can set the value of the placehold

Comments
  • How can I get this to work with a tab bar controller?

    How can I get this to work with a tab bar controller?

    It works perfect without a tabbar controller, but when i add the tab bar controller, it seems to cause some issues. The animation does not work, instead, it switches to the next view controller default IOS style (instead doing the inbox effect). Please help, thanks!

    opened by ryandailey100 13
  • Getting blank content and transition not working as expected.

    Getting blank content and transition not working as expected.

    Hello, I have added the library and followed the directions for implementation (including using the example project). I am coming across a weird issue.

    When I view the page that extends from SAInboxViewController, I see blank states where my data should be. And when I click on one of those blank states I get a Push transition, not the desired Google Inbox style transition.

    Do you have ideas of what the problem might be that is causing this?I suspect it is because I use Interface builder for layout, and since the library has me not using my typical @IBOutlet weak var tableView: UITableView! line, I feel like this is the root of my problem.

    The class extending from SAInboxViewController: image

    The class extending from SAInboxDetailViewController: image

    any assistance would be greatly appreciated.

    thanks!

    opened by grahammccarthy 3
  • iPhone X support

    iPhone X support

    Can you please add support for the iPhone X? I am using your library in my project and I am unable to support the iPhone X until this library supports it. Thanks for the wonderful library!

    opened by ryandailey100 0
  • tableview glitch when swiping up

    tableview glitch when swiping up

    When there is a small count of cells in the tableview (enough to not fill the tableview on the screen), and you try to swipe up, the tableview starts to do a glitchy animation. I can also confirm that this happens in the demo project that you have provided when I lower the count of the array of feed contents.

    img_8026

    Here is an example of how to make this glitch will occur (notice how in this case, there are only 3 cell)

    opened by ryandailey100 0
Owner
Taiki Suzuki
AbemaTV / University of Aizu 18th
Taiki Suzuki
An easy to use UITableViewCell subclass that allows to display swippable buttons with a variety of transitions.

MGSwipeTableCell MGSwipeTableCell is an easy to use UITableViewCell subclass that allows to display swipeable buttons with a variety of transitions. T

Imanol Fernandez 7k Dec 26, 2022
An easy-to-use UITableViewCell subclass that implements a swippable content view which exposes utility buttons (similar to iOS 7 Mail Application)

SWTableViewCell An easy-to-use UITableViewCell subclass that implements a swipeable content view which exposes utility buttons (similar to iOS 7 Mail

Christopher Wendel 7.2k Dec 31, 2022
Convenient UITableViewCell subclass that implements a swippable content to trigger actions (similar to the Mailbox app).

MCSwipeTableViewCell An effort to show how one would implement a UITableViewCell like the one we can see in the very well executed Mailbox iOS app. Pr

Ali Karagoz 3k Dec 16, 2022
A subclass of UITableView that styles it like Settings.app on iPad

TORoundedTableView As of iOS 13, Apple has released an official version of this table view style called UITableViewStyleInsetGrouped! Yay! In order to

Tim Oliver 162 Nov 2, 2022
PreviewTransition is a simple preview gallery UI controller with animated tranisitions.

PreviewTransition is a simple preview gallery UI controller with animated tranisitions. Swift UI library made by @Ramotion

Ramotion 2.1k Dec 19, 2022
Swift package for easily rendering text tables. Inspired by the Python tabulate library.

TextTable Easily print textual tables in Swift. Inspired by the Python tabulate library. Upcoming Changes See details on an upcoming change.

Cristian Filipov 102 Jan 5, 2023
DrawerKit lets an UIViewController modally present another UIViewController in a manner similar to the way Apple's Maps app works.

DrawerKit What is DrawerKit? DrawerKit is a custom view controller presentation mimicking the kind of behaviour in the Apple Maps app. It lets any vie

Babylon Health 773 Dec 27, 2022
A UIViewController subclass for Instagram authentication.

InstagramAuthViewController A ViewController for Instagram authentication. A UIViewController subclass that handles showing the Instagram login page,

Isuru Nanayakkara 38 Jun 29, 2021
UIViewController subclass to beautifully present news articles and blog posts.

LMArticleViewController This framework allows you to create Apple News-inspired UIViewControllers with ease. It is heavily inspired by MRArticleViewCo

Luca Mozzarelli 7 Feb 3, 2022
Our Guillotine Menu Transitioning Animation implemented in Swift reminds a bit of a notorious killing machine.

GuillotineMenu.swift Inspired by this project on Dribbble Also, read how it was done in our blog Requirements iOS 8.0+ Xcode 10 Swift 5.0 (v 4.1+) Swi

Yalantis 2.9k Dec 13, 2022