Skip to content

Instantly share code, notes, and snippets.

@regnerjr
Created November 1, 2014 14:03
Show Gist options
  • Select an option

  • Save regnerjr/b665c856c381cb52c85b to your computer and use it in GitHub Desktop.

Select an option

Save regnerjr/b665c856c381cb52c85b to your computer and use it in GitHub Desktop.
//
// ViewController.swift
// error-view
//
// Created by John Regner on 11/1/14.
// Copyright (c) 2014 In Your Dreams Software. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
ErrorView.errorInView(self.view, animted: true)
}
}
class ErrorView: UIView {
class func errorInView(view:UIView, animted:Bool) -> ErrorView {
println("ERROR VIEW LOADED")
//let errorView = ErrorView(frame: view.bounds)
//var errorView = ErrorView(frame: view.bounds)
let errorView = NSBundle.mainBundle().loadNibNamed("ErrorView", owner: self, options: nil)[0] as ErrorView
//errorView.backgroundColor = UIColor.purpleColor()
errorView.opaque = false
view.addSubview(errorView)
return errorView
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment