Should IBOutlet be weak or strong var?

4thSpace picture 4thSpace · Apr 2, 2015 · Viewed 19k times · Source

I'm using Xcode 6.2 for iOS projects. In older versions of Xcode, when a connection was create for an IBOutlet, it was always weak storage. Now when I create connections, they are defaulted to strong. I leave it that way and don't notice any difference.

Which version of Xcode did the default change to strong and why?

Answer

beryllium picture beryllium · Dec 10, 2015

Yes, previously outlets should generally be weak but Apple has changed that. Now they recommend to use strong outlets in the WWDC 2015 session Implementing UI Designs in Interface Builder. The only reason why it might be weak is retain cycle.