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
| // | |
| // UIFont+DahDit.m | |
| // DahDit | |
| // | |
| // Created by Erik Andersson on 2011-07-28. | |
| // Copyright 2011 Åva gymnasium. All rights reserved. | |
| // | |
| #import "UIFont+DahDit.h" |
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
| class SmartBoat: SmartVehicle, RoadDrivable, WaterDrivable { | |
| func driveOnRoad() { | |
| print("Vroom!") | |
| } | |
| func driveOnWater() { | |
| print("I can run over water, because I can! B-)") | |
| } | |
| } |
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
| class SuperSmartCar: SmartCar { | |
| func driveOnWater() { | |
| print("I can run over water, because I can! B-)") | |
| } | |
| } |
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 Flyable { | |
| func flyOnAir() | |
| } | |
| class SmartFlyingCar: SmartCar, Flyable { | |
| func flyOnAir() { | |
| print("Wohoo! I am flying high!") | |
| } | |
| } |
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 RoadDrivable { | |
| func driveOnRoad() | |
| } | |
| protocol WaterDrivable { | |
| func driveOnWater() | |
| } | |
| protocol Flyable { | |
| func flyOnAir() |
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
| class SmartCar { | |
| func driveOnRoad() { | |
| print("Vroom!") | |
| } | |
| func talk() { | |
| print("Hi! I am the smart talking car!") | |
| } | |
| } |
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
| @implementation Singleton | |
| + (instancetype)sharedInstance { | |
| static Singleton *sharedInstance = nil; | |
| static dispatch_once_t onceToken; | |
| dispatch_once(&onceToken, ^{ | |
| sharedInstance = [[Singleton alloc] init]; | |
| }); | |
| return sharedInstance; |
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
| class Singleton { | |
| static let sharedInstance = Singleton() | |
| private init() { | |
| // do stuff | |
| } | |
| } |
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
| class User { | |
| var name = "" | |
| var age = 0 | |
| } | |
| class EditUserInfoController { | |
| var user: User | |
| init (user: User) { | |
| self.user = user |
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
| enum OrderSize { | |
| case small | |
| case medium | |
| case large | |
| } | |
| enum SpiceRange { | |
| case spicy | |
| case hot | |
| case extraHot |
OlderNewer