Skip to content

Commit

Permalink
convert some functions to computed property
Browse files Browse the repository at this point in the history
  • Loading branch information
Urtaq committed Mar 17, 2017
1 parent 09b0b69 commit 7db8fe8
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Example/URExampleMovingTransition.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -700,6 +700,7 @@
973095DA1E7A9C8500B58892 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
973095E71E7A9C8E00B58892 /* Build configuration list for PBXNativeTarget "URExampleMovingTransitionTests" */ = {
isa = XCConfigurationList;
Expand All @@ -708,6 +709,7 @@
973095E91E7A9C8E00B58892 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
975FD8561E778D2600F409CB /* Build configuration list for PBXProject "URExampleMovingTransition" */ = {
isa = XCConfigurationList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ public class URMovingTransitionAnimatorDelegate: NSObject, UINavigationControlle
}

public func navigationController(_ navigationController: UINavigationController, didShow viewController: UIViewController, animated: Bool) {
if !(viewController is URMovingTransitionMakable) && !self.movingTransitionViewController.isPopableViewController() {
if !(viewController is URMovingTransitionMakable) && !self.movingTransitionViewController.isPopableViewController {
navigationController.delegate = nil
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ public protocol URMovingTransitionMakable: class {

var movingTransitionDelegate: URMovingTransitionAnimatorDelegate! { get set }
var navigationController: UINavigationController? { get }
var isPopableViewController: Bool { get }

func isPopableViewController() -> Bool
func makeTransitionAnimator(target: UIView, baseOn: UIView, duration: Double)
}

Expand All @@ -27,7 +27,7 @@ extension URMovingTransitionMakable where Self: UIViewController {
return self.navigationController
}

public func isPopableViewController() -> Bool {
public var isPopableViewController: Bool {
guard let navigationController = self.navigationController else { return false }

let navigationStackCount = navigationController.viewControllers.count
Expand Down
2 changes: 1 addition & 1 deletion URMovingTransitionAnimator.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Pod::Spec.new do |s|
#

s.name = "URMovingTransitionAnimator"
s.version = "0.2.0"
s.version = "0.2.1"
s.summary = "URMovingTransitionAnimator is moving view transition between viewcontrollers using core animation"

# This description is used to generate tags and improve search results.
Expand Down

0 comments on commit 7db8fe8

Please sign in to comment.