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
echo Process pods | |
if [ ! -e /usr/bin/pod ] ; then | |
echo Installing cocoapods... | |
gem install cocoapods | |
fi | |
pod update |
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
// | |
// Badge.swift | |
// Extensions for Rounded UILabel and UIButton, Badged UIBarButtonItem. | |
// | |
// Usage: | |
// let label = UILabel(badgeText: "Rounded Label"); | |
// let button = UIButton(type: .System); button.rounded = true | |
// let barButton = UIBarButtonItem(badge: "42", title: "How Many Roads", target: self, action: "answer") | |
// | |
// Created by Yonat Sharon on 06.04.2015. |
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
extension NSURL { | |
func queryParams() -> Dictionary<String, String> { | |
var params = Dictionary<String, String>() | |
if let queryParams = self.query?.componentsSeparatedByString("&") { | |
for param in queryParams { | |
var parts = param.componentsSeparatedByString("=") | |
params[parts[0]] = parts[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
// | |
// AppInfo.swift | |
// This is an Util to get app infos like build / version number etc | |
// Swift 3.0 | |
// Xcode 8.0 | |
// | |
import Foundation | |
import AVFoundation |
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
self.navigationItem.leftBarButtonItem = | |
UIBarButtonItem(image:UIImage(named:"chevron_left"), style:.Plain, target:self, action:"backButtonPressed:"); | |
self.navigationController!.interactivePopGestureRecognizer!.delegate = self; |
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 | |
class BaseViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
let backTitle = NSLocalizedString("Back", comment: "Back button label") | |
self.addBackbutton(backTitle) |
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
protocol JSONInitable { | |
init(data: JSON) | |
} | |
extension JSON { | |
func to<T where T: JSONInitable>(type: T.Type) -> [T] { | |
return self.arrayValue.map { | |
return T(data: $0) | |
} | |
} |
OlderNewer