Commit 58089e3d by Daniel Dahan

updated NavigationBarView Storyboard example

parent 8fbe2490
...@@ -46,6 +46,8 @@ class ViewController: UIViewController { ...@@ -46,6 +46,8 @@ class ViewController: UIViewController {
} }
/// General preparation statements are placed here. /// General preparation statements are placed here.
@IBOutlet weak var heightConstraint: NSLayoutConstraint!
@IBOutlet weak var navigationBarViewConstraint: NavigationBarView!
private func prepareView() { private func prepareView() {
view.backgroundColor = MaterialColor.white view.backgroundColor = MaterialColor.white
} }
......
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
9642FA251C1B50E700022BC6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9642FA231C1B50E700022BC6 /* LaunchScreen.storyboard */; }; 9642FA251C1B50E700022BC6 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 9642FA231C1B50E700022BC6 /* LaunchScreen.storyboard */; };
9642FA331C1B909700022BC6 /* LeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9642FA321C1B909700022BC6 /* LeftViewController.swift */; }; 9642FA331C1B909700022BC6 /* LeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9642FA321C1B909700022BC6 /* LeftViewController.swift */; };
967585381C569AA9001E4268 /* RightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967585371C569AA9001E4268 /* RightViewController.swift */; }; 967585381C569AA9001E4268 /* RightViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 967585371C569AA9001E4268 /* RightViewController.swift */; };
96A71F3C1C739D1E00C0C4AE /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96A71F3B1C739D1E00C0C4AE /* Material.framework */; };
96A71F3D1C739D1E00C0C4AE /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96A71F3B1C739D1E00C0C4AE /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96A71F471C74AD0700C0C4AE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F461C74AD0700C0C4AE /* FeedViewController.swift */; }; 96A71F471C74AD0700C0C4AE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71F461C74AD0700C0C4AE /* FeedViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -25,7 +23,6 @@ ...@@ -25,7 +23,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
96A71F3D1C739D1E00C0C4AE /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -41,7 +38,6 @@ ...@@ -41,7 +38,6 @@
9642FA261C1B50E700022BC6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; 9642FA261C1B50E700022BC6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9642FA321C1B909700022BC6 /* LeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftViewController.swift; sourceTree = "<group>"; }; 9642FA321C1B909700022BC6 /* LeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LeftViewController.swift; sourceTree = "<group>"; };
967585371C569AA9001E4268 /* RightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RightViewController.swift; sourceTree = "<group>"; }; 967585371C569AA9001E4268 /* RightViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RightViewController.swift; sourceTree = "<group>"; };
96A71F3B1C739D1E00C0C4AE /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphoneos/Material.framework"; sourceTree = "<absolute>"; };
96A71F461C74AD0700C0C4AE /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; }; 96A71F461C74AD0700C0C4AE /* FeedViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeedViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -50,7 +46,6 @@ ...@@ -50,7 +46,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96A71F3C1C739D1E00C0C4AE /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -60,7 +55,6 @@ ...@@ -60,7 +55,6 @@
9642FA0E1C1B50E700022BC6 = { 9642FA0E1C1B50E700022BC6 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96A71F3B1C739D1E00C0C4AE /* Material.framework */,
9642FA191C1B50E700022BC6 /* SideNavigationViewController */, 9642FA191C1B50E700022BC6 /* SideNavigationViewController */,
9642FA181C1B50E700022BC6 /* Products */, 9642FA181C1B50E700022BC6 /* Products */,
); );
......
...@@ -17,9 +17,12 @@ ...@@ -17,9 +17,12 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/> <rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews> <subviews>
<view contentMode="scaleToFill" ambiguous="YES" misplaced="YES" translatesAutoresizingMaskIntoConstraints="NO" id="est-za-GAc" customClass="NavigationBarView" customModule="Material"> <view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="est-za-GAc" customClass="NavigationBarView" customModule="Material">
<rect key="frame" x="0.0" y="0.0" width="600" height="64"/> <rect key="frame" x="0.0" y="0.0" width="600" height="64"/>
<color key="backgroundColor" red="0.39222975830000001" green="0.2440954615" blue="0.68699765469999996" alpha="1" colorSpace="calibratedRGB"/> <color key="backgroundColor" red="0.39222975830000001" green="0.2440954615" blue="0.68699765469999996" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="height" constant="64" id="dve-99-fA0"/>
</constraints>
</view> </view>
</subviews> </subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
...@@ -29,7 +32,7 @@ ...@@ -29,7 +32,7 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="navigationBarView" destination="est-za-GAc" id="yru-pV-frB"/> <outlet property="navigationBarView" destination="est-za-GAc" id="3ly-Ta-1qf"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......
...@@ -35,6 +35,17 @@ class ViewController: UIViewController { ...@@ -35,6 +35,17 @@ class ViewController: UIViewController {
@IBOutlet weak var navigationBarView: NavigationBarView! @IBOutlet weak var navigationBarView: NavigationBarView!
@IBOutlet weak var navigationBarViewHeightConstraint: NSLayoutConstraint?
override func willRotateToInterfaceOrientation(toInterfaceOrientation: UIInterfaceOrientation, duration: NSTimeInterval) {
// if landscape
if UIInterfaceOrientationIsLandscape(toInterfaceOrientation) {
navigationBarViewHeightConstraint?.constant = 44
} else { // else portrait
navigationBarViewHeightConstraint?.constant = 64
}
}
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
prepareView() prepareView()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment