Commit b2810a19 by Daniel Dahan

moved BottomNavigationBar to TabBar as it reflects more accurately the…

moved BottomNavigationBar to TabBar as it reflects more accurately the subclassing hierarchy with iOS.
parent 211e5fd9
......@@ -62,7 +62,7 @@
location = "group:Programmatic/SearchBarController/SearchBarController.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/BottomNavigationBar/BottomNavigationBar.xcodeproj">
location = "group:Programmatic/TabBar/TabBar.xcodeproj">
</FileRef>
<FileRef
location = "group:Programmatic/BottomNavigationController/BottomNavigationController.xcodeproj">
......@@ -105,7 +105,7 @@
location = "group:Storyboards/Toolbar/Toolbar.xcodeproj">
</FileRef>
<FileRef
location = "group:Storyboards/BottomNavigationBar/BottomNavigationBar.xcodeproj">
location = "group:Storyboards/TabBar/TabBar.xcodeproj">
</FileRef>
<FileRef
location = "group:Storyboards/SideNavigationController/SideNavigationController.xcodeproj">
......
......@@ -19,6 +19,8 @@
9663F94E1C7A74EA00AF0965 /* AppLeftViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */; };
9663F9521C7A751D00AF0965 /* ItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9663F9511C7A751D00AF0965 /* ItemViewController.swift */; };
96CC08881C7FEBD60034FF84 /* RecipesViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */; };
96FBE38A1CA8D931001E2932 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96FBE3891CA8D931001E2932 /* Material.framework */; };
96FBE38B1CA8D931001E2932 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96FBE3891CA8D931001E2932 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -28,6 +30,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96FBE38B1CA8D931001E2932 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -49,6 +52,7 @@
9663F94D1C7A74EA00AF0965 /* AppLeftViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppLeftViewController.swift; sourceTree = "<group>"; };
9663F9511C7A751D00AF0965 /* ItemViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ItemViewController.swift; sourceTree = "<group>"; };
96CC08871C7FEBD60034FF84 /* RecipesViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RecipesViewController.swift; sourceTree = "<group>"; };
96FBE3891CA8D931001E2932 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -56,6 +60,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96FBE38A1CA8D931001E2932 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -65,6 +70,7 @@
9663F9251C7A744500AF0965 = {
isa = PBXGroup;
children = (
96FBE3891CA8D931001E2932 /* Material.framework */,
9663F9301C7A744600AF0965 /* App */,
9663F92F1C7A744600AF0965 /* Products */,
);
......
......@@ -9,11 +9,12 @@
/* Begin PBXBuildFile section */
96162C2F1CA7064900E3A235 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C2E1CA7064900E3A235 /* AppDelegate.swift */; };
96162C311CA7064900E3A235 /* VideoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C301CA7064900E3A235 /* VideoViewController.swift */; };
96162C341CA7064900E3A235 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96162C321CA7064900E3A235 /* Main.storyboard */; };
96162C361CA7064900E3A235 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96162C351CA7064900E3A235 /* Assets.xcassets */; };
96162C391CA7064900E3A235 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96162C371CA7064900E3A235 /* LaunchScreen.storyboard */; };
96162C451CA7083000E3A235 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C441CA7083000E3A235 /* PhotoViewController.swift */; };
96162C471CA708B000E3A235 /* LibraryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C461CA708B000E3A235 /* LibraryViewController.swift */; };
96FBE3A91CA9AD02001E2932 /* Material.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96FBE3A81CA9AD01001E2932 /* Material.framework */; };
96FBE3AA1CA9AD02001E2932 /* Material.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 96FBE3A81CA9AD01001E2932 /* Material.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -23,6 +24,7 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96FBE3AA1CA9AD02001E2932 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -33,12 +35,12 @@
96162C2B1CA7064900E3A235 /* BottomNavigationController.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BottomNavigationController.app; sourceTree = BUILT_PRODUCTS_DIR; };
96162C2E1CA7064900E3A235 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96162C301CA7064900E3A235 /* VideoViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = VideoViewController.swift; sourceTree = "<group>"; };
96162C331CA7064900E3A235 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
96162C351CA7064900E3A235 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96162C381CA7064900E3A235 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96162C3A1CA7064900E3A235 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96162C441CA7083000E3A235 /* PhotoViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PhotoViewController.swift; sourceTree = "<group>"; };
96162C461CA708B000E3A235 /* LibraryViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LibraryViewController.swift; sourceTree = "<group>"; };
96FBE3A81CA9AD01001E2932 /* Material.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; name = Material.framework; path = "/Users/danieldahan/Library/Developer/Xcode/DerivedData/Material-hbpnflxhoouqxebjcyhbbhqyesjd/Build/Products/Debug-iphonesimulator/Material.framework"; sourceTree = "<absolute>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -46,6 +48,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96FBE3A91CA9AD02001E2932 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -55,6 +58,7 @@
96162C221CA7064900E3A235 = {
isa = PBXGroup;
children = (
96FBE3A81CA9AD01001E2932 /* Material.framework */,
96162C2D1CA7064900E3A235 /* BottomNavigationController */,
96162C2C1CA7064900E3A235 /* Products */,
);
......@@ -75,7 +79,6 @@
96162C301CA7064900E3A235 /* VideoViewController.swift */,
96162C441CA7083000E3A235 /* PhotoViewController.swift */,
96162C461CA708B000E3A235 /* LibraryViewController.swift */,
96162C321CA7064900E3A235 /* Main.storyboard */,
96162C351CA7064900E3A235 /* Assets.xcassets */,
96162C371CA7064900E3A235 /* LaunchScreen.storyboard */,
96162C3A1CA7064900E3A235 /* Info.plist */,
......@@ -144,7 +147,6 @@
files = (
96162C391CA7064900E3A235 /* LaunchScreen.storyboard in Resources */,
96162C361CA7064900E3A235 /* Assets.xcassets in Resources */,
96162C341CA7064900E3A235 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -165,14 +167,6 @@
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96162C321CA7064900E3A235 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
96162C331CA7064900E3A235 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
96162C371CA7064900E3A235 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
......
......@@ -32,16 +32,18 @@ import UIKit
import Material
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegate {
var window: UIWindow?
var bottomNavigationController: BottomNavigationController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
let bottomNavigationController: BottomNavigationController = BottomNavigationController()
bottomNavigationController.viewControllers = [VideoViewController(), PhotoViewController(), LibraryViewController()]
bottomNavigationController.selectedIndex = 0
bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
bottomNavigationController = BottomNavigationController()
bottomNavigationController!.selectedIndex = 0
bottomNavigationController!.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController!.tabBar.backgroundColor = MaterialColor.grey.darken4
bottomNavigationController!.delegate = self
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
......@@ -66,6 +68,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
bottomNavigationController!.viewControllers = [VideoViewController(), PhotoViewController(), LibraryViewController()]
}
func applicationWillTerminate(application: UIApplication) {
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
......@@ -24,8 +24,6 @@
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
......
......@@ -7,10 +7,11 @@
objects = {
/* Begin PBXBuildFile section */
96A536731CA3A5450069B3CC /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A536721CA3A5450069B3CC /* AppDelegate.swift */; };
96A536751CA3A5450069B3CC /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A536741CA3A5450069B3CC /* ViewController.swift */; };
96A5367A1CA3A5450069B3CC /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96A536791CA3A5450069B3CC /* Assets.xcassets */; };
96A5367D1CA3A5450069B3CC /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96A5367B1CA3A5450069B3CC /* LaunchScreen.storyboard */; };
96FBE3941CA9AB46001E2932 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE38E1CA9AB46001E2932 /* AppDelegate.swift */; };
96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE38F1CA9AB46001E2932 /* Assets.xcassets */; };
96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE3901CA9AB46001E2932 /* LaunchScreen.storyboard */; };
96FBE3971CA9AB46001E2932 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE3921CA9AB46001E2932 /* Info.plist */; };
96FBE3981CA9AB46001E2932 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE3931CA9AB46001E2932 /* ViewController.swift */; };
/* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */
......@@ -27,12 +28,12 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
96A5366F1CA3A5450069B3CC /* BottomNavigationBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BottomNavigationBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96A536721CA3A5450069B3CC /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96A536741CA3A5450069B3CC /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
96A536791CA3A5450069B3CC /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96A5367C1CA3A5450069B3CC /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96A5367E1CA3A5450069B3CC /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96A5366F1CA3A5450069B3CC /* TabBar.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TabBar.app; sourceTree = BUILT_PRODUCTS_DIR; };
96FBE38E1CA9AB46001E2932 /* AppDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
96FBE38F1CA9AB46001E2932 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
96FBE3911CA9AB46001E2932 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
96FBE3921CA9AB46001E2932 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
96FBE3931CA9AB46001E2932 /* ViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
......@@ -49,7 +50,7 @@
96A536661CA3A5450069B3CC = {
isa = PBXGroup;
children = (
96A536711CA3A5450069B3CC /* BottomNavigationBar */,
96FBE38D1CA9AB46001E2932 /* TabBar */,
96A536701CA3A5450069B3CC /* Products */,
);
sourceTree = "<group>";
......@@ -57,29 +58,29 @@
96A536701CA3A5450069B3CC /* Products */ = {
isa = PBXGroup;
children = (
96A5366F1CA3A5450069B3CC /* BottomNavigationBar.app */,
96A5366F1CA3A5450069B3CC /* TabBar.app */,
);
name = Products;
sourceTree = "<group>";
};
96A536711CA3A5450069B3CC /* BottomNavigationBar */ = {
96FBE38D1CA9AB46001E2932 /* TabBar */ = {
isa = PBXGroup;
children = (
96A536721CA3A5450069B3CC /* AppDelegate.swift */,
96A536741CA3A5450069B3CC /* ViewController.swift */,
96A536791CA3A5450069B3CC /* Assets.xcassets */,
96A5367B1CA3A5450069B3CC /* LaunchScreen.storyboard */,
96A5367E1CA3A5450069B3CC /* Info.plist */,
96FBE38E1CA9AB46001E2932 /* AppDelegate.swift */,
96FBE3931CA9AB46001E2932 /* ViewController.swift */,
96FBE38F1CA9AB46001E2932 /* Assets.xcassets */,
96FBE3901CA9AB46001E2932 /* LaunchScreen.storyboard */,
96FBE3921CA9AB46001E2932 /* Info.plist */,
);
path = BottomNavigationBar;
path = TabBar;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
96A5366E1CA3A5450069B3CC /* BottomNavigationBar */ = {
96A5366E1CA3A5450069B3CC /* TabBar */ = {
isa = PBXNativeTarget;
buildConfigurationList = 96A536811CA3A5450069B3CC /* Build configuration list for PBXNativeTarget "BottomNavigationBar" */;
buildConfigurationList = 96A536811CA3A5450069B3CC /* Build configuration list for PBXNativeTarget "TabBar" */;
buildPhases = (
96A5366B1CA3A5450069B3CC /* Sources */,
96A5366C1CA3A5450069B3CC /* Frameworks */,
......@@ -90,9 +91,9 @@
);
dependencies = (
);
name = BottomNavigationBar;
name = TabBar;
productName = BottomNavigationBar;
productReference = 96A5366F1CA3A5450069B3CC /* BottomNavigationBar.app */;
productReference = 96A5366F1CA3A5450069B3CC /* TabBar.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
......@@ -110,7 +111,7 @@
};
};
};
buildConfigurationList = 96A5366A1CA3A5450069B3CC /* Build configuration list for PBXProject "BottomNavigationBar" */;
buildConfigurationList = 96A5366A1CA3A5450069B3CC /* Build configuration list for PBXProject "TabBar" */;
compatibilityVersion = "Xcode 3.2";
developmentRegion = English;
hasScannedForEncodings = 0;
......@@ -123,7 +124,7 @@
projectDirPath = "";
projectRoot = "";
targets = (
96A5366E1CA3A5450069B3CC /* BottomNavigationBar */,
96A5366E1CA3A5450069B3CC /* TabBar */,
);
};
/* End PBXProject section */
......@@ -133,8 +134,9 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96A5367D1CA3A5450069B3CC /* LaunchScreen.storyboard in Resources */,
96A5367A1CA3A5450069B3CC /* Assets.xcassets in Resources */,
96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */,
96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */,
96FBE3971CA9AB46001E2932 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -145,18 +147,18 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96A536751CA3A5450069B3CC /* ViewController.swift in Sources */,
96A536731CA3A5450069B3CC /* AppDelegate.swift in Sources */,
96FBE3981CA9AB46001E2932 /* ViewController.swift in Sources */,
96FBE3941CA9AB46001E2932 /* AppDelegate.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
96A5367B1CA3A5450069B3CC /* LaunchScreen.storyboard */ = {
96FBE3901CA9AB46001E2932 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
96A5367C1CA3A5450069B3CC /* Base */,
96FBE3911CA9AB46001E2932 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
......@@ -254,7 +256,7 @@
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = TabBar;
};
name = Debug;
};
......@@ -265,14 +267,14 @@
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_NAME = "$(TARGET_NAME)";
PRODUCT_NAME = TabBar;
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
96A5366A1CA3A5450069B3CC /* Build configuration list for PBXProject "BottomNavigationBar" */ = {
96A5366A1CA3A5450069B3CC /* Build configuration list for PBXProject "TabBar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96A5367F1CA3A5450069B3CC /* Debug */,
......@@ -281,7 +283,7 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
96A536811CA3A5450069B3CC /* Build configuration list for PBXNativeTarget "BottomNavigationBar" */ = {
96A536811CA3A5450069B3CC /* Build configuration list for PBXNativeTarget "TabBar" */ = {
isa = XCConfigurationList;
buildConfigurations = (
96A536821CA3A5450069B3CC /* Debug */,
......
......@@ -32,13 +32,13 @@ import UIKit
import Material
class ViewController: UIViewController {
/// Reference for BottomNavigationBar.
private var bottomNavigationBar: BottomNavigationBar!
/// Reference for TabBar.
private var tabBar: TabBar!
override func viewDidLoad() {
super.viewDidLoad()
prepareView()
prepareBottomNavigationBar()
prepareTabBar()
}
/// General preparation statements.
......@@ -46,12 +46,12 @@ class ViewController: UIViewController {
view.backgroundColor = MaterialColor.white
}
/// Prepare bottomNavigationBar.
private func prepareBottomNavigationBar() {
bottomNavigationBar = BottomNavigationBar()
// bottomNavigationBar.autoLayoutToSuperview // Set to false if you want to handle the layout yourself.
bottomNavigationBar.backgroundColor = MaterialColor.grey.darken4
view.addSubview(bottomNavigationBar)
/// Prepare tabBar.
private func prepareTabBar() {
tabBar = TabBar()
// tabBar.autoLayoutToSuperview // Set to false if you want to handle the layout yourself.
tabBar.backgroundColor = MaterialColor.grey.darken4
view.addSubview(tabBar)
let videoItem: UITabBarItem = UITabBarItem(title: "Video", image: MaterialIcon.videocam, selectedImage: nil)
videoItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
......@@ -64,10 +64,10 @@ class ViewController: UIViewController {
let libraryItem: UITabBarItem = UITabBarItem(title: "Library", image: MaterialIcon.photoLibrary, selectedImage: nil)
libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
bottomNavigationBar.setItems([videoItem, photoItem, libraryItem], animated: true)
bottomNavigationBar.tintColor = MaterialColor.teal.base // Sets the image color when highlighted.
bottomNavigationBar.itemPositioning = .Automatic // Sets the alignment of the UITabBarItems.
bottomNavigationBar.selectedItem = videoItem
tabBar.setItems([videoItem, photoItem, libraryItem], animated: true)
tabBar.tintColor = MaterialColor.teal.base // Sets the image color when highlighted.
tabBar.itemPositioning = .Automatic // Sets the alignment of the UITabBarItems.
tabBar.selectedItem = videoItem
}
}
......@@ -8,7 +8,7 @@
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="BottomNavigationBar" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="BYZ-38-t0r" customClass="ViewController" customModule="TabBar" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
......@@ -17,7 +17,7 @@
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tabBar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sMP-AS-Zl9" customClass="BottomNavigationBar" customModule="Material">
<tabBar contentMode="scaleToFill" translucent="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sMP-AS-Zl9" customClass="TabBar" customModule="Material">
<rect key="frame" x="0.0" y="551" width="600" height="49"/>
<items/>
<userDefinedRuntimeAttributes>
......
Pod::Spec.new do |s|
s.name = 'Material'
s.version = '1.38.1'
s.version = '1.38.2'
s.license = 'BSD'
s.summary = 'Express your creativity with Material, an animation and graphics framework for Google\'s Material Design and Apple\'s Flat UI in Swift.'
s.homepage = 'http://cosmicmind.io'
......
......@@ -29,7 +29,7 @@
960B23521C38490D00E96216 /* TextView.swift in Headers */ = {isa = PBXBuildFile; fileRef = 960B23451C38480E00E96216 /* TextView.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96162BFB1CA6E89F00E3A235 /* MaterialPulseAnimation.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96162BFC1CA6E89F00E3A235 /* NavigationItem.swift in Headers */ = {isa = PBXBuildFile; fileRef = 967887861C9775900037F6C9 /* NavigationItem.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96162BFD1CA6E89F00E3A235 /* BottomNavigationBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A536641CA3A2C80069B3CC /* BottomNavigationBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96162BFD1CA6E89F00E3A235 /* TabBar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96A536641CA3A2C80069B3CC /* TabBar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96162BFF1CA6E89F00E3A235 /* BottomNavigationController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96BAECE91CA3B8B90048037C /* BottomNavigationController.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 */; };
......@@ -64,7 +64,7 @@
968F171C1C9266D0008CA3F6 /* Toolbar.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F51C9260EC008CA3F6 /* Toolbar.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F171D1C9266D0008CA3F6 /* ToolbarController.swift in Headers */ = {isa = PBXBuildFile; fileRef = 968F16F71C92612E008CA3F6 /* ToolbarController.swift */; settings = {ATTRIBUTES = (Public, ); }; };
968F17221C94B10B008CA3F6 /* MaterialPulseAnimation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */; };
96A536651CA3A2C80069B3CC /* BottomNavigationBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A536641CA3A2C80069B3CC /* BottomNavigationBar.swift */; };
96A536651CA3A2C80069B3CC /* TabBar.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A536641CA3A2C80069B3CC /* TabBar.swift */; };
96A71E911C6FBC2200C0C4AE /* MenuView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96A71E901C6FBC2200C0C4AE /* MenuView.swift */; };
96A71EB81C6FCFA300C0C4AE /* Material+UIImage+Color.swift in Headers */ = {isa = PBXBuildFile; fileRef = 96DBA7351C61198400844821 /* Material+UIImage+Color.swift */; settings = {ATTRIBUTES = (Public, ); }; };
96A71EB91C6FCFA300C0C4AE /* Grid.swift in Headers */ = {isa = PBXBuildFile; fileRef = 9656CD0B1C6BD33700EBCEF1 /* Grid.swift */; settings = {ATTRIBUTES = (Public, ); }; };
......@@ -200,7 +200,7 @@
968F16F51C9260EC008CA3F6 /* Toolbar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Toolbar.swift; sourceTree = "<group>"; };
968F16F71C92612E008CA3F6 /* ToolbarController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ToolbarController.swift; sourceTree = "<group>"; };
968F17211C94B10B008CA3F6 /* MaterialPulseAnimation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialPulseAnimation.swift; sourceTree = "<group>"; };
96A536641CA3A2C80069B3CC /* BottomNavigationBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BottomNavigationBar.swift; sourceTree = "<group>"; };
96A536641CA3A2C80069B3CC /* TabBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = TabBar.swift; sourceTree = "<group>"; };
96A71E901C6FBC2200C0C4AE /* MenuView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MenuView.swift; sourceTree = "<group>"; };
96A71EC61C6FFF0500C0C4AE /* MaterialSwitch.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MaterialSwitch.swift; sourceTree = "<group>"; };
96A71EF51C71127100C0C4AE /* SearchBar.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchBar.swift; sourceTree = "<group>"; };
......@@ -360,7 +360,6 @@
96A536631CA3A2400069B3CC /* BottomNavigation */ = {
isa = PBXGroup;
children = (
96A536641CA3A2C80069B3CC /* BottomNavigationBar.swift */,
96BAECE91CA3B8B90048037C /* BottomNavigationController.swift */,
);
name = BottomNavigation;
......@@ -442,6 +441,7 @@
96CC08561C7E0EC00034FF84 /* ControlView */,
96D88C541C132A7700B91418 /* StatusBar */,
96F2F1B31C97A40600A5FE27 /* Toolbar */,
96FBE38C1CA9A93E001E2932 /* TabBar */,
9626C2DB1C794FBB007CA8E0 /* SearchBar */,
9626C2DA1C794FA5007CA8E0 /* NavigationBar */,
9626C2DC1C794FE5007CA8E0 /* SideNavigation */,
......@@ -606,6 +606,14 @@
name = Toolbar;
sourceTree = "<group>";
};
96FBE38C1CA9A93E001E2932 /* TabBar */ = {
isa = PBXGroup;
children = (
96A536641CA3A2C80069B3CC /* TabBar.swift */,
);
name = TabBar;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXHeadersBuildPhase section */
......@@ -683,7 +691,7 @@
968F171D1C9266D0008CA3F6 /* ToolbarController.swift in Headers */,
96162BFB1CA6E89F00E3A235 /* MaterialPulseAnimation.swift in Headers */,
96162BFC1CA6E89F00E3A235 /* NavigationItem.swift in Headers */,
96162BFD1CA6E89F00E3A235 /* BottomNavigationBar.swift in Headers */,
96162BFD1CA6E89F00E3A235 /* TabBar.swift in Headers */,
96162BFF1CA6E89F00E3A235 /* BottomNavigationController.swift in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
......@@ -847,7 +855,7 @@
96334EFA1C8B849A0083986B /* NavigationController.swift in Sources */,
96D88C301C1328D800B91418 /* MaterialEdgeInset.swift in Sources */,
96CC08A01C80CB180034FF84 /* MaterialSpacing.swift in Sources */,
96A536651CA3A2C80069B3CC /* BottomNavigationBar.swift in Sources */,
96A536651CA3A2C80069B3CC /* TabBar.swift in Sources */,
96D88C211C1328D800B91418 /* CaptureSession.swift in Sources */,
96442ADE1C28EF3700C3C574 /* MaterialTableViewCell.swift in Sources */,
960B23271C383E5500E96216 /* Material+String.swift in Sources */,
......
......@@ -130,6 +130,9 @@ public class BottomNavigationController : UITabBarController, UITabBarController
/// Handles transitions when tabBarItems are pressed.
public func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
// if 1 < tabBarController.viewControllers?.count {
// return nil
// }
return .Fade == transitionAnimation ? BottomNavigationFadeAnimatedTransitioning() : nil
}
......
......@@ -15,7 +15,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.38.1</string>
<string>1.38.2</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
......
......@@ -38,7 +38,7 @@ public extension UITabBarItem {
}
@IBDesignable
public class BottomNavigationBar : UITabBar {
public class TabBar : UITabBar {
/// Automatically aligns the BottomNavigationBar to the superview.
public var autoLayoutToSuperview: Bool = true
......
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