Advertisement
Guest User

Untitled

a guest
Oct 5th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. protocol ConnectionServerProtocol {
  2.  
  3. func connectWithUsernameAndPassword(username: String, password: String)
  4. }
  5.  
  6. var username: String?
  7. var password: String?
  8. let connectionServerProtocol: ConnectionServerProtocol
  9.  
  10. public init(connectionServerProtocol: ConnectionServerProtocol) {
  11. self.connectionServerProtocol = connectionServerProtocol
  12. }
  13.  
  14. public func connectWithUsernameAndPassword(username: String, password: String) {
  15.  
  16. self.username = username
  17. self.password = MD5(password)
  18. self.connectionServerProtocol.dataTask()
  19. }
  20.  
  21. let cs = ConnectionServer()
  22.  
  23. let cs = ConnectionServer(connectionServerProtocol:ConnectionServerProtocol)
  24.  
  25. let cs = ConnectionServer(connectionServerProtocol: ConnectionServerProtocol.self as! ConnectionServerProtocol)
  26.  
  27. let cs = ConnectionServer.self
  28. cs.connectWithUsernameAndPassword(username: SomeUserName", password:"SomePassword")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement