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
struct Book { | |
var title: String | |
init(title: String) { | |
self.title = title | |
} | |
} | |
var bookOne = Book(title: "A Game of Thrones (1996)") | |
var bookTwo = bookOne // bookTwo now created a new copy from bookOne |
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
class Book { | |
var title: String | |
init(title: String) { | |
self.title = title | |
} | |
} | |
var bookOne = Book(title: "A Game of Thrones (1996)") | |
var bookTwo = bookOne // bookTwo now refers to the same instance as bookOne |
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
struct Person { | |
var name: String | |
var information: Information? | |
} | |
struct Information { | |
var id: String | |
var age: Int | |
} |
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 applicationDidReceiveMemoryWarning(_ application: UIApplication) { | |
// It is called when the app receives a memory warning | |
// This method can be used to release any resources that can be recreated when the app is launched again | |
} | |
func applicationWillTerminate(_ application: UIApplication) { | |
// It is called when the app is about to terminate | |
// This method can be used to save data or perform other cleanup tasks before the app is terminated | |
} |
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 applicationWillEnterForeground(_ application: UIApplication) { | |
// It is called when the app is about to enter foreground | |
// For example, when the user moves back to the app from another app or from the home screen | |
// You can use this to prepare your application for resuming from the background state | |
} |
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 applicationDidEnterBackground(_ application: UIApplication) { | |
// It is called when the app switched the background state | |
// For example, when the user move to another app | |
// You can use this method to cleanup tasks, save data or stop timers | |
} |
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 applicationDidBecomeActive(_ application: UIApplication) { | |
// It is called when the app has become active (in the foreground) | |
// For example, when a user taps on the app in home screen to launch it | |
} |
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 applicationWillResignActive(_ application: UIApplication) { | |
// It is called in the App Delegate when the app is about to move from active to inactive state | |
// For example, text message or a phone call is received | |
} |
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
struct AppConstants { | |
// static let baseURL = "https://dev.newserver.com" | |
static let baseURL = "https://newserver.com" | |
} |
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 Foundation | |
struct AppConstants { | |
static let baseURL = "https://dev.newserver.com" | |
// static let baseURL = "https://newserver.com" | |
} |