Giter Site home page Giter Site logo

nibloaderkit's Introduction

NibLoaderKit

Build Status codecov Language Carthage compatible CocoaPods Compatible Platform License

This is a tiny utility to load UIView/NSView from nibs.

Usage

1. Declare CustomView class

class CustomView: UIView { }

2. Place CustomView.xib

  • xib must contains just one top level view.

3. Set custom class

  • Set custom class of the top level view to CustomView.

4. Load from the code

let customView: CustomView = try! CustomView.view(with: self)

CustomView.xib will be loaded and generate the view.

Nib names are guessed automatically by class name. they would be demodulized.

You can also pass the nibName and bundle.

let customView: UIView = try! UIView.view(
    from: "MyCustomView", 
    owner: self, 
    bundle: Bundle(forClass: self.dynamicType)
)

Installation

Carthage

github "giginet/NibLoaderKit"

CocoaPods

use_frameworks!

pod 'NibLoaderKit'

Requirements

  • = iOS 8

  • = macOS 10.10

  • = tvOS 9

  • Swift 4.1
  • Xcode 9.4

LICENSE

MIT License

nibloaderkit's People

Contributors

giginet avatar morishin avatar

Stargazers

Yasin ATEŞ avatar Isao Kono avatar Fumiya Tanaka avatar Dor avatar  avatar Tula avatar Li Haozhen avatar Carabineiro avatar Akihiro Orikasa avatar Yuji Fujisaka avatar Seyhun Akyürek avatar Leo Tumwattana avatar Salam Horani avatar Yusuke Miyazaki avatar  avatar

Watchers

 avatar James Cloos avatar Carabineiro 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.