From c2f1c627a5f006ce3dd1aa2a1c49f6a9056e9908 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Fri, 28 Jun 2019 16:07:09 +0200 Subject: [PATCH 1/6] FIXED: needed to use weak macro to support old OS #1161 --- Core/Source/DTAttributedTextContentView.m | 2 +- Core/Source/DTAttributedTextView.m | 4 ++-- Core/Source/DTHTMLAttributedStringBuilder.m | 12 ++++++------ Demo/Source/AutoLayoutDemoViewController.m | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Core/Source/DTAttributedTextContentView.m b/Core/Source/DTAttributedTextContentView.m index bb7e388bc..53b283709 100644 --- a/Core/Source/DTAttributedTextContentView.m +++ b/Core/Source/DTAttributedTextContentView.m @@ -504,7 +504,7 @@ - (void)drawRect:(CGRect)rect - (void)relayoutText { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; DTBlockPerformSyncIfOnMainThreadElseAsync(^{ DTAttributedTextContentView *strongSelf = weakSelf; // Make sure we actually have a superview and a previous layout before attempting to relayout the text. diff --git a/Core/Source/DTAttributedTextView.m b/Core/Source/DTAttributedTextView.m index 25177b73e..05268b19a 100644 --- a/Core/Source/DTAttributedTextView.m +++ b/Core/Source/DTAttributedTextView.m @@ -130,7 +130,7 @@ - (void)scrollRangeToVisible:(NSRange)range animated:(BOOL)animated - (void)relayoutText { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; DTBlockPerformSyncIfOnMainThreadElseAsync(^{ DTAttributedTextView *strongSelf = weakSelf; @@ -168,7 +168,7 @@ - (CGRect)cursorRectAtIndex:(NSInteger)index #pragma mark Notifications - (void)contentViewDidLayout:(NSNotification *)notification { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; DTBlockPerformSyncIfOnMainThreadElseAsync(^{ DTAttributedTextView *strongSelf = weakSelf; diff --git a/Core/Source/DTHTMLAttributedStringBuilder.m b/Core/Source/DTHTMLAttributedStringBuilder.m index 0c63d4068..9e3ce097b 100644 --- a/Core/Source/DTHTMLAttributedStringBuilder.m +++ b/Core/Source/DTHTMLAttributedStringBuilder.m @@ -345,7 +345,7 @@ - (BOOL)_buildString // don't remove spaces at end of document _preserverDocumentTrailingSpaces = [[_options objectForKey:DTDocumentPreserveTrailingSpaces] boolValue]; - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; __block BOOL result; dispatch_group_async(_dataParsingGroup, _dataParsingQueue, ^{ result = [weakSelf.self->_parser parse]; }); @@ -702,7 +702,7 @@ - (void)_registerTagEndHandlers - (void)parser:(DTHTMLParser *)parser didStartElement:(NSString *)elementName attributes:(NSDictionary *)attributeDict { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; dispatch_group_async(_treeBuildingGroup, _treeBuildingQueue, ^{ DTHTMLAttributedStringBuilder *strongSelf = weakSelf; @@ -814,7 +814,7 @@ - (void)parser:(DTHTMLParser *)parser didStartElement:(NSString *)elementName at - (void)parser:(DTHTMLParser *)parser didEndElement:(NSString *)elementName { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; dispatch_group_async(_treeBuildingGroup, _treeBuildingQueue, ^{ @autoreleasepool { DTHTMLAttributedStringBuilder *strongSelf = weakSelf; @@ -904,7 +904,7 @@ - (void)parser:(DTHTMLParser *)parser didEndElement:(NSString *)elementName - (void)parser:(DTHTMLParser *)parser foundCharacters:(NSString *)string { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; dispatch_group_async(_treeBuildingGroup, _treeBuildingQueue, ^{ DTHTMLAttributedStringBuilder *strongSelf = weakSelf; if (strongSelf->_ignoreParseEvents) @@ -971,7 +971,7 @@ - (void)parser:(DTHTMLParser *)parser foundCharacters:(NSString *)string - (void)parser:(DTHTMLParser *)parser foundCDATA:(NSData *)CDATABlock { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; dispatch_group_async(_treeBuildingGroup, _treeBuildingQueue, ^{ DTHTMLAttributedStringBuilder *strongSelf = weakSelf; @@ -993,7 +993,7 @@ - (void)parser:(DTHTMLParser *)parser foundCDATA:(NSData *)CDATABlock - (void)parserDidEndDocument:(DTHTMLParser *)parser { - __weak typeof(self) weakSelf = self; + DT_WEAK_VARIABLE typeof(self) weakSelf = self; dispatch_group_async(_treeBuildingGroup, _treeBuildingQueue, ^{ DTHTMLAttributedStringBuilder *strongSelf = weakSelf; diff --git a/Demo/Source/AutoLayoutDemoViewController.m b/Demo/Source/AutoLayoutDemoViewController.m index fababe1c4..d5f9ed74e 100644 --- a/Demo/Source/AutoLayoutDemoViewController.m +++ b/Demo/Source/AutoLayoutDemoViewController.m @@ -10,7 +10,7 @@ @interface AutoLayoutDemoViewController () -@property (nonatomic, weak) IBOutlet DTAttributedTextContentView *textView; +@property (nonatomic, DT_WEAK_PROPERTY) IBOutlet DTAttributedTextContentView *textView; @end @implementation AutoLayoutDemoViewController @@ -24,4 +24,4 @@ - (void)viewDidLoad { self.textView.attributedString = [[NSAttributedString alloc] initWithHTMLData:data documentAttributes:NULL]; } -@end \ No newline at end of file +@end From 04be4f1dada929808377055f2e61217d1e555765 Mon Sep 17 00:00:00 2001 From: ZX Date: Mon, 1 Jul 2019 15:49:51 +0800 Subject: [PATCH 2/6] Update DTImageTextAttachment.m --- Core/Source/DTImageTextAttachment.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/Source/DTImageTextAttachment.m b/Core/Source/DTImageTextAttachment.m index a6a735a71..eca30d05b 100644 --- a/Core/Source/DTImageTextAttachment.m +++ b/Core/Source/DTImageTextAttachment.m @@ -271,12 +271,12 @@ - (void)_updateSizesFromImage:(DTImage *)image if (_originalSize.width==0 && _originalSize.height!=0) { CGFloat factor = _originalSize.height/image.size.height; - _originalSize.width = image.size.height * factor; + _originalSize.width = image.size.width * factor; } else if (_originalSize.width!=0 && _originalSize.height==0) { CGFloat factor = _originalSize.width/image.size.width; - _originalSize.height = image.size.width * factor; + _originalSize.height = image.size.height * factor; } } @@ -294,7 +294,7 @@ - (void)_updateSizesFromImage:(DTImage *)image CGSize newDisplaySize = _displaySize; CGFloat factor = _displaySize.height/_originalSize.height; - newDisplaySize.width = _originalSize.height * factor; + newDisplaySize.width = _originalSize.width * factor; [self setDisplaySize:newDisplaySize withMaxDisplaySize:_maxImageSize]; } @@ -303,7 +303,7 @@ - (void)_updateSizesFromImage:(DTImage *)image CGSize newDisplaySize = _displaySize; CGFloat factor = _displaySize.width/_originalSize.width; - newDisplaySize.height = _originalSize.width * factor; + newDisplaySize.height = _originalSize.height * factor; [self setDisplaySize:newDisplaySize withMaxDisplaySize:_maxImageSize]; } From 0398fc649f1dee91ff5c4c3d63dded97136ddb5e Mon Sep 17 00:00:00 2001 From: Jochen Pfeiffer Date: Tue, 3 Sep 2019 09:04:33 +0200 Subject: [PATCH 3/6] Remove references to deprecated UIWebView from framework Move DTWebVideoView to demo --- DTCoreText.xcodeproj/project.pbxproj | 14 ++++++-------- {Core/Source/iOS => Demo/Source}/DTWebVideoView.h | 0 {Core/Source/iOS => Demo/Source}/DTWebVideoView.m | 0 3 files changed, 6 insertions(+), 8 deletions(-) rename {Core/Source/iOS => Demo/Source}/DTWebVideoView.h (100%) rename {Core/Source/iOS => Demo/Source}/DTWebVideoView.m (100%) diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index c00398fa4..4db3d0897 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -25,6 +25,7 @@ 11848C07215E204600A18658 /* default.css in Resources */ = {isa = PBXBuildFile; fileRef = A76994F914DBB5F70047CC8D /* default.css */; }; 11848C08215E204F00A18658 /* default.css in Resources */ = {isa = PBXBuildFile; fileRef = A76994F914DBB5F70047CC8D /* default.css */; }; 11848C17215E259000A18658 /* DTCoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A79BA6201B46A1FB0086C2F6 /* DTCoreText.framework */; }; + 1926D78E231E467900F11523 /* DTWebVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 948723B21D4B130000274167 /* DTWebVideoView.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; @@ -40,8 +41,6 @@ 5AF0E509CE9C6EC97E3007F5 /* AutoLayoutDemoViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */; }; 5AF0ECFF9BD94137DE0992BA /* AutoLayoutDemoViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5AF0E4D86A6BE8FC798F9702 /* AutoLayoutDemoViewController.xib */; }; 944A9E6418B5A7F000E41481 /* DTCSSListStyleTest.m in Sources */ = {isa = PBXBuildFile; fileRef = 944A9E6318B5A7F000E41481 /* DTCSSListStyleTest.m */; }; - 948723C91D4B130D00274167 /* DTWebVideoView.h in Headers */ = {isa = PBXBuildFile; fileRef = 948723B11D4B130000274167 /* DTWebVideoView.h */; }; - 948723CC1D4B131A00274167 /* DTWebVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 948723B21D4B130000274167 /* DTWebVideoView.m */; }; 94D24B0D1D4AFE7800C7F33C /* CTLineUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = 4266937D1B56F60D00F9DBFC /* CTLineUtils.m */; }; 94D24B0E1D4AFE7800C7F33C /* NSAttributedStringRunDelegates.m in Sources */ = {isa = PBXBuildFile; fileRef = A788C93F14863E8700E1AFD9 /* NSAttributedStringRunDelegates.m */; }; 94D24B0F1D4AFE7800C7F33C /* DTLazyImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = A788C92D14863E8700E1AFD9 /* DTLazyImageView.m */; }; @@ -799,8 +798,8 @@ 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoLayoutDemoViewController.m; sourceTree = ""; }; 5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoLayoutDemoViewController.h; sourceTree = ""; }; 944A9E6318B5A7F000E41481 /* DTCSSListStyleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTCSSListStyleTest.m; sourceTree = ""; }; - 948723B11D4B130000274167 /* DTWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DTWebVideoView.h; path = iOS/DTWebVideoView.h; sourceTree = ""; }; - 948723B21D4B130000274167 /* DTWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DTWebVideoView.m; path = iOS/DTWebVideoView.m; sourceTree = ""; }; + 948723B11D4B130000274167 /* DTWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTWebVideoView.h; sourceTree = ""; }; + 948723B21D4B130000274167 /* DTWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTWebVideoView.m; sourceTree = ""; }; 94D24B961D4AFE7800C7F33C /* DTCoreText.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DTCoreText.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 94DE4B4218B5968D00F0BA6D /* NSCoder+DTCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCoder+DTCompatibility.h"; sourceTree = ""; }; 94DE4B4318B5968D00F0BA6D /* NSCoder+DTCompatibility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSCoder+DTCompatibility.m"; sourceTree = ""; }; @@ -1467,6 +1466,8 @@ 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */, 5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */, 5AF0E4D86A6BE8FC798F9702 /* AutoLayoutDemoViewController.xib */, + 948723B11D4B130000274167 /* DTWebVideoView.h */, + 948723B21D4B130000274167 /* DTWebVideoView.m */, ); path = Source; sourceTree = ""; @@ -1486,8 +1487,6 @@ A788C91514863E8700E1AFD9 /* DTAttributedTextView.m */, A788C92C14863E8700E1AFD9 /* DTLazyImageView.h */, A788C92D14863E8700E1AFD9 /* DTLazyImageView.m */, - 948723B11D4B130000274167 /* DTWebVideoView.h */, - 948723B21D4B130000274167 /* DTWebVideoView.m */, A788C92E14863E8700E1AFD9 /* DTLinkButton.h */, A788C92F14863E8700E1AFD9 /* DTLinkButton.m */, ); @@ -1830,7 +1829,6 @@ A79BA6791B46A24F0086C2F6 /* DTAnchorHTMLElement.h in Headers */, A79BA69B1B46A2660086C2F6 /* DTCoreTextFontCollection.h in Headers */, A79BA6BB1B46A2700086C2F6 /* NSMutableString+HTML.h in Headers */, - 948723C91D4B130D00274167 /* DTWebVideoView.h in Headers */, A7B130551B4B25E30014E109 /* DTAccessibilityElement.h in Headers */, A7B1304F1B4B25BF0014E109 /* DTLazyImageView.h in Headers */, A79BA65E1B46A24A0086C2F6 /* DTCoreTextConstants.h in Headers */, @@ -2413,6 +2411,7 @@ A788CA5014863EF100E1AFD9 /* CoreTextDemoAppDelegate.m in Sources */, A788CA5114863EF100E1AFD9 /* DemoSnippetsViewController.m in Sources */, 4266937E1B56F60D00F9DBFC /* CTLineUtils.m in Sources */, + 1926D78E231E467900F11523 /* DTWebVideoView.m in Sources */, A788CA5214863EF100E1AFD9 /* DemoTextViewController.m in Sources */, A788CA5314863EF100E1AFD9 /* main.m in Sources */, A740368816E51B3A00ECCDE0 /* DemoAboutViewController.m in Sources */, @@ -2588,7 +2587,6 @@ A79BA6981B46A25A0086C2F6 /* DTObjectTextAttachment.m in Sources */, A79BA67A1B46A24F0086C2F6 /* DTAnchorHTMLElement.m in Sources */, A79BA6B01B46A2700086C2F6 /* NSAttributedString+SmallCaps.m in Sources */, - 948723CC1D4B131A00274167 /* DTWebVideoView.m in Sources */, A79BA6901B46A25A0086C2F6 /* DTDictationPlaceholderTextAttachment.m in Sources */, A79BA68C1B46A2530086C2F6 /* DTColorFunctions.m in Sources */, A79BA69A1B46A2600086C2F6 /* DTHTMLWriter.m in Sources */, diff --git a/Core/Source/iOS/DTWebVideoView.h b/Demo/Source/DTWebVideoView.h similarity index 100% rename from Core/Source/iOS/DTWebVideoView.h rename to Demo/Source/DTWebVideoView.h diff --git a/Core/Source/iOS/DTWebVideoView.m b/Demo/Source/DTWebVideoView.m similarity index 100% rename from Core/Source/iOS/DTWebVideoView.m rename to Demo/Source/DTWebVideoView.m From d1a102e4bf65ab6d2084613b2c2dfd061d5ea25d Mon Sep 17 00:00:00 2001 From: Jochen Pfeiffer Date: Tue, 3 Sep 2019 09:28:31 +0200 Subject: [PATCH 4/6] Rename DTWebVideoView to DemoWebVideoView --- DTCoreText.xcodeproj/project.pbxproj | 12 ++++++------ Demo/Source/DemoTextViewController.m | 4 ++-- .../{DTWebVideoView.h => DemoWebVideoView.h} | 16 ++++++++-------- .../{DTWebVideoView.m => DemoWebVideoView.m} | 10 +++++----- 4 files changed, 21 insertions(+), 21 deletions(-) rename Demo/Source/{DTWebVideoView.h => DemoWebVideoView.h} (73%) rename Demo/Source/{DTWebVideoView.m => DemoWebVideoView.m} (93%) diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index 4db3d0897..25c484cc2 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -25,7 +25,7 @@ 11848C07215E204600A18658 /* default.css in Resources */ = {isa = PBXBuildFile; fileRef = A76994F914DBB5F70047CC8D /* default.css */; }; 11848C08215E204F00A18658 /* default.css in Resources */ = {isa = PBXBuildFile; fileRef = A76994F914DBB5F70047CC8D /* default.css */; }; 11848C17215E259000A18658 /* DTCoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A79BA6201B46A1FB0086C2F6 /* DTCoreText.framework */; }; - 1926D78E231E467900F11523 /* DTWebVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 948723B21D4B130000274167 /* DTWebVideoView.m */; }; + 1926D78E231E467900F11523 /* DemoWebVideoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 948723B21D4B130000274167 /* DemoWebVideoView.m */; }; 1D60589F0D05DD5A006BFB54 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; 1DF5F4E00D08C38300B7A737 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; @@ -798,8 +798,8 @@ 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoLayoutDemoViewController.m; sourceTree = ""; }; 5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoLayoutDemoViewController.h; sourceTree = ""; }; 944A9E6318B5A7F000E41481 /* DTCSSListStyleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTCSSListStyleTest.m; sourceTree = ""; }; - 948723B11D4B130000274167 /* DTWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DTWebVideoView.h; sourceTree = ""; }; - 948723B21D4B130000274167 /* DTWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DTWebVideoView.m; sourceTree = ""; }; + 948723B11D4B130000274167 /* DemoWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoWebVideoView.h; sourceTree = ""; }; + 948723B21D4B130000274167 /* DemoWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoWebVideoView.m; sourceTree = ""; }; 94D24B961D4AFE7800C7F33C /* DTCoreText.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = DTCoreText.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 94DE4B4218B5968D00F0BA6D /* NSCoder+DTCompatibility.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "NSCoder+DTCompatibility.h"; sourceTree = ""; }; 94DE4B4318B5968D00F0BA6D /* NSCoder+DTCompatibility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSCoder+DTCompatibility.m"; sourceTree = ""; }; @@ -1466,8 +1466,8 @@ 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */, 5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */, 5AF0E4D86A6BE8FC798F9702 /* AutoLayoutDemoViewController.xib */, - 948723B11D4B130000274167 /* DTWebVideoView.h */, - 948723B21D4B130000274167 /* DTWebVideoView.m */, + 948723B11D4B130000274167 /* DemoWebVideoView.h */, + 948723B21D4B130000274167 /* DemoWebVideoView.m */, ); path = Source; sourceTree = ""; @@ -2411,7 +2411,7 @@ A788CA5014863EF100E1AFD9 /* CoreTextDemoAppDelegate.m in Sources */, A788CA5114863EF100E1AFD9 /* DemoSnippetsViewController.m in Sources */, 4266937E1B56F60D00F9DBFC /* CTLineUtils.m in Sources */, - 1926D78E231E467900F11523 /* DTWebVideoView.m in Sources */, + 1926D78E231E467900F11523 /* DemoWebVideoView.m in Sources */, A788CA5214863EF100E1AFD9 /* DemoTextViewController.m in Sources */, A788CA5314863EF100E1AFD9 /* main.m in Sources */, A740368816E51B3A00ECCDE0 /* DemoAboutViewController.m in Sources */, diff --git a/Demo/Source/DemoTextViewController.m b/Demo/Source/DemoTextViewController.m index 4773a6528..f4b0be741 100644 --- a/Demo/Source/DemoTextViewController.m +++ b/Demo/Source/DemoTextViewController.m @@ -11,7 +11,7 @@ #import #import "DTTiledLayerWithoutFade.h" -#import "DTWebVideoView.h" +#import "DemoWebVideoView.h" @interface DemoTextViewController () @@ -576,7 +576,7 @@ - (UIView *)attributedTextContentView:(DTAttributedTextContentView *)attributedT } else if ([attachment isKindOfClass:[DTIframeTextAttachment class]]) { - DTWebVideoView *videoView = [[DTWebVideoView alloc] initWithFrame:frame]; + DemoWebVideoView *videoView = [[DemoWebVideoView alloc] initWithFrame:frame]; videoView.attachment = attachment; return videoView; diff --git a/Demo/Source/DTWebVideoView.h b/Demo/Source/DemoWebVideoView.h similarity index 73% rename from Demo/Source/DTWebVideoView.h rename to Demo/Source/DemoWebVideoView.h index 30e03917b..0408e7397 100644 --- a/Demo/Source/DTWebVideoView.h +++ b/Demo/Source/DemoWebVideoView.h @@ -1,5 +1,5 @@ // -// DTWebVideoView.h +// DemoWebVideoView.h // DTCoreText // // Created by Oliver Drobnik on 8/5/11. @@ -8,13 +8,13 @@ #import -@class DTWebVideoView; +@class DemoWebVideoView; @class DTTextAttachment; /** - Protocol for delegates of + Protocol for delegates of */ -@protocol DTWebVideoViewDelegate +@protocol DemoWebVideoViewDelegate @optional @@ -25,7 +25,7 @@ @returns `YES` if the app may be left to open the external URL */ -- (BOOL)videoView:(DTWebVideoView *)videoView shouldOpenExternalURL:(NSURL *)url; +- (BOOL)videoView:(DemoWebVideoView *)videoView shouldOpenExternalURL:(NSURL *)url; @end @@ -33,16 +33,16 @@ /** The class represents a custom subview for use in to represent an embedded video. - Embedded videos work by loading the video URL in a UIWebView which iOS then replaces with the built-in media player view. The URL of the embed script depends on the service and needs to be added to the webView:shouldStartLoadWithRequest:navigationType:. You want to allow the URL for the embed script, but disallow all other requests which for example occur if a user taps on the YouTube logo. If you were to allow this type of navigation then the YouTube website would be loaded in the video view. For these scenarios there is the videoView:shouldOpenExternalURL: method in DTWebVideoViewDelegate. If you respond with `YES` (which is default if the method is not implemented) then the URL will be opened in Safari. + Embedded videos work by loading the video URL in a UIWebView which iOS then replaces with the built-in media player view. The URL of the embed script depends on the service and needs to be added to the webView:shouldStartLoadWithRequest:navigationType:. You want to allow the URL for the embed script, but disallow all other requests which for example occur if a user taps on the YouTube logo. If you were to allow this type of navigation then the YouTube website would be loaded in the video view. For these scenarios there is the videoView:shouldOpenExternalURL: method in DemoWebVideoViewDelegate. If you respond with `YES` (which is default if the method is not implemented) then the URL will be opened in Safari. To add additional video services please add them in the mentioned location and submit a pull request for the addition. */ -@interface DTWebVideoView : UIView +@interface DemoWebVideoView : UIView /** The delegate of the video view */ -@property (nonatomic, DT_WEAK_PROPERTY) id delegate; +@property (nonatomic, DT_WEAK_PROPERTY) id delegate; /** The text attachment representing an embedded video. diff --git a/Demo/Source/DTWebVideoView.m b/Demo/Source/DemoWebVideoView.m similarity index 93% rename from Demo/Source/DTWebVideoView.m rename to Demo/Source/DemoWebVideoView.m index b490e4aa5..b74ef5acc 100644 --- a/Demo/Source/DTWebVideoView.m +++ b/Demo/Source/DemoWebVideoView.m @@ -1,26 +1,26 @@ // -// DTWebVideoView.m +// DemoWebVideoView.m // DTCoreText // // Created by Oliver Drobnik on 8/5/11. // Copyright 2011 Drobnik.com. All rights reserved. // -#import "DTWebVideoView.h" +#import "DemoWebVideoView.h" #import "DTIframeTextAttachment.h" -@interface DTWebVideoView () +@interface DemoWebVideoView () - (void)disableScrolling; @end -@implementation DTWebVideoView +@implementation DemoWebVideoView { DTTextAttachment *_attachment; - DT_WEAK_VARIABLE id _delegate; + DT_WEAK_VARIABLE id _delegate; UIWebView *_webView; } From 0e64a19f53e5c72a3aa3a5a97950437d81734b9f Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Wed, 11 Sep 2019 08:25:27 +0200 Subject: [PATCH 5/6] Updated DTFoundation --- Externals/DTFoundation | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals/DTFoundation b/Externals/DTFoundation index 612472636..30a51d11d 160000 --- a/Externals/DTFoundation +++ b/Externals/DTFoundation @@ -1 +1 @@ -Subproject commit 612472636da1162b378920e07c46f57c49868a4d +Subproject commit 30a51d11d43c6de2fb060d302b427a3a762b7ab5 From 6776a19bcafaa139216f068ce8311dcae79541d4 Mon Sep 17 00:00:00 2001 From: Oliver Drobnik Date: Wed, 11 Sep 2019 08:29:01 +0200 Subject: [PATCH 6/6] Updated version to 1.6.23, switched to $(CURRENT_PROJECT_VERSION) --- Core/DTCoreText-Info.plist | 2 +- DTCoreText.podspec | 2 +- DTCoreText.xcodeproj/project.pbxproj | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Core/DTCoreText-Info.plist b/Core/DTCoreText-Info.plist index c86810c2c..f069f48e9 100644 --- a/Core/DTCoreText-Info.plist +++ b/Core/DTCoreText-Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0 + $(CURRENT_PROJECT_VERSION) CFBundleSignature ???? CFBundleVersion diff --git a/DTCoreText.podspec b/DTCoreText.podspec index efe387555..2eb6e72fd 100644 --- a/DTCoreText.podspec +++ b/DTCoreText.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'DTCoreText' - spec.version = '1.6.22' + spec.version = '1.6.23' spec.platforms = {:ios => '4.3', :tvos => '9.0' } spec.license = 'BSD' spec.source = { :git => 'https://github.com/Cocoanetics/DTCoreText.git', :tag => spec.version.to_s } diff --git a/DTCoreText.xcodeproj/project.pbxproj b/DTCoreText.xcodeproj/project.pbxproj index 25c484cc2..f6ca1cdae 100644 --- a/DTCoreText.xcodeproj/project.pbxproj +++ b/DTCoreText.xcodeproj/project.pbxproj @@ -2751,7 +2751,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -2804,7 +2803,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -2852,7 +2850,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -3104,7 +3101,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -3158,7 +3154,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -3207,7 +3202,6 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; DEFINES_MODULE = YES; DYLIB_COMPATIBILITY_VERSION = 1; @@ -3264,6 +3258,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.6.23; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_C_LANGUAGE_STANDARD = c99; @@ -3405,6 +3400,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.6.23; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; @@ -3460,6 +3456,7 @@ CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; + CURRENT_PROJECT_VERSION = 1.6.23; ENABLE_STRICT_OBJC_MSGSEND = YES; FRAMEWORK_SEARCH_PATHS = "$(DEVELOPER_LIBRARY_DIR)/Frameworks"; GCC_C_LANGUAGE_STANDARD = c99;