Skip to content
This repository was archived by the owner on Jun 19, 2019. It is now read-only.
This repository was archived by the owner on Jun 19, 2019. It is now read-only.

Can't set UIViewContentMode enum #72

@daniel-hall

Description

@daniel-hall

Here's a weird but frustrating one:

I'm trying to set a UIImageView subclass's contentMode property to aspect fit (UIViewContentModeScaleAspectFit) using a stylesheet.

All of the below fail and result in the enum value of UIViewContentModeScaleToFill (0) being applied instead:

content-mode: scale-aspect-fit
content-mode: scaleAspectFit
content-mode: scaleaspectfit
content-mode: UIViewContentModeScaleAspectFit
content-mode: 1

However, enum constants with less camel-cased words work just fine, e.g.:

content-mode: top-left

So I'm guessing this is something that happens when more than two camel-cased words are appended to the enum name when naming the constant? For example:

typedef NS_ENUM(NSInteger, MyEnumType) {
MyEnumTypeOne, // works
MyEnumTypeOneTwo, // works
MyEnumTypeOneTwoThree, // will not work?
};

Or maybe it's just based on the total length of the constant name? Any suggestions / workarounds since even using the integer value doesn't seem to work?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions