Skip to content
This repository was archived by the owner on Feb 27, 2023. It is now read-only.

Update OLGhostAlertView.m#19

Open
KatkayApps wants to merge 1 commit into
ondalabs:masterfrom
KatkayApps:patch-1
Open

Update OLGhostAlertView.m#19
KatkayApps wants to merge 1 commit into
ondalabs:masterfrom
KatkayApps:patch-1

Conversation

@KatkayApps

Copy link
Copy Markdown

Your code was giving warning about deprecation on iOS 7. This solved the problem for me.

Your code was giving warning about deprecation on iOS 7. This solved the problem for me.
@KatkayApps

Copy link
Copy Markdown
Author

Your class is great. I would like to suggest two things to add:

  1. a way to change the box vertical position (top, middle and bottom)
  2. a way to change the box and text colors.

Beyond that the rest is perfect.

@radutzan

radutzan commented Mar 8, 2014

Copy link
Copy Markdown
Member

Thanks for the pull request. I'll look into it. Regarding your second post:

  1. There's a property called position just for that. Look for it on the readme file.
  2. The property style switches between light and dark styles. You can of course just modify the code to draw OLGAV however you like.

@KatkayApps

Copy link
Copy Markdown
Author

ah, sorry about that, I will look at it.

@kilink

kilink commented Mar 13, 2014

Copy link
Copy Markdown
Contributor

Is there a reason not to use NSString's boundingRectWithSize:options:attributes:context:, as suggested by the compiler warning?

I think it would avoid creating a UILabel just to calculate the rect.

@radutzan

Copy link
Copy Markdown
Member

Because it’s only available in iOS 7 and later. I don't want to break projects targeting earlier versions of iOS.

@KatkayApps

Copy link
Copy Markdown
Author

The label version works with barely all versions of iOS and works wonderfully and also my first version was using NSString's boundingRectWithSize:options:attributes:context: for a iOS 7 project and I discovered this method does not work correctly for some kinds of strings. I ended having wrong sizes all the time. Replacing it with the label method solved the problem.

@radutzan

Copy link
Copy Markdown
Member

Yes, but it seems to me that instantiating a label just to get its size may be too much overhead for the task. I'll take a closer look at this issue on the weekend.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants