diff --git a/LICENSE b/LICENSE index 744ac57..868de2b 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2017 Xavier Schott +Copyright (c) 2018 Xavier Schott Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 80de4d1..dc17773 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ Ideal to represent steps. *The discrete slider and the camel labels can work in ## Compatibility 1. Written in **Swift 3**, can be integrated with **Swift** or **Obj-C** 2. `TGPControls` are **AutoLayout**, `IB Designable` and `IB Inspectable` ready -3. Version **4.0.0** comes with a **Swift 3** demo application for **iOS 8** and above. +3. Version **5.0.1** comes with a **Swift 4** demo application for **iOS 8** and above. _**iOS 7** supported in versions 2.1.0 and earlier_ ![imagessliderdemo](https://cloud.githubusercontent.com/assets/4073988/6628373/183c7452-c8c2-11e4-9a63-107805bc0cc4.gif) diff --git a/TGPControls.podspec b/TGPControls.podspec index 4fc3e9b..a3f5c1f 100644 --- a/TGPControls.podspec +++ b/TGPControls.podspec @@ -2,7 +2,7 @@ Pod::Spec.new do |spec| # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # spec.name = "TGPControls" - spec.version = "5.0.0" + spec.version = "5.0.1" spec.summary = "Custom animated iOS controls: Animated discrete slider, animated labels" spec.description = <<-DESC @@ -17,7 +17,7 @@ Pod::Spec.new do |spec| spec.license = { :type => "MIT", :file => "LICENSE" } # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - spec.author = { "Xavier Schott" => "http://swiftarchitect.com/swiftarchitect/" } + spec.author = { "Xavier Schott" => "https://www.swiftarchitect.com/swiftarchitect/" } # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # spec.platform = :ios @@ -25,7 +25,7 @@ Pod::Spec.new do |spec| spec.requires_arc = true # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # - spec.source = { :git => "https://github.com/SwiftArchitect/TGPControls.git", :tag => "v4.0.0" } + spec.source = { :git => "https://github.com/SwiftArchitect/TGPControls.git", :tag => "v5.0.1" } spec.source_files = "TGPControls/**/*.{swift}" spec.exclude_files = "TGPControlsDemo/*" diff --git a/TGPControls.xcodeproj/project.pbxproj b/TGPControls.xcodeproj/project.pbxproj index 8528ff5..4de76d5 100644 --- a/TGPControls.xcodeproj/project.pbxproj +++ b/TGPControls.xcodeproj/project.pbxproj @@ -99,12 +99,12 @@ DC56BDF41E46EA2000AAD0D9 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = SwiftArchitect; TargetAttributes = { DC56BDFC1E46EA2000AAD0D9 = { CreatedOnToolsVersion = 8.2.1; - LastSwiftMigration = 0900; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; }; @@ -159,15 +159,23 @@ 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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -197,8 +205,7 @@ SDKROOT = iphoneos; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; TARGETED_DEVICE_FAMILY = "1,2"; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; @@ -214,15 +221,23 @@ 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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -244,8 +259,7 @@ MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; - SWIFT_VERSION = 4.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -271,7 +285,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Debug; @@ -293,7 +307,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.swiftarchitect.TGPControls; PRODUCT_NAME = "$(TARGET_NAME)"; SKIP_INSTALL = YES; - SWIFT_SWIFT3_OBJC_INFERENCE = Off; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; SWIFT_VERSION = 4.0; }; name = Release; diff --git a/TGPControls.xcodeproj/xcshareddata/xcschemes/TGPControls.xcscheme b/TGPControls.xcodeproj/xcshareddata/xcschemes/TGPControls.xcscheme index c41d331..3735ff1 100644 --- a/TGPControls.xcodeproj/xcshareddata/xcschemes/TGPControls.xcscheme +++ b/TGPControls.xcodeproj/xcshareddata/xcschemes/TGPControls.xcscheme @@ -1,6 +1,6 @@ //! Project version number for TGPControls. @@ -36,5 +7,3 @@ FOUNDATION_EXPORT double TGPControlsVersionNumber; FOUNDATION_EXPORT const unsigned char TGPControlsVersionString[]; // In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/TGPControls/TGPControlsTicksProtocol.swift b/TGPControls/TGPControlsTicksProtocol.swift index 606b5ba..b333d70 100644 --- a/TGPControls/TGPControlsTicksProtocol.swift +++ b/TGPControls/TGPControlsTicksProtocol.swift @@ -1,32 +1,3 @@ -// @file: TGPControlsTicksProtocol.swift -// @project: TGPControls -// -// @author: Xavier Schott -// mailto://xschott@gmail.com -// http://thegothicparty.com -// tel://+18089383634 -// -// @license: http://opensource.org/licenses/MIT -// Copyright (c) 2017, Xavier Schott -// -// 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. - import Foundation @objc public protocol TGPControlsTicksProtocol diff --git a/TGPControls/TGPDiscreteSlider.swift b/TGPControls/TGPDiscreteSlider.swift index 4606cc9..74457ba 100644 --- a/TGPControls/TGPDiscreteSlider.swift +++ b/TGPControls/TGPDiscreteSlider.swift @@ -1,32 +1,3 @@ -// @file: TGPDiscreteSlider.swift -// @project: TGPControls -// -// @author: Xavier Schott -// mailto://xschott@gmail.com -// http://thegothicparty.com -// tel://+18089383634 -// -// @license: http://opensource.org/licenses/MIT -// Copyright (c) 2017, Xavier Schott -// -// 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. - import UIKit public enum ComponentStyle:Int { @@ -37,14 +8,13 @@ public enum ComponentStyle:Int { case image } - // Interface builder hides the IBInspectable for UIControl #if TARGET_INTERFACE_BUILDER public class TGPSlider_INTERFACE_BUILDER:UIView { - } +} #else // !TARGET_INTERFACE_BUILDER - public class TGPSlider_INTERFACE_BUILDER:UIControl { - } +public class TGPSlider_INTERFACE_BUILDER:UIControl { +} #endif // TARGET_INTERFACE_BUILDER @IBDesignable @@ -71,6 +41,12 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER { } } + @IBInspectable public var tickTintColor:UIColor? = nil { + didSet { + layoutTrack() + } + } + @IBInspectable public var tickImage:UIImage? = nil { didSet { layoutTrack() @@ -309,8 +285,9 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER { func drawTicks() { ticksLayer.frame = bounds - if let backgroundColor = tintColor { - ticksLayer.backgroundColor = backgroundColor.cgColor + + if let tickColor = tickTintColor ?? tintColor { + ticksLayer.backgroundColor = tickColor.cgColor } let path = UIBezierPath() @@ -500,10 +477,10 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER { // Shadow if(shadowRadius != 0.0) { #if TARGET_INTERFACE_BUILDER - thumbLayer.shadowOffset = CGSize(width: shadowOffset.width, - height: -shadowOffset.height) + thumbLayer.shadowOffset = CGSize(width: shadowOffset.width, + height: -shadowOffset.height) #else // !TARGET_INTERFACE_BUILDER - thumbLayer.shadowOffset = shadowOffset + thumbLayer.shadowOffset = shadowOffset #endif // TARGET_INTERFACE_BUILDER thumbLayer.shadowRadius = shadowRadius @@ -585,8 +562,8 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER { + (iOSThumbShadowRadius * 2) + (iOSThumbShadowOffset.width * 2), height: 28.0 - + (iOSThumbShadowRadius * 2) - + (iOSThumbShadowOffset.height * 2)) + + (iOSThumbShadowRadius * 2) + + (iOSThumbShadowOffset.height * 2)) case .image: if let thumbImage = thumbImage { diff --git a/TGPControlsDemo/Cartfile b/TGPControlsDemo/Cartfile index 1c464ce..f3a7414 100644 --- a/TGPControlsDemo/Cartfile +++ b/TGPControlsDemo/Cartfile @@ -1,2 +1,2 @@ -github "SwiftArchitect/TGPControls" == 4.0.0 +github "SwiftArchitect/TGPControls" diff --git a/TGPControlsDemo/Podfile b/TGPControlsDemo/Podfile index 8dbef95..2fe7474 100644 --- a/TGPControlsDemo/Podfile +++ b/TGPControlsDemo/Podfile @@ -3,8 +3,8 @@ platform :ios, '8.0' use_frameworks! target 'TGPControlsDemo-Pods' do - #pod 'TGPControls', :path => '../../TGPControls' - pod 'TGPControls' + pod 'TGPControls', :path => '../../TGPControls' + #pod 'TGPControls' end diff --git a/TGPControlsDemo/TGPControlsDemo.xcodeproj/project.pbxproj b/TGPControlsDemo/TGPControlsDemo.xcodeproj/project.pbxproj index 2aca661..fe49934 100644 --- a/TGPControlsDemo/TGPControlsDemo.xcodeproj/project.pbxproj +++ b/TGPControlsDemo/TGPControlsDemo.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + AC26D296425BA1D414B87647 /* Pods_TGPControlsDemo_Pods.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 96ADF77D1CF3E3C9B5F25B38 /* Pods_TGPControlsDemo_Pods.framework */; }; DC4FF6431EA2E08C00BBF8E4 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC56BDC81E46DEB900AAD0D9 /* ViewController.swift */; }; DC4FF6441EA2E08C00BBF8E4 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = DC56BDC61E46DEB900AAD0D9 /* AppDelegate.swift */; }; DC4FF6481EA2E08C00BBF8E4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = DC56BDCF1E46DEB900AAD0D9 /* LaunchScreen.storyboard */; }; @@ -36,6 +37,9 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 860AEC28CE2BF295D5323689 /* Pods-TGPControlsDemo-Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TGPControlsDemo-Pods.debug.xcconfig"; path = "Pods/Target Support Files/Pods-TGPControlsDemo-Pods/Pods-TGPControlsDemo-Pods.debug.xcconfig"; sourceTree = ""; }; + 96ADF77D1CF3E3C9B5F25B38 /* Pods_TGPControlsDemo_Pods.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_TGPControlsDemo_Pods.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + D4E7ADCD9BF439A69C180A4A /* Pods-TGPControlsDemo-Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-TGPControlsDemo-Pods.release.xcconfig"; path = "Pods/Target Support Files/Pods-TGPControlsDemo-Pods/Pods-TGPControlsDemo-Pods.release.xcconfig"; sourceTree = ""; }; DC4FF6501EA2E08C00BBF8E4 /* TGPControlsDemo-Cart.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "TGPControlsDemo-Cart.app"; sourceTree = BUILT_PRODUCTS_DIR; }; DC4FF6511EA2E08C00BBF8E4 /* TGPControlsDemo-Cart-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "TGPControlsDemo-Cart-Info.plist"; sourceTree = ""; }; DC4FF6521EA2E2E700BBF8E4 /* TGPControls.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = TGPControls.framework; path = Carthage/Build/iOS/TGPControls.framework; sourceTree = ""; }; @@ -61,6 +65,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + AC26D296425BA1D414B87647 /* Pods_TGPControlsDemo_Pods.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -71,16 +76,27 @@ isa = PBXGroup; children = ( DC4FF6521EA2E2E700BBF8E4 /* TGPControls.framework */, + 96ADF77D1CF3E3C9B5F25B38 /* Pods_TGPControlsDemo_Pods.framework */, ); name = Frameworks; sourceTree = ""; }; + 90671EEB912570A269B400F1 /* Pods */ = { + isa = PBXGroup; + children = ( + 860AEC28CE2BF295D5323689 /* Pods-TGPControlsDemo-Pods.debug.xcconfig */, + D4E7ADCD9BF439A69C180A4A /* Pods-TGPControlsDemo-Pods.release.xcconfig */, + ); + name = Pods; + sourceTree = ""; + }; DC56BDBA1E46DEB900AAD0D9 = { isa = PBXGroup; children = ( DC56BDC51E46DEB900AAD0D9 /* TGPControlsDemo */, DC56BDC41E46DEB900AAD0D9 /* Products */, 10EC92099730DF4A939701BE /* Frameworks */, + 90671EEB912570A269B400F1 /* Pods */, ); sourceTree = ""; }; @@ -155,11 +171,12 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 0820; - LastUpgradeCheck = 0820; + LastUpgradeCheck = 0940; ORGANIZATIONNAME = SwiftArchitect; TargetAttributes = { DC56BDC21E46DEB900AAD0D9 = { CreatedOnToolsVersion = 8.2.1; + LastSwiftMigration = 0940; ProvisioningStyle = Automatic; }; }; @@ -213,13 +230,16 @@ files = ( ); inputPaths = ( + "${PODS_PODFILE_DIR_PATH}/Podfile.lock", + "${PODS_ROOT}/Manifest.lock", ); name = "[CP] Check Pods Manifest.lock"; outputPaths = ( + "$(DERIVED_FILE_DIR)/Pods-TGPControlsDemo-Pods-checkManifestLockResult.txt", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n"; + shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; showEnvVarsInLog = 0; }; 3FF2E09CAFA7D92A488FACF7 /* [CP] Copy Pods Resources */ = { @@ -243,9 +263,12 @@ files = ( ); inputPaths = ( + "${SRCROOT}/Pods/Target Support Files/Pods-TGPControlsDemo-Pods/Pods-TGPControlsDemo-Pods-frameworks.sh", + "${BUILT_PRODUCTS_DIR}/TGPControls/TGPControls.framework", ); name = "[CP] Embed Pods Frameworks"; outputPaths = ( + "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/TGPControls.framework", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; @@ -341,15 +364,23 @@ 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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -392,15 +423,23 @@ 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_DEPRECATED_OBJC_IMPLEMENTATIONS = 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_IMPLICIT_RETAIN_SELF = 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_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -428,6 +467,7 @@ }; DC56BDD61E46DEB900AAD0D9 /* Debug */ = { isa = XCBuildConfiguration; + baseConfigurationReference = 860AEC28CE2BF295D5323689 /* Pods-TGPControlsDemo-Pods.debug.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -436,12 +476,14 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.swiftarchitect.TGPControlsDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Debug; }; DC56BDD71E46DEB900AAD0D9 /* Release */ = { isa = XCBuildConfiguration; + baseConfigurationReference = D4E7ADCD9BF439A69C180A4A /* Pods-TGPControlsDemo-Pods.release.xcconfig */; buildSettings = { ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES = "$(inherited)"; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; @@ -450,7 +492,8 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.swiftarchitect.TGPControlsDemo; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_SWIFT3_OBJC_INFERENCE = Default; + SWIFT_VERSION = 4.0; }; name = Release; }; diff --git a/TGPControlsDemo/TGPControlsDemo/AppDelegate.swift b/TGPControlsDemo/TGPControlsDemo/AppDelegate.swift index ce93ae0..b304ae1 100644 --- a/TGPControlsDemo/TGPControlsDemo/AppDelegate.swift +++ b/TGPControlsDemo/TGPControlsDemo/AppDelegate.swift @@ -1,23 +1,3 @@ -// Copyright (c) 2017, Xavier Schott -// -// 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. - import UIKit @UIApplicationMain diff --git a/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json index f04f616..d79278b 100644 --- a/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json +++ b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/Contents.json @@ -88,6 +88,12 @@ "idiom" : "ipad", "filename" : "icon167.png", "scale" : "2x" + }, + { + "size" : "1024x1024", + "idiom" : "ios-marketing", + "filename" : "icon1024.png", + "scale" : "1x" } ], "info" : { diff --git a/TGPControlsDemo/icon-1024x1024.png b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/icon1024.png similarity index 100% rename from TGPControlsDemo/icon-1024x1024.png rename to TGPControlsDemo/TGPControlsDemo/Assets.xcassets/AppIcon.appiconset/icon1024.png diff --git a/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/Contents.json b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/Contents.json new file mode 100644 index 0000000..da4a164 --- /dev/null +++ b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/Contents.json @@ -0,0 +1,6 @@ +{ + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/Contents.json b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/Contents.json new file mode 100644 index 0000000..d41570a --- /dev/null +++ b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/Contents.json @@ -0,0 +1,21 @@ +{ + "images" : [ + { + "idiom" : "universal", + "filename" : "launch1024.png", + "scale" : "1x" + }, + { + "idiom" : "universal", + "scale" : "2x" + }, + { + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "version" : 1, + "author" : "xcode" + } +} \ No newline at end of file diff --git a/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/launch1024.png b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/launch1024.png new file mode 100644 index 0000000..0264bc2 Binary files /dev/null and b/TGPControlsDemo/TGPControlsDemo/Assets.xcassets/launch.imageset/launch1024.png differ diff --git a/TGPControlsDemo/TGPControlsDemo/Base.lproj/LaunchScreen.storyboard b/TGPControlsDemo/TGPControlsDemo/Base.lproj/LaunchScreen.storyboard index fdf3f97..41b186d 100644 --- a/TGPControlsDemo/TGPControlsDemo/Base.lproj/LaunchScreen.storyboard +++ b/TGPControlsDemo/TGPControlsDemo/Base.lproj/LaunchScreen.storyboard @@ -1,7 +1,11 @@ - - + + + + + - + + @@ -16,12 +20,26 @@ - + + + + + + + + + + + + - + + + + diff --git a/TGPControlsDemo/TGPControlsDemo/Base.lproj/Main.storyboard b/TGPControlsDemo/TGPControlsDemo/Base.lproj/Main.storyboard index e1ad42a..ce318ba 100755 --- a/TGPControlsDemo/TGPControlsDemo/Base.lproj/Main.storyboard +++ b/TGPControlsDemo/TGPControlsDemo/Base.lproj/Main.storyboard @@ -1,11 +1,11 @@ - + - + @@ -14,7 +14,7 @@ - + @@ -27,16 +27,16 @@ - + - + @@ -68,7 +68,7 @@ - + @@ -102,7 +102,7 @@ - + @@ -140,7 +140,7 @@ - + @@ -181,13 +181,13 @@ - + @@ -219,7 +219,7 @@ - + @@ -255,13 +255,13 @@ - + @@ -294,19 +294,19 @@ - + - + - + @@ -339,13 +339,13 @@ - + @@ -381,20 +381,20 @@ - - + + + + @@ -438,6 +441,7 @@ + @@ -449,6 +453,7 @@ + @@ -498,7 +503,7 @@ - + diff --git a/TGPControlsDemo/TGPControlsDemo/ViewController.swift b/TGPControlsDemo/TGPControlsDemo/ViewController.swift index 49d3a62..05000f2 100644 --- a/TGPControlsDemo/TGPControlsDemo/ViewController.swift +++ b/TGPControlsDemo/TGPControlsDemo/ViewController.swift @@ -1,23 +1,3 @@ -// Copyright (c) 2017, Xavier Schott -// -// 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. - import UIKit import TGPControls @@ -77,34 +57,34 @@ class ViewController: UIViewController { // MARK: - UIControlEvents - func touchDown(_ sender: UIControl, event:UIEvent) { + @objc func touchDown(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDown" } - func touchDownRepeat(_ sender: UIControl, event:UIEvent) { + @objc func touchDownRepeat(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDownRepeat" } - func touchDragInside(_ sender: UIControl, event:UIEvent) { + @objc func touchDragInside(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDragInside" } - func touchDragOutside(_ sender: UIControl, event:UIEvent) { + @objc func touchDragOutside(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDragOutside" } - func touchDragEnter(_ sender: UIControl, event:UIEvent) { + @objc func touchDragEnter(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDragEnter" } - func touchDragExit(_ sender: UIControl, event:UIEvent) { + @objc func touchDragExit(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchDragExit" } - func touchUpInside(_ sender: UIControl, event:UIEvent) { + @objc func touchUpInside(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchUpInside" } - func touchUpOutside(_ sender: UIControl, event:UIEvent) { + @objc func touchUpOutside(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchUpOutside" } - func touchCancel(_ sender: UIControl, event:UIEvent) { + @objc func touchCancel(_ sender: UIControl, event:UIEvent) { controlEventsLabel.text = "touchCancel" } - func valueChanged(_ sender: TGPDiscreteSlider, event:UIEvent) { + @objc func valueChanged(_ sender: TGPDiscreteSlider, event:UIEvent) { controlEventsLabel.text = "valueChanged" stepper.value = Double(sender.value) }