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
source 'https://github.com/CocoaPods/Specs.git' | |
target 'YOUR_APPLICATION_TARGET_NAME_HERE' do | |
pod 'GoogleMaps' | |
pod 'GooglePlaces' | |
end |
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
+ (UIFont *)systemFontOfSize:(CGFloat)fontSize; |
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
- (void)test | |
{ | |
NSArray *anArray = @[@"a", @"b", @"c"]; | |
NSDictionary *aDictionary = @{@"key1": @"val1", | |
@"key2": @"val2", | |
@"key3": @"val3"}; | |
// for loop | |
for (int i = 0; i < anArray.count; i++) |
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
+ (NSString *)relativeDateStringFromDate:(NSDate *)date | |
{ | |
NSInteger sec = (int)[[NSDate date] timeIntervalSinceDate:date]; | |
if (sec < 60) { | |
return @"たった今"; | |
} | |
else if (sec < 120) { | |
return @"1分前"; | |
} |
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 - UIScrollView delegate | |
- (void)scrollViewDidScroll:(UIScrollView *)scrollView | |
{ | |
if (scrollView.contentOffset.y < 0 || scrollView.contentOffset.y > scrollView.contentSize.height - kYCBScreenHeight) { | |
return; | |
} | |
// スクロールによってヘッダを出したり隠したり | |
if (lastContentOffset_ > scrollView.contentOffset.y) |
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
import UIKit | |
import MapKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
var mapRect: CGRect = CGRect(x:0, y:0, | |
width:self.view.frame.size.width, height:self.view.frame.size.height) |
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 buildQueryString(fromDictionary parameters: [String: String]) -> String { | |
var urlVars = [String]() | |
for (key, var val) in parameters { | |
val = val.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! | |
urlVars += [key + "=" + "\(val)"] | |
} | |
return (!urlVars.isEmpty ? "?" : "") + join("&", urlVars) | |
} |
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 func buildQueryString(fromDictionary parameters: [String: String]) -> String { | |
var urlVars = [String]() | |
for (key, var val) in parameters { | |
val = val.stringByAddingPercentEncodingWithAllowedCharacters(NSCharacterSet.URLQueryAllowedCharacterSet())! | |
urlVars += [key + "=" + "\(val)"] | |
} | |
return (!urlVars.isEmpty ? "?" : "") + join("&", urlVars) | |
} |
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
import Realm | |
class Book : RLMObject { | |
dynamic var isbn = "" | |
dynamic var name = "" | |
dynamic var price = 0 | |
} |
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
import UIKit | |
import RxSwift | |
import RxCocoa | |
class ViewController: UIViewController { | |
@IBOutlet weak var tableView: UITableView! | |
var viewModel = ViewModel() | |
var dataSource = DataSource() |
OlderNewer