Skip to content

Instantly share code, notes, and snippets.

// Example of a better API for UIActionSheet
- (void)showActionSheet {
ECActionSheet *actionSheet = [[ECActionSheet alloc] initWithTitle:@"Title" cancelButtonTitle:@"Cancel"];
// set a destructive button if needed
[actionSheet addDestructiveButtonWithTitle:@"Destructive Button" target:self action:@selector(destructiveButtonPressed)];
// add buttons with target/action
[actionSheet addButtonWithTitle:@"Button One" target:self action:@selector(buttonOnePressed)];
Factory.define :post do |post_factory|
post_factory.user { Factory.build(:user) }
end