swift outlet 是strong 还是 weak好?

最近用 swfit 需要一个 barbuttonitem,在 storyboard 创建后 connect 到 viewcontroller 发现,在 viewdidload 里还有值,被隐藏然后再次加载的时候为 nil。

From a practical perspective, in iOS and OS X outlets should be defined as declared properties. Outlets should generally be weak, except for those from File’s Owner to top-level objects in a nib file (or, in iOS, a storyboard scene) which should be strong. Outlets that you create should therefore typically be weak, because:

Outlets that you create to subviews of a view controller’s view or a window controller’s window, for example, are arbitrary references between objects that do not imply ownership.
The strong outlets are frequently specified by framework classes (for example, UIViewController’s view outlet, or NSWindowController’swindow outlet).

参考

ARC下IBOutlet用weak还是strong