ios - Updating UI as the result of a request handler -


i have setup this;

startup() {     ...     self.gcdwebserver.addhandlerformethod("get", path: "/hide",          requestclass: gcdwebserverrequest.self, asyncprocessblock: {request in self.hide()})     ... }  func hide() -> gcdwebserverdataresponse {     self.view.hidden = true;     print("hide")     return gcdwebserverdataresponse(statuscode: 200) } 

when request /hide made, console shows print() call immediately, view not disappear arbitrary delay, somewhere between 10-30 seconds.

how can have request result in view being hidden?

try one, calling hidden on main thread.

dispatch_async(dispatch_get_main_queue(),{    self.view.hidden = true; }) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -