Files
linguist/samples/Swift/section-77.swift
Andy Lindeman 8f251e6756 Adds basic support for the Swift programming language
Text only lexer for now until Pygments catches up
2014-06-02 15:54:05 -04:00

21 lines
552 B
Swift

class SimpleClass: ExampleProtocol {
var simpleDescription: String = "A very simple class."
var anotherProperty: Int = 69105
func adjust() {
simpleDescription += " Now 100% adjusted."
}
}
var a = SimpleClass()
a.adjust()
let aDescription = a.simpleDescription
struct SimpleStructure: ExampleProtocol {
var simpleDescription: String = "A simple structure"
mutating func adjust() {
simpleDescription += " (adjusted)"
}
}
var b = SimpleStructure()
b.adjust()
let bDescription = b.simpleDescription