Giter Club home page Giter Club logo

uinibview's Introduction

NibView

[![CI Status](http://img.shields.io/travis/Chase Holland/NibView.svg?style=flat)](https://travis-ci.org/Chase Holland/NibView) Version License Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

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

pod "NibView"

About

This is a super simple pod for those times when you want to create a UIView from a nib (.xib), but you're tired of typing all the extra code to do the automatic loading when you add your custom nib-based view to another view or view controller.

I chose to hijack the "UI" name prefix because there isn't anything called UINibView, and I don't expect a similar class from Apple in the future. If it does become a thing, you don't need this pod anymore! Also, "UINibView" was what I expected it to be named when I used it, so I went with it.

Usage

All you need to do (after installing the pod) is

  1. Create a subclass of UINibView
  2. Create a Resource->"View" from Apple's new file templates and name it the exact same thing as your subclass

ie. If your subclass is called MyView, your nib would be named MyView, too. So you'd have MyView.h, MyView.m, and MyView.xib.

  1. Set the class type in the xib file to your view's name (ie MyView).
  2. Drag a UIView from the templates into the view you want your custom view in.
  3. Set the class type of the view in the storyboard / other nib for your custom class
  4. Build / Run
  5. ???
  6. Profit

See the example file for more details, or feel free to open an issue or send me an email for further clarifications!

Author

Chase Holland, [email protected]

License

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

uinibview's People

Contributors

chaseholland avatar

Watchers

 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.