fixes
This commit is contained in:
parent
2c6f9667a5
commit
f4f5d8dc84
@ -181,7 +181,7 @@ import UIKit
|
|||||||
let widthWillChange = !MVMCoreGetterUtility.cgfequal(widthConstraint?.constant ?? 0, width ?? 0)
|
let widthWillChange = !MVMCoreGetterUtility.cgfequal(widthConstraint?.constant ?? 0, width ?? 0)
|
||||||
let heightWillChange = !MVMCoreGetterUtility.cgfequal(heightConstraint?.constant ?? 0, height ?? 0)
|
let heightWillChange = !MVMCoreGetterUtility.cgfequal(heightConstraint?.constant ?? 0, height ?? 0)
|
||||||
let sizeWillChange = (width == nil || height == nil) && !(size?.equalTo(imageView.image?.size ?? CGSize.zero) ?? false)
|
let sizeWillChange = (width == nil || height == nil) && !(size?.equalTo(imageView.image?.size ?? CGSize.zero) ?? false)
|
||||||
let heightChangeFromSpinner = ((height ?? size?.height) ?? 0) < loadingSpinnerHeightConstraint?.constant ?? CGFloat.leastNormalMagnitude
|
let heightChangeFromSpinner = (heightConstraint?.isActive ?? false) ? false : ((height ?? size?.height) ?? 0) < loadingSpinnerHeightConstraint?.constant ?? CGFloat.leastNormalMagnitude
|
||||||
return widthWillChange || heightWillChange || sizeWillChange || heightChangeFromSpinner
|
return widthWillChange || heightWillChange || sizeWillChange || heightChangeFromSpinner
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,10 +37,10 @@ open class ThreeLayerTableViewController: ProgrammaticTableViewController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
open override func handleNewData() {
|
open override func handleNewData() {
|
||||||
|
super.handleNewData()
|
||||||
createViewForTableHeader()
|
createViewForTableHeader()
|
||||||
createViewForTableFooter()
|
createViewForTableFooter()
|
||||||
tableView?.reloadData()
|
tableView?.reloadData()
|
||||||
super.handleNewData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
|
|||||||
@ -123,24 +123,6 @@ open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMC
|
|||||||
}
|
}
|
||||||
|
|
||||||
open func parsePageJSON() throws {
|
open func parsePageJSON() throws {
|
||||||
// Convert legacy to navigation model.
|
|
||||||
if pageModel?.navigationItem == nil {
|
|
||||||
let navigationModel = NavigationItemModel()
|
|
||||||
if navigationModel.title == nil {
|
|
||||||
navigationModel.title = pageModel?.screenHeading
|
|
||||||
}
|
|
||||||
if navigationModel.showLeftPanelButton == nil {
|
|
||||||
navigationModel.showLeftPanelButton = isMasterInitiallyAccessible()
|
|
||||||
}
|
|
||||||
if navigationModel.showRightPanelButton == nil {
|
|
||||||
navigationModel.showRightPanelButton = isSupportInitiallyAccessible()
|
|
||||||
}
|
|
||||||
pageModel?.navigationItem = navigationModel
|
|
||||||
}
|
|
||||||
if self.formValidator == nil {
|
|
||||||
let rules = pageModel?.formRules
|
|
||||||
self.formValidator = FormValidator(rules)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
open class func verifyRequiredModulesLoaded(for loadObject: MVMCoreLoadObject?, error: inout MVMCoreErrorObject?) -> Bool {
|
open class func verifyRequiredModulesLoaded(for loadObject: MVMCoreLoadObject?, error: inout MVMCoreErrorObject?) -> Bool {
|
||||||
@ -173,7 +155,24 @@ open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMC
|
|||||||
|
|
||||||
/// Processes any new data. Called after the page is loaded the first time and on response updates for this page,
|
/// Processes any new data. Called after the page is loaded the first time and on response updates for this page,
|
||||||
open func handleNewData() {
|
open func handleNewData() {
|
||||||
formValidator?.validate()
|
// Convert legacy to navigation model.
|
||||||
|
if pageModel?.navigationItem == nil {
|
||||||
|
let navigationModel = NavigationItemModel()
|
||||||
|
if navigationModel.title == nil {
|
||||||
|
navigationModel.title = pageModel?.screenHeading
|
||||||
|
}
|
||||||
|
if navigationModel.showLeftPanelButton == nil {
|
||||||
|
navigationModel.showLeftPanelButton = isMasterInitiallyAccessible()
|
||||||
|
}
|
||||||
|
if navigationModel.showRightPanelButton == nil {
|
||||||
|
navigationModel.showRightPanelButton = isSupportInitiallyAccessible()
|
||||||
|
}
|
||||||
|
pageModel?.navigationItem = navigationModel
|
||||||
|
}
|
||||||
|
if self.formValidator == nil {
|
||||||
|
let rules = pageModel?.formRules
|
||||||
|
self.formValidator = FormValidator(rules)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Navigation Item (Move to model base)
|
// MARK: - Navigation Item (Move to model base)
|
||||||
@ -257,6 +256,7 @@ open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMC
|
|||||||
}
|
}
|
||||||
|
|
||||||
open func updateViews() {
|
open func updateViews() {
|
||||||
|
formValidator?.validate()
|
||||||
}
|
}
|
||||||
|
|
||||||
override open func viewDidLoad() {
|
override open func viewDidLoad() {
|
||||||
@ -312,7 +312,7 @@ open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMC
|
|||||||
|
|
||||||
if manager == nil {
|
if manager == nil {
|
||||||
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
||||||
MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
//MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -341,7 +341,7 @@ open class ViewController: UIViewController, MVMCoreViewControllerProtocol, MVMC
|
|||||||
set(navigationController: manager.navigationController)
|
set(navigationController: manager.navigationController)
|
||||||
}
|
}
|
||||||
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
MVMCoreUISession.sharedGlobal()?.currentPageType = pageType
|
||||||
MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
//MVMCoreUILoggingHandler.shared()?.defaultLogPageState(forController: self)
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - MVMCoreActionDelegateProtocol
|
// MARK: - MVMCoreActionDelegateProtocol
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class ListPageTemplateModel: TemplateModelProtocol {
|
@objcMembers public class ListPageTemplateModel: MVMControllerModelProtocol {
|
||||||
|
|
||||||
public var formRules: [FormGroupRule]?
|
public var formRules: [FormGroupRule]?
|
||||||
public var formValidator: FormValidator?
|
public var formValidator: FormValidator?
|
||||||
|
|||||||
@ -81,9 +81,9 @@ open class MoleculeListTemplate: ThreeLayerTableViewController, TemplateProtocol
|
|||||||
}
|
}
|
||||||
|
|
||||||
open override func handleNewData() {
|
open override func handleNewData() {
|
||||||
|
super.handleNewData()
|
||||||
setup()
|
setup()
|
||||||
registerWithTable()
|
registerWithTable()
|
||||||
super.handleNewData()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------
|
//--------------------------------------------------
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class StackCenteredPageTemplateModel: TemplateModelProtocol {
|
@objcMembers public class StackCenteredPageTemplateModel: MVMControllerModelProtocol {
|
||||||
|
|
||||||
public var formRules: [FormGroupRule]?
|
public var formRules: [FormGroupRule]?
|
||||||
public var formValidator: FormValidator?
|
public var formValidator: FormValidator?
|
||||||
|
|||||||
@ -8,7 +8,7 @@
|
|||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
@objcMembers public class ThreeLayerPageTemplateModel: TemplateModelProtocol {
|
@objcMembers public class ThreeLayerPageTemplateModel: MVMControllerModelProtocol {
|
||||||
|
|
||||||
public var formRules: [FormGroupRule]?
|
public var formRules: [FormGroupRule]?
|
||||||
public var formValidator: FormValidator?
|
public var formValidator: FormValidator?
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user