I've moved this gist to https://github.com/phynet/iOS-Schemes please check it there ;)
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
struct StructWithTwoObjects { | |
let object: String | |
/* | |
var object: A { // Stupid, but causes compilation error - OK! | |
return self | |
} | |
*/ | |
} | |
// --------------------- |
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 | |
public protocol Observer: Equatable { | |
associatedtype EventType | |
func listen(_ event: EventType) | |
} | |
public protocol Observable { | |
associatedtype ObserverType: Observer | |
associatedtype EventType |
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 | |
extension UILabel { | |
func setText(text: String, withKerning kerning: Double) { | |
self.attributedText = NSAttributedString(string: text, attributes: kerningAttribute(kerning)) | |
} | |
func setText(text: String, withLineSpacing lineSpacing: CGFloat) { | |
self.attributedText = NSAttributedString(string: text, attributes: lineSpacingAttribute(lineSpacing)) |