This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIColor+RandomColor.h | |
// ViewImage | |
// | |
// Created by hechen on 15/4/8. | |
// Copyright (c) 2015年 hechen. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// UIView+Image.h | |
// ViewImage | |
// | |
// Created by hechen on 15/4/8. | |
// Copyright (c) 2015年 hechen. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# view #> = ({ | |
UIView *v = [[UIView alloc] init]; | |
<# ... #> | |
v; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UITableViewDataSource | |
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { | |
return <#number#>; | |
} | |
- (NSInteger)tableView:(UITableView *)tableView | |
numberOfRowsInSection:(NSInteger)section { | |
return <#number#>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UITableViewDelegate | |
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { | |
<#statements#> | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - NSCoding | |
- (instancetype)initWithCoder:(NSCoder *)decoder { | |
self = [super init]; | |
if (!self) { | |
return nil; | |
} | |
<# implementation #> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma mark - UIViewController | |
- (void)viewDidLoad { | |
[super viewDidLoad]; | |
} | |
- (void)viewWillAppear:(BOOL)animated { | |
[super viewWillAppear:animated]; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+ (instancetype)shared<#name#> { | |
static <#class#> *_shared<#name#> = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_shared<#name#> = <#initializer#>; | |
}); | |
return _shared<#name#>; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func numberOfSectionsInTableView(tableView: UITableView) -> Int { | |
return <#count#> | |
} | |
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int { | |
return <#count#> | |
} | |
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { | |
<#code#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private struct AssociatedKeys { | |
static var <#name#> = "<#name#>" | |
} | |
var <#name#>: String? { | |
get { | |
return objc_getAssociatedObject(self, &AssociatedKeys.<#name#>) as? String | |
} | |
set { |
OlderNewer