Answer the question
In order to leave comments, you need to log in
What is the best way to update content in the application?
I am writing a program, the database is implemented using Realm. When the application is opened for the first time (the database is empty), then I check with the usual if closure whether it is necessary to load data from the server.
if objects.count == 0 {
// загружаем данные через Alamofire request, парсим и сохраняем их в Realm
}
Answer the question
In order to leave comments, you need to log in
Disclaimer: Don't reinvent the wheel!
func application(
_ application: UIApplication,
willFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil
) -> Bool {
// ...
return true
}
func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
// ...
return true
}
AppDelegate
override func viewDidLoad() {
super.viewDidLoad()
// ...
}
It's not clear what problem you are trying to solve.
To formulate a problem, you need to define :
Will update the answer after your comment.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question