Skip to content

Commit 1fb0c14

Browse files
author
Xavier Schott
committed
Fixed #26 #37 #38. Merged #35 #44. Pod 5.0.1
1 parent 8bbfca1 commit 1fb0c14

21 files changed

Lines changed: 202 additions & 233 deletions

File tree

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2017 Xavier Schott
1+
Copyright (c) 2018 Xavier Schott
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Ideal to represent steps. *The discrete slider and the camel labels can work in
2424
## Compatibility
2525
1. Written in **Swift 3**, can be integrated with **Swift** or **Obj-C**
2626
2. `TGPControls` are **AutoLayout**, `IB Designable` and `IB Inspectable` ready
27-
3. Version **4.0.0** comes with a **Swift 3** demo application for **iOS 8** and above.
27+
3. Version **5.0.1** comes with a **Swift 4** demo application for **iOS 8** and above.
2828
_**iOS 7** supported in versions 2.1.0 and earlier_
2929

3030
![imagessliderdemo](https://cloud.githubusercontent.com/assets/4073988/6628373/183c7452-c8c2-11e4-9a63-107805bc0cc4.gif)

TGPControls.podspec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pod::Spec.new do |spec|
22

33
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
44
spec.name = "TGPControls"
5-
spec.version = "5.0.0"
5+
spec.version = "5.0.1"
66
spec.summary = "Custom animated iOS controls: Animated discrete slider, animated labels"
77

88
spec.description = <<-DESC
@@ -17,15 +17,15 @@ Pod::Spec.new do |spec|
1717
spec.license = { :type => "MIT", :file => "LICENSE" }
1818

1919
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
20-
spec.author = { "Xavier Schott" => "http://swiftarchitect.com/swiftarchitect/" }
20+
spec.author = { "Xavier Schott" => "https://www.swiftarchitect.com/swiftarchitect/" }
2121

2222
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
2323
spec.platform = :ios
2424
spec.ios.deployment_target = '8.0'
2525
spec.requires_arc = true
2626

2727
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
28-
spec.source = { :git => "https://github.com/SwiftArchitect/TGPControls.git", :tag => "v4.0.0" }
28+
spec.source = { :git => "https://github.com/SwiftArchitect/TGPControls.git", :tag => "v5.0.1" }
2929
spec.source_files = "TGPControls/**/*.{swift}"
3030
spec.exclude_files = "TGPControlsDemo/*"
3131

TGPControls.xcodeproj/project.pbxproj

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@
9999
DC56BDF41E46EA2000AAD0D9 /* Project object */ = {
100100
isa = PBXProject;
101101
attributes = {
102-
LastUpgradeCheck = 0820;
102+
LastUpgradeCheck = 0940;
103103
ORGANIZATIONNAME = SwiftArchitect;
104104
TargetAttributes = {
105105
DC56BDFC1E46EA2000AAD0D9 = {
106106
CreatedOnToolsVersion = 8.2.1;
107-
LastSwiftMigration = 0900;
107+
LastSwiftMigration = 0940;
108108
ProvisioningStyle = Automatic;
109109
};
110110
};
@@ -159,15 +159,23 @@
159159
CLANG_CXX_LIBRARY = "libc++";
160160
CLANG_ENABLE_MODULES = YES;
161161
CLANG_ENABLE_OBJC_ARC = YES;
162+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
162163
CLANG_WARN_BOOL_CONVERSION = YES;
164+
CLANG_WARN_COMMA = YES;
163165
CLANG_WARN_CONSTANT_CONVERSION = YES;
166+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
164167
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
165168
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
166169
CLANG_WARN_EMPTY_BODY = YES;
167170
CLANG_WARN_ENUM_CONVERSION = YES;
168171
CLANG_WARN_INFINITE_RECURSION = YES;
169172
CLANG_WARN_INT_CONVERSION = YES;
173+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
174+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
175+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
170176
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
177+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
178+
CLANG_WARN_STRICT_PROTOTYPES = YES;
171179
CLANG_WARN_SUSPICIOUS_MOVE = YES;
172180
CLANG_WARN_UNREACHABLE_CODE = YES;
173181
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -197,8 +205,7 @@
197205
SDKROOT = iphoneos;
198206
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
199207
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
200-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
201-
SWIFT_VERSION = 4.0;
208+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
202209
TARGETED_DEVICE_FAMILY = "1,2";
203210
VERSIONING_SYSTEM = "apple-generic";
204211
VERSION_INFO_PREFIX = "";
@@ -214,15 +221,23 @@
214221
CLANG_CXX_LIBRARY = "libc++";
215222
CLANG_ENABLE_MODULES = YES;
216223
CLANG_ENABLE_OBJC_ARC = YES;
224+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
217225
CLANG_WARN_BOOL_CONVERSION = YES;
226+
CLANG_WARN_COMMA = YES;
218227
CLANG_WARN_CONSTANT_CONVERSION = YES;
228+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
219229
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
220230
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
221231
CLANG_WARN_EMPTY_BODY = YES;
222232
CLANG_WARN_ENUM_CONVERSION = YES;
223233
CLANG_WARN_INFINITE_RECURSION = YES;
224234
CLANG_WARN_INT_CONVERSION = YES;
235+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
236+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
237+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
225238
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
239+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
240+
CLANG_WARN_STRICT_PROTOTYPES = YES;
226241
CLANG_WARN_SUSPICIOUS_MOVE = YES;
227242
CLANG_WARN_UNREACHABLE_CODE = YES;
228243
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -244,8 +259,7 @@
244259
MTL_ENABLE_DEBUG_INFO = NO;
245260
SDKROOT = iphoneos;
246261
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
247-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
248-
SWIFT_VERSION = 4.0;
262+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
249263
TARGETED_DEVICE_FAMILY = "1,2";
250264
VALIDATE_PRODUCT = YES;
251265
VERSIONING_SYSTEM = "apple-generic";
@@ -271,7 +285,7 @@
271285
PRODUCT_NAME = "$(TARGET_NAME)";
272286
SKIP_INSTALL = YES;
273287
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
274-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
288+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
275289
SWIFT_VERSION = 4.0;
276290
};
277291
name = Debug;
@@ -293,7 +307,7 @@
293307
PRODUCT_BUNDLE_IDENTIFIER = com.swiftarchitect.TGPControls;
294308
PRODUCT_NAME = "$(TARGET_NAME)";
295309
SKIP_INSTALL = YES;
296-
SWIFT_SWIFT3_OBJC_INFERENCE = Off;
310+
SWIFT_SWIFT3_OBJC_INFERENCE = Default;
297311
SWIFT_VERSION = 4.0;
298312
};
299313
name = Release;

TGPControls.xcodeproj/xcshareddata/xcschemes/TGPControls.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0820"
3+
LastUpgradeVersion = "0940"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

TGPControls/TGPCamelLabels.swift

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,20 @@
1-
// @file: TGPCamelLabels.swift
2-
// @project: TGPControls
3-
//
4-
// @author: Xavier Schott
5-
// mailto://xschott@gmail.com
6-
// http://thegothicparty.com
7-
// tel://+18089383634
8-
//
9-
// @license: http://opensource.org/licenses/MIT
10-
// Copyright (c) 2017, Xavier Schott
11-
//
12-
// Permission is hereby granted, free of charge, to any person obtaining a copy
13-
// of this software and associated documentation files (the "Software"), to deal
14-
// in the Software without restriction, including without limitation the rights
15-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16-
// copies of the Software, and to permit persons to whom the Software is
17-
// furnished to do so, subject to the following conditions:
18-
//
19-
// The above copyright notice and this permission notice shall be included in
20-
// all copies or substantial portions of the Software.
21-
//
22-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28-
// THE SOFTWARE.
29-
301
import UIKit
312

3+
// Interface builder hides the IBInspectable for UIControl
4+
#if TARGET_INTERFACE_BUILDER
5+
public class TGPCamelLabels_INTERFACE_BUILDER:UIView {
6+
}
7+
#else // !TARGET_INTERFACE_BUILDER
8+
public class TGPCamelLabels_INTERFACE_BUILDER:UIControl {
9+
}
10+
#endif // TARGET_INTERFACE_BUILDER
3211

3312
@IBDesignable
34-
public class TGPCamelLabels: UIControl {
13+
public class TGPCamelLabels: TGPCamelLabels_INTERFACE_BUILDER {
3514

3615
let validAttributes = [NSLayoutAttribute.top.rawValue, // 3
37-
NSLayoutAttribute.centerY.rawValue, // 10
38-
NSLayoutAttribute.bottom.rawValue] // 4
16+
NSLayoutAttribute.centerY.rawValue, // 10
17+
NSLayoutAttribute.bottom.rawValue] // 4
3918

4019
// Only used if labels.count < 1
4120
@IBInspectable public var tickCount:Int {

TGPControls/TGPControls.h

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
// @file: TGPControls.h
2-
// @project: TGPControls
3-
//
4-
// @author: Xavier Schott
5-
// mailto://xschott@gmail.com
6-
// http://thegothicparty.com
7-
// tel://+18089383634
8-
//
9-
// @license: http://opensource.org/licenses/MIT
10-
// Copyright (c) 2017, Xavier Schott
11-
//
12-
// Permission is hereby granted, free of charge, to any person obtaining a copy
13-
// of this software and associated documentation files (the "Software"), to deal
14-
// in the Software without restriction, including without limitation the rights
15-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16-
// copies of the Software, and to permit persons to whom the Software is
17-
// furnished to do so, subject to the following conditions:
18-
//
19-
// The above copyright notice and this permission notice shall be included in
20-
// all copies or substantial portions of the Software.
21-
//
22-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28-
// THE SOFTWARE.
29-
301
#import <UIKit/UIKit.h>
312

323
//! Project version number for TGPControls.
@@ -36,5 +7,3 @@ FOUNDATION_EXPORT double TGPControlsVersionNumber;
367
FOUNDATION_EXPORT const unsigned char TGPControlsVersionString[];
378

389
// In this header, you should import all the public headers of your framework using statements like #import <TGPControls/PublicHeader.h>
39-
40-

TGPControls/TGPControlsTicksProtocol.swift

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
// @file: TGPControlsTicksProtocol.swift
2-
// @project: TGPControls
3-
//
4-
// @author: Xavier Schott
5-
// mailto://xschott@gmail.com
6-
// http://thegothicparty.com
7-
// tel://+18089383634
8-
//
9-
// @license: http://opensource.org/licenses/MIT
10-
// Copyright (c) 2017, Xavier Schott
11-
//
12-
// Permission is hereby granted, free of charge, to any person obtaining a copy
13-
// of this software and associated documentation files (the "Software"), to deal
14-
// in the Software without restriction, including without limitation the rights
15-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16-
// copies of the Software, and to permit persons to whom the Software is
17-
// furnished to do so, subject to the following conditions:
18-
//
19-
// The above copyright notice and this permission notice shall be included in
20-
// all copies or substantial portions of the Software.
21-
//
22-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28-
// THE SOFTWARE.
29-
301
import Foundation
312

323
@objc public protocol TGPControlsTicksProtocol

TGPControls/TGPDiscreteSlider.swift

Lines changed: 17 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,3 @@
1-
// @file: TGPDiscreteSlider.swift
2-
// @project: TGPControls
3-
//
4-
// @author: Xavier Schott
5-
// mailto://xschott@gmail.com
6-
// http://thegothicparty.com
7-
// tel://+18089383634
8-
//
9-
// @license: http://opensource.org/licenses/MIT
10-
// Copyright (c) 2017, Xavier Schott
11-
//
12-
// Permission is hereby granted, free of charge, to any person obtaining a copy
13-
// of this software and associated documentation files (the "Software"), to deal
14-
// in the Software without restriction, including without limitation the rights
15-
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16-
// copies of the Software, and to permit persons to whom the Software is
17-
// furnished to do so, subject to the following conditions:
18-
//
19-
// The above copyright notice and this permission notice shall be included in
20-
// all copies or substantial portions of the Software.
21-
//
22-
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23-
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24-
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25-
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26-
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27-
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28-
// THE SOFTWARE.
29-
301
import UIKit
312

323
public enum ComponentStyle:Int {
@@ -37,14 +8,13 @@ public enum ComponentStyle:Int {
378
case image
389
}
3910

40-
4111
// Interface builder hides the IBInspectable for UIControl
4212
#if TARGET_INTERFACE_BUILDER
4313
public class TGPSlider_INTERFACE_BUILDER:UIView {
44-
}
14+
}
4515
#else // !TARGET_INTERFACE_BUILDER
46-
public class TGPSlider_INTERFACE_BUILDER:UIControl {
47-
}
16+
public class TGPSlider_INTERFACE_BUILDER:UIControl {
17+
}
4818
#endif // TARGET_INTERFACE_BUILDER
4919

5020
@IBDesignable
@@ -71,6 +41,12 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
7141
}
7242
}
7343

44+
@IBInspectable public var tickTintColor:UIColor? = nil {
45+
didSet {
46+
layoutTrack()
47+
}
48+
}
49+
7450
@IBInspectable public var tickImage:UIImage? = nil {
7551
didSet {
7652
layoutTrack()
@@ -309,8 +285,9 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
309285

310286
func drawTicks() {
311287
ticksLayer.frame = bounds
312-
if let backgroundColor = tintColor {
313-
ticksLayer.backgroundColor = backgroundColor.cgColor
288+
289+
if let tickColor = tickTintColor ?? tintColor {
290+
ticksLayer.backgroundColor = tickColor.cgColor
314291
}
315292

316293
let path = UIBezierPath()
@@ -500,10 +477,10 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
500477
// Shadow
501478
if(shadowRadius != 0.0) {
502479
#if TARGET_INTERFACE_BUILDER
503-
thumbLayer.shadowOffset = CGSize(width: shadowOffset.width,
504-
height: -shadowOffset.height)
480+
thumbLayer.shadowOffset = CGSize(width: shadowOffset.width,
481+
height: -shadowOffset.height)
505482
#else // !TARGET_INTERFACE_BUILDER
506-
thumbLayer.shadowOffset = shadowOffset
483+
thumbLayer.shadowOffset = shadowOffset
507484
#endif // TARGET_INTERFACE_BUILDER
508485

509486
thumbLayer.shadowRadius = shadowRadius
@@ -585,8 +562,8 @@ public class TGPDiscreteSlider:TGPSlider_INTERFACE_BUILDER {
585562
+ (iOSThumbShadowRadius * 2)
586563
+ (iOSThumbShadowOffset.width * 2),
587564
height: 28.0
588-
+ (iOSThumbShadowRadius * 2)
589-
+ (iOSThumbShadowOffset.height * 2))
565+
+ (iOSThumbShadowRadius * 2)
566+
+ (iOSThumbShadowOffset.height * 2))
590567

591568
case .image:
592569
if let thumbImage = thumbImage {

TGPControlsDemo/Cartfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
github "SwiftArchitect/TGPControls" == 4.0.0
1+
github "SwiftArchitect/TGPControls"
22

0 commit comments

Comments
 (0)