SEQUE seu MBProgressHUD no RubyMotion
Uso:
HUD.wrap(@myView, proc do
sleep 20
end, proc do
App.alert("Done loading!")
end)
Dependências:
– MBProgressHUD (duh)
– BubbleWrap :: Reactor
Instalação:
1. Crie um arquivo lib
chamado hud.rb
2. Adicione app.files.unshift(*Dir['lib/*.rb'])
ao seuRakefile
class HUD
def self.wrap(view, operation, callback)
MBProgressHUD.showHUDAddedTo(view, animated:true)
BW::Reactor.defer(operation, proc do
MBProgressHUD.hideHUDForView(view, animated:true)
callback.call
end)
end
end