birdy
birdy

Reputation: 9636

How can I implement this objC code in ruby

I am using ruby motion and want to increase the clickable area of a UIView. I found an answer for this on SO

I'm trying to find out how to do this in ruby.

Basically I want to subclass UIView and override the pointInside button.

Upvotes: 0

Views: 62

Answers (1)

Chuck
Chuck

Reputation: 237060

The direct translation of that code would be:

def pointInside(point, withEvent:event)
  margin = 5.0
  area = CGRectInset(self.bounds, -margin, -margin)
  CGRectContainsPoint(area, point)
end

Upvotes: 1

Related Questions