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 AVFoundation | |
final class ViewController: UIViewController { | |
@IBOutlet weak var captureView: UIView? | |
private lazy var captureSession: AVCaptureSession = AVCaptureSession() | |
private lazy var captureDevice: AVCaptureDevice = AVCaptureDevice.defaultDeviceWithMediaType(AVMediaTypeVideo) | |
private lazy var capturePreviewLayer: AVCaptureVideoPreviewLayer = { |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
import Himotoki | |
var str = "Hello, playground" | |
struct Person: Decodable { | |
let name: String |
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
## Himotoki | |
## source: https://github.com/ikesyo/Himotoki | |
github "ikesyo/Himotoki" ~> 1.3 | |
## Alamofire | |
## source: https://github.com/Alamofire/Alamofire | |
github "Alamofire/Alamofire" ~> 3.0 | |
## BrightFutures | |
## source https://github.com/Thomvis/BrightFutures |
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
class Cat: Equatable { | |
let name: String | |
init(name: String) { | |
self.name = name | |
} | |
} | |
// これを実装します | |
func ==(lhs: Cat, rhs: Cat) -> Bool { |
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
% pod search MDCSwipeToChoose | |
-> MDCSwipeToChoose (0.2.3) | |
Swipe to "like" or "dislike" any view, just like Tinder.app. Build a | |
flashcard app, a photo viewer, and more, in minutes, not hours! | |
pod 'MDCSwipeToChoose', '~> 0.2.3' | |
- Homepage: https://github.com/modocache/MDCSwipeToChoose | |
- Source: https://github.com/modocache/MDCSwipeToChoose.git | |
- Versions: 0.2.3, 0.2.2, 0.2.1, 0.2.0, 0.1.0 [master repo] |
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 Foundation | |
import CoreData | |
class Person: NSManagedObject { | |
// Insert code here to add functionality to your managed object subclass | |
} |
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
/// maxの値のkey | |
NSString *expressionName = @"maxWeight"; | |
/// お決まりのやつ | |
/// 生成方法は各自でお任せです | |
NSManagedObjectContext *context = [CoreData sharedInstance].managedObjectContext; | |
/// fetch requestの生成 | |
NSFetchRequest *fetchRequest = [NSFetchRequest new]; |
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 <Foundation/Foundation.h> | |
@interface Util : NSObject | |
/** | |
* デバイスのOSバージョンが指定したバージョン以上かどうかを確認してBOOLで返す | |
* @param majorVersion メジャーバージョン | |
* @param minorVersion マイナーバージョン | |
* @param patchVersion バッジバージョン | |
* @return BOOL 引数で渡したOSバージョン以上だった場合,YES それより下の場合はNO |
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 APIResult<T: ModelType> { | |
var model: Optional(T.ModelType) = nil | |
init(response: AnyObject!) { | |
self.model = T.toModel(response: response) | |
} |
NewerOlder