Giter VIP home page Giter VIP logo

dlr-uikit-ios's Introduction

DLRUIKit

CI Status Version License Platform

Installation

DLRUIKit is available through CocoaPods. To install it, simply add the following line to your Podfile:

pod "DLRUIKit"

Author

Nathan Walczak, [email protected]

License

DLRUIKit is available under the MIT license. See the LICENSE file for more info.

Examples

UIButton Category Examples

Normal State Highlighted State Disabled State
UIButton normal UIButton highlighted UIButton disabled
UIButton dlr_setBackgroundColor: forState:
[self.veryNiceButton dlr_setBackgroundColor:[UIColor brownColor] forState:UIControlStateNormal];
[self.veryNiceButton dlr_setBackgroundColor:[UIColor blueColor] forState:UIControlStateHighlighted];
[self.veryNiceButton dlr_setBackgroundColor:[UIColor lightGrayColor] forState:UIControlStateDisabled];
UIView dlr_applyRoundedCornersWithRadius:
[self.veryNiceButton dlr_applyRoundedCornersWithRadius:18.0f];

UIColor Category Examples

UIColor

UIColor dlr_colorWithRed: green: blue:
self.navyBlueView.backgroundColor = [UIColor dlr_colorWithRed:25 green:116 blue:210];
self.outrageousOrangeView.backgroundColor = [UIColor dlr_colorWithRed:255 green:110 blue:74];
self.purpleHeartView.backgroundColor = [UIColor dlr_colorWithRed:116 green:66 blue:200];
self.tumbleweedView.backgroundColor = [UIColor dlr_colorWithRed:222 green:170 blue:136];

self.unmellowYellowView.backgroundColor = [UIColor dlr_colorWithRed:255 green:255 blue:102 alpha:0.6f];
UIView dlr_applyRoundedCornersWithRadius:
[self.navyBlueView dlr_applyRoundedCornersWithRadius:18.0f];
[self.outrageousOrangeView dlr_applyRoundedCornersWithRadius:18.0f];
[self.purpleHeartView dlr_applyRoundedCornersWithRadius:18.0f];
[self.tumbleweedView dlr_applyRoundedCornersWithRadius:18.0f];

[self.unmellowYellowView dlr_applyRoundedCornersWithRadius:18.0f];

UIViewController+DLRParentViewController Category Examples

Screen Shot Storyboard
DLRParentViewController DLRParentViewController storyboard
UIViewController dlr_instantiateViewController
ChildViewController *childViewController = [ChildViewController dlr_instantiateViewController];
UIViewController dlr_addToParentViewController:
[childViewController dlr_addToParentViewController:self parentView:self.containerView];
UIView dlr_applyRoundedCornersWithRadius:
[self.containerView dlr_applyRoundedCornersWithRadius:18.0f];

UIViewController+DLRStoryboardManager Category Examples

Create one category for each storyboard.

#import "DLRStoryboardManager+Main.h"

#import "ChildViewController.h"

static NSString * const kStoryboardName = @"Main"; // Main.storyboard

@implementation DLRStoryboardManager (Main)

+ (void)load {
  [self registerStoryboardName:kStoryboardName
      withStoryboardIdentifier:NSStringFromClass([ChildViewController class])];
}

@end

These categories can be generated.

bin/DLRStoryboardManager.sh DLRUIKitExampleApp/Main.storyboard

Lets instantiate a child view controller.

ChildViewController *childViewController = [ChildViewController dlr_instantiateViewController];

UIDevice Category Examples

User Interface Idiom
/** Returns true if current device has an idiom of pad. */
+ (BOOL)dlr_isUserInterfaceIdiomPad;
System Version
/** Returns true if the curent device system version is equal to version. */
+ (BOOL)dlr_isSystemVersionEqualToVersion:(NSString *)version;

/** Returns true if the curent device system version is greater than version. */
+ (BOOL)dlr_isSystemVersionGreaterThanVersion:(NSString *)version;

/** Returns true if the curent device system version is greater than or equal to version. */
+ (BOOL)dlr_isSystemVersionGreaterThanOrEqualToVersion:(NSString *)version;

/** Returns true if the curent device system version is less than version. */
+ (BOOL)dlr_isSystemVersionLessThanVersion:(NSString *)version;

/** Returns true if the curent device system version is less than or equal to version. */
+ (BOOL)dlr_isSystemVersionLessThanOrEqualToVersion:(NSString *)version;

DLRLayoutConstraint Examples

/** Resets the constant back to the initial value after awake from nib. */
- (void)dlr_applyInitialConstant;
@property (weak, nonatomic) IBOutlet DLRLayoutConstraint *layoutConstraint;

// initial value of layoutConstraint.constant is 50

layoutConstraint.constant = -10;

// resets layoutConstraint.constant back to 50
[layoutConstraint dlr_applyInitialConstant];

UINavigationController+DLR Category Examples

/** Returns true if the passed view controller is the first view controller in the
 stack of view controllers.  This can be helpful in determining if the
 view controller needed to be popped or dismissed. */
- (BOOL)dlr_isFirstViewController:(UIViewController *)viewController;

UIViewController+DLRNavigationController Category Examples

/** Returns a new navigation controller instance with this view controller as the
 root view controller. */
- (UINavigationController *)dlr_embedInsideNavigationController;

UIViewController+DLRPresentedViewController Category Examples

/** Returns the top most presented view controller, which could be this view controller. */
- (UIViewController *)dlr_topPresentedViewController;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.