{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
{ super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources that can be recreated. } }
like a RecyclerView, but for grids ▸ UICollectionViewDataSource is the protocol that owns the data protocol is the equivalent of an interface protocol extensions as Kotlin extensions
like a RecyclerView, but for grids ▸ UICollectionViewDataSource is the protocol that owns the data ▸ UICollectionViewDelegate is the protocol that owns the interaction protocol is the equivalent of an interface protocol extensions as Kotlin extensions
like a RecyclerView, but for grids ▸ UICollectionViewDataSource is the protocol that owns the data ▸ UICollectionViewDelegate is the protocol that owns the interaction ▸ UICollectionViewCell is the UI representation of a single item protocol is the equivalent of an interface protocol extensions as Kotlin extensions
-> [Song] { var songs = [Song]() songs.append(Song(orderNumber: 1, name: "Another day of sun", artist: "La La Land Cast", isFavorite: true, lyrics: """ I think about that day I left him at a Greyhound station West of Santa Fé """)) return songs } }
-> [Song] { var songs = [Song]() songs.append(Song(orderNumber: 1, name: "Another day of sun", artist: "La La Land Cast", isFavorite: true, lyrics: """ I think about that day I left him at a Greyhound station West of Santa Fé """)) return songs } }
-> [Song] { var songs = [Song]() songs.append(Song(orderNumber: 1, name: "Another day of sun", artist: "La La Land Cast", isFavorite: true, lyrics: """ I think about that day I left him at a Greyhound station West of Santa Fé """)) return songs } }
-> [Song] { var songs = [Song]() songs.append(Song(orderNumber: 1, name: "Another day of sun", artist: "La La Land Cast", isFavorite: true, lyrics: """ I think about that day I left him at a Greyhound station West of Santa Fé """)) return songs } }
URLSession seems to be the current preferred option. Built in. ▸ Alamofire is an easy to use, but heavy, framework ▸ ... but hey, nothing like Retrofit
URLSession seems to be the current preferred option. Built in. ▸ Alamofire is an easy to use, but heavy, framework ▸ ... but hey, nothing like Retrofit ▸ ... and let's not even talk about Moshi or Gson...
task = URLSession.shared.dataTask(with: url!) { (data, response, error) in if let data = data { do { let jsonSerialized = try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any] if let json = jsonSerialized, let name = json["name"], let artist = json["artist"] { print(url) print(explanation) } } catch let error as NSError { print(error.localizedDescription) } } else if let error = error { print(error.localizedDescription) } } task.resume()
task = URLSession.shared.dataTask(with: url!) { (data, response, error) in if let data = data { do { let jsonSerialized = try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any] if let json = jsonSerialized, let name = json["name"], let artist = json["artist"] { print(url) print(explanation) } } catch let error as NSError { print(error.localizedDescription) } } else if let error = error { print(error.localizedDescription) } } task.resume()
task = URLSession.shared.dataTask(with: url!) { (data, response, error) in if let data = data { do { let jsonSerialized = try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any] if let json = jsonSerialized, let name = json["name"], let artist = json["artist"] { print(url) print(explanation) } } catch let error as NSError { print(error.localizedDescription) } } else if let error = error { print(error.localizedDescription) } } task.resume()
task = URLSession.shared.dataTask(with: url!) { (data, response, error) in if let data = data { do { let jsonSerialized = try JSONSerialization.jsonObject(with: data, options: []) as? [String : Any] if let json = jsonSerialized, let name = json["name"], let artist = json["artist"] { print(url) print(explanation) } } catch let error as NSError { print(error.localizedDescription) } } else if let error = error { print(error.localizedDescription) } } task.resume()