diff --git a/Example/Example.xcodeproj/project.pbxproj b/Example/Example.xcodeproj/project.pbxproj new file mode 100644 index 0000000..0d2da91 --- /dev/null +++ b/Example/Example.xcodeproj/project.pbxproj @@ -0,0 +1,639 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 175EA06D203C11420042A4B4 /* HeaderZoomTableView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 175EA06E203C11420042A4B4 /* HeaderZoomTableView.framework */; }; + 17A1F62E203BC4460082EEDE /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F62D203BC4460082EEDE /* AppDelegate.swift */; }; + 17A1F630203BC4460082EEDE /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F62F203BC4460082EEDE /* ViewController.swift */; }; + 17A1F633203BC4460082EEDE /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F631203BC4460082EEDE /* Main.storyboard */; }; + 17A1F635203BC4460082EEDE /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F634203BC4460082EEDE /* Assets.xcassets */; }; + 17A1F638203BC4460082EEDE /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F636203BC4460082EEDE /* LaunchScreen.storyboard */; }; + 17A1F643203BC4460082EEDE /* ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F642203BC4460082EEDE /* ExampleTests.swift */; }; + 17A1F64E203BC4460082EEDE /* ExampleUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F64D203BC4460082EEDE /* ExampleUITests.swift */; }; + 17A1F664203BD5FB0082EEDE /* Standard.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F663203BD5FB0082EEDE /* Standard.storyboard */; }; + 17A1F666203BD60D0082EEDE /* Square.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F665203BD60D0082EEDE /* Square.storyboard */; }; + 17A1F668203BD61D0082EEDE /* Wide.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F667203BD61D0082EEDE /* Wide.storyboard */; }; + 17A1F66A203BD62A0082EEDE /* Custom.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 17A1F669203BD62A0082EEDE /* Custom.storyboard */; }; + 17A1F670203BD6A80082EEDE /* StandardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F66F203BD6A80082EEDE /* StandardViewController.swift */; }; + 17A1F672203BD6B60082EEDE /* SquareViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F671203BD6B60082EEDE /* SquareViewController.swift */; }; + 17A1F674203BD6C30082EEDE /* WideViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F673203BD6C30082EEDE /* WideViewController.swift */; }; + 17A1F676203BD6DA0082EEDE /* CustomViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 17A1F675203BD6DA0082EEDE /* CustomViewController.swift */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 17A1F63F203BC4460082EEDE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 17A1F622203BC4460082EEDE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 17A1F629203BC4460082EEDE; + remoteInfo = Example; + }; + 17A1F64A203BC4460082EEDE /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 17A1F622203BC4460082EEDE /* Project object */; + proxyType = 1; + remoteGlobalIDString = 17A1F629203BC4460082EEDE; + remoteInfo = Example; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 175EA06E203C11420042A4B4 /* HeaderZoomTableView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = HeaderZoomTableView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 17A1F62A203BC4460082EEDE /* Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; + 17A1F62D203BC4460082EEDE /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + 17A1F62F203BC4460082EEDE /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; + 17A1F632203BC4460082EEDE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; + 17A1F634203BC4460082EEDE /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; + 17A1F637203BC4460082EEDE /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; + 17A1F639203BC4460082EEDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 17A1F63E203BC4460082EEDE /* ExampleTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 17A1F642203BC4460082EEDE /* ExampleTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleTests.swift; sourceTree = ""; }; + 17A1F644203BC4460082EEDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 17A1F649203BC4460082EEDE /* ExampleUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ExampleUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 17A1F64D203BC4460082EEDE /* ExampleUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExampleUITests.swift; sourceTree = ""; }; + 17A1F64F203BC4460082EEDE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 17A1F663203BD5FB0082EEDE /* Standard.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Standard.storyboard; sourceTree = ""; }; + 17A1F665203BD60D0082EEDE /* Square.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Square.storyboard; sourceTree = ""; }; + 17A1F667203BD61D0082EEDE /* Wide.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Wide.storyboard; sourceTree = ""; }; + 17A1F669203BD62A0082EEDE /* Custom.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Custom.storyboard; sourceTree = ""; }; + 17A1F66F203BD6A80082EEDE /* StandardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = StandardViewController.swift; sourceTree = ""; }; + 17A1F671203BD6B60082EEDE /* SquareViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SquareViewController.swift; sourceTree = ""; }; + 17A1F673203BD6C30082EEDE /* WideViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WideViewController.swift; sourceTree = ""; }; + 17A1F675203BD6DA0082EEDE /* CustomViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomViewController.swift; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 17A1F627203BC4460082EEDE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA06D203C11420042A4B4 /* HeaderZoomTableView.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F63B203BC4460082EEDE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F646203BC4460082EEDE /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 175EA06C203C11420042A4B4 /* Frameworks */ = { + isa = PBXGroup; + children = ( + 175EA06E203C11420042A4B4 /* HeaderZoomTableView.framework */, + ); + name = Frameworks; + sourceTree = ""; + }; + 17A1F621203BC4460082EEDE = { + isa = PBXGroup; + children = ( + 17A1F62C203BC4460082EEDE /* Example */, + 17A1F641203BC4460082EEDE /* ExampleTests */, + 17A1F64C203BC4460082EEDE /* ExampleUITests */, + 17A1F62B203BC4460082EEDE /* Products */, + 175EA06C203C11420042A4B4 /* Frameworks */, + ); + sourceTree = ""; + }; + 17A1F62B203BC4460082EEDE /* Products */ = { + isa = PBXGroup; + children = ( + 17A1F62A203BC4460082EEDE /* Example.app */, + 17A1F63E203BC4460082EEDE /* ExampleTests.xctest */, + 17A1F649203BC4460082EEDE /* ExampleUITests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 17A1F62C203BC4460082EEDE /* Example */ = { + isa = PBXGroup; + children = ( + 17A1F62F203BC4460082EEDE /* ViewController.swift */, + 17A1F66B203BD62E0082EEDE /* Standard */, + 17A1F66C203BD6360082EEDE /* Square */, + 17A1F66D203BD63C0082EEDE /* Wide */, + 17A1F66E203BD6420082EEDE /* Custom */, + 17A1F62D203BC4460082EEDE /* AppDelegate.swift */, + 17A1F631203BC4460082EEDE /* Main.storyboard */, + 17A1F634203BC4460082EEDE /* Assets.xcassets */, + 17A1F636203BC4460082EEDE /* LaunchScreen.storyboard */, + 17A1F639203BC4460082EEDE /* Info.plist */, + ); + path = Example; + sourceTree = ""; + }; + 17A1F641203BC4460082EEDE /* ExampleTests */ = { + isa = PBXGroup; + children = ( + 17A1F642203BC4460082EEDE /* ExampleTests.swift */, + 17A1F644203BC4460082EEDE /* Info.plist */, + ); + path = ExampleTests; + sourceTree = ""; + }; + 17A1F64C203BC4460082EEDE /* ExampleUITests */ = { + isa = PBXGroup; + children = ( + 17A1F64D203BC4460082EEDE /* ExampleUITests.swift */, + 17A1F64F203BC4460082EEDE /* Info.plist */, + ); + path = ExampleUITests; + sourceTree = ""; + }; + 17A1F66B203BD62E0082EEDE /* Standard */ = { + isa = PBXGroup; + children = ( + 17A1F66F203BD6A80082EEDE /* StandardViewController.swift */, + 17A1F663203BD5FB0082EEDE /* Standard.storyboard */, + ); + path = Standard; + sourceTree = ""; + }; + 17A1F66C203BD6360082EEDE /* Square */ = { + isa = PBXGroup; + children = ( + 17A1F671203BD6B60082EEDE /* SquareViewController.swift */, + 17A1F665203BD60D0082EEDE /* Square.storyboard */, + ); + path = Square; + sourceTree = ""; + }; + 17A1F66D203BD63C0082EEDE /* Wide */ = { + isa = PBXGroup; + children = ( + 17A1F673203BD6C30082EEDE /* WideViewController.swift */, + 17A1F667203BD61D0082EEDE /* Wide.storyboard */, + ); + path = Wide; + sourceTree = ""; + }; + 17A1F66E203BD6420082EEDE /* Custom */ = { + isa = PBXGroup; + children = ( + 17A1F675203BD6DA0082EEDE /* CustomViewController.swift */, + 17A1F669203BD62A0082EEDE /* Custom.storyboard */, + ); + path = Custom; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXNativeTarget section */ + 17A1F629203BC4460082EEDE /* Example */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17A1F652203BC4460082EEDE /* Build configuration list for PBXNativeTarget "Example" */; + buildPhases = ( + 17A1F626203BC4460082EEDE /* Sources */, + 17A1F627203BC4460082EEDE /* Frameworks */, + 17A1F628203BC4460082EEDE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = Example; + productName = Example; + productReference = 17A1F62A203BC4460082EEDE /* Example.app */; + productType = "com.apple.product-type.application"; + }; + 17A1F63D203BC4460082EEDE /* ExampleTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17A1F655203BC4460082EEDE /* Build configuration list for PBXNativeTarget "ExampleTests" */; + buildPhases = ( + 17A1F63A203BC4460082EEDE /* Sources */, + 17A1F63B203BC4460082EEDE /* Frameworks */, + 17A1F63C203BC4460082EEDE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 17A1F640203BC4460082EEDE /* PBXTargetDependency */, + ); + name = ExampleTests; + productName = ExampleTests; + productReference = 17A1F63E203BC4460082EEDE /* ExampleTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; + 17A1F648203BC4460082EEDE /* ExampleUITests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 17A1F658203BC4460082EEDE /* Build configuration list for PBXNativeTarget "ExampleUITests" */; + buildPhases = ( + 17A1F645203BC4460082EEDE /* Sources */, + 17A1F646203BC4460082EEDE /* Frameworks */, + 17A1F647203BC4460082EEDE /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 17A1F64B203BC4460082EEDE /* PBXTargetDependency */, + ); + name = ExampleUITests; + productName = ExampleUITests; + productReference = 17A1F649203BC4460082EEDE /* ExampleUITests.xctest */; + productType = "com.apple.product-type.bundle.ui-testing"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 17A1F622203BC4460082EEDE /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Teruki Nakano"; + TargetAttributes = { + 17A1F629203BC4460082EEDE = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + 17A1F63D203BC4460082EEDE = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + TestTargetID = 17A1F629203BC4460082EEDE; + }; + 17A1F648203BC4460082EEDE = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + TestTargetID = 17A1F629203BC4460082EEDE; + }; + }; + }; + buildConfigurationList = 17A1F625203BC4460082EEDE /* Build configuration list for PBXProject "Example" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + Base, + ); + mainGroup = 17A1F621203BC4460082EEDE; + productRefGroup = 17A1F62B203BC4460082EEDE /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 17A1F629203BC4460082EEDE /* Example */, + 17A1F63D203BC4460082EEDE /* ExampleTests */, + 17A1F648203BC4460082EEDE /* ExampleUITests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 17A1F628203BC4460082EEDE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17A1F638203BC4460082EEDE /* LaunchScreen.storyboard in Resources */, + 17A1F668203BD61D0082EEDE /* Wide.storyboard in Resources */, + 17A1F666203BD60D0082EEDE /* Square.storyboard in Resources */, + 17A1F635203BC4460082EEDE /* Assets.xcassets in Resources */, + 17A1F66A203BD62A0082EEDE /* Custom.storyboard in Resources */, + 17A1F633203BC4460082EEDE /* Main.storyboard in Resources */, + 17A1F664203BD5FB0082EEDE /* Standard.storyboard in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F63C203BC4460082EEDE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F647203BC4460082EEDE /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 17A1F626203BC4460082EEDE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17A1F670203BD6A80082EEDE /* StandardViewController.swift in Sources */, + 17A1F672203BD6B60082EEDE /* SquareViewController.swift in Sources */, + 17A1F674203BD6C30082EEDE /* WideViewController.swift in Sources */, + 17A1F676203BD6DA0082EEDE /* CustomViewController.swift in Sources */, + 17A1F630203BC4460082EEDE /* ViewController.swift in Sources */, + 17A1F62E203BC4460082EEDE /* AppDelegate.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F63A203BC4460082EEDE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17A1F643203BC4460082EEDE /* ExampleTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 17A1F645203BC4460082EEDE /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 17A1F64E203BC4460082EEDE /* ExampleUITests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 17A1F640203BC4460082EEDE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 17A1F629203BC4460082EEDE /* Example */; + targetProxy = 17A1F63F203BC4460082EEDE /* PBXContainerItemProxy */; + }; + 17A1F64B203BC4460082EEDE /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 17A1F629203BC4460082EEDE /* Example */; + targetProxy = 17A1F64A203BC4460082EEDE /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin PBXVariantGroup section */ + 17A1F631203BC4460082EEDE /* Main.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 17A1F632203BC4460082EEDE /* Base */, + ); + name = Main.storyboard; + sourceTree = ""; + }; + 17A1F636203BC4460082EEDE /* LaunchScreen.storyboard */ = { + isa = PBXVariantGroup; + children = ( + 17A1F637203BC4460082EEDE /* Base */, + ); + name = LaunchScreen.storyboard; + sourceTree = ""; + }; +/* End PBXVariantGroup section */ + +/* Begin XCBuildConfiguration section */ + 17A1F650203BC4460082EEDE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + }; + name = Debug; + }; + 17A1F651203BC4460082EEDE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 11.2; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + }; + name = Release; + }; + 17A1F653203BC4460082EEDE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 17A1F654203BC4460082EEDE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = ""; + INFOPLIST_FILE = Example/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.Example; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 17A1F656203BC4460082EEDE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = LEKYLHW8W5; + INFOPLIST_FILE = ExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.ExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; + }; + name = Debug; + }; + 17A1F657203BC4460082EEDE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + BUNDLE_LOADER = "$(TEST_HOST)"; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = LEKYLHW8W5; + INFOPLIST_FILE = ExampleTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.ExampleTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_HOST = "$(BUILT_PRODUCTS_DIR)/Example.app/Example"; + }; + name = Release; + }; + 17A1F659203BC4460082EEDE /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = LEKYLHW8W5; + INFOPLIST_FILE = ExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.ExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = Example; + }; + name = Debug; + }; + 17A1F65A203BC4460082EEDE /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + DEVELOPMENT_TEAM = LEKYLHW8W5; + INFOPLIST_FILE = ExampleUITests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.ExampleUITests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + TEST_TARGET_NAME = Example; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 17A1F625203BC4460082EEDE /* Build configuration list for PBXProject "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17A1F650203BC4460082EEDE /* Debug */, + 17A1F651203BC4460082EEDE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17A1F652203BC4460082EEDE /* Build configuration list for PBXNativeTarget "Example" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17A1F653203BC4460082EEDE /* Debug */, + 17A1F654203BC4460082EEDE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17A1F655203BC4460082EEDE /* Build configuration list for PBXNativeTarget "ExampleTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17A1F656203BC4460082EEDE /* Debug */, + 17A1F657203BC4460082EEDE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 17A1F658203BC4460082EEDE /* Build configuration list for PBXNativeTarget "ExampleUITests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 17A1F659203BC4460082EEDE /* Debug */, + 17A1F65A203BC4460082EEDE /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 17A1F622203BC4460082EEDE /* Project object */; +} diff --git a/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..6d2a51b --- /dev/null +++ b/Example/Example.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Example/Example.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist b/Example/Example.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..b67cdbd --- /dev/null +++ b/Example/Example.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + Example.xcscheme + + orderHint + 0 + + + + diff --git a/Example/Example/AppDelegate.swift b/Example/Example/AppDelegate.swift new file mode 100644 index 0000000..c6b4b63 --- /dev/null +++ b/Example/Example/AppDelegate.swift @@ -0,0 +1,46 @@ +// +// AppDelegate.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit + +@UIApplicationMain +class AppDelegate: UIResponder, UIApplicationDelegate { + + var window: UIWindow? + + + func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { + // Override point for customization after application launch. + return true + } + + func applicationWillResignActive(_ application: UIApplication) { + // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. + // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. + } + + func applicationDidEnterBackground(_ application: UIApplication) { + // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. + // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. + } + + func applicationWillEnterForeground(_ application: UIApplication) { + // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. + } + + func applicationDidBecomeActive(_ application: UIApplication) { + // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. + } + + func applicationWillTerminate(_ application: UIApplication) { + // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. + } + + +} + diff --git a/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json new file mode 100644 index 0000000..d8db8d6 --- /dev/null +++ b/Example/Example/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -0,0 +1,98 @@ +{ + "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "29x29", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "40x40", + "scale" : "3x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "60x60", + "scale" : "3x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "29x29", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "40x40", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "1x" + }, + { + "idiom" : "ipad", + "size" : "76x76", + "scale" : "2x" + }, + { + "idiom" : "ipad", + "size" : "83.5x83.5", + "scale" : "2x" + }, + { + "idiom" : "ios-marketing", + "size" : "1024x1024", + "scale" : "1x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/Contents.json b/Example/Example/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/Example/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Contents.json b/Example/Example/Assets.xcassets/New Folder/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/Example/Example/Assets.xcassets/New Folder/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Contents.json b/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Contents.json new file mode 100644 index 0000000..8853090 --- /dev/null +++ b/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Image_custom.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Image_custom.jpg b/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Image_custom.jpg new file mode 100644 index 0000000..8b733c4 Binary files /dev/null and b/Example/Example/Assets.xcassets/New Folder/Image_custom.imageset/Image_custom.jpg differ diff --git a/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Contents.json b/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Contents.json new file mode 100644 index 0000000..fb5d16d --- /dev/null +++ b/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Image_square.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Image_square.jpg b/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Image_square.jpg new file mode 100644 index 0000000..49111cc Binary files /dev/null and b/Example/Example/Assets.xcassets/New Folder/Image_square.imageset/Image_square.jpg differ diff --git a/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Contents.json b/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Contents.json new file mode 100644 index 0000000..a8bf852 --- /dev/null +++ b/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Image_standard.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Image_standard.jpg b/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Image_standard.jpg new file mode 100644 index 0000000..e66729a Binary files /dev/null and b/Example/Example/Assets.xcassets/New Folder/Image_standard.imageset/Image_standard.jpg differ diff --git a/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Contents.json b/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Contents.json new file mode 100644 index 0000000..b948e80 --- /dev/null +++ b/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "Image_wide.jpg", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Image_wide.jpg b/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Image_wide.jpg new file mode 100644 index 0000000..395c8d5 Binary files /dev/null and b/Example/Example/Assets.xcassets/New Folder/Image_wide.imageset/Image_wide.jpg differ diff --git a/Example/Example/Base.lproj/LaunchScreen.storyboard b/Example/Example/Base.lproj/LaunchScreen.storyboard new file mode 100644 index 0000000..f83f6fd --- /dev/null +++ b/Example/Example/Base.lproj/LaunchScreen.storyboard @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Base.lproj/Main.storyboard b/Example/Example/Base.lproj/Main.storyboard new file mode 100644 index 0000000..41bb0cc --- /dev/null +++ b/Example/Example/Base.lproj/Main.storyboard @@ -0,0 +1,119 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Custom/Custom.storyboard b/Example/Example/Custom/Custom.storyboard new file mode 100644 index 0000000..2c22e93 --- /dev/null +++ b/Example/Example/Custom/Custom.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Custom/CustomViewController.swift b/Example/Example/Custom/CustomViewController.swift new file mode 100644 index 0000000..3af9057 --- /dev/null +++ b/Example/Example/Custom/CustomViewController.swift @@ -0,0 +1,27 @@ +// +// CustomViewController.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit +import HeaderZoomTableView + +class CustomViewController: UIViewController { + + @IBOutlet weak var tableView: HeaderZoomTableView! + + override func viewDidLoad() { + super.viewDidLoad() + + // for custom(e.g w375:h235) + tableView.imageAspectRatio = .custom(w: 375.0, h: 235.0) + tableView.headerImage = #imageLiteral(resourceName: "Image_custom") + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } +} diff --git a/Example/Example/Info.plist b/Example/Example/Info.plist new file mode 100644 index 0000000..16be3b6 --- /dev/null +++ b/Example/Example/Info.plist @@ -0,0 +1,45 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIMainStoryboardFile + Main + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + + diff --git a/Example/Example/Square/Square.storyboard b/Example/Example/Square/Square.storyboard new file mode 100644 index 0000000..c14b82d --- /dev/null +++ b/Example/Example/Square/Square.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Square/SquareViewController.swift b/Example/Example/Square/SquareViewController.swift new file mode 100644 index 0000000..92f5a78 --- /dev/null +++ b/Example/Example/Square/SquareViewController.swift @@ -0,0 +1,27 @@ +// +// SquareViewController.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit +import HeaderZoomTableView + +class SquareViewController: UIViewController { + + @IBOutlet weak var tableView: HeaderZoomTableView! + + override func viewDidLoad() { + super.viewDidLoad() + + // for square(w1:h1) + tableView.imageAspectRatio = .square + tableView.headerImage = #imageLiteral(resourceName: "Image_square") + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } +} diff --git a/Example/Example/Standard/Standard.storyboard b/Example/Example/Standard/Standard.storyboard new file mode 100644 index 0000000..395fff1 --- /dev/null +++ b/Example/Example/Standard/Standard.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Standard/StandardViewController.swift b/Example/Example/Standard/StandardViewController.swift new file mode 100644 index 0000000..9e2f6f5 --- /dev/null +++ b/Example/Example/Standard/StandardViewController.swift @@ -0,0 +1,27 @@ +// +// StandardViewController.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit +import HeaderZoomTableView + +class StandardViewController: UIViewController { + + @IBOutlet weak var tableView: HeaderZoomTableView! + + override func viewDidLoad() { + super.viewDidLoad() + + // Default Setting + tableView.imageAspectRatio = .standard + tableView.headerImage = #imageLiteral(resourceName: "Image_standard") + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } +} diff --git a/Example/Example/ViewController.swift b/Example/Example/ViewController.swift new file mode 100644 index 0000000..35d0e8f --- /dev/null +++ b/Example/Example/ViewController.swift @@ -0,0 +1,21 @@ +// +// ViewController.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit + +class ViewController: UIViewController { + + override func viewDidLoad() { + super.viewDidLoad() + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } +} + diff --git a/Example/Example/Wide/Wide.storyboard b/Example/Example/Wide/Wide.storyboard new file mode 100644 index 0000000..6f0913b --- /dev/null +++ b/Example/Example/Wide/Wide.storyboard @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Example/Example/Wide/WideViewController.swift b/Example/Example/Wide/WideViewController.swift new file mode 100644 index 0000000..e7f9eee --- /dev/null +++ b/Example/Example/Wide/WideViewController.swift @@ -0,0 +1,28 @@ +// +// WideViewController.swift +// Example +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit +import HeaderZoomTableView + +class WideViewController: UIViewController { + + @IBOutlet weak var tableView: HeaderZoomTableView! + + override func viewDidLoad() { + super.viewDidLoad() + + // for wide(w16:h9) + tableView.imageAspectRatio = .wide + tableView.headerImage = #imageLiteral(resourceName: "Image_wide") + + } + + override func didReceiveMemoryWarning() { + super.didReceiveMemoryWarning() + } +} diff --git a/Example/ExampleTests/ExampleTests.swift b/Example/ExampleTests/ExampleTests.swift new file mode 100644 index 0000000..8d220d9 --- /dev/null +++ b/Example/ExampleTests/ExampleTests.swift @@ -0,0 +1,36 @@ +// +// ExampleTests.swift +// ExampleTests +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import XCTest +@testable import Example + +class ExampleTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/Example/ExampleTests/Info.plist b/Example/ExampleTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/Example/ExampleTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/Example/ExampleUITests/ExampleUITests.swift b/Example/ExampleUITests/ExampleUITests.swift new file mode 100644 index 0000000..c0aa63b --- /dev/null +++ b/Example/ExampleUITests/ExampleUITests.swift @@ -0,0 +1,36 @@ +// +// ExampleUITests.swift +// ExampleUITests +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import XCTest + +class ExampleUITests: XCTestCase { + + override func setUp() { + super.setUp() + + // Put setup code here. This method is called before the invocation of each test method in the class. + + // In UI tests it is usually best to stop immediately when a failure occurs. + continueAfterFailure = false + // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. + XCUIApplication().launch() + + // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // Use recording to get started writing UI tests. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + +} diff --git a/Example/ExampleUITests/Info.plist b/Example/ExampleUITests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/Example/ExampleUITests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/HeaderZoomTableView.xcodeproj/project.pbxproj b/HeaderZoomTableView.xcodeproj/project.pbxproj new file mode 100644 index 0000000..2c72121 --- /dev/null +++ b/HeaderZoomTableView.xcodeproj/project.pbxproj @@ -0,0 +1,459 @@ +// !$*UTF8*$! +{ + archiveVersion = 1; + classes = { + }; + objectVersion = 48; + objects = { + +/* Begin PBXBuildFile section */ + 175EA051203C0F630042A4B4 /* HeaderZoomTableView.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 175EA047203C0F630042A4B4 /* HeaderZoomTableView.framework */; }; + 175EA056203C0F630042A4B4 /* HeaderZoomTableViewTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 175EA055203C0F630042A4B4 /* HeaderZoomTableViewTests.swift */; }; + 175EA058203C0F630042A4B4 /* HeaderZoomTableView.h in Headers */ = {isa = PBXBuildFile; fileRef = 175EA04A203C0F630042A4B4 /* HeaderZoomTableView.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 175EA068203C10CF0042A4B4 /* HeaderZoomTableView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 175EA063203C10CF0042A4B4 /* HeaderZoomTableView.swift */; }; + 175EA069203C10CF0042A4B4 /* ImageAspectRatio.swift in Sources */ = {isa = PBXBuildFile; fileRef = 175EA064203C10CF0042A4B4 /* ImageAspectRatio.swift */; }; + 175EA06A203C10CF0042A4B4 /* HeaderImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 175EA066203C10CF0042A4B4 /* HeaderImageView.swift */; }; + 175EA06B203C10CF0042A4B4 /* HeaderImageView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 175EA067203C10CF0042A4B4 /* HeaderImageView.xib */; }; +/* End PBXBuildFile section */ + +/* Begin PBXContainerItemProxy section */ + 175EA052203C0F630042A4B4 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 175EA03E203C0F630042A4B4 /* Project object */; + proxyType = 1; + remoteGlobalIDString = 175EA046203C0F630042A4B4; + remoteInfo = HeaderZoomTableView; + }; +/* End PBXContainerItemProxy section */ + +/* Begin PBXFileReference section */ + 175EA047203C0F630042A4B4 /* HeaderZoomTableView.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = HeaderZoomTableView.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 175EA04A203C0F630042A4B4 /* HeaderZoomTableView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HeaderZoomTableView.h; sourceTree = ""; }; + 175EA04B203C0F630042A4B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 175EA050203C0F630042A4B4 /* HeaderZoomTableViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HeaderZoomTableViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; + 175EA055203C0F630042A4B4 /* HeaderZoomTableViewTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HeaderZoomTableViewTests.swift; sourceTree = ""; }; + 175EA057203C0F630042A4B4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + 175EA063203C10CF0042A4B4 /* HeaderZoomTableView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderZoomTableView.swift; sourceTree = ""; }; + 175EA064203C10CF0042A4B4 /* ImageAspectRatio.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageAspectRatio.swift; sourceTree = ""; }; + 175EA066203C10CF0042A4B4 /* HeaderImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HeaderImageView.swift; sourceTree = ""; }; + 175EA067203C10CF0042A4B4 /* HeaderImageView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = HeaderImageView.xib; sourceTree = ""; }; +/* End PBXFileReference section */ + +/* Begin PBXFrameworksBuildPhase section */ + 175EA043203C0F630042A4B4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 175EA04D203C0F630042A4B4 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA051203C0F630042A4B4 /* HeaderZoomTableView.framework in Frameworks */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXFrameworksBuildPhase section */ + +/* Begin PBXGroup section */ + 175EA03D203C0F630042A4B4 = { + isa = PBXGroup; + children = ( + 175EA049203C0F630042A4B4 /* HeaderZoomTableView */, + 175EA054203C0F630042A4B4 /* HeaderZoomTableViewTests */, + 175EA048203C0F630042A4B4 /* Products */, + ); + sourceTree = ""; + }; + 175EA048203C0F630042A4B4 /* Products */ = { + isa = PBXGroup; + children = ( + 175EA047203C0F630042A4B4 /* HeaderZoomTableView.framework */, + 175EA050203C0F630042A4B4 /* HeaderZoomTableViewTests.xctest */, + ); + name = Products; + sourceTree = ""; + }; + 175EA049203C0F630042A4B4 /* HeaderZoomTableView */ = { + isa = PBXGroup; + children = ( + 175EA063203C10CF0042A4B4 /* HeaderZoomTableView.swift */, + 175EA064203C10CF0042A4B4 /* ImageAspectRatio.swift */, + 175EA065203C10CF0042A4B4 /* HeaderImage */, + 175EA04A203C0F630042A4B4 /* HeaderZoomTableView.h */, + 175EA04B203C0F630042A4B4 /* Info.plist */, + ); + path = HeaderZoomTableView; + sourceTree = ""; + }; + 175EA054203C0F630042A4B4 /* HeaderZoomTableViewTests */ = { + isa = PBXGroup; + children = ( + 175EA055203C0F630042A4B4 /* HeaderZoomTableViewTests.swift */, + 175EA057203C0F630042A4B4 /* Info.plist */, + ); + path = HeaderZoomTableViewTests; + sourceTree = ""; + }; + 175EA065203C10CF0042A4B4 /* HeaderImage */ = { + isa = PBXGroup; + children = ( + 175EA066203C10CF0042A4B4 /* HeaderImageView.swift */, + 175EA067203C10CF0042A4B4 /* HeaderImageView.xib */, + ); + path = HeaderImage; + sourceTree = ""; + }; +/* End PBXGroup section */ + +/* Begin PBXHeadersBuildPhase section */ + 175EA044203C0F630042A4B4 /* Headers */ = { + isa = PBXHeadersBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA058203C0F630042A4B4 /* HeaderZoomTableView.h in Headers */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXHeadersBuildPhase section */ + +/* Begin PBXNativeTarget section */ + 175EA046203C0F630042A4B4 /* HeaderZoomTableView */ = { + isa = PBXNativeTarget; + buildConfigurationList = 175EA05B203C0F630042A4B4 /* Build configuration list for PBXNativeTarget "HeaderZoomTableView" */; + buildPhases = ( + 175EA042203C0F630042A4B4 /* Sources */, + 175EA043203C0F630042A4B4 /* Frameworks */, + 175EA044203C0F630042A4B4 /* Headers */, + 175EA045203C0F630042A4B4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + ); + name = HeaderZoomTableView; + productName = HeaderZoomTableView; + productReference = 175EA047203C0F630042A4B4 /* HeaderZoomTableView.framework */; + productType = "com.apple.product-type.framework"; + }; + 175EA04F203C0F630042A4B4 /* HeaderZoomTableViewTests */ = { + isa = PBXNativeTarget; + buildConfigurationList = 175EA05E203C0F630042A4B4 /* Build configuration list for PBXNativeTarget "HeaderZoomTableViewTests" */; + buildPhases = ( + 175EA04C203C0F630042A4B4 /* Sources */, + 175EA04D203C0F630042A4B4 /* Frameworks */, + 175EA04E203C0F630042A4B4 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + 175EA053203C0F630042A4B4 /* PBXTargetDependency */, + ); + name = HeaderZoomTableViewTests; + productName = HeaderZoomTableViewTests; + productReference = 175EA050203C0F630042A4B4 /* HeaderZoomTableViewTests.xctest */; + productType = "com.apple.product-type.bundle.unit-test"; + }; +/* End PBXNativeTarget section */ + +/* Begin PBXProject section */ + 175EA03E203C0F630042A4B4 /* Project object */ = { + isa = PBXProject; + attributes = { + LastSwiftUpdateCheck = 0920; + LastUpgradeCheck = 0920; + ORGANIZATIONNAME = "Teruki Nakano"; + TargetAttributes = { + 175EA046203C0F630042A4B4 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + 175EA04F203C0F630042A4B4 = { + CreatedOnToolsVersion = 9.2; + ProvisioningStyle = Automatic; + }; + }; + }; + buildConfigurationList = 175EA041203C0F630042A4B4 /* Build configuration list for PBXProject "HeaderZoomTableView" */; + compatibilityVersion = "Xcode 8.0"; + developmentRegion = en; + hasScannedForEncodings = 0; + knownRegions = ( + en, + ); + mainGroup = 175EA03D203C0F630042A4B4; + productRefGroup = 175EA048203C0F630042A4B4 /* Products */; + projectDirPath = ""; + projectRoot = ""; + targets = ( + 175EA046203C0F630042A4B4 /* HeaderZoomTableView */, + 175EA04F203C0F630042A4B4 /* HeaderZoomTableViewTests */, + ); + }; +/* End PBXProject section */ + +/* Begin PBXResourcesBuildPhase section */ + 175EA045203C0F630042A4B4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA06B203C10CF0042A4B4 /* HeaderImageView.xib in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 175EA04E203C0F630042A4B4 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXResourcesBuildPhase section */ + +/* Begin PBXSourcesBuildPhase section */ + 175EA042203C0F630042A4B4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA06A203C10CF0042A4B4 /* HeaderImageView.swift in Sources */, + 175EA068203C10CF0042A4B4 /* HeaderZoomTableView.swift in Sources */, + 175EA069203C10CF0042A4B4 /* ImageAspectRatio.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + 175EA04C203C0F630042A4B4 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + 175EA056203C0F630042A4B4 /* HeaderZoomTableViewTests.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXSourcesBuildPhase section */ + +/* Begin PBXTargetDependency section */ + 175EA053203C0F630042A4B4 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = 175EA046203C0F630042A4B4 /* HeaderZoomTableView */; + targetProxy = 175EA052203C0F630042A4B4 /* PBXContainerItemProxy */; + }; +/* End PBXTargetDependency section */ + +/* Begin XCBuildConfiguration section */ + 175EA059203C0F630042A4B4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = dwarf; + ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_TESTABILITY = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = YES; + ONLY_ACTIVE_ARCH = YES; + SDKROOT = iphoneos; + SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; + SWIFT_OPTIMIZATION_LEVEL = "-Onone"; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Debug; + }; + 175EA05A203C0F630042A4B4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_NONNULL = YES; + CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; + CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; + CLANG_CXX_LIBRARY = "libc++"; + CLANG_ENABLE_MODULES = YES; + CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; + CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = 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_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; + CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; + CLANG_WARN_SUSPICIOUS_MOVE = YES; + CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; + CLANG_WARN_UNREACHABLE_CODE = YES; + CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; + CODE_SIGN_IDENTITY = "iPhone Developer"; + COPY_PHASE_STRIP = NO; + CURRENT_PROJECT_VERSION = 1; + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + ENABLE_NS_ASSERTIONS = NO; + ENABLE_STRICT_OBJC_MSGSEND = YES; + GCC_C_LANGUAGE_STANDARD = gnu11; + 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; + GCC_WARN_UNUSED_VARIABLE = YES; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MTL_ENABLE_DEBUG_INFO = NO; + SDKROOT = iphoneos; + SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + VALIDATE_PRODUCT = YES; + VERSIONING_SYSTEM = "apple-generic"; + VERSION_INFO_PREFIX = ""; + }; + name = Release; + }; + 175EA05C203C0F630042A4B4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = HeaderZoomTableView/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.HeaderZoomTableView; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 175EA05D203C0F630042A4B4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + CODE_SIGN_IDENTITY = ""; + CODE_SIGN_STYLE = Automatic; + DEFINES_MODULE = YES; + DYLIB_COMPATIBILITY_VERSION = 1; + DYLIB_CURRENT_VERSION = 1; + DYLIB_INSTALL_NAME_BASE = "@rpath"; + INFOPLIST_FILE = HeaderZoomTableView/Info.plist; + INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.HeaderZoomTableView; + PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)"; + SKIP_INSTALL = YES; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; + 175EA05F203C0F630042A4B4 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HeaderZoomTableViewTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.HeaderZoomTableViewTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Debug; + }; + 175EA060203C0F630042A4B4 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = YES; + CODE_SIGN_STYLE = Automatic; + INFOPLIST_FILE = HeaderZoomTableViewTests/Info.plist; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = Teruki.Nakano.HeaderZoomTableViewTests; + PRODUCT_NAME = "$(TARGET_NAME)"; + SWIFT_VERSION = 4.0; + TARGETED_DEVICE_FAMILY = "1,2"; + }; + name = Release; + }; +/* End XCBuildConfiguration section */ + +/* Begin XCConfigurationList section */ + 175EA041203C0F630042A4B4 /* Build configuration list for PBXProject "HeaderZoomTableView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 175EA059203C0F630042A4B4 /* Debug */, + 175EA05A203C0F630042A4B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 175EA05B203C0F630042A4B4 /* Build configuration list for PBXNativeTarget "HeaderZoomTableView" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 175EA05C203C0F630042A4B4 /* Debug */, + 175EA05D203C0F630042A4B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; + 175EA05E203C0F630042A4B4 /* Build configuration list for PBXNativeTarget "HeaderZoomTableViewTests" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + 175EA05F203C0F630042A4B4 /* Debug */, + 175EA060203C0F630042A4B4 /* Release */, + ); + defaultConfigurationIsVisible = 0; + defaultConfigurationName = Release; + }; +/* End XCConfigurationList section */ + }; + rootObject = 175EA03E203C0F630042A4B4 /* Project object */; +} diff --git a/HeaderZoomTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/HeaderZoomTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..716a162 --- /dev/null +++ b/HeaderZoomTableView.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/HeaderZoomTableView.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist b/HeaderZoomTableView.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist new file mode 100644 index 0000000..7fa631d --- /dev/null +++ b/HeaderZoomTableView.xcodeproj/xcuserdata/terukinakano.xcuserdatad/xcschemes/xcschememanagement.plist @@ -0,0 +1,14 @@ + + + + + SchemeUserState + + HeaderZoomTableView.xcscheme + + orderHint + 1 + + + + diff --git a/HeaderZoomTableView.xcworkspace/contents.xcworkspacedata b/HeaderZoomTableView.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9a7796d --- /dev/null +++ b/HeaderZoomTableView.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,10 @@ + + + + + + + diff --git a/HeaderZoomTableView/HeaderImage/HeaderImageView.swift b/HeaderZoomTableView/HeaderImage/HeaderImageView.swift new file mode 100644 index 0000000..9d9a716 --- /dev/null +++ b/HeaderZoomTableView/HeaderImage/HeaderImageView.swift @@ -0,0 +1,90 @@ +// +// HeaderImageView.swift +// HeaderZoomTableView +// +// Created by Teruki Nakano on 2018/02/16. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit + +class HeaderImageView: UIView { + + @IBOutlet private weak var imageView: UIImageView! + @IBOutlet private weak var imageViewHeightConstraint: NSLayoutConstraint! + @IBOutlet private weak var imageViewWidthConstraint: NSLayoutConstraint! + @IBOutlet private weak var imageViewAspectConstraint: NSLayoutConstraint! + + @IBInspectable var headerImage: UIImage = UIImage() { + didSet { + imageView.image = headerImage + } + } + + var imageAspectRatio: ImageAspectRatio = .standard { + didSet{ + + imageView.removeConstraint(imageViewAspectConstraint) + + switch imageAspectRatio { + case .standard: + imageViewAspectConstraint = imageAspectConstriant(width: 4, height: 3) + case .square: + imageViewAspectConstraint = imageAspectConstriant(width: 1, height: 1) + case .wide: + imageViewAspectConstraint = imageAspectConstriant(width: 16, height: 9) + case .custom(let w, let h): + imageViewAspectConstraint = imageAspectConstriant(width: CGFloat(w), height: CGFloat(h)) + } + + NSLayoutConstraint.activate([imageViewAspectConstraint]) + } + } + + var imageHeight: CGFloat = 0 { + didSet{ + imageViewHeightConstraint.constant = imageHeight + } + } + + override init(frame: CGRect) { + super.init(frame: frame) + loadNib() + } + + required init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + loadNib() + } + + override func layoutSubviews() { + super.layoutSubviews() + imageViewWidthConstraint.constant = self.bounds.width + } + + private func loadNib() { + let bundle = Bundle(for: type(of: self)) + guard let view = UINib(nibName: "HeaderImageView", bundle: bundle).instantiate(withOwner: self, options: nil).first as? UIView else { + return + } + self.addSubview(view) + + view.translatesAutoresizingMaskIntoConstraints = false + view.leadingAnchor.constraint(equalTo: self.leadingAnchor).isActive = true + view.topAnchor.constraint(equalTo: self.topAnchor).isActive = true + view.bottomAnchor.constraint(equalTo: self.bottomAnchor).isActive = true + view.trailingAnchor.constraint(equalTo: self.trailingAnchor).isActive = true + } + + private func imageAspectConstriant(width: CGFloat, height: CGFloat) -> NSLayoutConstraint { + return NSLayoutConstraint( + item: imageView, + attribute: NSLayoutAttribute.height, + relatedBy: NSLayoutRelation.equal, + toItem: imageView, + attribute: NSLayoutAttribute.width, + multiplier: height / width, + constant: 0 + ) + } +} diff --git a/HeaderZoomTableView/HeaderImage/HeaderImageView.xib b/HeaderZoomTableView/HeaderImage/HeaderImageView.xib new file mode 100644 index 0000000..83fb37b --- /dev/null +++ b/HeaderZoomTableView/HeaderImage/HeaderImageView.xib @@ -0,0 +1,44 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/HeaderZoomTableView/HeaderZoomTableView.h b/HeaderZoomTableView/HeaderZoomTableView.h new file mode 100644 index 0000000..8757655 --- /dev/null +++ b/HeaderZoomTableView/HeaderZoomTableView.h @@ -0,0 +1,19 @@ +// +// HeaderZoomTableView.h +// HeaderZoomTableView +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +#import + +//! Project version number for HeaderZoomTableView. +FOUNDATION_EXPORT double HeaderZoomTableViewVersionNumber; + +//! Project version string for HeaderZoomTableView. +FOUNDATION_EXPORT const unsigned char HeaderZoomTableViewVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/HeaderZoomTableView/HeaderZoomTableView.swift b/HeaderZoomTableView/HeaderZoomTableView.swift new file mode 100644 index 0000000..31e1f55 --- /dev/null +++ b/HeaderZoomTableView/HeaderZoomTableView.swift @@ -0,0 +1,69 @@ +// +// HeaderZoomTableView.swift +// HeaderZoomTableView +// +// Created by Teruki Nakano on 2018/02/18. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import UIKit + +public class HeaderZoomTableView: UITableView { + + private let headerImageView = HeaderImageView() + + override public var contentOffset: CGPoint { + didSet{ + if contentOffset.y > 0 { + return + } + + let height = headerImageView.frame.height - contentOffset.y + headerImageView.imageHeight = height + } + } + + @IBInspectable public var headerImage: UIImage = UIImage() { + didSet { + headerImageView.headerImage = headerImage + } + } + + public var imageAspectRatio: ImageAspectRatio = .standard { + didSet{ + headerImageView.imageAspectRatio = imageAspectRatio + setUpCoverImage() + } + } + + public override init(frame: CGRect, style: UITableViewStyle) { + super.init(frame: frame, style: style) + setUpCoverImage() + } + + required public init?(coder aDecoder: NSCoder) { + super.init(coder: aDecoder) + setUpCoverImage() + } + + private func setUpCoverImage() { + var aspect: CGFloat = CGFloat(3.0 / 4.0) + switch imageAspectRatio { + case .standard: + aspect = CGFloat(3.0 / 4.0) + case .square: + aspect = CGFloat(1.0 / 1.0) + case .wide: + aspect = CGFloat(9.0 / 16.0) + case .custom(let w, let h): + aspect = CGFloat(h / w) + } + + let width = self.bounds.width + let height = width * aspect + + headerImageView.frame = CGRect(origin: .zero, size: CGSize(width: self.bounds.width, height: height)) + self.tableHeaderView = headerImageView + } +} + diff --git a/HeaderZoomTableView/ImageAspectRatio.swift b/HeaderZoomTableView/ImageAspectRatio.swift new file mode 100644 index 0000000..f7703ac --- /dev/null +++ b/HeaderZoomTableView/ImageAspectRatio.swift @@ -0,0 +1,15 @@ +// +// ImageAspectRatio.swift +// HeaderZoomTableViewPackageDescription +// +// Created by Teruki Nakano on 2018/02/20. +// + +import Foundation + +public enum ImageAspectRatio { + case standard // w4:h3 + case square // w1:h1 + case wide // w16:h9 + case custom(w: Float, h: Float) // for custom +} diff --git a/HeaderZoomTableView/Info.plist b/HeaderZoomTableView/Info.plist new file mode 100644 index 0000000..974dceb --- /dev/null +++ b/HeaderZoomTableView/Info.plist @@ -0,0 +1,24 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + FMWK + CFBundleShortVersionString + 0.9.0 + CFBundleVersion + $(CURRENT_PROJECT_VERSION) + NSPrincipalClass + + + diff --git a/HeaderZoomTableViewTests/HeaderZoomTableViewTests.swift b/HeaderZoomTableViewTests/HeaderZoomTableViewTests.swift new file mode 100644 index 0000000..b29b315 --- /dev/null +++ b/HeaderZoomTableViewTests/HeaderZoomTableViewTests.swift @@ -0,0 +1,36 @@ +// +// HeaderZoomTableViewTests.swift +// HeaderZoomTableViewTests +// +// Created by Teruki Nakano on 2018/02/20. +// Copyright © 2018年 Teruki Nakano. All rights reserved. +// + +import XCTest +@testable import HeaderZoomTableView + +class HeaderZoomTableViewTests: XCTestCase { + + override func setUp() { + super.setUp() + // Put setup code here. This method is called before the invocation of each test method in the class. + } + + override func tearDown() { + // Put teardown code here. This method is called after the invocation of each test method in the class. + super.tearDown() + } + + func testExample() { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct results. + } + + func testPerformanceExample() { + // This is an example of a performance test case. + self.measure { + // Put the code you want to measure the time of here. + } + } + +} diff --git a/HeaderZoomTableViewTests/Info.plist b/HeaderZoomTableViewTests/Info.plist new file mode 100644 index 0000000..6c40a6c --- /dev/null +++ b/HeaderZoomTableViewTests/Info.plist @@ -0,0 +1,22 @@ + + + + + CFBundleDevelopmentRegion + $(DEVELOPMENT_LANGUAGE) + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + BNDL + CFBundleShortVersionString + 1.0 + CFBundleVersion + 1 + + diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..544f21d --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 trk-nkn + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..717b3d4 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# HeaderZoomTableView \ No newline at end of file