From 13358731ecdc823f6cdc02297c3b07d131087c25 Mon Sep 17 00:00:00 2001 From: Arnas Dundulis Date: Thu, 26 Jan 2017 11:37:59 +0200 Subject: [PATCH 1/2] Add framework target to test project --- .../project.pbxproj | 214 ++++++++++++++++++ .../xcschemes/HPGrowingTextView.xcscheme | 80 +++++++ .../HPGrowingTextViewUmbrella.h | 19 ++ example/HPGrowingTextViewFramework/Info.plist | 24 ++ .../module.modulemap | 6 + 5 files changed, 343 insertions(+) create mode 100644 example/GrowingTextViewExample.xcodeproj/xcshareddata/xcschemes/HPGrowingTextView.xcscheme create mode 100644 example/HPGrowingTextViewFramework/HPGrowingTextViewUmbrella.h create mode 100644 example/HPGrowingTextViewFramework/Info.plist create mode 100644 example/HPGrowingTextViewFramework/module.modulemap diff --git a/example/GrowingTextViewExample.xcodeproj/project.pbxproj b/example/GrowingTextViewExample.xcodeproj/project.pbxproj index 53f47ed..45df0bb 100755 --- a/example/GrowingTextViewExample.xcodeproj/project.pbxproj +++ b/example/GrowingTextViewExample.xcodeproj/project.pbxproj @@ -14,6 +14,15 @@ 288765A50DF7441C002DB57D /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; 28AD733F0D9D9553002E5188 /* MainWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = 28AD733E0D9D9553002E5188 /* MainWindow.xib */; }; 28D7ACF80DDB3853001CB0EB /* GrowingTextViewExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */; }; + 37F040EE1E39EAB000548C03 /* HPGrowingTextView.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37F040EF1E39EAB000548C03 /* HPTextViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37F040F01E39EAC400548C03 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1D30AB110D05D00D00671497 /* Foundation.framework */; }; + 37F040F11E39EAC900548C03 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1DF5F4DF0D08C38300B7A737 /* UIKit.framework */; }; + 37F040F21E39EAD200548C03 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 288765A40DF7441C002DB57D /* CoreGraphics.framework */; }; + 37F040F31E39EADC00548C03 /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */; }; + 37F040F41E39EADC00548C03 /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */; }; + 37F040F91E39EB1400548C03 /* HPGrowingTextViewUmbrella.h in Headers */ = {isa = PBXBuildFile; fileRef = 37F040F61E39EB1400548C03 /* HPGrowingTextViewUmbrella.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 37F040FA1E39EB1400548C03 /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 37F040F71E39EB1400548C03 /* Info.plist */; }; 3A5B30CE13EC633200DB7A65 /* HPGrowingTextView.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */; }; 3A5B30CF13EC633200DB7A65 /* HPTextViewInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A5B30CD13EC633200DB7A65 /* HPTextViewInternal.m */; }; 3A6144DE17719E8500311E3E /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 3A6144DD17719E8500311E3E /* Default-568h@2x.png */; }; @@ -39,6 +48,10 @@ 28D7ACF70DDB3853001CB0EB /* GrowingTextViewExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GrowingTextViewExampleViewController.m; sourceTree = ""; }; 29B97316FDCFA39411CA2CEA /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 32CA4F630368D1EE00C91783 /* GrowingTextViewExample_Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GrowingTextViewExample_Prefix.pch; sourceTree = ""; }; + 37F040E51E39E95800548C03 /* HPGrowingTextView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HPGrowingTextView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 37F040F61E39EB1400548C03 /* HPGrowingTextViewUmbrella.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPGrowingTextViewUmbrella.h; sourceTree = ""; }; + 37F040F71E39EB1400548C03 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 37F040F81E39EB1400548C03 /* module.modulemap */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = "sourcecode.module-map"; path = module.modulemap; sourceTree = ""; }; 3A5B30CA13EC633200DB7A65 /* HPGrowingTextView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPGrowingTextView.h; sourceTree = ""; }; 3A5B30CB13EC633200DB7A65 /* HPGrowingTextView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HPGrowingTextView.m; sourceTree = ""; }; 3A5B30CC13EC633200DB7A65 /* HPTextViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HPTextViewInternal.h; sourceTree = ""; }; @@ -66,6 +79,16 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 37F040E11E39E95800548C03 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 37F040F21E39EAD200548C03 /* CoreGraphics.framework in Frameworks */, + 37F040F11E39EAC900548C03 /* UIKit.framework in Frameworks */, + 37F040F01E39EAC400548C03 /* Foundation.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -85,6 +108,7 @@ isa = PBXGroup; children = ( 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */, + 37F040E51E39E95800548C03 /* HPGrowingTextView.framework */, ); name = Products; sourceTree = ""; @@ -95,6 +119,7 @@ 080E96DDFE201D6D7F000001 /* Classes */, 29B97315FDCFA39411CA2CEA /* Other Sources */, 29B97317FDCFA39411CA2CEA /* Resources */, + 37F040F51E39EB1400548C03 /* HPGrowingTextViewFramework */, 29B97323FDCFA39411CA2CEA /* Frameworks */, 19C28FACFE9D520D11CA2CBB /* Products */, ); @@ -138,6 +163,16 @@ name = Frameworks; sourceTree = ""; }; + 37F040F51E39EB1400548C03 /* HPGrowingTextViewFramework */ = { + isa = PBXGroup; + children = ( + 37F040F61E39EB1400548C03 /* HPGrowingTextViewUmbrella.h */, + 37F040F71E39EB1400548C03 /* Info.plist */, + 37F040F81E39EB1400548C03 /* module.modulemap */, + ); + path = HPGrowingTextViewFramework; + sourceTree = ""; + }; 3A5B30C913EC633200DB7A65 /* HPGrowingTextView */ = { isa = PBXGroup; children = ( @@ -152,6 +187,19 @@ }; /* End PBXGroup section */ +/* Begin PBXHeadersBuildPhase section */ + 37F040E21E39E95800548C03 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 37F040EF1E39EAB000548C03 /* HPTextViewInternal.h in Headers */, + 37F040F91E39EB1400548C03 /* HPGrowingTextViewUmbrella.h in Headers */, + 37F040EE1E39EAB000548C03 /* HPGrowingTextView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + /* Begin PBXNativeTarget section */ 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */ = { isa = PBXNativeTarget; @@ -170,6 +218,24 @@ productReference = 1D6058910D05DD3D006BFB54 /* GrowingTextViewExample.app */; productType = "com.apple.product-type.application"; }; + 37F040E41E39E95800548C03 /* HPGrowingTextView */ = { + isa = PBXNativeTarget; + buildConfigurationList = 37F040EC1E39E95800548C03 /* Build configuration list for PBXNativeTarget "HPGrowingTextView" */; + buildPhases = ( + 37F040E01E39E95800548C03 /* Sources */, + 37F040E11E39E95800548C03 /* Frameworks */, + 37F040E21E39E95800548C03 /* Headers */, + 37F040E31E39E95800548C03 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HPGrowingTextView; + productName = HPGrowingTextView; + productReference = 37F040E51E39E95800548C03 /* HPGrowingTextView.framework */; + productType = "com.apple.product-type.framework"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -177,6 +243,12 @@ isa = PBXProject; attributes = { LastUpgradeCheck = 0460; + TargetAttributes = { + 37F040E41E39E95800548C03 = { + CreatedOnToolsVersion = 8.2.1; + ProvisioningStyle = Automatic; + }; + }; }; buildConfigurationList = C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */; compatibilityVersion = "Xcode 3.2"; @@ -193,6 +265,7 @@ projectRoot = ""; targets = ( 1D6058900D05DD3D006BFB54 /* GrowingTextViewExample */, + 37F040E41E39E95800548C03 /* HPGrowingTextView */, ); }; /* End PBXProject section */ @@ -215,6 +288,14 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 37F040E31E39E95800548C03 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 37F040FA1E39EB1400548C03 /* Info.plist in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXResourcesBuildPhase section */ /* Begin PBXSourcesBuildPhase section */ @@ -230,6 +311,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + 37F040E01E39E95800548C03 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 37F040F31E39EADC00548C03 /* HPGrowingTextView.m in Sources */, + 37F040F41E39EADC00548C03 /* HPTextViewInternal.m in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin XCBuildConfiguration section */ @@ -268,6 +358,122 @@ }; name = Release; }; + 37F040EA1E39E95800548C03 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_DYNAMIC_NO_PIC = NO; + GCC_NO_COMMON_BLOCKS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + GCC_PREPROCESSOR_DEFINITIONS = ( + "DEBUG=1", + "$(inherited)", + ); + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "$(SRCROOT)/HPGrowingTextViewFramework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "$(SRCROOT)/HPGrowingTextViewFramework/module.modulemap"; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + PRODUCT_BUNDLE_IDENTIFIER = com.HansPinckaers.HPGrowingTextView; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 37F040EB1E39E95800548C03 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + ARCHS = "$(ARCHS_STANDARD)"; + CLANG_ANALYZER_NONNULL = YES; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; + CLANG_WARN_DOCUMENTATION_COMMENTS = YES; + CLANG_WARN_EMPTY_BODY = YES; + CLANG_WARN_ENUM_CONVERSION = YES; + CLANG_WARN_INFINITE_RECURSION = YES; + CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = ""; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_NO_COMMON_BLOCKS = YES; + GCC_WARN_64_TO_32_BIT_CONVERSION = YES; + GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; + GCC_WARN_UNDECLARED_SELECTOR = YES; + GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; + GCC_WARN_UNUSED_FUNCTION = YES; + INFOPLIST_FILE = "$(SRCROOT)/HPGrowingTextViewFramework/Info.plist"; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MODULEMAP_FILE = "$(SRCROOT)/HPGrowingTextViewFramework/module.modulemap"; + MTL_ENABLE_DEBUG_INFO = NO; + PRODUCT_BUNDLE_IDENTIFIER = com.HansPinckaers.HPGrowingTextView; + PRODUCT_NAME = "$(TARGET_NAME)"; + SKIP_INSTALL = YES; + TARGETED_DEVICE_FAMILY = "1,2"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; C01FCF4F08A954540054247B /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { @@ -305,6 +511,14 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; }; + 37F040EC1E39E95800548C03 /* Build configuration list for PBXNativeTarget "HPGrowingTextView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 37F040EA1E39E95800548C03 /* Debug */, + 37F040EB1E39E95800548C03 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; C01FCF4E08A954540054247B /* Build configuration list for PBXProject "GrowingTextViewExample" */ = { isa = XCConfigurationList; buildConfigurations = ( diff --git a/example/GrowingTextViewExample.xcodeproj/xcshareddata/xcschemes/HPGrowingTextView.xcscheme b/example/GrowingTextViewExample.xcodeproj/xcshareddata/xcschemes/HPGrowingTextView.xcscheme new file mode 100644 index 0000000..29d1909 --- /dev/null +++ b/example/GrowingTextViewExample.xcodeproj/xcshareddata/xcschemes/HPGrowingTextView.xcscheme @@ -0,0 +1,80 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/example/HPGrowingTextViewFramework/HPGrowingTextViewUmbrella.h b/example/HPGrowingTextViewFramework/HPGrowingTextViewUmbrella.h new file mode 100644 index 0000000..a77f370 --- /dev/null +++ b/example/HPGrowingTextViewFramework/HPGrowingTextViewUmbrella.h @@ -0,0 +1,19 @@ +// +// HPGrowingTextView.h +// HPGrowingTextView +// +// Created by Arnas Dundulis on 1/26/17. +// +// + +#import + +//! Project version number for HPGrowingTextView. +FOUNDATION_EXPORT double HPGrowingTextViewVersionNumber; + +//! Project version string for HPGrowingTextView. +FOUNDATION_EXPORT const unsigned char HPGrowingTextViewVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import +#import +#import diff --git a/example/HPGrowingTextViewFramework/Info.plist b/example/HPGrowingTextViewFramework/Info.plist new file mode 100644 index 0000000..fbe1e6b --- /dev/null +++ b/example/HPGrowingTextViewFramework/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 1.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/example/HPGrowingTextViewFramework/module.modulemap b/example/HPGrowingTextViewFramework/module.modulemap new file mode 100644 index 0000000..1f43b59 --- /dev/null +++ b/example/HPGrowingTextViewFramework/module.modulemap @@ -0,0 +1,6 @@ +framework module HPGrowingTextView { + umbrella header "HPGrowingTextViewUmbrella.h" + + export * + module * { export * } +} From 9f2b44246bba060f7e3ca1e10c2d59dd6d3fbae5 Mon Sep 17 00:00:00 2001 From: Arnas Dundulis Date: Thu, 26 Jan 2017 13:29:10 +0200 Subject: [PATCH 2/2] Fix deprecated warning --- class/HPTextViewInternal.m | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/class/HPTextViewInternal.m b/class/HPTextViewInternal.m index f3a6a1d..4b1c082 100644 --- a/class/HPTextViewInternal.m +++ b/class/HPTextViewInternal.m @@ -111,7 +111,15 @@ - (void)drawRect:(CGRect)rect } else { [self.placeholderColor set]; - [self.placeholder drawInRect:CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f) withFont:self.font]; + CGRect rect = CGRectMake(8.0f, 8.0f, self.frame.size.width - 16.0f, self.frame.size.height - 16.0f); + if ([self.placeholder respondsToSelector:@selector(drawInRect:withAttributes:)]) { + [self.placeholder drawInRect:rect withAttributes:@{NSFontAttributeName: self.font}]; + } else { + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wdeprecated-declarations" + [self.placeholder drawInRect:rect withFont:self.font]; + #pragma clang diagnostic pop + } } } }