Skip to content

Commit

Permalink
fixed memory problem with strong references
Browse files Browse the repository at this point in the history
  • Loading branch information
azimin committed Nov 6, 2016
1 parent 7aeeb43 commit eccd598
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion AZTransitions.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "AZTransitions"
s.version = "0.21"
s.version = "0.22"
s.summary = "Framework that helps you to work with custom modal transtions."
s.description = <<-DESC
With this framework can easily work with custom modal transitions. CustomModalTransition class provides you with all nesessary API, so you should only think about aniamtions.
Expand Down
15 changes: 8 additions & 7 deletions Source/CustomModalTransition.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,21 @@ open class CustomModalTransition: NSObject {

// MARK: - Transition Parameters

public fileprivate(set) var transitionContext: UIViewControllerContextTransitioning!
public fileprivate(set) var transitionContainerView: UIView!
public fileprivate(set) weak var transitionContext: UIViewControllerContextTransitioning!
public fileprivate(set) weak var transitionContainerView: UIView!
public fileprivate(set) var isPresenting: Bool = false
public fileprivate(set) var isInteractive: Bool = false

// MARK: - View Controllers
// You can choose any pair

// Presented/preseting style view controllees
public fileprivate(set) var presentedViewController: UIViewController!
public fileprivate(set) var presentingViewController: UIViewController!
public fileprivate(set) weak var presentedViewController: UIViewController!
public fileprivate(set) weak var presentingViewController: UIViewController!

// Apple style view controllers
public fileprivate(set) var fromViewController: UIViewController!
public fileprivate(set) var toViewController: UIViewController!
public fileprivate(set) weak var fromViewController: UIViewController!
public fileprivate(set) weak var toViewController: UIViewController!

public func viewControllerFor(type: TransitionViewControllerType) -> UIViewController {
switch type {
Expand Down Expand Up @@ -120,6 +120,7 @@ open class CustomModalTransition: NSObject {
}

public func cancelInteractiveTransition() {
// http://openradar.appspot.com/14675246
interactionController.completionSpeed = 0.999 // http://stackoverflow.com/a/22968139/188461
interactionController.cancel()

Expand Down Expand Up @@ -183,7 +184,7 @@ open class CustomModalTransition: NSObject {
// MARK: - Private

fileprivate var interactionController: UIPercentDrivenInteractiveTransition!
fileprivate var owningController: UIViewController!
fileprivate weak var owningController: UIViewController!
}

// MARK: - UIViewControllerTransitioningDelegate
Expand Down
2 changes: 1 addition & 1 deletion Source/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>0.21</string>
<string>0.22</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
Expand Down

0 comments on commit eccd598

Please sign in to comment.