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
let someNumber = 150 | |
switch someNumber { | |
case 0...50: | |
print("Number is between 0 & 50") | |
case 51...100: | |
print("Number is between 51 & 100") | |
case 101...150: | |
print("Number is between 101 & 150") | |
default: |
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
func parseJSON () { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
let task = URLSession.shared.dataTask(with: url!) {(data, response, error ) in | |
guard error == nil else { | |
print("returned error") | |
return | |
} | |
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
import UIKit | |
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view, typically from a nib. | |
} | |
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
func parseJSON () { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
} |
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
func parseJSON () { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
let task = URLSession.shared.dataTask(with: url!) {(data, response, error ) in | |
} | |
} |
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
func parseJSON () { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
let task = URLSession.shared.dataTask(with: url!) {(data, response, error ) in | |
guard error == nil else { | |
print("returned error") | |
return | |
} | |
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
func parseJSON () { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
let task = URLSession.shared.dataTask(with: url!) {(data, response, error ) in | |
guard error == nil else { | |
print("returned error") | |
return | |
} |
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
import UIKit | |
class ViewController: UIViewController { | |
var tableArray = [String] () | |
... |
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
if let array = json["companies"] as? [String] { | |
self.tableArray = array | |
} | |
print(self.tableArray) |
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
func parseJSON() { | |
let url = URL(string: "https://api.myjson.com/bins/vi56v") | |
let task = URLSession.shared.dataTask(with: url!) {(data, response, error) in | |
guard error == nil else { | |
print("returning error") | |
return | |
} |