Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: f1c3afab7d
Fetching contributors…

Cannot retrieve contributors at this time

30 lines (23 sloc) 0.835 kB
class ListViewController < UITableViewController
attr_accessor :delegate
def viewDidLoad
@links = ['http://www.rubymotion.com/', 'http://www.github.com/', 'rubymotion.com', 'google.com']
end
def shouldAutorotateToInterfaceOrientation(*)
true
end
def numberOfSectionsInTableView(tableView)
1
end
def tableView(tableView, numberOfRowsInSection:section)
@links.length
end
def tableView(tableView, cellForRowAtIndexPath:path)
cell = tableView.dequeueReusableCellWithIdentifier("cell") || UITableViewCell.alloc.initWithStyle(UITableViewCellStyleDefault, reuseIdentifier:"cell")
cell.textLabel.text = @links[path.row]
cell
end
def tableView(tableView, didSelectRowAtIndexPath:path)
@delegate.openURL(@links[path.row]) if @delegate.respond_to?'openURL'
end
end
Jump to Line
Something went wrong with that request. Please try again.