A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
| import UIKit | |
| class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource { | |
| @IBOutlet weak var tableView: UITableView! | |
| override func viewDidLoad() { | |
| super.viewDidLoad() | |
| NSLayoutConstraint.activate([ | |
| tableView.topAnchor.constraint(equalTo: view.topAnchor), |
A list of presenters at the Brooklyn Swift Developers Meetup with links to videos, slides and source code: http://www.meetup.com/Brooklyn-Swift-Developers
Taiki Suzuki - Flux & MVVM (Video)
Harlan Kellaway - Should Code Always be DRY? (Video)
| extension Array { | |
| func first() -> Element? { | |
| if isEmpty { | |
| return nil | |
| } | |
| return self[0] | |
| } | |
| func last() -> Element? { |
| - (NSString *)tableView:(UITableView *)tableView titleForSwipeAccessoryButtonForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| return @"More"; | |
| } | |
| - (void)tableView:(UITableView *)tableView swipeAccessoryButtonPushedForRowAtIndexPath:(NSIndexPath *)indexPath { | |
| NSLog(@"I wanted to be a pretty public API, but then time ran out and they forgot me..."); | |
| // Hide the More/Delete menu. | |
| [self setEditing:NO animated:YES]; | |
| } |
Greetings, NSHipsters!
As we prepare to increment our NSDateComponents -year by 1, it's time once again for NSHipster end-of-the-year Reader Submissions! Last year, we got some mind-blowing tips and tricks. With the release of iOS 7 & Mavericks, and a year's worth of new developments in the Objective-C ecosystem, there should be a ton of new stuff to write up for this year.
Submit your favorite piece of Objective-C trivia, framework arcana, hidden Xcode feature, or anything else you think is cool, and you could have it featured in the year-end blowout article. Just comment on this gist below!
Here are a few examples of the kind of things I'd like to see:
NSStringFromSelector(@selector()) as a safer way to do KVC / KVO / NSCoding.| #import <UIKit/UIKit.h> | |
| #import <ImageIO/ImageIO.h> | |
| #import <MobileCoreServices/MobileCoreServices.h> | |
| static UIImage *frameImage(CGSize size, CGFloat radians) { | |
| UIGraphicsBeginImageContextWithOptions(size, YES, 1); { | |
| [[UIColor whiteColor] setFill]; | |
| UIRectFill(CGRectInfinite); | |
| CGContextRef gc = UIGraphicsGetCurrentContext(); | |
| CGContextTranslateCTM(gc, size.width / 2, size.height / 2); |