うまくいったのがあったら追記していきます。
storyboardの末尾のほうにある以下の様な部分のお話ですね。
<inferredMetricsTieBreakers>
<segue reference="YUa-1a-iG8"/>
<segue reference="nKl-EP-JoK"/>
/* | |
Distributed under The MIT License: | |
http://opensource.org/licenses/mit-license.php | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the | |
"Software"), to deal in the Software without restriction, including | |
without limitation the rights to use, copy, modify, merge, publish, | |
distribute, sublicense, and/or sell copies of the Software, and to |
// simple fragment shader | |
// 'time' contains seconds since the program was linked. | |
uniform float time; | |
uniform sampler2D tex; | |
uniform sampler2D tex2; | |
float radius = .5; |
.h | |
@interface TabViewController : UITabBarController | |
.m | |
- (id)initWithCoder:(NSCoder *)aDecoder | |
{ | |
self = [super initWithCoder:aDecoder]; | |
if (self) { |
# Thanks to commenters for providing the base of this much nicer implementation! | |
# Save and run with $ python 0dedict.py | |
# You may need to hunt down the dictionary files yourself and change the awful path string below. | |
# This works for me on MacOS 10.14 Mohave | |
from struct import unpack | |
from zlib import decompress | |
import re | |
filename = '/System/Library/Assets/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/9f5862030e8f00af171924ebbc23ebfd6e91af78.asset/AssetData/Oxford Dictionary of English.dictionary/Contents/Resources/Body.data' | |
f = open(filename, 'rb') |
on run {input, parameters} | |
set logPath to "Dropbox/Dictionary/words.txt" | |
set lookUpWord to quoted form of (input as string) | |
tell application "System Events" to tell (process 1 where frontmost is true) | |
set windowTitle to name | |
try | |
set windowTitle to windowTitle | |
set titleBar to name of window 1 | |
end try |
public extension MKMultiPoint { | |
var coordinates: [CLLocationCoordinate2D] { | |
var coords = [CLLocationCoordinate2D](repeating: kCLLocationCoordinate2DInvalid, | |
count: pointCount) | |
getCoordinates(&coords, range: NSRange(location: 0, length: pointCount)) | |
return coords | |
} | |
} |
import Foundation | |
extension String { | |
subscript(index: Int) -> Character { | |
return self[self.index(self.startIndex, offsetBy: index)] | |
} | |
} | |
extension String { | |
public func levenshtein(_ other: String) -> Int { |
Modern Cocoa development involves a lot of asynchronous programming using closures and completion handlers, but these APIs are hard to use. This gets particularly problematic when many asynchronous operations are used, error handling is required, or control flow between asynchronous calls gets complicated. This proposal describes a language extension to make this a lot more natural and less error prone.
This paper introduces a first class Coroutine model to Swift. Functions can opt into to being async, allowing the programmer to compose complex logic involving asynchronous operations, leaving the compiler in charge of producing the necessary closures and state machines to implement that logic.