Skip to content

Latest commit

 

History

History
70 lines (49 loc) · 1.81 KB

README.md

File metadata and controls

70 lines (49 loc) · 1.81 KB

SwiftXib

An easy Xib loader:

platform pod swift Carthage compatible

Installation

CocoaPods

You can use CocoaPods to install SwiftXib by adding it to your Podfile:

platform :ios, '8.0'
pod 'SwiftXib'

Carthage

SwiftXib is carthage compatible. Add the following entry in your Cartfile:

github "kuyu12/SwiftXib"

Then run carthage update.

In your application, simply import the library

import SwiftXib

Support Xibs:

  • UIView xib
  • UITableView xib

How to use:

  1. Create your Xib view.
  2. Create you Xib class and extend SwiftXibView class.
  3. Override nibName and set you xib view name.
  4. Connect Xib File's Owner to your class.

Example

This example will simply load xib view with SwiftXibView

Class MyCustomView : SwiftXibView {

  // override nibName and return your nib name. ('nibName.xib)
  override var nibName: String {return "nibName"}
  
  // setUI is call immediately after the view setUp.
  override func setUI() { 
    // initialized your view
  }
}

alt text

For more info check ours Wiki.

Contributors

License

Distributed under the MIT license. See LICENSE for more information.