toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

  1. 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
    }
}
  1. Show/hide loading methods
Kitchen.showLoading()
Kitchen.hideLoading()
  1. 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.😉