When I\'m declaring variables as weak in Swift, I sometimes get the error message from Xcode:
weak
\'weak\' may only be applied to class and
weak only works for reference type, so Xcode would report an error if you are calling from struct (instead of class).
struct
class