This file contains hidden or 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 P1 { | |
} | |
protocol P2 { | |
typealias A = P1 // Selfでも同様 | |
} | |
let arr1: Array<P1> = [] | |
let arr2: Array<P2> = [] // Protocol 'P2' can only be used as a generic constraint because it has Self or associated type requirements |
This file contains hidden or 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
let t: AnyClass = NSObject.self | |
typealias T = t // Use of undeclared type 't' |
This file contains hidden or 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
@available(iOS 10.0, *) | |
extension MyClass {} |
This file contains hidden or 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
@available(*, unavailable, message="Hello!") | |
@available(*, unavailable, renamed="newFunc") |
This file contains hidden or 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
let param | |
let a: String = { @noescape () -> String in | |
param // self.がいらない! | |
}() |
This file contains hidden or 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
This file contains hidden or 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 | |
class Thunder { } | |
class Fire { } | |
protocol Pokemon { | |
associatedtype PokemonType | |
func attack(move:PokemonType) | |
} |
This file contains hidden or 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
mkdir tmp && \ | |
ffmpeg -i img.mov -an -r 5 tmp/%04d.png && \ | |
convert tmp/*.png -resize 40% tmp/output_%04d.png && \ | |
convert -delay 12 tmp/output_*.png img.gif && \ | |
convert -layers Optimize img.gif img.gif && \ | |
rm -rf tmp |
This file contains hidden or 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
#!/bin/sh | |
# settings | |
DEVICE_TOKEN="XXXXXX" | |
TOPIC="com.your.app.bundle.id" | |
# process | |
DATE="`date \"+%Y/%m/%d %H:%M:%S\"`" |
This file contains hidden or 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
var str: NSString = "abcdef" | |
for i in 0..<str.length { | |
print(str.substring(with: NSRange(location: i, length: 1))) | |
} |