Top Level Namespace

Defined Under Namespace

Modules: Teacup Classes: CALayer, DummyActivityIndicatorView, DummyButton, DummyLabel, DummyLayer, DummyPickerView, DummyScrollView, DummySwitch, DummyTableColumn, DummyTableView, DummyTextField, DummyTextView, DummyView, NSView, NSViewController, NSWindow, NSWindowController, TeacupWindowController, UIView, UIViewController

Instance Method Summary collapse

Instance Method Details

#NSViewObject

| | NSView.frame |



4
5
6
# File 'lib/teacup-osx/core_extensions/teacup_handlers.rb', line 4

Teacup.handler NSView, :constraints do |target, constraints|
  target.add_uniq_constraints(constraints)
end

#UIButtonObject

| | UIButton |



148
149
150
151
152
153
154
# File 'lib/teacup-ios/core_extensions/teacup_handlers.rb', line 148

Teacup.handler UIButton, :title do |target, title|
  if title.is_a?(NSAttributedString)
    target.setAttributedTitle(title, forState: UIControlStateNormal)
  else
    target.setTitle(title.to_s, forState: UIControlStateNormal)
  end
end

#UINavigationBarObject

| | UINavigationBar |



180
181
182
183
184
185
186
187
188
189
190
191
192
193
# File 'lib/teacup-ios/core_extensions/teacup_handlers.rb', line 180

Teacup.handler UINavigationBar, :backgroundImage do |styles|
  if styles.is_a?(UIImage)
    styles = { portrait: styles }
  end

  styles.each do |metric, image|
    case metric
    when UIBarMetricsDefault, :portrait
      self.setBackgroundImage(image && image.uiimage, forBarMetrics:UIBarMetricsDefault)
    when UIBarMetricsLandscapePhone, :landscape
      self.setBackgroundImage(image && image.uiimage, forBarMetrics:UIBarMetricsLandscapePhone)
    end
  end
end

#UIViewObject

| | UIView.frame |



4
5
6
# File 'lib/teacup-ios/core_extensions/teacup_handlers.rb', line 4

Teacup.handler UIView, :constraints do |target, constraints|
  target.add_uniq_constraints(constraints)
end