Skip to content

Commit

Permalink
Merge branch 'release-1.6.23'
Browse files Browse the repository at this point in the history
  • Loading branch information
odrobnik committed Sep 11, 2019
2 parents 92b34a9 + 6776a19 commit e9cc5bb
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 36 deletions.
2 changes: 1 addition & 1 deletion Core/DTCoreText-Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
Expand Down
8 changes: 4 additions & 4 deletions Core/Source/DTImageTextAttachment.m
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand All @@ -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];
}
Expand All @@ -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];
}
Expand Down
2 changes: 1 addition & 1 deletion DTCoreText.podspec
Original file line number Diff line number Diff line change
@@ -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 }
Expand Down
23 changes: 9 additions & 14 deletions DTCoreText.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -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 */; };
Expand Down Expand Up @@ -799,8 +798,8 @@
5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AutoLayoutDemoViewController.m; sourceTree = "<group>"; };
5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AutoLayoutDemoViewController.h; sourceTree = "<group>"; };
944A9E6318B5A7F000E41481 /* DTCSSListStyleTest.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DTCSSListStyleTest.m; sourceTree = "<group>"; };
948723B11D4B130000274167 /* DTWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = DTWebVideoView.h; path = iOS/DTWebVideoView.h; sourceTree = "<group>"; };
948723B21D4B130000274167 /* DTWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = DTWebVideoView.m; path = iOS/DTWebVideoView.m; sourceTree = "<group>"; };
948723B11D4B130000274167 /* DemoWebVideoView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = DemoWebVideoView.h; sourceTree = "<group>"; };
948723B21D4B130000274167 /* DemoWebVideoView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = DemoWebVideoView.m; sourceTree = "<group>"; };
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 = "<group>"; };
94DE4B4318B5968D00F0BA6D /* NSCoder+DTCompatibility.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSCoder+DTCompatibility.m"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1467,6 +1466,8 @@
5AF0E4DB1FBCBA1C165C0959 /* AutoLayoutDemoViewController.m */,
5AF0E909A170F1B0FF3CCC47 /* AutoLayoutDemoViewController.h */,
5AF0E4D86A6BE8FC798F9702 /* AutoLayoutDemoViewController.xib */,
948723B11D4B130000274167 /* DemoWebVideoView.h */,
948723B21D4B130000274167 /* DemoWebVideoView.m */,
);
path = Source;
sourceTree = "<group>";
Expand All @@ -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 */,
);
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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";
Expand Down Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions Demo/Source/DemoTextViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#import <MediaPlayer/MediaPlayer.h>

#import "DTTiledLayerWithoutFade.h"
#import "DTWebVideoView.h"
#import "DemoWebVideoView.h"


@interface DemoTextViewController ()
Expand Down Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// DTWebVideoView.h
// DemoWebVideoView.h
// DTCoreText
//
// Created by Oliver Drobnik on 8/5/11.
Expand All @@ -8,13 +8,13 @@

#import <DTFoundation/DTWeakSupport.h>

@class DTWebVideoView;
@class DemoWebVideoView;
@class DTTextAttachment;

/**
Protocol for delegates of <DTWebVideoView>
Protocol for delegates of <DemoWebVideoView>
*/
@protocol DTWebVideoViewDelegate <NSObject>
@protocol DemoWebVideoViewDelegate <NSObject>

@optional

Expand All @@ -25,24 +25,24 @@
@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


/**
The class represents a custom subview for use in <DTAttributedTextContentView> 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 <UIWebViewDelegate>
@interface DemoWebVideoView : UIView <UIWebViewDelegate>

/**
The delegate of the video view
*/
@property (nonatomic, DT_WEAK_PROPERTY) id <DTWebVideoViewDelegate> delegate;
@property (nonatomic, DT_WEAK_PROPERTY) id <DemoWebVideoViewDelegate> delegate;

/**
The text attachment representing an embedded video.
Expand Down
Original file line number Diff line number Diff line change
@@ -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 <DTWebVideoViewDelegate> _delegate;
DT_WEAK_VARIABLE id <DemoWebVideoViewDelegate> _delegate;

UIWebView *_webView;
}
Expand Down
2 changes: 1 addition & 1 deletion Externals/DTFoundation
Submodule DTFoundation updated 31 files
+6 −17 .travis.yml
+1 −1 Core/DTFoundation-Info.plist
+0 −1 Core/DTFoundation.h
+1 −1 Core/Source/DTLog.m
+1 −1 Core/Source/DTSQLite/DTSQLiteDatabase.m
+2 −2 Core/Source/DTZipArchive/DTZipArchiveGZip.m
+11 −11 Core/Source/DTZipArchive/DTZipArchivePKZip.m
+2 −3 Core/Source/NSString+DTURLEncoding.m
+0 −21 Core/Source/iOS/UIWebView+DTFoundation.h
+0 −19 Core/Source/iOS/UIWebView+DTFoundation.m
+1 −1 DTFoundation.podspec
+4 −31 DTFoundation.xcodeproj/project.pbxproj
+10 −14 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTFoundation (OSX).xcscheme
+10 −14 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTFoundation (iOS).xcscheme
+1 −5 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTFoundation (tvOS).xcscheme
+3 −7 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTProgressHUD Demo.xcscheme
+3 −7 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTReachability Demo.xcscheme
+3 −7 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTSidePanels Demo.xcscheme
+3 −7 DTFoundation.xcodeproj/xcshareddata/xcschemes/DTZipArchive Demo.xcscheme
+1 −5 DTFoundation.xcodeproj/xcshareddata/xcschemes/Static Library (Mac).xcscheme
+1 −5 DTFoundation.xcodeproj/xcshareddata/xcschemes/Static Library (tvOS).xcscheme
+1 −5 DTFoundation.xcodeproj/xcshareddata/xcschemes/Static Library.xcscheme
+1 −5 DTFoundation.xcodeproj/xcshareddata/xcschemes/Unit Tests.xcscheme
+2 −2 Demo/DTSidePanels/Source/AppDelegate.m
+2 −0 Demo/DTZipArchiveDemo/DTZipArchiveDemo-Info.plist
+2 −2 Demo/DTZipArchiveDemo/Source/ViewController.m
+1 −1 Demo/DTZipArchiveDemo/Source/ZipArchiveManager.m
+1 −1 Demo/DTZipArchiveDemo/Source/ZipArchiveModel.m
+0 −4 Documentation/UIKit Subspec-template.markdown
+39 −0 Test/Source/NSStringDTURLEncodingTest.m
+1 −1 readme.markdown

0 comments on commit e9cc5bb

Please sign in to comment.