Commit 7bfafdfa by Daniel Dahan

initial commit for NavigationController and NavigationBar

parent 5365d0be
......@@ -7,6 +7,9 @@
objects = {
/* Begin PBXBuildFile section */
96334EFC1C8B85F40083986B /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96334EFB1C8B85F40083986B /* Material.framework */; };
96334EFD1C8B85F40083986B /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96334EFB1C8B85F40083986B /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
96334EFF1C8B876E0083986B /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96334EFE1C8B876E0083986B /* ViewController.swift */; };
9663F9321C7A744600AF0965 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9311C7A744600AF0965 /* AppDelegate.swift */; };
9663F9341C7A744600AF0965 /* SearchListViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9331C7A744600AF0965 /* SearchListViewController.swift */; };
9663F9391C7A744600AF0965 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9663F9381C7A744600AF0965 /* Assets.xcassets */; };
......@@ -27,6 +30,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96334EFD1C8B85F40083986B /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -34,6 +38,8 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96334EFB1C8B85F40083986B /* 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>"; };
96334EFE1C8B876E0083986B /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
9663F92E1C7A744600AF0965 /* App.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = App.app; sourceTree = BUILT_PRODUCTS_DIR; };
9663F9311C7A744600AF0965 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
9663F9331C7A744600AF0965 /* SearchListViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchListViewController.swift; sourceTree = "<group>"; };
......@@ -54,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96334EFC1C8B85F40083986B /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -63,6 +70,7 @@
9663F9251C7A744500AF0965 = {
isa = PBXGroup;
children = (
96334EFB1C8B85F40083986B /* Material.framework */,
9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */,
);
......@@ -91,6 +99,7 @@
9663F9381C7A744600AF0965 /* Assets.xcassets */,
9663F93A1C7A744600AF0965 /* LaunchScreen.storyboard */,
9663F93D1C7A744600AF0965 /* Info.plist */,
96334EFE1C8B876E0083986B /* ViewController.swift */,
);
path = App;
sourceTree = "<group>";
......@@ -166,6 +175,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96334EFF1C8B876E0083986B /* ViewController.swift in Sources */,
9663F94A1C7A74B500AF0965 /* AppSearchBarViewController.swift in Sources */,
96CC08881C7FEBD60034FF84 /* InboxViewController.swift in Sources */,
9663F9501C7A74FC00AF0965 /* AppRightViewController.swift in Sources */,
......
......@@ -39,7 +39,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationBarViewController(mainViewController: InboxViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
// window!.rootViewController = SideNavigationViewController(mainViewController: AppMenuViewController(mainViewController: AppNavigationBarViewController(mainViewController: InboxViewController())), leftViewController: AppLeftViewController(), rightViewController: AppRightViewController())
window!.rootViewController = NavigationController(rootViewController: FeedViewController())
window!.makeKeyAndVisible()
return true
}
......
......@@ -207,6 +207,7 @@ extension FeedViewController: MaterialCollectionViewDataSource {
extension FeedViewController: MaterialCollectionViewDelegate {
/// Executed when an item is selected.
func collectionView(collectionView: UICollectionView, didSelectItemAtIndexPath indexPath: NSIndexPath) {
print(indexPath)
// print(indexPath)
navigationController?.pushViewController(ViewController(), animated: true)
}
}
\ No newline at end of file
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*
The following example shows how to dynamically size MaterialCollectionViewCells.
*/
import UIKit
import Material
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
navigationController?.navigationBar.backgroundColor = MaterialColor.blue.base
}
/// Prepares view.
private func prepareView() {
view.backgroundColor = MaterialColor.grey.lighten4
}
}
\ No newline at end of file
......@@ -30,6 +30,9 @@
960B23511C38490D00E96216 /* TextStorage.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960B23441C38480E00E96216 /* TextStorage.swift */; settings = {ATTRIBUTES = (Public, ); }; };
960B23521C38490D00E96216 /* TextView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960B23451C38480E00E96216 /* TextView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
9626C2DE1C795017007CA8E0 /* MenuViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9626C2DD1C795017007CA8E0 /* MenuViewController.swift */; };
96334EF61C8B84660083986B /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96334EF51C8B84660083986B /* Assets.xcassets */; };
96334EF81C8B84880083986B /* NavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96334EF71C8B84880083986B /* NavigationBar.swift */; };
96334EFA1C8B849A0083986B /* NavigationController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96334EF91C8B849A0083986B /* NavigationController.swift */; };
963832421B88DFD80015F710 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 963832361B88DFD80015F710 /* Material.framework */; };
96442ADB1C28EEFA00C3C574 /* TextField.swift in Headers */ = {isa = PBXBuildFile; fileRef = 966F57B71C226D75009185B7 /* TextField.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96442ADD1C28EF3700C3C574 /* MaterialTableViewCell.swift */; };
......@@ -166,6 +169,9 @@
960B23441C38480E00E96216 /* TextStorage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextStorage.swift; sourceTree = "<group>"; };
960B23451C38480E00E96216 /* TextView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TextView.swift; sourceTree = "<group>"; };
9626C2DD1C795017007CA8E0 /* MenuViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuViewController.swift; sourceTree = "<group>"; };
96334EF51C8B84660083986B /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96334EF71C8B84880083986B /* NavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationBar.swift; sourceTree = "<group>"; };
96334EF91C8B849A0083986B /* NavigationController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NavigationController.swift; sourceTree = "<group>"; };
963832361B88DFD80015F710 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Material.framework; sourceTree = BUILT_PRODUCTS_DIR; };
963832411B88DFD80015F710 /* Material.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Material.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
963832591B88E31A0015F710 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
......@@ -253,6 +259,8 @@
children = (
96D88C151C1328D800B91418 /* NavigationBarView.swift */,
96A71F2F1C72E41100C0C4AE /* NavigationBarViewController.swift */,
96334EF71C8B84880083986B /* NavigationBar.swift */,
96334EF91C8B849A0083986B /* NavigationController.swift */,
);
name = NavigationBar;
sourceTree = "<group>";
......@@ -395,6 +403,7 @@
9626C2DB1C794FBB007CA8E0 /* SearchBar */,
9626C2DA1C794FA5007CA8E0 /* NavigationBar */,
9626C2DC1C794FE5007CA8E0 /* SideNavigation */,
96334EF51C8B84660083986B /* Assets.xcassets */,
);
path = Sources;
sourceTree = "<group>";
......@@ -703,6 +712,7 @@
96D88C431C1328D800B91418 /* Roboto-Regular.ttf in Resources */,
96D88C421C1328D800B91418 /* Roboto-Medium.ttf in Resources */,
96D88C411C1328D800B91418 /* Roboto-Light.ttf in Resources */,
96334EF61C8B84660083986B /* Assets.xcassets in Resources */,
96D88C401C1328D800B91418 /* Roboto-Bold.ttf in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -740,6 +750,7 @@
96D88C351C1328D800B91418 /* MaterialLayout.swift in Sources */,
96D88C2F1C1328D800B91418 /* MaterialGravity.swift in Sources */,
96D88C231C1328D800B91418 /* FlatButton.swift in Sources */,
96334EF81C8B84880083986B /* NavigationBar.swift in Sources */,
966F57B81C226D75009185B7 /* TextField.swift in Sources */,
96DBA7361C61198400844821 /* Material+UIImage+Color.swift in Sources */,
96CC08931C7FEC170034FF84 /* MaterialCollectionViewCell.swift in Sources */,
......@@ -767,6 +778,7 @@
96D88C451C1328D800B91418 /* RobotoFont.swift in Sources */,
96D88C1F1C1328D800B91418 /* CardView.swift in Sources */,
96D88C2C1C1328D800B91418 /* MaterialColor.swift in Sources */,
96334EFA1C8B849A0083986B /* NavigationController.swift in Sources */,
96D88C301C1328D800B91418 /* MaterialEdgeInset.swift in Sources */,
96CC08A01C80CB180034FF84 /* MaterialSpacing.swift in Sources */,
96D88C211C1328D800B91418 /* CaptureSession.swift in Sources */,
......
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public class NavigationBar : UINavigationBar {
public var backButtonImage: UIImage? {
didSet {
if nil == backButtonImage {
backButtonImage = UIImage(named: "ic_arrow_back_white", inBundle: NSBundle(identifier: "io.cosmicmind.Material"), compatibleWithTraitCollection: nil)
}
backIndicatorImage = backButtonImage
backIndicatorTransitionMaskImage = backButtonImage
}
}
/// A property that accesses the backing layer's backgroundColor.
public override var backgroundColor: UIColor? {
didSet {
barTintColor = backgroundColor
}
}
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareView()
}
public override init(frame: CGRect) {
super.init(frame: frame)
prepareView()
}
public func prepareView() {
backButtonImage = nil
}
}
/*
* Copyright (C) 2015 - 2016, Daniel Dahan and CosmicMind, Inc. <http://cosmicmind.io>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* * Neither the name of Material nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
import UIKit
public class NavigationController : UINavigationController {
public required init?(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)
prepareView()
}
public override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
prepareView()
}
public override init(rootViewController: UIViewController) {
super.init(navigationBarClass: NavigationBar.self, toolbarClass: nil)
setViewControllers([rootViewController], animated: false)
prepareView()
}
public func 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