Release 0.1.0
This commit is contained in:
1 parent
fae05a1709
commit
c8bd9b7435
230 files changed
+17003
-15
No files matched your search
Whitespace-only changes.
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// TabBarItem.h
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "TabBarSubItem.h"
|
||||
|
||||
@interface TabBarItem : NSObject
|
||||
|
||||
/**
|
||||
* Represents the image visible in picker when item is not selected.
|
||||
*/
|
||||
@property (nonatomic, strong) UIImage *image;
|
||||
/**
|
||||
* Represents the image visible in picker when item is selected.
|
||||
*/
|
||||
@property (nonatomic, strong) UIImage *selectedImage;
|
||||
/**
|
||||
* Represents the name of the item that can be shown in picker.
|
||||
*/
|
||||
@property (nonatomic, strong) NSString *itemName;
|
||||
/**
|
||||
* Represents the sub items that appeare when you select the item in picker.
|
||||
*/
|
||||
@property (nonatomic, strong) NSMutableArray *subItems;
|
||||
|
||||
/**
|
||||
* <#Description#>
|
||||
*
|
||||
* @param array <#array description#>
|
||||
*
|
||||
* @return <#return value description#>
|
||||
*/
|
||||
- (instancetype) initWithSubItems:(NSArray*) array;
|
||||
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// TabBarItem.m
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "TabBarItem.h"
|
||||
|
||||
@implementation TabBarItem
|
||||
|
||||
- (instancetype) initWithSubItems:(NSArray*) array {
|
||||
self = [super init];
|
||||
|
||||
if (self) {
|
||||
NSAssert(array, @"SubItemsArray cannot be nil");
|
||||
|
||||
|
||||
_subItems = [[NSMutableArray alloc] init];
|
||||
|
||||
for (NSObject *subItem in array) {
|
||||
if ([subItem isKindOfClass:[TabBarSubItem class]]) {
|
||||
[_subItems addObject:subItem];
|
||||
}
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,41 @@
|
||||
//
|
||||
// TabBarPicker.h
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import "TabbarItem.h"
|
||||
#import "TabBarSubItem.h"
|
||||
|
||||
typedef enum
|
||||
{
|
||||
// Informational
|
||||
TabBarPickerPositionLeft,
|
||||
TabBarPickerPositionRight,
|
||||
TabBarPickerPositionBottom
|
||||
|
||||
} TabBarPickerPosition;
|
||||
|
||||
@interface TabBarPicker : UIView
|
||||
|
||||
|
||||
|
||||
@property (nonatomic, strong) NSMutableArray *tabBarItems;
|
||||
@property (nonatomic) CGFloat maxHeight;
|
||||
@property (nonatomic) CGFloat maxWidth;
|
||||
@property (nonatomic) TabBarPickerPosition position;
|
||||
|
||||
/**
|
||||
* Init TabBarPicker with items. When is selected an item the picher show down subitems.
|
||||
* By default when one of more subItems are selected the selected item become selected.
|
||||
*
|
||||
* @param items Represents tab bar items. That array cannot be nil.
|
||||
*
|
||||
* @return raturn instance of TabBarPicker object.
|
||||
*/
|
||||
- (instancetype) initWithTabBarItems:(NSArray*) items withSize:(CGSize) size forPosition:(TabBarPickerPosition) position;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,31 @@
|
||||
//
|
||||
// TabBarPicker.m
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "TabBarPicker.h"
|
||||
|
||||
@implementation TabBarPicker
|
||||
|
||||
- (instancetype) initWithTabBarItems:(NSArray*) items withSize:(CGSize) size forPosition:(TabBarPickerPosition) position {
|
||||
|
||||
self = [super init];
|
||||
if (self) {
|
||||
|
||||
NSAssert(items, @"TabBar Items array cannot be nil!");
|
||||
|
||||
_tabBarItems = [[NSMutableArray alloc] init];
|
||||
|
||||
for (NSObject *item in items) {
|
||||
if ([item isKindOfClass:[TabBarItem class]]) {
|
||||
[_tabBarItems addObject:item];
|
||||
}
|
||||
}
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,17 @@
|
||||
//
|
||||
// TabBarSubItem.h
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
@interface TabBarSubItem : NSObject
|
||||
|
||||
@property (nonatomic, strong) NSString *name;
|
||||
|
||||
+ (instancetype) tabBarSubItemWithName:(NSString*)name;
|
||||
|
||||
@end
|
||||
@@ -0,0 +1,28 @@
|
||||
//
|
||||
// TabBarSubItem.m
|
||||
// Pods
|
||||
//
|
||||
// Created by Giuseppe Nucifora on 15/07/15.
|
||||
//
|
||||
//
|
||||
|
||||
#import "TabBarSubItem.h"
|
||||
|
||||
@implementation TabBarSubItem
|
||||
|
||||
|
||||
- (instancetype) initWithName:(NSString *) name {
|
||||
|
||||
self = [super init];
|
||||
|
||||
if (self) {
|
||||
_name = name;
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (instancetype) tabBarSubItemWithName:(NSString*)name {
|
||||
return [[self alloc] initWithName:name];
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user