Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Side by Side Diff: ui/ios/NSString+CrStringDrawing.h

Issue 497503004: Add NSString category for providing iOS6-style string drawing APIs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: split into two methods Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UI_IOS_NSSTRING_CR_STRING_DRAWING_H_
6 #define UI_IOS_NSSTRING_CR_STRING_DRAWING_H_
7
8 #import <UIKit/UIKit.h>
9
10 @interface NSString (CrStringDrawing)
11
12 // Returns the size of the string if it were to be rendered with the specified
13 // font on a single line.
14 //
15 // This method is a convenience wrapper around sizeWithAttributes: to avoid
16 // boilerplate required to put |font| in a dictionary of attributes. Do not pass
17 // nil into this method.
18 - (CGSize)cr_sizeWithFont:(UIFont*)font;
19
20 // Returns the integral size of the string (i.e. width and height rounded up to
21 // integer values) if it were to be rendered with the specified font on a single
22 // line.
23 //
24 // This method provides a drop-in replacement for sizeWithFont:, which was
25 // deprecated in iOS 7 in favor of -sizeWithAttributes:. Specifically, this
26 // method will return CGSizeZero if |font| is nil, and the width and height
27 // returned are rounded up to integer values.
stuartmorgan 2014/08/28 15:18:14 Please add a note that this is deprecated and no n
lliabraa 2014/08/28 19:25:05 Done.
28 - (CGSize)cr_integralSizeWithFont:(UIFont*)font;
29
30 @end
31
32 #endif // UI_IOS_NSSTRING_CR_STRING_DRAWING_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698