Sha256: 36cf7b62e88c33d92343f7748ff5e89be8ad2e9ee6c15aabc5d0ab453d8406cd

Contents?: true

Size: 752 Bytes

Versions: 28

Compression:

Stored size: 752 Bytes

Contents

# 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.
class UIView
  include Teacup::Layout
  include Teacup::View

  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

  def style(properties)
    super

    self.setNeedsDisplay
    self.setNeedsLayout
  end

  def top_level_view
    self
  end

end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
teacup-3.0.1 lib/teacup-ios/core_extensions/ui_view.rb
teacup-3.0.0 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.3.0 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.2.2 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.2.0 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.16 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.15 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.14 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.13 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.12 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.11 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.10 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.9 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.8 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.7 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.6 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.5 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.4 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.3 lib/teacup-ios/core_extensions/ui_view.rb
teacup-2.1.2 lib/teacup-ios/core_extensions/ui_view.rb