toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server
MIT License
81 stars 12 forks source link

Add a way to manually show/hide loading #36

Closed steve228uk closed 8 years ago

steve228uk commented 8 years ago

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.

toshi0383 commented 8 years ago

Nice. I agree. 👍

steve228uk commented 8 years ago

@toshi0383 Awesome :smile: I'll get the .Replace presentation type added to #33 as I think it's pretty useful for tabs.

toshi0383 commented 8 years ago

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.

toshi0383 commented 8 years ago

@steve228uk Do you feel this issue is solved ? Feel free to reopen to continue discussing.😉