From 112992a869b6097dd195d5e7efdb0166d6a9bdf1 Mon Sep 17 00:00:00 2001 From: Daniel Dahan Date: Wed, 16 Aug 2017 19:00:00 -0600 Subject: [PATCH] updated ToolbarController and SearchBarController to accept alignment properties --- Material.xcodeproj/project.pbxproj | 72 +++++++++++++++++++++++++++ README.md | 2 - Sources/iOS/ImageCard.swift | 6 --- Sources/iOS/SearchBar.swift | 27 ++++++---- Sources/iOS/SearchBarController.swift | 69 +++++++++++++++---------- Sources/iOS/StatusBarController.swift | 11 +++- Sources/iOS/ToolbarController.swift | 53 ++++++++++++++------ 7 files changed, 177 insertions(+), 63 deletions(-) diff --git a/Material.xcodeproj/project.pbxproj b/Material.xcodeproj/project.pbxproj index 70c00fa96..c0c56f988 100644 --- a/Material.xcodeproj/project.pbxproj +++ b/Material.xcodeproj/project.pbxproj @@ -197,6 +197,42 @@ 96BFC1541E5E486F0075DE1F /* SpringAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 965532281E47E388005C2792 /* SpringAnimation.swift */; }; 96BFC16F1E63C10A0075DE1F /* SpringAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 965532281E47E388005C2792 /* SpringAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96D88C321C1328D800B91418 /* Material.h in Headers */ = {isa = PBXBuildFile; fileRef = 96D88C091C1328D800B91418 /* Material.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994741F4521BB00AFD6E3 /* MotionAnimator.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527581F393C0E00E8B2AC /* MotionAnimator.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994751F4521BB00AFD6E3 /* MotionAnimatorViewContext.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527591F393C0E00E8B2AC /* MotionAnimatorViewContext.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994761F4521BB00AFD6E3 /* MotionCoreAnimationViewContext.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615275A1F393C0E00E8B2AC /* MotionCoreAnimationViewContext.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994771F4521BB00AFD6E3 /* MotionHasInsertOrder.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615275B1F393C0E00E8B2AC /* MotionHasInsertOrder.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994781F4521BB00AFD6E3 /* MotionTransitionAnimator.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615275C1F393C0E00E8B2AC /* MotionTransitionAnimator.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994791F4521BB00AFD6E3 /* MotionViewPropertyViewContext.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615275D1F393C0E00E8B2AC /* MotionViewPropertyViewContext.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947A1F4521BB00AFD6E3 /* Motion+Array.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615275F1F393C0E00E8B2AC /* Motion+Array.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947B1F4521BB00AFD6E3 /* Motion+CALayer.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527601F393C0E00E8B2AC /* Motion+CALayer.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947C1F4521BB00AFD6E3 /* Motion+CAMediaTimingFunction.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527611F393C0E00E8B2AC /* Motion+CAMediaTimingFunction.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947D1F4521BB00AFD6E3 /* Motion+CG.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527621F393C0E00E8B2AC /* Motion+CG.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947E1F4521BB00AFD6E3 /* Motion+Obj-C.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527631F393C0E00E8B2AC /* Motion+Obj-C.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9947F1F4521BB00AFD6E3 /* Motion+UIKit.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527641F393C0E00E8B2AC /* Motion+UIKit.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994801F4521BB00AFD6E3 /* Motion+UIView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527651F393C0E00E8B2AC /* Motion+UIView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994811F4521BB00AFD6E3 /* Motion+UIViewController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527661F393C0E00E8B2AC /* Motion+UIViewController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994821F4521BB00AFD6E3 /* MotionAnimationFillMode.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527671F393C0E00E8B2AC /* MotionAnimationFillMode.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994831F4521BB00AFD6E3 /* LICENSE in Headers */ = {isa = PBXBuildFile; fileRef = 961527681F393C0E00E8B2AC /* LICENSE */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994841F4521BB00AFD6E3 /* Motion.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527691F393C0E00E8B2AC /* Motion.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994851F4521BB00AFD6E3 /* MotionAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276A1F393C0E00E8B2AC /* MotionAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994861F4521BB00AFD6E3 /* MotionAnimationState.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276B1F393C0E00E8B2AC /* MotionAnimationState.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994871F4521BB00AFD6E3 /* MotionCAAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276C1F393C0E00E8B2AC /* MotionCAAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994881F4521BB00AFD6E3 /* MotionContext.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276D1F393C0E00E8B2AC /* MotionContext.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994891F4521BB00AFD6E3 /* MotionController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276E1F393C0E00E8B2AC /* MotionController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948A1F4521BB00AFD6E3 /* MotionCoordinateSpace.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615276F1F393C0E00E8B2AC /* MotionCoordinateSpace.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948B1F4521BB00AFD6E3 /* MotionIndependentController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527701F393C0E00E8B2AC /* MotionIndependentController.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948C1F4521BB00AFD6E3 /* MotionPlugin.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527711F393C0E00E8B2AC /* MotionPlugin.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948D1F4521BB00AFD6E3 /* MotionSnapshotType.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527721F393C0E00E8B2AC /* MotionSnapshotType.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948E1F4521BB00AFD6E3 /* MotionTransition.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527731F393C0E00E8B2AC /* MotionTransition.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D9948F1F4521BB00AFD6E3 /* MotionTransitionObserver.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527741F393C0E00E8B2AC /* MotionTransitionObserver.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994901F4521BB00AFD6E3 /* MotionTransitionState.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527751F393C0E00E8B2AC /* MotionTransitionState.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994911F4521BB00AFD6E3 /* CascadePreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527771F393C0E00E8B2AC /* CascadePreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994921F4521BB00AFD6E3 /* DurationPreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527781F393C0E00E8B2AC /* DurationPreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994931F4521BB00AFD6E3 /* IgnoreSubviewModifiersPreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 961527791F393C0E00E8B2AC /* IgnoreSubviewModifiersPreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994941F4521BB00AFD6E3 /* MatchPreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615277A1F393C0E00E8B2AC /* MatchPreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994951F4521BB00AFD6E3 /* MotionPreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615277B1F393C0E00E8B2AC /* MotionPreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994961F4521BB00AFD6E3 /* SourcePreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615277C1F393C0E00E8B2AC /* SourcePreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; + 96D994971F4521BB00AFD6E3 /* TransitionPreprocessor.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9615277D1F393C0E00E8B2AC /* TransitionPreprocessor.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E09DC81F2287E50000B121 /* TabsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96E09DC71F2287E50000B121 /* TabsController.swift */; }; 96E3C3951D3A1CC20086A024 /* IconButton.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9658F2161CD6FA4700B902C1 /* IconButton.swift */; settings = {ATTRIBUTES = (Public, ); }; }; 96E3C3961D3A1CC20086A024 /* CollectionReusableView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 966ECF291CF4C20100BB0BDF /* CollectionReusableView.swift */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -924,6 +960,42 @@ 9685D5B01F0F04CB00AFEB79 /* CardCollectionViewController.swift in Headers */, 9685D5B11F0F04CB00AFEB79 /* Material+MotionAnimation.swift in Headers */, 96F1A5531F24F17A001D8CAF /* TabsController.swift in Headers */, + 96D994741F4521BB00AFD6E3 /* MotionAnimator.swift in Headers */, + 96D994751F4521BB00AFD6E3 /* MotionAnimatorViewContext.swift in Headers */, + 96D994761F4521BB00AFD6E3 /* MotionCoreAnimationViewContext.swift in Headers */, + 96D994771F4521BB00AFD6E3 /* MotionHasInsertOrder.swift in Headers */, + 96D994781F4521BB00AFD6E3 /* MotionTransitionAnimator.swift in Headers */, + 96D994791F4521BB00AFD6E3 /* MotionViewPropertyViewContext.swift in Headers */, + 96D9947A1F4521BB00AFD6E3 /* Motion+Array.swift in Headers */, + 96D9947B1F4521BB00AFD6E3 /* Motion+CALayer.swift in Headers */, + 96D9947C1F4521BB00AFD6E3 /* Motion+CAMediaTimingFunction.swift in Headers */, + 96D9947D1F4521BB00AFD6E3 /* Motion+CG.swift in Headers */, + 96D9947E1F4521BB00AFD6E3 /* Motion+Obj-C.swift in Headers */, + 96D9947F1F4521BB00AFD6E3 /* Motion+UIKit.swift in Headers */, + 96D994801F4521BB00AFD6E3 /* Motion+UIView.swift in Headers */, + 96D994811F4521BB00AFD6E3 /* Motion+UIViewController.swift in Headers */, + 96D994821F4521BB00AFD6E3 /* MotionAnimationFillMode.swift in Headers */, + 96D994831F4521BB00AFD6E3 /* LICENSE in Headers */, + 96D994841F4521BB00AFD6E3 /* Motion.swift in Headers */, + 96D994851F4521BB00AFD6E3 /* MotionAnimation.swift in Headers */, + 96D994861F4521BB00AFD6E3 /* MotionAnimationState.swift in Headers */, + 96D994871F4521BB00AFD6E3 /* MotionCAAnimation.swift in Headers */, + 96D994881F4521BB00AFD6E3 /* MotionContext.swift in Headers */, + 96D994891F4521BB00AFD6E3 /* MotionController.swift in Headers */, + 96D9948A1F4521BB00AFD6E3 /* MotionCoordinateSpace.swift in Headers */, + 96D9948B1F4521BB00AFD6E3 /* MotionIndependentController.swift in Headers */, + 96D9948C1F4521BB00AFD6E3 /* MotionPlugin.swift in Headers */, + 96D9948D1F4521BB00AFD6E3 /* MotionSnapshotType.swift in Headers */, + 96D9948E1F4521BB00AFD6E3 /* MotionTransition.swift in Headers */, + 96D9948F1F4521BB00AFD6E3 /* MotionTransitionObserver.swift in Headers */, + 96D994901F4521BB00AFD6E3 /* MotionTransitionState.swift in Headers */, + 96D994911F4521BB00AFD6E3 /* CascadePreprocessor.swift in Headers */, + 96D994921F4521BB00AFD6E3 /* DurationPreprocessor.swift in Headers */, + 96D994931F4521BB00AFD6E3 /* IgnoreSubviewModifiersPreprocessor.swift in Headers */, + 96D994941F4521BB00AFD6E3 /* MatchPreprocessor.swift in Headers */, + 96D994951F4521BB00AFD6E3 /* MotionPreprocessor.swift in Headers */, + 96D994961F4521BB00AFD6E3 /* SourcePreprocessor.swift in Headers */, + 96D994971F4521BB00AFD6E3 /* TransitionPreprocessor.swift in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; diff --git a/README.md b/README.md index 2476e026c..5e7352e4d 100644 --- a/README.md +++ b/README.md @@ -18,8 +18,6 @@ Take a look at a sample [Photos](https://github.com/CosmicMind/Samples/tree/mast ![Photos](http://www.cosmicmind.com/motion/projects/photos.gif) -* [Photos Sample](https://github.com/CosmicMind/Samples/tree/master/Projects/Programmatic/Photos) - ## Sample Projects Take a look at [Sample Projects](https://github.com/CosmicMind/Samples) to get your projects started. diff --git a/Sources/iOS/ImageCard.swift b/Sources/iOS/ImageCard.swift index 5268cbd3b..0eb2e5672 100644 --- a/Sources/iOS/ImageCard.swift +++ b/Sources/iOS/ImageCard.swift @@ -30,12 +30,6 @@ import UIKit -@objc(ToolbarAlignment) -public enum ToolbarAlignment: Int { - case top - case bottom -} - open class ImageCard: Card { /** A Display value to indicate whether or not to diff --git a/Sources/iOS/SearchBar.swift b/Sources/iOS/SearchBar.swift index d20af2e47..54985b42a 100644 --- a/Sources/iOS/SearchBar.swift +++ b/Sources/iOS/SearchBar.swift @@ -148,7 +148,7 @@ open class SearchBar: Bar { return } - textField.frame = contentView.bounds + layoutTextField() layoutLeftView() layoutClearButton() } @@ -161,10 +161,9 @@ open class SearchBar: Bar { } extension SearchBar { - /// Layout the clearButton. - open func layoutClearButton() { - let h = textField.frame.height - clearButton.frame = CGRect(x: textField.frame.width - h - 4, y: 4, width: h, height: h - 8) + /// Layout the textField. + open func layoutTextField() { + textField.frame = contentView.bounds } /// Layout the leftView. @@ -178,12 +177,18 @@ extension SearchBar { (v as? UIImageView)?.contentMode = .scaleAspectFit } + + /// Layout the clearButton. + open func layoutClearButton() { + let h = textField.frame.height + clearButton.frame = CGRect(x: textField.frame.width - h - 4, y: 4, width: h, height: h - 8) + } } -extension SearchBar { +fileprivate extension SearchBar { /// Clears the textField text. @objc - fileprivate func handleClearButton() { + func handleClearButton() { guard nil == textField.delegate?.textFieldShouldClear || true == textField.delegate?.textFieldShouldClear?(textField) else { return } @@ -199,14 +204,14 @@ extension SearchBar { // Live updates the search results. @objc - fileprivate func handleEditingChanged(textField: UITextField) { + func handleEditingChanged(textField: UITextField) { delegate?.searchBar?(searchBar: self, didChange: textField, with: textField.text) } } -extension SearchBar { +fileprivate extension SearchBar { /// Prepares the textField. - fileprivate func prepareTextField() { + func prepareTextField() { textField.contentScaleFactor = Screen.scale textField.font = RobotoFont.regular(with: 17) textField.backgroundColor = Color.clear @@ -219,7 +224,7 @@ extension SearchBar { } /// Prepares the clearButton. - fileprivate func prepareClearButton() { + func prepareClearButton() { clearButton = IconButton(image: Icon.cm.close, tintColor: placeholderColor) clearButton.contentEdgeInsets = .zero isClearButtonAutoHandleEnabled = true diff --git a/Sources/iOS/SearchBarController.swift b/Sources/iOS/SearchBarController.swift index 6ca37332e..37c974bdc 100644 --- a/Sources/iOS/SearchBarController.swift +++ b/Sources/iOS/SearchBarController.swift @@ -61,45 +61,62 @@ open class SearchBarController: StatusBarController { open override func layoutSubviews() { super.layoutSubviews() - - let y = Application.shouldStatusBarBeHidden || statusBar.isHidden ? 0 : statusBar.height - - searchBar.y = y - searchBar.width = view.width - - switch displayStyle { - case .partial: - - - let h = y + searchBar.height - container.y = h - container.height = view.height - h - case .full: - container.frame = view.bounds - } - - rootViewController.view.frame = container.bounds + layoutSearchBar() + layoutContainer() + layoutRootViewController() } open override func prepare() { super.prepare() displayStyle = .partial - prepareStatusBar() - prepareSearchBar() + prepareSearchBar() } } fileprivate extension SearchBarController { - /// Prepares the statusBar. - func prepareStatusBar() { - shouldHideStatusBarOnRotation = false - } - /// Prepares the searchBar. func prepareSearchBar() { - searchBar.depthPreset = .depth1 searchBar.zPosition = 1000 + searchBar.depthPreset = .depth1 view.addSubview(searchBar) } } + +fileprivate extension SearchBarController { + /// Layout the container. + func layoutContainer() { + switch displayStyle { + case .partial: + let p = searchBar.height + let q = statusBarOffsetAdjustment + let h = view.height - p - q + + switch searchBarAlignment { + case .top: + container.y = q + p + container.height = h + case .bottom: + container.y = q + container.height = h + } + + container.width = view.width + + case .full: + container.frame = view.bounds + } + } + + /// Layout the searchBar. + func layoutSearchBar() { + searchBar.x = 0 + searchBar.y = .top == searchBarAlignment ? statusBarOffsetAdjustment : view.height - searchBar.height + searchBar.width = view.width + } + + /// Layout the rootViewController. + func layoutRootViewController() { + rootViewController.view.frame = container.bounds + } +} diff --git a/Sources/iOS/StatusBarController.swift b/Sources/iOS/StatusBarController.swift index c9f68244c..f65558800 100644 --- a/Sources/iOS/StatusBarController.swift +++ b/Sources/iOS/StatusBarController.swift @@ -74,8 +74,13 @@ open class StatusBarController: TransitionController { } } + /// An adjustment based on the rules for displaying the statusBar. + open var statusBarOffsetAdjustment: CGFloat { + return Application.shouldStatusBarBeHidden || statusBar.isHidden ? 0 : statusBar.height + } + /// A boolean that indicates to hide the statusBar on rotation. - open var shouldHideStatusBarOnRotation = true + open var shouldHideStatusBarOnRotation = false /// A reference to the statusBar. open let statusBar = UIView() @@ -99,7 +104,9 @@ open class StatusBarController: TransitionController { } rootViewController.view.frame = container.bounds - } + + container.zPosition = statusBar.zPosition + (Application.shouldStatusBarBeHidden ? 1 : -1) + } open override func prepare() { super.prepare() diff --git a/Sources/iOS/ToolbarController.swift b/Sources/iOS/ToolbarController.swift index e3781ab28..daf51a198 100644 --- a/Sources/iOS/ToolbarController.swift +++ b/Sources/iOS/ToolbarController.swift @@ -30,6 +30,12 @@ import UIKit +@objc(ToolbarAlignment) +public enum ToolbarAlignment: Int { + case top + case bottom +} + public extension UIViewController { /** A convenience property that provides access to the ToolbarController. @@ -47,6 +53,13 @@ open class ToolbarController: StatusBarController { @IBInspectable open let toolbar = Toolbar() + /// The toolbar alignment. + open var toolbarAlignment = ToolbarAlignment.top { + didSet { + layoutSubviews() + } + } + open override func layoutSubviews() { super.layoutSubviews() layoutToolbar() @@ -57,44 +70,52 @@ open class ToolbarController: StatusBarController { open override func prepare() { super.prepare() displayStyle = .partial - - prepareStatusBar() + prepareToolbar() } } fileprivate extension ToolbarController { - /// Prepares the statusBar. - func prepareStatusBar() { - shouldHideStatusBarOnRotation = false - } - /// Prepares the toolbar. func prepareToolbar() { + toolbar.zPosition = 1000 toolbar.depthPreset = .depth1 view.addSubview(toolbar) } } fileprivate extension ToolbarController { - /// Layout the toolbar. - func layoutToolbar() { - toolbar.y = Application.shouldStatusBarBeHidden || statusBar.isHidden ? 0 : statusBar.height - toolbar.width = view.width - } - /// Layout the container. func layoutContainer() { switch displayStyle { case .partial: - let h = toolbar.y + toolbar.height - container.y = h - container.height = view.height - h + let p = toolbar.height + let q = statusBarOffsetAdjustment + let h = view.height - p - q + + switch toolbarAlignment { + case .top: + container.y = q + p + container.height = h + case .bottom: + container.y = q + container.height = h + } + + container.width = view.width + case .full: container.frame = view.bounds } } + /// Layout the toolbar. + func layoutToolbar() { + toolbar.x = 0 + toolbar.y = .top == toolbarAlignment ? statusBarOffsetAdjustment : view.height - toolbar.height + toolbar.width = view.width + } + /// Layout the rootViewController. func layoutRootViewController() { rootViewController.view.frame = container.bounds