Skip to content

Commit f1fb7cf

Browse files
64bit support has been improved with 'tgmath.h' header.
1 parent 79b6561 commit f1fb7cf

3 files changed

Lines changed: 9 additions & 1 deletion

File tree

OHAttributedLabel/Source/NSAttributedString+Attributes.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727

2828
#import "NSAttributedString+Attributes.h"
2929

30+
#include <tgmath.h>
31+
3032
#if ! defined(COCOAPODS) && ! defined(OHATTRIBUTEDLABEL_DEDICATED_PROJECT)
3133
// Copying files in your project and thus compiling OHAttributedLabel under different build settings
3234
// than the one provided is not recommended and increase risks of leaks (mixing ARC vs. MRC) or unwanted behaviors
@@ -348,7 +350,9 @@ -(void)setCharacterSpacing:(CGFloat)chracterSpacing
348350
}
349351
-(void)setCharacterSpacing:(CGFloat)chracterSpacing range:(NSRange)range
350352
{
351-
[self addAttribute:(NSString *)kCTKernAttributeName value:[NSNumber numberWithDouble:chracterSpacing] range:range];
353+
[self addAttribute:(NSString *)kCTKernAttributeName
354+
value:@(chracterSpacing) // http://stackoverflow.com/a/17067994
355+
range:range];
352356
}
353357

354358
-(void)modifyParagraphStylesWithBlock:(void(^)(OHParagraphStyle* paragraphStyle))block

OHAttributedLabel/Source/OHAttributedLabel.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929
#import "CoreTextUtils.h"
3030
#import "OHTouchesGestureRecognizer.h"
3131

32+
#include <tgmath.h>
33+
3234
#ifndef OHATTRIBUTEDLABEL_WARN_ABOUT_KNOWN_ISSUES
3335
#define OHATTRIBUTEDLABEL_WARN_ABOUT_KNOWN_ISSUES 1
3436
#endif

OHAttributedLabel/Source/OHTouchesGestureRecognizer.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@
2929

3030
#import <UIKit/UIGestureRecognizerSubclass.h>
3131

32+
#include <tgmath.h>
33+
3234
@interface OHTouchesGestureRecognizer ()
3335

3436
@property (nonatomic, assign) CGPoint startPoint;

0 commit comments

Comments
 (0)