toshi0383 / TVMLKitchen

Swifty TVML template manager with or without client-server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Nothing Displays

russ opened this issue · comments

This must be something to do with my setup but when I call Kitchen serve nothing gets displayed.

Here is what I get in the console:

App[13589:5955308] ITML <Error>: Unable to create elements for document <alertTemplate itmlID="id_2"><title>test</title><description>DESCRIPTION</description></alertTemplate>
App[13589:5955091] #T:[Main] #Notice #SYSTEM : Template element: (null) 
2016-06-15 21:11:17.498 

Here is the code from the AppDelegate.

 func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
    let cookbook = Cookbook(launchOptions: launchOptions)
    Kitchen.prepare(cookbook)
    Kitchen.serve(xmlFile: "alert.xml", type: .Modal)
    return true
  }

I'm using a slimmed down template with pretty much nothing in it. But even the built in recipes do the same thing.

I think you're missing this at the top of your TVML.

<?xml version="1.0" encoding="UTF-8"?>

I just added that in to be sure but same result. No more info in the logs.

This was actually not required.

<?xml version="1.0" encoding="UTF-8"?>

So this should be the answer.

<document>
<alertTemplate itmlID="id_2">
<title>test</title><description>DESCRIPTION</description>
</alertTemplate>
</document>

Sorry, I had to sign off last night in the middle of this. I just added in the above into to my template and still nothing.

App[20133:5991517] #T:[Main] #Notice #SYSTEM : Template element: <IKViewElement: 0x7fe8aed4cda0> 2016-06-16 08:10:49.663 App[20133:5991517] #T:[Main] #Notice #SYSTEM : Template controller: <_TVAlertTemplateController: 0x7fe8aeaaf5c0>

Nothing about the can't display elements error though.

Pretty sure this is an issue with my loading of a SKView initially. I think that is sitting above the tvml modal. If I disable my view controller that loads that as the initial entry point I'm able to see the modal.

I'm still pretty new at this. Is there a way to push the SKView off the stack or "behind" the modal?

I think this actually relates to #81. I was able to get the recipe to display using this:

self.view.hidden = true Kitchen.serve(xmlFile: "alert.xml", type: .Modal)

But once the view comes up it loses focus. Here is a video of the Behavior: https://www.dropbox.com/s/tnutttg2mpdnnu3/IMG_0424.MOV.mov?dl=0

A little more research confirms #81. The Kitchen has to be the top navigationController otherwise the OS has no idea where to focus. Not sure if there can be anything done about that. I created a test app to play around with it here: https://github.com/russ/TVMLKitchenTest

@russ
Sorry for late response. Thanks for research !
I just didn't understand about "storyboard entry point", but now I understand that it is the Info.plist's UIMainStoryboardFile value.

Just did a little investigation, and found out that multiple UIWindow was generated in this case.
Continued in #95.

The Kitchen has to be the top navigationController

Yes, that's right. I guess it's only workaround for now.