Here I create two views(bar and icon) and I would like to make one call to @window.addSubview to add them both.
class AppDelegate
def application(application, didFinishLaunchingWithOptions:launchOptions)
@window = UIWindow.alloc.initWithFrame UIScreen.mainScreen.bounds
@window.makeKeyAndVisible
bar = UIView.alloc.initWithFrame [[0, 0], [320, 100]]
icon= UIImageView.alloc.initWithFrame([[100,0], [100,100]])
@window.addSubview bar # I have two calls to addSubview
@window.addSubview icon
true
end
end
I would like something like this:
@window.addSubview bar, icon
or
@window.addSubview [bar,icon]
I realize the difference is nominal but it seems like there should be a way to call addSubview on several views at once.
I would say you are just begging to trip yourself and others up at a latter date by doing this, but if you must you can just reopen
UIViewand define the method yourselfThis should allow
To try it out here is a full example