Esqarrouth / EZLoadingActivity

:hatching_chick: Lightweight Swift loading activity for iOS7+
MIT License
607 stars 82 forks source link

EZLoadingActivity: You don't have an activity Instance? #13

Closed jgebbeken closed 8 years ago

jgebbeken commented 8 years ago

I'm getting an EZLoadingActivity: You don't have an activity Instance problem when trying to call up EZLoadingActivity.hide(success: false, animated: true)

thellimist commented 8 years ago

EZLoadingActivity.show should be called first then EZLoadingActivity.hide should be called.

If you didn't create the instance first it will warn (the instance is created when EZLoadingActivity.show is called)

    public static func hide(success success: Bool? = nil, animated: Bool = false) -> Bool {
        guard instance != nil else {
            print("EZLoadingActivity: You don't have an activity instance")
            return false
        }
       ...
    }
Esqarrouth commented 8 years ago

Its not a problem when that prints, meaning you won't get bugs or crashes. But you probably wrote your code incorrectly and might consider changing it.