Skip to content

Suggestion #11

@inb4ohnoes

Description

@inb4ohnoes

Hey, I'd just like to say first that this is a fantastic control. Thanks for building it!

In my own personal branch, I've changed all the UILabels you've been using to UIButtons. The reason for this is I wanted to support images instead of text.

Why did I choose UIButton? Well, mostly for laziness, but also convenience. UIButton acts similarly to UILabel (it contains one), but also contains an image view as well as a background image view. In addition, image view + label layout is automatically handled. This is a convenience for people who might want image + text.

What about tint color? Well, there's a method on UIImage, imageWithRenderingMode, where you can set the property UIImageRenderingModeAlwaysTemplate which will ignore color values of the original image and apply any given UIColor to any non-0-alpha part of the image.

My version currently has no API changes, as the support is mostly just shoehorned on there. However, If you would like, I can submit a PR. You'll have to tell me what you want though, as I can do one of two things:

change the default initializers to something like
- (instancetype)initWithStringsArray:(NSArray *)strings andImageStringsArray:(NSArray *)imageStrings;

if users don't want a part, they can pass nil for any given argument, or selectively pass [NSNull null] for any index in the arrays.

Or add an additional initializer for both regular strings and attributed string that support images in additional to text.

Let me know!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions