From 53dbde0ca7b8882bc8f4577e8bfdf5778b851b1e Mon Sep 17 00:00:00 2001 From: tichise <43707+tichise@users.noreply.github.com> Date: Sat, 19 Sep 2020 12:55:55 +0900 Subject: [PATCH 1/5] add iconColor --- Sources/OMJoyStick.swift | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Sources/OMJoyStick.swift b/Sources/OMJoyStick.swift index b76058e..11c1ad5 100644 --- a/Sources/OMJoyStick.swift +++ b/Sources/OMJoyStick.swift @@ -71,16 +71,19 @@ public struct ColorSetting { var bigRingNormalBackgroundColor: Color var bigRingDarkBackgroundColor: Color var bigRingStrokeColor: Color + var iconColor: Color public init(subRingColor: Color = .primary, bigRingNormalBackgroundColor: Color = .white, bigRingDarkBackgroundColor: Color = .black, - bigRingStrokeColor: Color = Color.primary) { + bigRingStrokeColor: Color = Color.primary, + iconColor: Color = Color.primary) { self.subRingColor = subRingColor self.bigRingNormalBackgroundColor = bigRingNormalBackgroundColor self.bigRingDarkBackgroundColor = bigRingDarkBackgroundColor self.bigRingStrokeColor = bigRingStrokeColor + self.iconColor = iconColor } } @@ -234,11 +237,11 @@ public struct OMJoystick: View { } upIcon?.renderingMode(.template) - .foregroundColor(.secondary).padding(iconPadding) + .foregroundColor(iconColor).padding(iconPadding) HStack() { leftIcon?.renderingMode(.template) - .foregroundColor(.secondary).padding(iconPadding) + .foregroundColor(iconColor).padding(iconPadding) ZStack { // 中央は直径280の場合は140:140 @@ -251,11 +254,11 @@ public struct OMJoystick: View { } rightIcon?.renderingMode(.template) - .foregroundColor(.secondary).padding(iconPadding) + .foregroundColor(iconColor).padding(iconPadding) } downIcon?.renderingMode(.template) - .foregroundColor(.secondary).padding(iconPadding) + .foregroundColor(iconColor).padding(iconPadding) if isDebug { HStack(spacing: 15) { From 63042f518207609084545adba574939eb2db028a Mon Sep 17 00:00:00 2001 From: tichise <43707+tichise@users.noreply.github.com> Date: Sat, 19 Sep 2020 13:04:51 +0900 Subject: [PATCH 2/5] Update version --- OMJoystick.podspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OMJoystick.podspec b/OMJoystick.podspec index 5880ef2..dd2916f 100644 --- a/OMJoystick.podspec +++ b/OMJoystick.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = 'OMJoystick' - s.version = '0.5.4' + s.version = '0.6.0' s.swift_versions = '5.0' s.license = 'MIT' s.summary = 'This is the Joystick UI library for SwiftUI.' From eda47a89b05d4938c46880c9be93e6aa810e236a Mon Sep 17 00:00:00 2001 From: tichise <43707+tichise@users.noreply.github.com> Date: Sat, 19 Sep 2020 13:06:12 +0900 Subject: [PATCH 3/5] Add iconColor --- Sample/Sample/ContentView.swift | 2 +- Sources/OMJoyStick.swift | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Sample/Sample/ContentView.swift b/Sample/Sample/ContentView.swift index b7d73ca..c43c811 100644 --- a/Sample/Sample/ContentView.swift +++ b/Sample/Sample/ContentView.swift @@ -21,7 +21,7 @@ struct ContentView: View { downIcon: Image(systemSymbol: .arrowDown) ) - let colorSetting = ColorSetting(subRingColor: .red, bigRingNormalBackgroundColor: .green, bigRingDarkBackgroundColor: .blue, bigRingStrokeColor: .yellow) + let colorSetting = ColorSetting(subRingColor: .red, bigRingNormalBackgroundColor: .green, bigRingDarkBackgroundColor: .blue, bigRingStrokeColor: .yellow, iconColor: .red) var body: some View { GeometryReader { geometry in diff --git a/Sources/OMJoyStick.swift b/Sources/OMJoyStick.swift index 11c1ad5..6d27a82 100644 --- a/Sources/OMJoyStick.swift +++ b/Sources/OMJoyStick.swift @@ -89,6 +89,7 @@ public struct ColorSetting { public struct OMJoystick: View { + var iconColor: Color var subRingColor: Color var bigRingNormalBackgroundColor: Color var bigRingDarkBackgroundColor: Color @@ -203,6 +204,7 @@ public struct OMJoystick: View { self.isDebug = isDebug + self.iconColor = colorSetting.iconColor self.subRingColor = colorSetting.subRingColor self.bigRingNormalBackgroundColor = colorSetting.bigRingNormalBackgroundColor self.bigRingDarkBackgroundColor = colorSetting.bigRingDarkBackgroundColor From 1ebb9cf0850dc3c4c6ee70c3c9c0d9f8371dba0b Mon Sep 17 00:00:00 2001 From: tichise <43707+tichise@users.noreply.github.com> Date: Sat, 19 Sep 2020 13:06:20 +0900 Subject: [PATCH 4/5] Update project --- Sample/Sample.xcodeproj/project.pbxproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sample/Sample.xcodeproj/project.pbxproj b/Sample/Sample.xcodeproj/project.pbxproj index b09af48..ae5d4de 100644 --- a/Sample/Sample.xcodeproj/project.pbxproj +++ b/Sample/Sample.xcodeproj/project.pbxproj @@ -186,7 +186,7 @@ isa = PBXProject; attributes = { LastSwiftUpdateCheck = 1160; - LastUpgradeCheck = 1160; + LastUpgradeCheck = 1200; ORGANIZATIONNAME = tichise; TargetAttributes = { B021BC402504B56E00BFB99E = { @@ -350,6 +350,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -410,6 +411,7 @@ CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; From 605eb71169b9b46938d9fdcd44a96b34045ea4a8 Mon Sep 17 00:00:00 2001 From: tichise <43707+tichise@users.noreply.github.com> Date: Sat, 19 Sep 2020 14:57:43 +0900 Subject: [PATCH 5/5] Update ContentView.swift --- Sample/Sample/ContentView.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sample/Sample/ContentView.swift b/Sample/Sample/ContentView.swift index c43c811..ed4d6c2 100644 --- a/Sample/Sample/ContentView.swift +++ b/Sample/Sample/ContentView.swift @@ -32,7 +32,7 @@ struct ContentView: View { }.frame(width: geometry.size.width-40, height: geometry.size.width-40) - OMJoystick(isDebug: true, iconSetting: self.iconSetting, colorSetting: ColorSetting(), smallRingRadius: 70, bigRingRadius: 120 + OMJoystick(isDebug: true, iconSetting: self.iconSetting, colorSetting: ColorSetting(iconColor: .orange), smallRingRadius: 70, bigRingRadius: 120 ) { (joyStickState, stickPosition) in TILogger().info(joyStickState.rawValue) TILogger().info(stickPosition)