mirror of
				https://github.com/KevinMidboe/linguist.git
				synced 2025-10-29 17:50:22 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			21 lines
		
	
	
		
			552 B
		
	
	
	
		
			Swift
		
	
	
	
	
	
			
		
		
	
	
			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
 |