Skip to content

Instantly share code, notes, and snippets.

View iSapozhnik's full-sized avatar
🎯
Focusing

Ivan Sapozhnik iSapozhnik

🎯
Focusing
View GitHub Profile
@iSapozhnik
iSapozhnik / UIView+Nib.swift
Created June 30, 2016 18:53
[Swift] UIView loaded from Xib
protocol UIViewLoading {}
extension UIView : UIViewLoading {}
extension UIViewLoading where Self : UIView {
static func loadFromNib() -> Self {
let nibName = "\(self)".characters.split{$0 == "."}.map(String.init).last!
let bundle = NSBundle(forClass: self)
let nib = UINib(nibName: nibName, bundle: bundle)
return nib.instantiateWithOwner(self, options: nil).first as! Self
#!/bin/bash
set -e
THIS_SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd "${THIS_SCRIPT_DIR}/.."
# Check if there's something uncommitted (don't release if there are files
# not yet committed)
set +e
@iSapozhnik
iSapozhnik / UIView+Nib.swift
Last active June 29, 2016 20:42
UIView loading from Nib
//
// UIView+Nib.swift
// Pods
//
// Created by Sapozhnik Ivan on 29.06.16.
//
//
import Foundation