From 1c20989de64d876fac9562b25a5ebdc6b7a922ae Mon Sep 17 00:00:00 2001 From: Ruslan Skorb Date: Fri, 11 Dec 2020 16:09:03 +0200 Subject: [PATCH 1/2] [Package.swift + RSKInternalUtility] Include `RSKImageCropperStrings.bundle` into module. Fixes #227. --- Package.swift | 8 ++++++-- RSKImageCropper/RSKInternalUtility.m | 11 ++++++++--- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Package.swift b/Package.swift index ec13ed6..24967ef 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:5.2 +// swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription @@ -15,6 +15,10 @@ let package = Package( .target( name: "RSKImageCropper", path: "RSKImageCropper", - publicHeadersPath: "include"), + resources: [ + .copy("RSKImageCropperStrings.bundle") + ], + publicHeadersPath: "include" + ), ] ) diff --git a/RSKImageCropper/RSKInternalUtility.m b/RSKImageCropper/RSKInternalUtility.m index 68165bc..9d47535 100644 --- a/RSKImageCropper/RSKInternalUtility.m +++ b/RSKImageCropper/RSKInternalUtility.m @@ -37,9 +37,14 @@ + (NSBundle *)bundleForStrings static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ - NSBundle *bundleForClass = [NSBundle bundleForClass:[self class]]; - NSString *stringsBundlePath = [bundleForClass pathForResource:@"RSKImageCropperStrings" ofType:@"bundle"]; - bundle = [NSBundle bundleWithPath:stringsBundlePath] ?: bundleForClass; + NSBundle *resourcesBundle; +#ifdef SWIFTPM_MODULE_BUNDLE + resourcesBundle = SWIFTPM_MODULE_BUNDLE; +#else + resourcesBundle = [NSBundle bundleForClass:[self class]]; +#endif + NSString *stringsBundlePath = [resourcesBundle pathForResource:@"RSKImageCropperStrings" ofType:@"bundle"]; + bundle = [NSBundle bundleWithPath:stringsBundlePath] ?: resourcesBundle; }); return bundle; From 4bb339738f63a76bba1ab0ee90eb5cacc4699e87 Mon Sep 17 00:00:00 2001 From: Ruslan Skorb Date: Fri, 11 Dec 2020 16:10:06 +0200 Subject: [PATCH 2/2] Update RSKImageCropper version (3.0.1). --- .../project.pbxproj | 4 ++-- RSKImageCropper.podspec | 2 +- RSKImageCropper.xcodeproj/project.pbxproj | 20 +++++++++---------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Example/RSKImageCropperExample.xcodeproj/project.pbxproj b/Example/RSKImageCropperExample.xcodeproj/project.pbxproj index c77e21e..9826de6 100644 --- a/Example/RSKImageCropperExample.xcodeproj/project.pbxproj +++ b/Example/RSKImageCropperExample.xcodeproj/project.pbxproj @@ -551,7 +551,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "RSKImageCropperExample/RSKImageCropperExample-Prefix.pch"; INFOPLIST_FILE = "RSKImageCropperExample/RSKImageCropperExample-Info.plist"; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = RSKImageCropperExample; TARGETED_DEVICE_FAMILY = 1; @@ -567,7 +567,7 @@ GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "RSKImageCropperExample/RSKImageCropperExample-Prefix.pch"; INFOPLIST_FILE = "RSKImageCropperExample/RSKImageCropperExample-Info.plist"; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = RSKImageCropperExample; TARGETED_DEVICE_FAMILY = 1; diff --git a/RSKImageCropper.podspec b/RSKImageCropper.podspec index c1b4c8e..252b6c1 100644 --- a/RSKImageCropper.podspec +++ b/RSKImageCropper.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'RSKImageCropper' - s.version = '3.0.0' + s.version = '3.0.1' s.summary = 'An image cropper for iOS like in the Contacts app with support for landscape orientation.' s.homepage = 'https://github.com/ruslanskorb/RSKImageCropper' s.license = { :type => 'MIT', :file => 'LICENSE' } diff --git a/RSKImageCropper.xcodeproj/project.pbxproj b/RSKImageCropper.xcodeproj/project.pbxproj index 7620106..deb07bf 100644 --- a/RSKImageCropper.xcodeproj/project.pbxproj +++ b/RSKImageCropper.xcodeproj/project.pbxproj @@ -230,7 +230,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 3.0.0; + CURRENT_PROJECT_VERSION = 3.0.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; @@ -289,7 +289,7 @@ CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 3.0.0; + CURRENT_PROJECT_VERSION = 3.0.1; DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; @@ -315,15 +315,15 @@ isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 3.0.0; + CURRENT_PROJECT_VERSION = 3.0.1; DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 3.0.0; - DYLIB_CURRENT_VERSION = 3.0.0; + DYLIB_COMPATIBILITY_VERSION = 3.0.1; + DYLIB_CURRENT_VERSION = 3.0.1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; MODULEMAP_FILE = "$(SRCROOT)/RSKImageCropper/RSKImageCropper.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = RSKImageCropper; @@ -335,15 +335,15 @@ isa = XCBuildConfiguration; buildSettings = { "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; - CURRENT_PROJECT_VERSION = 3.0.0; + CURRENT_PROJECT_VERSION = 3.0.1; DEFINES_MODULE = YES; - DYLIB_COMPATIBILITY_VERSION = 3.0.0; - DYLIB_CURRENT_VERSION = 3.0.0; + DYLIB_COMPATIBILITY_VERSION = 3.0.1; + DYLIB_CURRENT_VERSION = 3.0.1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - MARKETING_VERSION = 3.0.0; + MARKETING_VERSION = 3.0.1; MODULEMAP_FILE = "$(SRCROOT)/RSKImageCropper/RSKImageCropper.modulemap"; PRODUCT_BUNDLE_IDENTIFIER = "com.ruslanskorb.$(PRODUCT_NAME:rfc1034identifier)"; PRODUCT_NAME = RSKImageCropper;