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
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. | |
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene. | |
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). | |
guard let windowScene = (scene as? UIWindowScene) else { return } | |
window = UIWindow(frame: windowScene.coordinateSpace.bounds) | |
window?.windowScene = windowScene | |
window?.rootViewController = ViewController() | |
window?.makeKeyAndVisible() | |
} |
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
func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { | |
// Use this method to optionally configure and attach the UIWindow `window` to the provided UIWindowScene `scene`. | |
// If using a storyboard, the `window` property will automatically be initialized and attached to the scene. | |
// This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). | |
guard let windowScene = (scene as? UIWindowScene) else { return } | |
// 이전 글에서 추가했던 내용 | |
window = UIWindow(frame: windowScene.coordinateSpace.bounds) | |
window?.windowScene = windowScene | |
window?.rootViewController = ViewController() | |
window?.makeKeyAndVisible() |
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
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
view.backgroundColor = .red | |
} | |
} |
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
class ViewController: UITabBarController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
self.view.backgroundColor = .red | |
} | |
} |
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
class ViewController: UITabBarController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
// Do any additional setup after loading the view. | |
self.view.backgroundColor = .white | |
self.tabBar.tintColor = .systemPink | |
self.tabBar.backgroundColor = .systemGray5 | |
addVC() |
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
func f(_ nums: [Int]) -> Int { | |
sleep(1) | |
let sum = nums.reduce(0, +) | |
return sum | |
} |
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
func af(_ nums: [Int], _ result: @escaping (Int) -> Void) { | |
DispatchQueue.main.async { | |
sleep(1) | |
let sum = nums.reduce(0, +) | |
result(sum) | |
} | |
} |
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
var num = 1 | |
func add(a: Int) -> Int { | |
return a + num | |
} |
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
func add(a: Int, b: Int) -> Int { | |
return a + b | |
} | |
let result = add(2, 3) // 5 |
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
override func viewDidAppear(_ animated: Bool) { | |
super.viewDidAppear(animated) | |
setupUI() | |
connectUIControls() | |
createDataSource() | |
listenForChanges() | |
} |
OlderNewer