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 | |
extension String { | |
func firstCharacterUpperCase() -> String { | |
if let firstCharacter = characters.first, characters.count > 0 { | |
return replacingCharacters(in: startIndex ..< index(after: startIndex), with: String(firstCharacter).uppercased()) | |
} | |
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 UIKit | |
// the protocol | |
protocol LayerManagerDelegate: class { | |
func doSomething() | |
} | |
// the class | |
class LayerManager { | |