Skip to content

Commit

Permalink
- Cleanup and pod fixes 0.1.4
Browse files Browse the repository at this point in the history
  • Loading branch information
nbhasin2 committed Jan 1, 2017
1 parent aab5312 commit 4382352
Show file tree
Hide file tree
Showing 7 changed files with 26 additions and 26 deletions.
2 changes: 1 addition & 1 deletion NBNavigationController.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'NBNavigationController'
s.version = '0.1.3'
s.version = '0.1.4'
s.summary = 'Navigation controller with custom transition'

s.description = <<-DESC
Expand Down
4 changes: 2 additions & 2 deletions NBNavigationController/BaseTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
import Foundation
import UIKit

class BaseTransition: NSObject {
var transitionDuration: TimeInterval = 1.0
public class BaseTransition: NSObject {
public var transitionDuration: TimeInterval = 1.0

convenience init(transitionDuration:TimeInterval) {
self.init()
Expand Down
6 changes: 3 additions & 3 deletions NBNavigationController/BottomUpTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import Foundation
import UIKit

class BottomUpTransition: BaseTransition, UIViewControllerAnimatedTransitioning {
public class BottomUpTransition: BaseTransition, UIViewControllerAnimatedTransitioning {

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return transitionDuration
}

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let container = transitionContext.containerView
guard

Expand Down
6 changes: 3 additions & 3 deletions NBNavigationController/FadeInTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ import Foundation
import UIKit


class FadeInTransition: BaseTransition, UIViewControllerAnimatedTransitioning {
public class FadeInTransition: BaseTransition, UIViewControllerAnimatedTransitioning {

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return transitionDuration
}

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let container = transitionContext.containerView
guard
let toView = transitionContext.view(forKey: UITransitionContextViewKey.to),
Expand Down
6 changes: 3 additions & 3 deletions NBNavigationController/FadeOutTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import Foundation
import UIKit

class FadeOutTransition: BaseTransition, UIViewControllerAnimatedTransitioning {
public class FadeOutTransition: BaseTransition, UIViewControllerAnimatedTransitioning {

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return transitionDuration
}

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let container = transitionContext.containerView
guard
let toView = transitionContext.view(forKey: UITransitionContextViewKey.to),
Expand Down
22 changes: 11 additions & 11 deletions NBNavigationController/NBNavigationController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,20 +25,20 @@

import UIKit

class NBNavigationController: NSObject {
public class NBNavigationController: NSObject {

var customTransition: UIViewControllerAnimatedTransitioning?
fileprivate weak var previousDelegate: UINavigationControllerDelegate?
public var customTransition: UIViewControllerAnimatedTransitioning?
public weak var delegate: UINavigationControllerDelegate?

func pushViewController(_ controller: UIViewController, ontoNavigationController navigationController: UINavigationController, animatedTransition: UIViewControllerAnimatedTransitioning) {
self.previousDelegate = navigationController.delegate
public func pushViewController(_ controller: UIViewController, ontoNavigationController navigationController: UINavigationController, animatedTransition: UIViewControllerAnimatedTransitioning) {
self.delegate = navigationController.delegate
self.customTransition = animatedTransition
navigationController.delegate = self
navigationController.pushViewController(controller, animated: true)
}

func popNavigationController(_ navigationController: UINavigationController, animatedTransition: UIViewControllerAnimatedTransitioning) {
self.previousDelegate = navigationController.delegate
public func popNavigationController(_ navigationController: UINavigationController, animatedTransition: UIViewControllerAnimatedTransitioning) {
self.delegate = navigationController.delegate
self.customTransition = animatedTransition
navigationController.delegate = self
navigationController.popViewController(animated: true)
Expand All @@ -49,13 +49,13 @@ class NBNavigationController: NSObject {

extension NBNavigationController: UINavigationControllerDelegate{

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

func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
navigationController.delegate = previousDelegate
previousDelegate = nil
public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
navigationController.delegate = self.delegate
self.delegate = nil
}
}

6 changes: 3 additions & 3 deletions NBNavigationController/TopDownTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@
import Foundation
import UIKit

class TopDownTransition: BaseTransition, UIViewControllerAnimatedTransitioning {
public class TopDownTransition: BaseTransition, UIViewControllerAnimatedTransitioning {

func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
public func transitionDuration(using transitionContext: UIViewControllerContextTransitioning?) -> TimeInterval {
return transitionDuration
}

func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
public func animateTransition(using transitionContext: UIViewControllerContextTransitioning) {
let container = transitionContext.containerView
guard
let toView = transitionContext.view(forKey: UITransitionContextViewKey.to),
Expand Down

0 comments on commit 4382352

Please sign in to comment.