Skip to content

nodahikaru/CarbonKit

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

86 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

alt tag

###CarbonKit v2.x is completely different from version 1.x. ###Version 2.x is more custimized, interacted, documented and also nullability is integrated.

CarbonKit is an OpenSource iOS library that includes powerful and beauty UI controllers. I started developing these controllers inspired by Android Material Design.

CarbonKit includes:

  • CarbonSwipeRefresh
  • CarbonTabSwipeNavigation

#Installation CarbonKit is available on CocoaPods. Add to your Podfile:

pod 'CarbonKit'

and run

pod install

CarbonSwipeRefresh

alt tag

SAMPLE CODE

#import "CarbonKit.h"

@interface ViewController ()
{
	CarbonSwipeRefresh *refresh;
}
@end

@implementation ViewController
- (void)viewDidLoad {
	[super viewDidLoad];

	refresh = [[CarbonSwipeRefresh alloc] initWithScrollView:self.tableView];
	[refresh setColors:@[
		[UIColor blueColor],
	 	[UIColor redColor],
		[UIColor orangeColor],
		[UIColor greenColor]]
	]; // default tintColor
	
	// If your ViewController extends to UIViewController
	// else see below
	[self.view addSubview:refresh];

	[refresh addTarget:self action:@selector(refresh:) forControlEvents:UIControlEventValueChanged];
}

- (void)refresh:(id)sender {
	[refresh endRefreshing];
}
@end

If you are using UITableViewController you must add the refreshControl into self.view.superview after viewDidApper

- (void)viewDidAppear:(BOOL)animated {
	[super viewDidAppear:animated];
	
	if (!refreshControl.superview) {
		[self.view.superview addSubview:refreshControl];
	}
}

CarbonTabSwipeNavigation

alt tag

SAMPLE CODE

#import "CarbonKit.h"

@interface ViewController () <CarbonTabSwipeDelegate>
@end

@implementation ViewController

- (void)viewDidLoad {
	[super viewDidLoad];

	NSArray *items = @[[UIImage imageNamed:@"home"], [UIImage imageNamed:@"hourglass"],
	[UIImage imageNamed:@"premium_badge"], @"Categories", @"Top Free",
	@"Top New Free", @"Top Paid", @"Top New Paid"];
	
	CarbonTabSwipeNavigation *carbonTabSwipeNavigation = 
	[[CarbonTabSwipeNavigation alloc] initWithItems:items rootViewController:self];
	
	[carbonTabSwipeNavigation setDelegate:self];
}

// delegate
- (UIViewController *)carbonTabSwipeNavigation:(CarbonTabSwipeNavigation *)carbontTabSwipeNavigation
			 viewControllerAtIndex:(NSUInteger)index {
	// return viewController at index
}

@end

Swift Sample

class ViewController: UIViewController, CarbonTabSwipeNavigationDelegate {
    
    // MARK: Override methods
    override func viewDidLoad() {
        super.viewDidLoad()
        let items = ["Features", "Products", "About"]
        let carbonTabSwipeNavigation = CarbonTabSwipeNavigation.init(items: items, rootViewController: self)
        carbonTabSwipeNavigation.delegate = self
    }
    
    func carbonTabSwipeNavigation(carbonTabSwipeNavigation: CarbonTabSwipeNavigation, viewControllerAtIndex index: UInt) -> UIViewController {
        // return viewController at index
    }
}

LICENSE

The MIT License (MIT)

About

CarbonKit - iOS Components

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Objective-C 90.1%
  • Ruby 9.9%