Commit c52f057b by Daniel Dahan

updated example TabBar projects

parent b2810a19
...@@ -13,8 +13,6 @@ ...@@ -13,8 +13,6 @@
96162C391CA7064900E3A235 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96162C371CA7064900E3A235 /* LaunchScreen.storyboard */; }; 96162C391CA7064900E3A235 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96162C371CA7064900E3A235 /* LaunchScreen.storyboard */; };
96162C451CA7083000E3A235 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C441CA7083000E3A235 /* PhotoViewController.swift */; }; 96162C451CA7083000E3A235 /* PhotoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C441CA7083000E3A235 /* PhotoViewController.swift */; };
96162C471CA708B000E3A235 /* LibraryViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96162C461CA708B000E3A235 /* LibraryViewController.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 */ /* End PBXBuildFile section */
/* Begin PBXCopyFilesBuildPhase section */ /* Begin PBXCopyFilesBuildPhase section */
...@@ -24,7 +22,6 @@ ...@@ -24,7 +22,6 @@
dstPath = ""; dstPath = "";
dstSubfolderSpec = 10; dstSubfolderSpec = 10;
files = ( files = (
96FBE3AA1CA9AD02001E2932 /* Material.framework in Embed Frameworks */,
); );
name = "Embed Frameworks"; name = "Embed Frameworks";
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
...@@ -40,7 +37,6 @@ ...@@ -40,7 +37,6 @@
96162C3A1CA7064900E3A235 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; 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>"; }; 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>"; }; 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 */ /* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */ /* Begin PBXFrameworksBuildPhase section */
...@@ -48,7 +44,6 @@ ...@@ -48,7 +44,6 @@
isa = PBXFrameworksBuildPhase; isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96FBE3A91CA9AD02001E2932 /* Material.framework in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -58,7 +53,6 @@ ...@@ -58,7 +53,6 @@
96162C221CA7064900E3A235 = { 96162C221CA7064900E3A235 = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
96FBE3A81CA9AD01001E2932 /* Material.framework */,
96162C2D1CA7064900E3A235 /* BottomNavigationController */, 96162C2D1CA7064900E3A235 /* BottomNavigationController */,
96162C2C1CA7064900E3A235 /* Products */, 96162C2C1CA7064900E3A235 /* Products */,
); );
......
...@@ -35,15 +35,13 @@ import Material ...@@ -35,15 +35,13 @@ import Material
class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegate { class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegate {
var window: UIWindow? var window: UIWindow?
var bottomNavigationController: BottomNavigationController?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool { func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
bottomNavigationController = BottomNavigationController() let bottomNavigationController: BottomNavigationController = BottomNavigationController()
bottomNavigationController!.selectedIndex = 0 bottomNavigationController.viewControllers = [VideoViewController(), PhotoViewController(), LibraryViewController()]
bottomNavigationController!.tabBar.tintColor = MaterialColor.teal.base bottomNavigationController.selectedIndex = 0
bottomNavigationController!.tabBar.backgroundColor = MaterialColor.grey.darken4 bottomNavigationController.tabBar.tintColor = MaterialColor.teal.base
bottomNavigationController.tabBar.backgroundColor = MaterialColor.grey.darken4
bottomNavigationController!.delegate = self
// Override point for customization after application launch. // Override point for customization after application launch.
window = UIWindow(frame: UIScreen.mainScreen().bounds) window = UIWindow(frame: UIScreen.mainScreen().bounds)
...@@ -68,8 +66,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat ...@@ -68,8 +66,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UITabBarControllerDelegat
func applicationDidBecomeActive(application: UIApplication) { 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. // 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) { func applicationWillTerminate(application: UIApplication) {
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
96FBE3941CA9AB46001E2932 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE38E1CA9AB46001E2932 /* AppDelegate.swift */; }; 96FBE3941CA9AB46001E2932 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE38E1CA9AB46001E2932 /* AppDelegate.swift */; };
96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE38F1CA9AB46001E2932 /* Assets.xcassets */; }; 96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE38F1CA9AB46001E2932 /* Assets.xcassets */; };
96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE3901CA9AB46001E2932 /* LaunchScreen.storyboard */; }; 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 */; }; 96FBE3981CA9AB46001E2932 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE3931CA9AB46001E2932 /* ViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -136,7 +135,6 @@ ...@@ -136,7 +135,6 @@
files = ( files = (
96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */, 96FBE3951CA9AB46001E2932 /* Assets.xcassets in Resources */,
96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */, 96FBE3961CA9AB46001E2932 /* LaunchScreen.storyboard in Resources */,
96FBE3971CA9AB46001E2932 /* Info.plist in Resources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -253,9 +251,9 @@ ...@@ -253,9 +251,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar; PRODUCT_NAME = TabBar;
}; };
name = Debug; name = Debug;
...@@ -264,9 +262,9 @@ ...@@ -264,9 +262,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar; PRODUCT_NAME = TabBar;
}; };
name = Release; name = Release;
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39B1CA9ABAF001E2932 /* Assets.xcassets */; }; 96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39B1CA9ABAF001E2932 /* Assets.xcassets */; };
96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39C1CA9ABAF001E2932 /* LaunchScreen.storyboard */; }; 96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39C1CA9ABAF001E2932 /* LaunchScreen.storyboard */; };
96FBE3A51CA9ABAF001E2932 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 96FBE39E1CA9ABAF001E2932 /* Main.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 */; }; 96FBE3A71CA9ABAF001E2932 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 96FBE3A11CA9ABAF001E2932 /* ViewController.swift */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -137,7 +136,6 @@ ...@@ -137,7 +136,6 @@
isa = PBXResourcesBuildPhase; isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
96FBE3A61CA9ABAF001E2932 /* Info.plist in Resources */,
96FBE3A51CA9ABAF001E2932 /* Main.storyboard in Resources */, 96FBE3A51CA9ABAF001E2932 /* Main.storyboard in Resources */,
96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */, 96FBE3A31CA9ABAF001E2932 /* Assets.xcassets in Resources */,
96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */, 96FBE3A41CA9ABAF001E2932 /* LaunchScreen.storyboard in Resources */,
...@@ -265,9 +263,9 @@ ...@@ -265,9 +263,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar; PRODUCT_NAME = TabBar;
}; };
name = Debug; name = Debug;
...@@ -276,9 +274,9 @@ ...@@ -276,9 +274,9 @@
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
INFOPLIST_FILE = BottomNavigationBar/Info.plist; INFOPLIST_FILE = "$(SRCROOT)/TabBar/Info.plist";
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.BottomNavigationBar; PRODUCT_BUNDLE_IDENTIFIER = io.cosmicmind.TabBar;
PRODUCT_NAME = TabBar; PRODUCT_NAME = TabBar;
}; };
name = Release; name = Release;
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
</constraints> </constraints>
</view> </view>
<connections> <connections>
<outlet property="bottomNavigationBar" destination="sMP-AS-Zl9" id="sTP-Ix-Cds"/> <outlet property="tabBar" destination="sMP-AS-Zl9" id="zaC-4Z-zf1"/>
</connections> </connections>
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
......
...@@ -33,7 +33,7 @@ import Material ...@@ -33,7 +33,7 @@ import Material
class ViewController: UIViewController { class ViewController: UIViewController {
@IBOutlet weak var bottomNavigationBar: BottomNavigationBar! @IBOutlet weak var tabBar: TabBar!
override func viewDidLoad() { override func viewDidLoad() {
super.viewDidLoad() super.viewDidLoad()
...@@ -49,10 +49,10 @@ class ViewController: UIViewController { ...@@ -49,10 +49,10 @@ class ViewController: UIViewController {
libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal) libraryItem.setTitleColor(MaterialColor.grey.base, forState: .Normal)
libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected) libraryItem.setTitleColor(MaterialColor.teal.base, forState: .Selected)
bottomNavigationBar.setItems([videoItem, photoItem, libraryItem], animated: true) tabBar.setItems([videoItem, photoItem, libraryItem], animated: true)
bottomNavigationBar.tintColor = MaterialColor.teal.base // Sets the image color when highlighted. tabBar.tintColor = MaterialColor.teal.base // Sets the image color when highlighted.
bottomNavigationBar.itemPositioning = .Automatic // Sets the alignment of the UITabBarItems. tabBar.itemPositioning = .Automatic // Sets the alignment of the UITabBarItems.
bottomNavigationBar.selectedItem = videoItem tabBar.selectedItem = videoItem
} }
} }
......
...@@ -130,9 +130,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController ...@@ -130,9 +130,6 @@ public class BottomNavigationController : UITabBarController, UITabBarController
/// Handles transitions when tabBarItems are pressed. /// Handles transitions when tabBarItems are pressed.
public func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? { public func tabBarController(tabBarController: UITabBarController, animationControllerForTransitionFromViewController fromVC: UIViewController, toViewController toVC: UIViewController) -> UIViewControllerAnimatedTransitioning? {
// if 1 < tabBarController.viewControllers?.count {
// return nil
// }
return .Fade == transitionAnimation ? BottomNavigationFadeAnimatedTransitioning() : 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