hotfix/fix-menu-reload

Fix view life cycle callbacks when reload of menu.
Fix layout of menu items on reload.
Update framework version to 1.1.2.
This commit is contained in:
David Livadaru 2017-08-17 16:56:28 +03:00
parent 10320d1aca
commit c760e02aa8
4 changed files with 6 additions and 7 deletions

View File

@ -37,14 +37,14 @@ class MenuContainerViewController: UIViewController, LayoutControllerDelegate {
}
menuViewController = HorizontalMenuViewController()
menuViewController.dataSource = self
menuViewController.willMove(toParentViewController: self)
menuViewController.view.frame = view.bounds
menuViewController.view.autoresizingMask = [.flexibleWidth, .flexibleHeight]
menuViewController.view.backgroundColor = UIColor.menuBackgroundColor()
view.addSubview(menuViewController.view)
addChildViewController(menuViewController)
menuViewController.dataSource = self
menuViewController.layoutDelegate = self
}

View File

@ -147,9 +147,6 @@ public class HorizontalMenuViewController: UIViewController, MenuDataSource, Pag
// Do any additional setup after loading the view.
initializeSubviews()
initializeControllers()
reloadData()
containerLifeCycleController.update(currentIndex: 0)
}
public override func viewDidAppear(_ animated: Bool) {
@ -181,11 +178,13 @@ public class HorizontalMenuViewController: UIViewController, MenuDataSource, Pag
paginationController.scroll(to: 0)
containerLoaderController.preloadScreensForCurrentIndex()
containerLifeCycleController.reload()
containerLifeCycleController.update(currentIndex: 0)
addScrollIndicator()
updateAbilityToChangeIndicatorColor()
selectionController.resetItemsHandling()
view.setNeedsLayout()
}
// MARK: PaginationControllerDelegate

View File

@ -61,6 +61,7 @@ public class LayoutController: NSObject, GeometryHolder {
if let menuGeometry = delegate?.layoutControllerMenuGeometry?(layoutController: self) {
self.menuGeometry = menuGeometry
}
reloadItemsGeometry()
layoutScrollViews()
layoutItems()
layoutScreens()
@ -139,7 +140,6 @@ public class LayoutController: NSObject, GeometryHolder {
}
private func layoutItems() {
reloadItemsGeometry()
for (index, item) in menuDataSource.items.enumerated() {
layout(item: item, at: index)
}

View File

@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.1.1</string>
<string>1.1.2</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>