Skip to content

Instantly share code, notes, and snippets.

@edwardinubuntu
Created August 24, 2017 04:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save edwardinubuntu/a879d36a2081f90e0274ecb0bbe538a7 to your computer and use it in GitHub Desktop.
Save edwardinubuntu/a879d36a2081f90e0274ecb0bbe538a7 to your computer and use it in GitHub Desktop.
//
// View+Extension.swift
// carce-ios
//
// Created by Edward Chiang on 12/14/15.
// Copyright © 2015 Soleil Studio. All rights reserved.
//
import UIKit
extension UIView {
class func loadFromNibNamed(nibNamed: String, bundle : Bundle? = nil) -> UIView? {
return UINib(nibName: nibNamed, bundle: bundle).instantiate(withOwner: nil, options: nil)[0] as? UIView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment