Skip to content

Commit

Permalink
Fixed regression where view lifecycle functions were not being called.
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Dahan committed Jan 7, 2018
1 parent 45e9f9a commit 45325e0
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 2.13.3

* [issue-1015](https://github.com/CosmicMind/Material/issues/1015): Fixed regression where view lifecycle functions were not being called.

## 2.13.2

* Updated to [Motion 1.3.2](https://github.com/CosmicMind/Motion/releases/tag/1.3.2).
Expand Down
2 changes: 1 addition & 1 deletion Material.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '2.13.2'
s.version = '2.13.3'
s.license = 'BSD-3-Clause'
s.summary = 'A UI/UX framework for creating beautiful applications.'
s.homepage = 'http://cosmicmind.com'
Expand Down
2 changes: 1 addition & 1 deletion Sources/Frameworks/Motion
2 changes: 1 addition & 1 deletion Sources/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>2.13.2</string>
<string>2.13.3</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
26 changes: 25 additions & 1 deletion Sources/iOS/NavigationDrawerController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,31 @@ open class NavigationDrawerController: TransitionController {

rootViewController.view.frame = container.bounds
}


open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
leftViewController?.beginAppearanceTransition(true, animated: animated)
rightViewController?.beginAppearanceTransition(true, animated: animated)
}

open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
leftViewController?.endAppearanceTransition()
rightViewController?.endAppearanceTransition()
}

open override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
leftViewController?.beginAppearanceTransition(false, animated: animated)
rightViewController?.beginAppearanceTransition(false, animated: animated)
}

open override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
leftViewController?.endAppearanceTransition()
rightViewController?.endAppearanceTransition()
}

open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
// Ensures the view is isHidden.
Expand Down
20 changes: 20 additions & 0 deletions Sources/iOS/TransitionController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,26 @@ open class TransitionController: UIViewController {
prepare()
}

open override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
rootViewController.beginAppearanceTransition(true, animated: animated)
}

open override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
rootViewController.endAppearanceTransition()
}

open override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
rootViewController.beginAppearanceTransition(false, animated: animated)
}

open override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
rootViewController.endAppearanceTransition()
}

open override func viewWillLayoutSubviews() {
super.viewWillLayoutSubviews()
layoutSubviews()
Expand Down

0 comments on commit 45325e0

Please sign in to comment.