Add a way to manually show/hide loading
steve228uk opened this issue · comments
When running async requests in UIKit it would be good to have a way to show/hide the loading screen.
Potential Solutions
- A computed property called
loading
. This would be executed as the following:
Kitchen.loading = true
Kitchen.loading = false
var kitchen: Bool {
didSet {
// Show/hide the loading screen based on the new value
}
}
- Show/hide loading methods
Kitchen.showLoading()
Kitchen.hideLoading()
- A 'replace' presentation style (I feel this should exist anyway). This will replace the current view in place and is already be used in
kitchen.js
for the default loading screen.
Kitchen.serve(xmlFile: "loading.xml", type: .Replace)
The benefit of this is that the user can also customise the loading.xml
to be whatever they want/need. This could also be a recipe with a title
property.
Proposed Solution
My suggestion would be to utilise both the property and new .Replace
presentation types together to give the developer the most flexibility.
Nice. I agree. 👍
@toshi0383 Awesome 😄 I'll get the .Replace
presentation type added to #33 as I think it's pretty useful for tabs.
Opened #67
TVML view manipulating is very stateful. So I'd ended up making Kitchen control how or when to show indicators based on PresentationType.
@steve228uk Do you feel this issue is solved ? Feel free to reopen to continue discussing.😉