Commit c52f057b by Daniel Dahan

updated example TabBar projects

parent b2810a19
......@@ -13,8 +13,6 @@
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 */
......@@ -24,7 +22,6 @@
dstPath = "";
dstSubfolderSpec = 10;
files = (
96FBE3AA1CA9AD02001E2932 /* Material.framework in Embed Frameworks */,
);
name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0;
......@@ -40,7 +37,6 @@
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 */
......@@ -48,7 +44,6 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
96FBE3A91CA9AD02001E2932 /* Material.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -58,7 +53,6 @@
96162C221CA7064900E3A235 = {
isa = PBXGroup;
children = (
96FBE3A81CA9AD01001E2932 /* Material.framework */,
96162C2D1CA7064900E3A235 /* BottomNavigationController */,
96162C2C1CA7064900E3A235 /* Products */,
);
......
......@@ -35,15 +35,13 @@ import Material
class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegate {
var window: UIWindow?
var bottomNavigationController: BottomNavigationController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
bottomNavigationController = BottomNavigationController()
bottomNavigationController!.selectedIndex = 0
bottomNavigationController!.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController!.tabBar.backgroundColor = MaterialColor.grey.darken4
bottomNavigationController!.delegate = self
let bottomNavigationController: BottomNavigationController = BottomNavigationController()
bottomNavigationController.viewControllers = [VideoViewController(), PhotoViewController(), LibraryViewController()]
bottomNavigationController.selectedIndex = 0
bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
// Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds)
......@@ -68,8 +66,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat
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) {
......
......@@ -10,7 +10,6 @@
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 */
......@@ -136,7 +135,6 @@
files = (
96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */,
96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */,
96FBE3971CA9AB46001E2932 /* Info.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -253,9 +251,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar;
};
name = Debug;
......@@ -264,9 +262,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar;
};
name = Release;
......
......@@ -11,7 +11,6 @@
96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39B1CA9ABAF001E2932 /* Assets.xcassets */; };
96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39C1CA9ABAF001E2932 /* LaunchScreen.storyboard */; };
96FBE3A51CA9ABAF001E2932 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39E1CA9ABAF001E2932 /* Main.storyboard */; };
96FBE3A61CA9ABAF001E2932 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE3A01CA9ABAF001E2932 /* Info.plist */; };
96FBE3A71CA9ABAF001E2932 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE3A11CA9ABAF001E2932 /* ViewController.swift */; };
/* End PBXBuildFile section */
......@@ -137,7 +136,6 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
96FBE3A61CA9ABAF001E2932 /* Info.plist in Resources */,
96FBE3A51CA9ABAF001E2932 /* Main.storyboard in Resources */,
96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */,
96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */,
......@@ -265,9 +263,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar;
};
name = Debug;
......@@ -276,9 +274,9 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist;
INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar;
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar;
};
name = Release;
......
......@@ -35,7 +35,7 @@
</constraints>
</view>
<connections>
<outlet property="bottomNavigationBar" destination="sMP-AS-Zl9" id="sTP-Ix-Cds"/>
<outlet property="tabBar" destination="sMP-AS-Zl9" id="zaC-4Z-zf1"/>
</connections>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......
......@@ -33,7 +33,7 @@ import Material
class ViewController: UIViewController {
@IBOutlet weak var bottomNavigationBar: BottomNavigationBar!
@IBOutlet weak var tabBar: TabBar!
override func viewDidLoad() {
super.viewDidLoad()
......@@ -49,10 +49,10 @@ class ViewController: UIViewController {
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
}
}
......
......@@ -130,9 +130,6 @@ 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
}
......
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