OAuth2App icon indicating copy to clipboard operation
OAuth2App copied to clipboard

IBOutlet improvement

Open pascalfribi opened this issue 7 years ago • 1 comments
trafficstars

Hi,

I am thinking of adding your OAuth2 to my app so I was doing a little code reading. Just wanted to give you a little feedback on IBOutlets.

The normal style to use IBOutlet in swift code, as also adviced by Apple is to have them as weak vars and with an implicit unwrapped optional.

So instead of writing: @IBOutlet var pasteButton: NSButton?

You should do: @IBOutlet weak var pasteButton: NSButton!

You know that they will be connected after loading the view, so you can be safe to implicitly unwrap them. This makes the code a little easier.

BTW: did you grow up in Zurich or did you just spend some time there?

pascalfribi avatar Oct 18 '18 13:10 pascalfribi

Yes, that would be better indeed! And while I'm Swiss I'm not originally from Zurich, I worked there for a while.

p2 avatar Oct 22 '18 09:10 p2