Skip to content

Instantly share code, notes, and snippets.

@DonMag
Created May 19, 2016 15:41
Show Gist options
  • Select an option

  • Save DonMag/9a3fc77a479594f583c47ca915038f10 to your computer and use it in GitHub Desktop.

Select an option

Save DonMag/9a3fc77a479594f583c47ca915038f10 to your computer and use it in GitHub Desktop.
var v1: UIView
// this seems ok?
guard let vvv = UINib(nibName: "SampleView", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as? UIView else { return }
v1 = vvv
// but this won't compile?
guard v1 = UINib(nibName: "SampleView", bundle: nil).instantiateWithOwner(nil, options: nil)[0] as? UIView else { return }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment