nicklockwood / layout

A declarative UI framework for iOS
MIT License
2.23k stars 97 forks source link

How to use Bool variables with parameter passing? #145

Closed sidhenn closed 6 years ago

sidhenn commented 6 years ago

I've been getting errors with the following example code and it may be syntax. I can pass Strings using parameters but not having success with Bool.

Template.xml

 <param name="weekend" type="Bool" />

<UILabel
        isHidden="{weekend}"
        text="Weekend!"
        />

Separate file.xml

 <UIView
        template="Template.xml"
        weekend="true"
    />
nicklockwood commented 6 years ago

@den2k this looks correct to me. What happens when you try it?

sidhenn commented 6 years ago

it crashes. I've since created a separate Bool param using the same code and it now works. Not sure what I was doing wrong. closed issue unless I can reproduce this problem. thanks.