class UIView

Teacup's UIView extensions defines some utility functions for UIView that enable a lot of the magic for Teacup::Layout.

Users of teacup should be able to ignore the contents of this file for the most part.

Public Instance Methods

style(properties) click to toggle source
Calls superclass method Teacup::View#style
# File lib/teacup-ios/core_extensions/ui_view.rb, line 19
def style(properties)
  super

  self.setNeedsDisplay
  self.setNeedsLayout
end
teacup_animation(options) { || ... } click to toggle source
# File lib/teacup-ios/core_extensions/ui_view.rb, line 10
def teacup_animation(options)
  UIView.beginAnimations(nil, context: nil)
  UIView.setAnimationDuration(options[:duration]) if options.key?(:duration)
  UIView.setAnimationCurve(options[:curve]) if options.key?(:curve)
  UIView.setAnimationDelay(options[:delay]) if options.key?(:delay)
  yield
  UIView.commitAnimations
end
top_level_view() click to toggle source
# File lib/teacup-ios/core_extensions/ui_view.rb, line 26
def top_level_view
  self
end