nicklockwood / layout

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

// in comments doesn't work for images #50

Closed hartbit closed 7 years ago

hartbit commented 7 years ago
<UITabBarController>
    <UIViewController
        title="Tab"
        tabBarItem.image="// Image-Normal"
        tabBarItem.selectedImage="// Image-Selected"
        xml="Other.xml"
    />
</UITabBarController>
nicklockwood commented 7 years ago

Images are treated as strings, so you'd need to wrap the comment in { }.

I agree this is awkward, but since an image name can be a path, it could plausibly start with a /. // is fairly unlikely though, so perhaps I can special-case it.

hartbit commented 7 years ago

Okay, understood :) I think special casing it would be worth it!

nicklockwood commented 7 years ago

@hartbit This is now supported on the develop branch. See README for details.

nicklockwood commented 7 years ago

Fixed in 0.4.25

hartbit commented 7 years ago

👍