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/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]; } 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 c00398fa4..f6ca1cdae 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 /* 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 */; }; @@ -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 /* 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 = ""; }; @@ -1467,6 +1466,8 @@ 5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */, 5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */, 5AF0E4D86A6BE8FC798F9702 /* AutoLayoutDemoViewController.xib */, + 948723B11D4B130000274167 /* DemoWebVideoView.h */, + 948723B21D4B130000274167 /* DemoWebVideoView.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 /* DemoWebVideoView.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 */, @@ -2753,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; @@ -2806,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; @@ -2854,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; @@ -3106,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; @@ -3160,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; @@ -3209,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; @@ -3266,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; @@ -3407,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"; @@ -3462,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; 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/Core/Source/iOS/DTWebVideoView.h b/Demo/Source/DemoWebVideoView.h similarity index 73% rename from Core/Source/iOS/DTWebVideoView.h rename to Demo/Source/DemoWebVideoView.h index 30e03917b..0408e7397 100644 --- a/Core/Source/iOS/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/Core/Source/iOS/DTWebVideoView.m b/Demo/Source/DemoWebVideoView.m similarity index 93% rename from Core/Source/iOS/DTWebVideoView.m rename to Demo/Source/DemoWebVideoView.m index b490e4aa5..b74ef5acc 100644 --- a/Core/Source/iOS/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; } 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