From f6fdcba014ab2156ff0cdca66b43f55fea34eac1 Mon Sep 17 00:00:00 2001 From: gabrielxpanda Date: Tue, 11 Feb 2020 12:03:17 +0800 Subject: [PATCH 1/2] fix conflict from SDWebImage Category HexString --- iosMath/render/MTConfig.h | 4 ++-- iosMath/render/NSColor+HexString.h | 19 ------------------- iosMath/render/NSColor+iosMathHexString.h | 13 +++++++++++++ ...HexString.m => NSColor+iosMathHexString.m} | 13 +++---------- iosMath/render/UIColor+HexString.h | 16 ---------------- iosMath/render/UIColor+iosMathHexString.h | 10 ++++++++++ ...HexString.m => UIColor+iosMathHexString.m} | 14 ++++---------- iosMath/render/internal/MTTypesetter.m | 4 ++-- 8 files changed, 34 insertions(+), 59 deletions(-) delete mode 100644 iosMath/render/NSColor+HexString.h create mode 100644 iosMath/render/NSColor+iosMathHexString.h rename iosMath/render/{NSColor+HexString.m => NSColor+iosMathHexString.m} (78%) delete mode 100644 iosMath/render/UIColor+HexString.h create mode 100644 iosMath/render/UIColor+iosMathHexString.h rename iosMath/render/{UIColor+HexString.m => UIColor+iosMathHexString.m} (72%) diff --git a/iosMath/render/MTConfig.h b/iosMath/render/MTConfig.h index 12748d8..d79fb27 100644 --- a/iosMath/render/MTConfig.h +++ b/iosMath/render/MTConfig.h @@ -16,7 +16,7 @@ // TARGET_OS_MAC is defined as 1 for both Mac OS and iOS, // so TARGET_OS_IPHONE is reliable. @import UIKit; -#import "UIColor+HexString.h" +#import "UIColor+iosMathHexString.h" typedef UIView MTView; typedef UIColor MTColor; @@ -32,7 +32,7 @@ typedef CGRect MTRect; @import AppKit; #import "NSBezierPath+addLineToPoint.h" #import "NSView+backgroundColor.h" -#import "NSColor+HexString.h" +#import "NSColor+iosMathHexString.h" #import "MTLabel.h" typedef NSView MTView; diff --git a/iosMath/render/NSColor+HexString.h b/iosMath/render/NSColor+HexString.h deleted file mode 100644 index 230b23c..0000000 --- a/iosMath/render/NSColor+HexString.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// NSColor+HexString.h -// iosMath -// -// Created by Markus Sähn on 21/03/2017. -// -// - -#include - -#if !TARGET_OS_IPHONE -#import - -@interface NSColor (HexString) - -+ (NSColor *)colorFromHexString:(NSString *)hexString; - -@end -#endif diff --git a/iosMath/render/NSColor+iosMathHexString.h b/iosMath/render/NSColor+iosMathHexString.h new file mode 100644 index 0000000..3b1f666 --- /dev/null +++ b/iosMath/render/NSColor+iosMathHexString.h @@ -0,0 +1,13 @@ + + +#include + +#if !TARGET_OS_IPHONE +#import + +@interface NSColor (iosMathHexString) + ++ (NSColor *)iosMathColorFromHexString:(NSString *)hexString; + +@end +#endif diff --git a/iosMath/render/NSColor+HexString.m b/iosMath/render/NSColor+iosMathHexString.m similarity index 78% rename from iosMath/render/NSColor+HexString.m rename to iosMath/render/NSColor+iosMathHexString.m index 40f5a0f..82d6bb7 100644 --- a/iosMath/render/NSColor+HexString.m +++ b/iosMath/render/NSColor+iosMathHexString.m @@ -1,17 +1,10 @@ -// -// NSColor+HexString.m -// iosMath -// -// Created by Markus Sähn on 21/03/2017. -// -// -#import "NSColor+HexString.h" +#import "NSColor+iosMathHexString.h" #if !TARGET_OS_IPHONE -@implementation NSColor (HexString) +@implementation NSColor (iosMathHexString) -+ (NSColor *)colorFromHexString:(NSString *)hexString { ++ (NSColor *)iosMathColorFromHexString:(NSString *)hexString { if ([hexString isEqualToString:@""]) { return nil; } diff --git a/iosMath/render/UIColor+HexString.h b/iosMath/render/UIColor+HexString.h deleted file mode 100644 index 0f84409..0000000 --- a/iosMath/render/UIColor+HexString.h +++ /dev/null @@ -1,16 +0,0 @@ -// -// UIColor+HexString.h -// iosMath -// -// Created by Markus Sähn on 21/03/2017. -// -// - -#if TARGET_OS_IPHONE - -@interface UIColor (HexString) - -+ (UIColor *)colorFromHexString:(NSString *)hexString; - -@end -#endif diff --git a/iosMath/render/UIColor+iosMathHexString.h b/iosMath/render/UIColor+iosMathHexString.h new file mode 100644 index 0000000..20e7db6 --- /dev/null +++ b/iosMath/render/UIColor+iosMathHexString.h @@ -0,0 +1,10 @@ + + +#if TARGET_OS_IPHONE + +@interface UIColor (iosMathHexString) + ++ (UIColor *)iosMathColorFromHexString:(NSString *)hexString; + +@end +#endif diff --git a/iosMath/render/UIColor+HexString.m b/iosMath/render/UIColor+iosMathHexString.m similarity index 72% rename from iosMath/render/UIColor+HexString.m rename to iosMath/render/UIColor+iosMathHexString.m index 274fc56..ddfd2fb 100644 --- a/iosMath/render/UIColor+HexString.m +++ b/iosMath/render/UIColor+iosMathHexString.m @@ -1,18 +1,12 @@ -// -// UIColor+HexString.m -// iosMath -// -// Created by Markus Sähn on 21/03/2017. -// -// -#import "UIColor+HexString.h" + +#import "UIColor+iosMathHexString.h" #if TARGET_OS_IPHONE -@implementation UIColor (HexString) +@implementation UIColor (iosMathHexString) -+ (UIColor *)colorFromHexString:(NSString *)hexString { ++ (UIColor *)iosMathColorFromHexString:(NSString *)hexString { if ([hexString isEqualToString:@""]) { return nil; } diff --git a/iosMath/render/internal/MTTypesetter.m b/iosMath/render/internal/MTTypesetter.m index 5f56270..7b971b0 100644 --- a/iosMath/render/internal/MTTypesetter.m +++ b/iosMath/render/internal/MTTypesetter.m @@ -623,7 +623,7 @@ - (void) createDisplayAtoms:(NSArray*) preprocessed } MTMathColor* colorAtom = (MTMathColor*) atom; MTDisplay* display = [MTTypesetter createLineForMathList:colorAtom.innerList font:_font style:_style]; - display.localTextColor = [MTColor colorFromHexString:colorAtom.colorString]; + display.localTextColor = [MTColor iosMathColorFromHexString:colorAtom.colorString]; display.position = _currentPosition; _currentPosition.x += display.width; [_displayAtoms addObject:display]; @@ -638,7 +638,7 @@ - (void) createDisplayAtoms:(NSArray*) preprocessed MTMathColorbox* colorboxAtom = (MTMathColorbox*) atom; MTDisplay* display = [MTTypesetter createLineForMathList:colorboxAtom.innerList font:_font style:_style]; - display.localBackgroundColor = [MTColor colorFromHexString:colorboxAtom.colorString]; + display.localBackgroundColor = [MTColor iosMathColorFromHexString:colorboxAtom.colorString]; display.position = _currentPosition; _currentPosition.x += display.width; [_displayAtoms addObject:display]; From a5a03ed5115332e0e515e597b623e44f9c608402 Mon Sep 17 00:00:00 2001 From: gabrielxpanda Date: Tue, 11 Feb 2020 13:02:23 +0800 Subject: [PATCH 2/2] fix .gitignore file with ._* --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index a74cfed..29be44d 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ build/ DerivedData .DS_Store +._* ## Various settings *.pbxuser