title: iOS RubyMotion Promotion Webscreen Freeze
body: <p>I am getting a freeze in my app(which is a ruby motion IOS app) on a drop down click inside a web screen.</p>
  
  <pre><code>def thing
   open_modal WebScreen.new(
    name: "Thing",
    url: testURL,
    nav_bar: true,
    modal: true,
    transition_style: UIModalTransitionStyleFlipHorizontal)
  end
  </code></pre>
  
  <p>app gets frozen on something like this.  The user here clicks the SelectCategory button and now can't do anything. <a href="http://i.stack.imgur.com/FpZQ3.png" rel="nofollow">http://i.stack.imgur.com/FpZQ3.png</a> <br></p>
  
  <p>My console outputs this:<br>
  Mar 11 14:59:33: CoreAnimation: timed out fence c413<br>
  Mar 11 14:59:33: CoreAnimation: updates deferred for too long</p>
  
  <p>Here is my web screen class:</p>
  
  <pre><code>class WebScreen &lt; PM::WebScreen
    # status_bar :none
    attr_accessor :url, :name, :id, :thing, :loading
  
   def on_init
    self.loading = 0
    nav_bar
  end
  
  def on_load
    # find.screen.webview.scalesPageToFit = true
    self.title = @name? @name.upcase : "Thing"
    @notifier = Motion::Blitz
  end
  
  def content
   NSURL.URLWithString(@url)
  end
  
  def load_started
    if self.loading &lt;= 1
     @notifier.loading
     self.loading += 1
    end
  end
  
  def load_finished
    @notifier.dismiss
  end
  
  def load_failed(error)
   # Optional
   # "error" is an instance of NSError
  end
  
  def shut_screen
   @notifier.dismiss
   close({ no_load: true, id: self.id })
  end
  
  def nav_bar
    unless self.coupon
     icon = FIEntypoIcon.chevronThinLeftIcon
     icon_image = icon.imageWithBounds([[0, 0], [20, 20]], color:     UIColor.whiteColor)
    set_nav_bar_button :left, image: icon_image, action: :shut_screen
    else
     set_nav_bar_button :left, title: "Done", style: :plain, action: :close_coupon
    end
  end
  
   def close_coupon
  rmq.app.alert(title: *, message: "Thing will disappear. Please make sure      you've used the thing before closing.", actions: :yes_no_cancel, style: :sheet) do |action_type|
    case action_type
    when :yes
      shut_screen
    when :no
      puts "FINE!"
    end
  end
  end
  
  def back
   find.screen.close to_screen: :root
  end
  end
  </code></pre>
  
  <p>Any info is greatly appreciated.</p>