Summary text.
Hello World, how is it going?
// For https://twitter.com/nicklockwood/status/819938181483233285 | |
protocol Withable { | |
init() | |
} | |
extension Withable { | |
func with(_ body: (inout Self) -> ()) -> Self { | |
var copy = self | |
body(©) |
a: AM/PM | |
A: 0~86399999 (Millisecond of Day) | |
c/cc: 1~7 (Day of Week) | |
ccc: Sun/Mon/Tue/Wed/Thu/Fri/Sat | |
cccc: Sunday/Monday/Tuesday/Wednesday/Thursday/Friday/Saturday | |
d: 1~31 (0 padded Day of Month) | |
D: 1~366 (0 padded Day of Year) | |
import AppKit | |
public extension NSBezierPath { | |
public var CGPath: CGPath { | |
let path = CGMutablePath() | |
var points = [CGPoint](repeating: .zero, count: 3) | |
for i in 0 ..< self.elementCount { | |
let type = self.element(at: i, associatedPoints: &points) | |
switch type { |
Hello World, how is it going?
import Cocoa | |
public extension NSDateComponents { | |
public convenience init(_ components: DictionaryLiteral<NSCalendarUnit, Int>) { | |
self.init() | |
for (key, value) in components { | |
setValue(value, forComponent: key) | |
} | |
} | |
} |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="10117" systemVersion="15E65" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS"> | |
<dependencies> | |
<deployment identifier="macosx"/> | |
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="10117"/> | |
<capability name="stacking Non-gravity area distributions on NSStackView" minToolsVersion="7.0" minSystemVersion="10.11"/> | |
</dependencies> | |
<scenes> | |
<!--Application--> | |
<scene sceneID="JPo-4y-FX3"> |
#if os(iOS) | |
import UIKit | |
#else | |
import AppKit | |
#endif | |
let view = UIView(frame: CGRectMake(0, 0, 400, 300)) | |
view.backgroundColor = UIColor.redColor() | |
let button = UIButton(type: .Custom) |
#import <Foundation/Foundation.h> | |
@interface Subject: NSObject | |
@property double a; | |
@property long b; | |
@property NSObject* c; | |
@property NSObject* d; | |
@property NSObject* e; | |
@property NSObject* f; |
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc"> | |
<dependencies> | |
<deployment identifier="iOS"/> | |
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/> | |
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/> | |
</dependencies> | |
<scenes> | |
<!--View Controller--> | |
<scene sceneID="ufC-wZ-h7g"> |
import UIKit | |
class FloatingButtonController: UIViewController { | |
private(set) var button: UIButton! | |
required init?(coder aDecoder: NSCoder) { | |
fatalError() | |
} |