Sha256: aac48b26d05e69a22279f8986fae7792dc753ff452334e2be6ef195b0722ff12
Contents?: true
Size: 718 Bytes
Versions: 5
Compression:
Stored size: 718 Bytes
Contents
module Elevate module HTTP class ActivityIndicator def self.instance Dispatch.once { @instance = new } @instance end def initialize @lock = NSLock.alloc.init @count = 0 end def hide toggled = false @lock.lock @count -= 1 if @count > 0 toggled = @count == 0 @lock.unlock update_indicator(false) if toggled end def show toggled = false @lock.lock toggled = @count == 0 @count += 1 @lock.unlock update_indicator(true) if toggled end private def update_indicator(visible) UIApplication.sharedApplication.networkActivityIndicatorVisible = visible end end end end
Version data entries
5 entries across 5 versions & 1 rubygems