Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

different shape and arrow #14

Open
Rufy86 opened this issue Apr 15, 2017 · 8 comments
Open

different shape and arrow #14

Rufy86 opened this issue Apr 15, 2017 · 8 comments

Comments

@Rufy86
Copy link

Rufy86 commented Apr 15, 2017

it's possible to add and arrow like disclosure indicator to the badge? And it's possible have different shape?

@evgenyneu
Copy link
Owner

Hi @Rufy86, thanks for the questions.

it's possible to add and arrow like disclosure indicator to the badge?

Sorry, could you specify what you mean by the arrow? Do you want the badge to have the arrow shape, or do you want to place a smaller arrow inside an oval-shaped badge?

And it's possible have different shape?

Currently one can alter the shape of the badge by changing the insets and cornerRadius properties. With this one can achieve all kinds of rectangular, oval or round shapes. If you want to have a different shape, like a triangle, for example, it's not possible at the moment, unfortunately.

@Rufy86
Copy link
Author

Rufy86 commented Apr 19, 2017

@evgenyneu thanks the answer

Sorry, could you specify what you mean by the arrow?
yes I can.

Do you want the badge to have the arrow shape, or do you want to place a smaller arrow inside an oval-shaped badge?
well, both!

for example, if you see this project, MLPAccessoryBadge, this badge has different shape and some of these have an arrow. some arrow is attached to badge, also has some space.

in this project the different badges are already made and the user has only choose the shape to use.

it's possible make the same thing?

I'm using your badge in a table view, but I can't insert the disclosure indicator, because insert the badge in the accessoryView. if the badge has the disclosure indicator build-in , it's better. or I think.

what do you think about?

@evgenyneu
Copy link
Owner

evgenyneu commented Apr 19, 2017

MLPAccessoryBadge is a very nice badge indeed, thanks for the suggestion. I have added it to the list of recommended libraries.

I think this variable shape feature is very nice. It is not currently possible with this library, as you already know. To be honest, I don't think it is worth adding it to this library, since there is already MLPAccessoryBadge that is doing it very well. I would rather keep this library simple, so it is a "does one thing and does it well" kind of thing. :)

@Rufy86
Copy link
Author

Rufy86 commented Apr 19, 2017

@evgenyneu thank you for the answer,

does one thing and does it well

it's a great think way, but the problems of MLPAccessoryBadge are: 1) it isn't update since 4 years; 2) is written in Objective-C.

your badge is written in swift and could have big potential.

however, you can add at least the arrow like disclosure indicator?

@evgenyneu
Copy link
Owner

evgenyneu commented Apr 19, 2017

Yeah, it is a good idea, I agree. However, I don't know any simple way of adding an arrow or the disclosure indicator to this library. This library is just a very simple subclass of a Label that draws an oval in its background. Is there an easy way of drawing an arrow or a disclosure indicator without sacrificing the simplicity?

@Rufy86
Copy link
Author

Rufy86 commented Apr 19, 2017

I'll try to search about it. but I think that the answer could be also in MPLAccessoryBadge.

but I've found something in internet:
check these

http://swiftiostutorials.com/tutorial-draw-nice-triangle-view-border-cashapelayer/
https://www.raywenderlich.com/38918/paintcode-tutorial-bezier-paths
https://github.com/mukeshthawani/TriLabelView
https://gist.github.com/mayoff/4146780

@evgenyneu
Copy link
Owner

evgenyneu commented Apr 20, 2017

Hi @Rufy86, thanks for the research! Feel free to implement this in the library if you want. I will merge it if it is a simple solution that does not involve a lot of code lines.

@chanders
Copy link

chanders commented Jul 1, 2017

@evgenyneu think that he is speaking about the "disclosure" arrow that tableviews come with.

@Rufy86 all you need to do is enable "disclosure" arrows in storyboard and then proceed to add the badge :)

screen shot 2017-07-01 at 6 58 30 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants