GitXplorerGitXplorer
g

NibLoaderKit

public
15 stars
5 forks
0 issues

Commits

List of commits on branch master.
Verified
3b182078ca70023d612964a7adf8f0984fc32332

Fix README

ggiginet committed 7 years ago
Verified
029876ddf75360fe2de14c656907bc6bb84aa37e

Merge pull request #7 from giginet/swift4

ggiginet committed 7 years ago
Unverified
ca06914634fc29bd14e01e046ea9c4fa0a372a2d

Use class method instead of static method

ggiginet committed 7 years ago
Unverified
acde3bb88ec684ebd86c0d527fc05389a26d6519

Update README

ggiginet committed 7 years ago
Unverified
ded3ab9098779454a4f1c14eecbe37e93988e9fb

Update CocoaPods

ggiginet committed 7 years ago
Unverified
92bb6d5c515fe291f861e0cae4bf577475486126

Update swift version

ggiginet committed 7 years ago

README

The README file for this repository.

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