TestsTested | ✗ |
LangLanguage | Obj-CObjective C |
License | MIT |
ReleasedLast Release | Dec 2014 |
Maintained by Brandon McQuilkin.
M13InfiniteTabBar is an elegant replacement for UITabBar. UITabBar becomes a problem when you have more than five view controllers that have the need to be accessed an equal amount of times. It maskes no sense to hide any of the tabs away under the "More" tab, as it takes two extra clicks to reach those view controllers. M13InfiniteTabBar solves this problem by having all the view controllers on a single level. The "extra" view controllers can be reached by scrolling the tab bar left or right. The scrolling does pose a problem though, in which direction is my offscreen tab? M13InfiniteTabBar solves this by putting the tabs in an infinite scrolling loop. Any tab can be reached by scrolling in any direction. M13InfiniteTabBar also has a few other features that UITabBar doesn't offer on top of that.
Tap To Change Tabs
Infinite Scrolling
Delegate Methods (Preventing tab selection)
Directing User Attention
Rotation
Pinned To Top
M13InfiniteTabBarController handles the rotation of all child view controllers. M13InfiniteTabBarController itself is locked to portrait orientation. It changes the frame, bounds, and angle of the child view controllers manually. It checks the values of the child view controller's "supportedInterfaceOrientations" before rotation. Unlike UITabBarController, rotation for each child UIViewController is handled individually. If one of five child controllers requires portrait orientation while the rest can use any, the other four are not locked to portrait only. Even if the portrait view controller is selected in landscape orientation, it will display in portrait.
UIViewController *vc1 = [[UIViewController alloc] init];
UIViewController *vc2 = [[UIViewController alloc] init];
UIViewController *vc3 = [[UIViewController alloc] init];
UIViewController *vc4 = [[UIViewController alloc] init];
UIViewController *vc5 = [[UIViewController alloc] init];
M13InfiteTabBarItem *item1 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]];
M13InfiteTabBarItem *item2 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]];
M13InfiteTabBarItem *item3 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]];
M13InfiteTabBarItem *item4 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]];
M13InfiteTabBarItem *item5 = [[M13InfiniteTabBarItem alloc] initWithTitle:@"Title" selectedIconMask:[UIImage imageNamed:@"image.png"] unselectedIconMask:[UIImage imageNamed:@"image.png"]];
M13InfiniteTabBarController *viewController = [[M13InfiniteTabBarController alloc] initWithViewControllers:@[vc1, vc2, vc3, vc4, vc5] pairedWithInfiniteTabBarItems:@[item1, item2, item3, item4, item5]];
Customize any of the other attributes of M13InfiniteTabBar after it has been initalized.
To be able to direct the user's attention, set the requires user attention background view. This feature is separated to allow easy subclassing and custom designs.
viewController.requiresAttentionBackgroundView = [[PulsingRequiresAttentionView alloc] init];
These features will eventually be added to M13InfiniteTabBar:
If you have any questions comments or suggestions, send me a message. If you find a bug, or want to submit a pull request, let me know.
MIT License
Copyright (c) 2014 Brandon McQuilkin
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to
the following conditions:The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.