Git Product home page Git Product logo

dckit's Introduction

DCKit

Version Build Status License Platform

DCKit is a set of @IBDesignable iOS controls (UIButtons, UITextFields etc.), which have useful @IBInspectable properties. They allows you to build a nice screens, see a result directly on Xcode Interface Builder.

Written on Swift.

Preview

DCKit preview

Installation

Cocoapods

CocoaPods recommended to use DCKit.

  1. Add pod record to your Podfile:
  • Swift 3: pod 'DCKit', :git => 'https://github.com/agordeev/DCKit.git'
  • Swift 2.3: pod 'DCKit', :git => 'https://github.com/agordeev/DCKit.git', :branch => 'swift23'
  • Swift 2.2 and below: pod 'DCKit', '<= 1.0.4'
  1. Add use_frameworks! keyword to your Podfile. The library is written on Swift, so this is a mandatory.
  2. Install the pod(s) by running pod install.

Source files

  1. Download the latest code version or add the repository as a git submodule to your git-tracked project.
  2. Drag and drop the Classes directory from the archive in your project navigator. Make sure to select Copy items when asked if you extracted the code archive outside of your project.

How to use

  1. Add a control (e.g. UIButton) onto storyboard: Add a control (e.g. UIButton) onto storyboard
  2. Change the button's class to DCBorderedButton. Also change module to DCKit if you've installed the library via CocoaPods. You'll notice a border appeared around the button: Change the button's class to DCBorderedButton
  3. Now you're able to customize the button from IB directly: Now you're able to customize the button from IB directly

Please download the latest code version and run DCKitSample.xcodeproj to test out all the features it offers.

Documentation

Basically, all of the classes are pretty straightforward and don't worth describing. Most of them you can see in the demo project.

I'll describe a few of them here though.

DCHairlineView

Very useful control, I widely use it in my projects as a separator between views.

DCMandatoryTextField

Base text field for all the mandatory text fields. Highlights the text field if the entered value is false.

By default it considers the empty value as invalid. You can override this behaviour by subclassing this class and overriding isValid method.

DCMandatoryEmailTextField

This field is also checks if the entered value is a valid email address. It uses a regexp taken from here: http://stackoverflow.com/questions/5428304/email-validation-on-textfield-in-iphone-sdk

Requirements

  • Xcode 6 or above
  • iOS 8 or above
  • Swift 2.0 and above

Author

Andrey Gordeev

License

This project is under MIT license. For more information, see LICENSE file.

dckit's People

Contributors

agordeev avatar bryant1410 avatar

Watchers

James Cloos avatar  avatar

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.