import UIKit
final class UIApplication {
static let shared: UIApplication = UIApplication()
func open(_ url: URL, function: String = #function) {
print(function, "called to open:", url)
}
}
//: Hello World! Nice to meet you
class Jarek
{
let firstName = "Jarek"
let lastName = "Pendowski"
let motto = "Everything is possible."
var technologies : [String] = []
var recentJobs : [(String, String)] = []
func hello() -> String {
return "Hi! I'm \(firstName) \(lastName)."
}
"Hi! I'm Jarek Pendowski"
func picture() -> UIImage? {
guard let url = URL(string: "http://pendowski.com/img/jarek148.jpg"),
let data = try? Data(contentsOf: url) else {
return nil
}
return UIImage(data: data)
}
func email() -> String? {
if let email = URL(string: "mailto:[email protected]") {
UIApplication.shared.open(email)
return "Email me"
}
return nil
}
func twitter() -> String? {
if let twitter = URL(string: "http://twitter.com/iloveshw") {
UIApplication.shared.open(twitter)
return "@iloveshw"
}
return nil
}
func github() -> String? {
if let github = URL(string: "http://github.com/pendowski") {
UIApplication.shared.open(github)
return "@pendowski"
}
return nil
}
}
let me = Jarek()
me.technologies = [ "Swift", "Node.js", "Objective-C", ".NET" ]
me.recentJobs = [ ("410 Labs", "iOS Engineer"), ("Macoscope", "iOS / OS X Developer"), ("Apple Poland", "Trainer"), ("Novel & Microsoft", ".NET Partner") ]