上から下に依存
- アプリA
- アプリB
- アプリC
それぞれレイヤー構成によって複数あり得る:
// | |
// CoreDateManager.h | |
// | |
// Created by haoyayoi on 09/12/28. | |
// Copyright 2009 haoyayoi. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
上から下に依存
それぞれレイヤー構成によって複数あり得る:
class AutoCaptureGLThing extends Component { | |
onRef = exportable => { | |
if (!exportable || this.exporting) return; | |
this.exporting = true; | |
exportable.captureFrame(/* see https://projectseptemberinc.gitbooks.io/gl-react/content/docs/api/Surface.html */) | |
.then(path => { // oops back to node callback pattern via props callback | |
this.props.onCapture(null, path); | |
}, error => { | |
this.props.onCapture(error); | |
}); |
・Cocoapods | |
AF+Image+Helper | |
ARChromeActivity | |
Aspects | |
Bolts | |
CocoaSecurity | |
Colours | |
Crashlytics | |
DACircularProgress |
#! bin/sh | |
NAME=$1 | |
input="${NAME}Inputs" | |
output="${NAME}Outputs" | |
protocol="${NAME}Type" | |
cat << EOL | |
protocol ${input} { |
// A much better version of C#-style Async/Await. It can return values! | |
import Cocoa | |
struct Await<T> { | |
// private | |
let group: dispatch_group_t | |
let getResult: () -> T | |
// public | |
func await() -> T { return getResult() } |
#!/usr/bin/env xcrun swift -F Carthage/Build/Mac | |
import Foundation | |
import Markingbird | |
protocol Streamable { | |
var title: String { get } | |
var body: String { get } | |
} |
最近AppleがProtocol Buffersの公式プラグインをGitHubに公開して話題になったので、実際に使ってみました。APIの通信が速くなったり、型安全に通信処理を書ける など、メリットが多いと感じたので簡単に紹介します。
他の事例だと、iOSオールスターズ2で発表された「これから始めるProtocol Buffers導入」が非常に参考になると思うので併せて読んでみてください。
この記事ではProtocol Buffersの概要について書いています。別途こちらの記事で使い方について サンプルを使って説明している ので、併せて読んでみてください。
So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!
Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.
But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.
// Thanks to CuriousKea for getting this started! | |
// http://stackoverflow.com/a/8480325/239380 | |
- (void)scrollRowToVisible:(NSInteger)rowIndex animate:(BOOL)animate{ | |
if(animate){ | |
NSRect rowRect = [self rectOfRow:rowIndex]; | |
NSPoint scrollOrigin = rowRect.origin; | |
NSClipView *clipView = (NSClipView *)[self superview]; | |
scrollOrigin.y += MAX(0, round((NSHeight(rowRect)-NSHeight(clipView.frame))*0.5f)); | |
NSScrollView *scrollView = (NSScrollView *)[clipView superview]; |