From 62d8a6a216bba193587cc13d47beb424ec96dd13 Mon Sep 17 00:00:00 2001 From: Presto Date: Fri, 15 Mar 2019 00:00:33 +0900 Subject: [PATCH] hotfix --- RespectU.xcodeproj/project.pbxproj | 64 ++++++++-------- RespectU/Sources/Common/MissionSection.swift | 73 ++----------------- .../Sources/Extension/CAGradientLayer+.swift | 10 ++- ...dient.swift => MissionSection.BS+UI.swift} | 12 +-- ...dient.swift => MissionSection.CE+UI.swift} | 12 +-- ...swift => MissionSection.LinkDisk+UI.swift} | 12 +-- ....swift => MissionSection.Respect+UI.swift} | 20 +++-- ...wift => MissionSection.Technika1+UI.swift} | 12 +-- ...wift => MissionSection.Technika2+UI.swift} | 12 +-- .../MissionSection.Technika3+Gradient.swift | 28 ------- .../MissionSection.Technika3+UI.swift | 37 ++++++++++ ....swift => MissionSection.Trilogy+UI.swift} | 12 +-- .../Top50/Top504BTableViewController.swift | 2 +- .../Top50/Top505BTableViewController.swift | 2 +- .../Top50/Top506BTableViewController.swift | 2 +- RespectU/Sources/Views/RecordView.swift | 2 +- RespectU/Supports/Info.plist | 2 +- 17 files changed, 145 insertions(+), 169 deletions(-) rename RespectU/Sources/Extension/{MissionSection.BS+Gradient.swift => MissionSection.BS+UI.swift} (86%) rename RespectU/Sources/Extension/{MissionSection.CE+Gradient.swift => MissionSection.CE+UI.swift} (86%) rename RespectU/Sources/Extension/{MissionSection.LinkDisk+Gradient.swift => MissionSection.LinkDisk+UI.swift} (86%) rename RespectU/Sources/Extension/{MissionSection.Respect+Gradient.swift => MissionSection.Respect+UI.swift} (90%) rename RespectU/Sources/Extension/{MissionSection.Technika1+Gradient.swift => MissionSection.Technika1+UI.swift} (86%) rename RespectU/Sources/Extension/{MissionSection.Technika2+Gradient.swift => MissionSection.Technika2+UI.swift} (87%) delete mode 100644 RespectU/Sources/Extension/MissionSection.Technika3+Gradient.swift create mode 100644 RespectU/Sources/Extension/MissionSection.Technika3+UI.swift rename RespectU/Sources/Extension/{MissionSection.Trilogy+Gradient.swift => MissionSection.Trilogy+UI.swift} (87%) diff --git a/RespectU.xcodeproj/project.pbxproj b/RespectU.xcodeproj/project.pbxproj index 8b918bb..1fb6535 100644 --- a/RespectU.xcodeproj/project.pbxproj +++ b/RespectU.xcodeproj/project.pbxproj @@ -70,14 +70,14 @@ 99897C2ED7674E739230DED65BDC06D2 /* MissionLinkDiskTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5EB4F2D81091EAC8D197F1D737EA41B9 /* MissionLinkDiskTableViewController.swift */; }; 80F2294D348F4A43E2CB8F35028D0423 /* MissionRespectTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1936880A3D30B8BC49B8587F6778EEA /* MissionRespectTableViewController.swift */; }; 90AF44D559BE00DEB63346B84D141E10 /* MissionResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 356291260ADA8E8A175631818583AAC6 /* MissionResponse.swift */; }; - AC365183A54C207B12519696FFF64C67 /* MissionSection.BS+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9BE0A154D3D7E018D76684B281CECD0 /* MissionSection.BS+Gradient.swift */; }; - 0380D257C2F539A6344259BF2EFED65A /* MissionSection.CE+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 91CBAA567778CAD53CB93CE152F92D55 /* MissionSection.CE+Gradient.swift */; }; - BEC2CC592CAB4198746262C55D73DBA0 /* MissionSection.LinkDisk+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60EAD4483197E0A753FDD10845C98D09 /* MissionSection.LinkDisk+Gradient.swift */; }; - 8DD62325C32CFDD11403EF407197E9A9 /* MissionSection.Respect+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = A09D0FEC3D95CCD8ECE16CBDA7084FFA /* MissionSection.Respect+Gradient.swift */; }; - 87EE66478A51CBA1A1A9F26347694685 /* MissionSection.Technika1+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 79D7A5F0799CF86A96D301D82B8B1090 /* MissionSection.Technika1+Gradient.swift */; }; - 72713E32C8FA38F681A9C4F075A7D08B /* MissionSection.Technika2+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 241BD9807E33EA3CBBF302A35813F5C2 /* MissionSection.Technika2+Gradient.swift */; }; - 5A54507509E4E4DC3181C3FCB74FBBC0 /* MissionSection.Technika3+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = FBF7FCA66B507564BF411BB82D824394 /* MissionSection.Technika3+Gradient.swift */; }; - 9F579ACF8BFC762F49A03A837BCCF7ED /* MissionSection.Trilogy+Gradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6B59269E3AB75988A25F6D4EF5088A20 /* MissionSection.Trilogy+Gradient.swift */; }; + 66FD3654735C071C001E78ECE1B2ABB3 /* MissionSection.BS+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0F3D34B43DF30D610EC43BBADC96563E /* MissionSection.BS+UI.swift */; }; + ADB67C24258FDE09E281323CC0D81A11 /* MissionSection.CE+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 954CFB083C00CDB9E307C63BBEA58207 /* MissionSection.CE+UI.swift */; }; + 2393EF38D443D7A396C9D074B0726CE6 /* MissionSection.LinkDisk+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 50368872E0899227AA374CA6E296B27B /* MissionSection.LinkDisk+UI.swift */; }; + 433B40CCC809DF69C0F51058349CF1E6 /* MissionSection.Respect+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 507F2446A863CB86AF7532AC85D74D3F /* MissionSection.Respect+UI.swift */; }; + 3286DFFC9EAD3C3E654FECB757878B89 /* MissionSection.Technika1+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = D1B6CACA6D115E48E0B8F85E9D461EDA /* MissionSection.Technika1+UI.swift */; }; + CF49DAE3FEBA267700E391BEC367587F /* MissionSection.Technika2+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 883F40CC3D38EF613B6164D31E74574E /* MissionSection.Technika2+UI.swift */; }; + A97D770C729CFE8D99CF49AEC477C7A2 /* MissionSection.Technika3+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = CEFE945969F149232A7EDC417D48B504 /* MissionSection.Technika3+UI.swift */; }; + 1287F2D82C3E24170575A2732992D5BF /* MissionSection.Trilogy+UI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33FC8754224174261B82C1BA1E0BEE09 /* MissionSection.Trilogy+UI.swift */; }; F551680129D8E83F451174BE5B4DBF5D /* MissionSection.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27FD193AE2FCE3A3F96143D41ADBCC7F /* MissionSection.swift */; }; BEC7D1F3799FA6E0EEDB0980E345F689 /* MissionStageInfo.swift in Sources */ = {isa = PBXBuildFile; fileRef = D78571F88000DB2A377C1A859F5F2B0B /* MissionStageInfo.swift */; }; D4F4FB7D6DFADE1F54AEEDDEEE9BF681 /* MissionTechnika1TableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3127AC853734E65CD8EDD6BD1D9AEB68 /* MissionTechnika1TableViewController.swift */; }; @@ -299,14 +299,14 @@ 5EB4F2D81091EAC8D197F1D737EA41B9 /* MissionLinkDiskTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionLinkDiskTableViewController.swift; sourceTree = ""; }; D1936880A3D30B8BC49B8587F6778EEA /* MissionRespectTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionRespectTableViewController.swift; sourceTree = ""; }; 356291260ADA8E8A175631818583AAC6 /* MissionResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionResponse.swift; sourceTree = ""; }; - A9BE0A154D3D7E018D76684B281CECD0 /* MissionSection.BS+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.BS+Gradient.swift"; sourceTree = ""; }; - 91CBAA567778CAD53CB93CE152F92D55 /* MissionSection.CE+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.CE+Gradient.swift"; sourceTree = ""; }; - 60EAD4483197E0A753FDD10845C98D09 /* MissionSection.LinkDisk+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.LinkDisk+Gradient.swift"; sourceTree = ""; }; - A09D0FEC3D95CCD8ECE16CBDA7084FFA /* MissionSection.Respect+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Respect+Gradient.swift"; sourceTree = ""; }; - 79D7A5F0799CF86A96D301D82B8B1090 /* MissionSection.Technika1+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika1+Gradient.swift"; sourceTree = ""; }; - 241BD9807E33EA3CBBF302A35813F5C2 /* MissionSection.Technika2+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika2+Gradient.swift"; sourceTree = ""; }; - FBF7FCA66B507564BF411BB82D824394 /* MissionSection.Technika3+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika3+Gradient.swift"; sourceTree = ""; }; - 6B59269E3AB75988A25F6D4EF5088A20 /* MissionSection.Trilogy+Gradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Trilogy+Gradient.swift"; sourceTree = ""; }; + 0F3D34B43DF30D610EC43BBADC96563E /* MissionSection.BS+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.BS+UI.swift"; sourceTree = ""; }; + 954CFB083C00CDB9E307C63BBEA58207 /* MissionSection.CE+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.CE+UI.swift"; sourceTree = ""; }; + 50368872E0899227AA374CA6E296B27B /* MissionSection.LinkDisk+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.LinkDisk+UI.swift"; sourceTree = ""; }; + 507F2446A863CB86AF7532AC85D74D3F /* MissionSection.Respect+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Respect+UI.swift"; sourceTree = ""; }; + D1B6CACA6D115E48E0B8F85E9D461EDA /* MissionSection.Technika1+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika1+UI.swift"; sourceTree = ""; }; + 883F40CC3D38EF613B6164D31E74574E /* MissionSection.Technika2+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika2+UI.swift"; sourceTree = ""; }; + CEFE945969F149232A7EDC417D48B504 /* MissionSection.Technika3+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Technika3+UI.swift"; sourceTree = ""; }; + 33FC8754224174261B82C1BA1E0BEE09 /* MissionSection.Trilogy+UI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "MissionSection.Trilogy+UI.swift"; sourceTree = ""; }; 27FD193AE2FCE3A3F96143D41ADBCC7F /* MissionSection.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionSection.swift; sourceTree = ""; }; D78571F88000DB2A377C1A859F5F2B0B /* MissionStageInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MissionStageInfo.swift; sourceTree = ""; }; 3127AC853734E65CD8EDD6BD1D9AEB68 /* MissionTechnika1TableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionTechnika1TableViewController.swift; sourceTree = ""; }; @@ -633,14 +633,14 @@ children = ( 6F8D863B4192345379FAA072605B014B /* CAGradientLayer+.swift */, 00C0A70ADF02A515C554A2A7F65D04D0 /* Double+.swift */, - A9BE0A154D3D7E018D76684B281CECD0 /* MissionSection.BS+Gradient.swift */, - 91CBAA567778CAD53CB93CE152F92D55 /* MissionSection.CE+Gradient.swift */, - 60EAD4483197E0A753FDD10845C98D09 /* MissionSection.LinkDisk+Gradient.swift */, - A09D0FEC3D95CCD8ECE16CBDA7084FFA /* MissionSection.Respect+Gradient.swift */, - 79D7A5F0799CF86A96D301D82B8B1090 /* MissionSection.Technika1+Gradient.swift */, - 241BD9807E33EA3CBBF302A35813F5C2 /* MissionSection.Technika2+Gradient.swift */, - FBF7FCA66B507564BF411BB82D824394 /* MissionSection.Technika3+Gradient.swift */, - 6B59269E3AB75988A25F6D4EF5088A20 /* MissionSection.Trilogy+Gradient.swift */, + 0F3D34B43DF30D610EC43BBADC96563E /* MissionSection.BS+UI.swift */, + 954CFB083C00CDB9E307C63BBEA58207 /* MissionSection.CE+UI.swift */, + 50368872E0899227AA374CA6E296B27B /* MissionSection.LinkDisk+UI.swift */, + 507F2446A863CB86AF7532AC85D74D3F /* MissionSection.Respect+UI.swift */, + D1B6CACA6D115E48E0B8F85E9D461EDA /* MissionSection.Technika1+UI.swift */, + 883F40CC3D38EF613B6164D31E74574E /* MissionSection.Technika2+UI.swift */, + CEFE945969F149232A7EDC417D48B504 /* MissionSection.Technika3+UI.swift */, + 33FC8754224174261B82C1BA1E0BEE09 /* MissionSection.Trilogy+UI.swift */, 90B143CCDE9CB1920C76E56DFB8E619A /* NSObject+.swift */, 9A9970140918A7A61332718A9C9D8322 /* Series+UI.swift */, 08640281899B112DEB6A0A0A56A169B7 /* String+.swift */, @@ -1143,14 +1143,14 @@ 99897C2ED7674E739230DED65BDC06D2 /* MissionLinkDiskTableViewController.swift in Sources */, 80F2294D348F4A43E2CB8F35028D0423 /* MissionRespectTableViewController.swift in Sources */, 90AF44D559BE00DEB63346B84D141E10 /* MissionResponse.swift in Sources */, - AC365183A54C207B12519696FFF64C67 /* MissionSection.BS+Gradient.swift in Sources */, - 0380D257C2F539A6344259BF2EFED65A /* MissionSection.CE+Gradient.swift in Sources */, - BEC2CC592CAB4198746262C55D73DBA0 /* MissionSection.LinkDisk+Gradient.swift in Sources */, - 8DD62325C32CFDD11403EF407197E9A9 /* MissionSection.Respect+Gradient.swift in Sources */, - 87EE66478A51CBA1A1A9F26347694685 /* MissionSection.Technika1+Gradient.swift in Sources */, - 72713E32C8FA38F681A9C4F075A7D08B /* MissionSection.Technika2+Gradient.swift in Sources */, - 5A54507509E4E4DC3181C3FCB74FBBC0 /* MissionSection.Technika3+Gradient.swift in Sources */, - 9F579ACF8BFC762F49A03A837BCCF7ED /* MissionSection.Trilogy+Gradient.swift in Sources */, + 66FD3654735C071C001E78ECE1B2ABB3 /* MissionSection.BS+UI.swift in Sources */, + ADB67C24258FDE09E281323CC0D81A11 /* MissionSection.CE+UI.swift in Sources */, + 2393EF38D443D7A396C9D074B0726CE6 /* MissionSection.LinkDisk+UI.swift in Sources */, + 433B40CCC809DF69C0F51058349CF1E6 /* MissionSection.Respect+UI.swift in Sources */, + 3286DFFC9EAD3C3E654FECB757878B89 /* MissionSection.Technika1+UI.swift in Sources */, + CF49DAE3FEBA267700E391BEC367587F /* MissionSection.Technika2+UI.swift in Sources */, + A97D770C729CFE8D99CF49AEC477C7A2 /* MissionSection.Technika3+UI.swift in Sources */, + 1287F2D82C3E24170575A2732992D5BF /* MissionSection.Trilogy+UI.swift in Sources */, F551680129D8E83F451174BE5B4DBF5D /* MissionSection.swift in Sources */, BEC7D1F3799FA6E0EEDB0980E345F689 /* MissionStageInfo.swift in Sources */, D4F4FB7D6DFADE1F54AEEDDEEE9BF681 /* MissionTechnika1TableViewController.swift in Sources */, diff --git a/RespectU/Sources/Common/MissionSection.swift b/RespectU/Sources/Common/MissionSection.swift index 7e64da5..9ce0a17 100644 --- a/RespectU/Sources/Common/MissionSection.swift +++ b/RespectU/Sources/Common/MissionSection.swift @@ -14,7 +14,7 @@ protocol MissionSectionType { /// The color representing each section. var color: UIColor? { get } - /// Makes gradient layer by `direction`. + /// Creates gradient layer by `direction`. /// /// - Parameter direction: The direction of the gradient layer. /// @@ -57,21 +57,6 @@ enum MissionSection { /// RESPECT - Destination. case destination = "Destination" - - var color: UIColor? { - switch self { - case .departure: return .departure - case .clubRoad645: return .clubRoad645 - case .maxTheater: return .maxTheater - case .anotherWorld: return .anotherWorld - case .backStage: return .backStage - case .chaosTheory: return .chaosTheory - case .soundLab: return .soundLab - case .visualizer: return .visualizer - case .developers: return .developers - case .destination: return .destination - } - } } /// The `enum` that defines TRILOGY mission sections. @@ -82,13 +67,6 @@ enum MissionSection { /// TRILOGY - R-SIDE. case rSide = "R-SIDE" - - var color: UIColor? { - switch self { - case .tSide: return .tSide - case .rSide: return .rSide - } - } } /// The `enum` that defines CLAZZIQUAI EDITION mission sections. @@ -99,13 +77,6 @@ enum MissionSection { /// CE - Metropolis. case metropolis = "Metropolis" - - var color: UIColor? { - switch self { - case .electronicCity: return .electronicCity - case .metropolis: return .metropolis - } - } } /// The `enum` that defines TECHNIKA 1 mission sections. @@ -116,13 +87,6 @@ enum MissionSection { /// TECHNIKA 1 - Technical Mixing. case technicalMixing = "Technical Mixing" - - var color: UIColor? { - switch self { - case .platinumMixing: return .platinumMixing - case .technicalMixing: return .technicalMixing - } - } } /// The `enum` that defines BLACK SQUARE mission sections. @@ -133,13 +97,6 @@ enum MissionSection { /// BS - Absolute Sound. case absoluteSound = "Absolute Sound" - - var color: UIColor? { - switch self { - case .stylishPerformance: return .stylishPerformance - case .absoluteSound: return .absoluteSound - } - } } /// The `enum` that defines TECHNIKA 2 mission sections. @@ -150,13 +107,6 @@ enum MissionSection { /// TECHNIKA 2 - CLUB MIXING. case clubMixing = "CLUB MIXING" - - var color: UIColor? { - switch self { - case .starMixing: return .starMixing - case .clubMixing: return .clubMixing - } - } } /// The `enum` that defines LINK DISK mission sections. @@ -167,13 +117,6 @@ enum MissionSection { /// LINK DISK - BLACK DISK. case blackDisk = "BLACK DISK" - - var color: UIColor? { - switch self { - case .whiteDisk: return .whiteDisk - case .blackDisk: return .blackDisk - } - } } /// The `enum` that defines TECHNIKA 3 mission sections. @@ -184,15 +127,15 @@ enum MissionSection { /// TECHNIKA 3 - Crew Challenge. case crewChallenge = "Crew Challenge" - - var color: UIColor? { - switch self { - case .popMixing: return .popMixing - case .crewChallenge: return .crewChallenge - } - } } + /// Creates section by `series` and `section`. + /// + /// - Parameters: + /// - series: The series of the mission. + /// - section: The section string value of the mission. + /// + /// - Returns: The object conforming `MissionSectionType`. It can be `nil`. static func makeSection(bySeries series: Series, section: String) -> MissionSectionType? { switch series { case .respect: diff --git a/RespectU/Sources/Extension/CAGradientLayer+.swift b/RespectU/Sources/Extension/CAGradientLayer+.swift index 4057b02..c92f942 100644 --- a/RespectU/Sources/Extension/CAGradientLayer+.swift +++ b/RespectU/Sources/Extension/CAGradientLayer+.swift @@ -22,9 +22,11 @@ extension CAGradientLayer { colors: [CGColor], locations: [NSNumber]) { self.init() - self.startPoint = startPoint - self.endPoint = endPoint - self.colors = colors - self.locations = locations + self.do { + $0.startPoint = startPoint + $0.endPoint = endPoint + $0.colors = colors + $0.locations = locations + } } } diff --git a/RespectU/Sources/Extension/MissionSection.BS+Gradient.swift b/RespectU/Sources/Extension/MissionSection.BS+UI.swift similarity index 86% rename from RespectU/Sources/Extension/MissionSection.BS+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.BS+UI.swift index 1920467..8d2251c 100644 --- a/RespectU/Sources/Extension/MissionSection.BS+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.BS+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.BS { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .stylishPerformance: return .stylishPerformance + case .absoluteSound: return .absoluteSound + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.CE+Gradient.swift b/RespectU/Sources/Extension/MissionSection.CE+UI.swift similarity index 86% rename from RespectU/Sources/Extension/MissionSection.CE+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.CE+UI.swift index 8049f3e..c0d0def 100644 --- a/RespectU/Sources/Extension/MissionSection.CE+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.CE+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.CE { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .electronicCity: return .electronicCity + case .metropolis: return .metropolis + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.LinkDisk+Gradient.swift b/RespectU/Sources/Extension/MissionSection.LinkDisk+UI.swift similarity index 86% rename from RespectU/Sources/Extension/MissionSection.LinkDisk+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.LinkDisk+UI.swift index b56214c..1cff0e0 100644 --- a/RespectU/Sources/Extension/MissionSection.LinkDisk+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.LinkDisk+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.LinkDisk { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .whiteDisk: return .whiteDisk + case .blackDisk: return .blackDisk + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.Respect+Gradient.swift b/RespectU/Sources/Extension/MissionSection.Respect+UI.swift similarity index 90% rename from RespectU/Sources/Extension/MissionSection.Respect+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.Respect+UI.swift index 821955e..3b0f56e 100644 --- a/RespectU/Sources/Extension/MissionSection.Respect+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.Respect+UI.swift @@ -10,11 +10,21 @@ import UIKit extension MissionSection.Respect { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .departure: return .departure + case .clubRoad645: return .clubRoad645 + case .maxTheater: return .maxTheater + case .anotherWorld: return .anotherWorld + case .backStage: return .backStage + case .chaosTheory: return .chaosTheory + case .soundLab: return .soundLab + case .visualizer: return .visualizer + case .developers: return .developers + case .destination: return .destination + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.Technika1+Gradient.swift b/RespectU/Sources/Extension/MissionSection.Technika1+UI.swift similarity index 86% rename from RespectU/Sources/Extension/MissionSection.Technika1+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.Technika1+UI.swift index f8d2b8a..a488834 100644 --- a/RespectU/Sources/Extension/MissionSection.Technika1+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.Technika1+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.Technika1 { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .platinumMixing: return .platinumMixing + case .technicalMixing: return .technicalMixing + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.Technika2+Gradient.swift b/RespectU/Sources/Extension/MissionSection.Technika2+UI.swift similarity index 87% rename from RespectU/Sources/Extension/MissionSection.Technika2+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.Technika2+UI.swift index d433aa7..ca03f44 100644 --- a/RespectU/Sources/Extension/MissionSection.Technika2+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.Technika2+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.Technika2 { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .starMixing: return .starMixing + case .clubMixing: return .clubMixing + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/Extension/MissionSection.Technika3+Gradient.swift b/RespectU/Sources/Extension/MissionSection.Technika3+Gradient.swift deleted file mode 100644 index 585ba06..0000000 --- a/RespectU/Sources/Extension/MissionSection.Technika3+Gradient.swift +++ /dev/null @@ -1,28 +0,0 @@ -// -// MissionSection.Technika3+Gradient.swift -// RespectU -// -// Created by Presto on 10/03/2019. -// Copyright © 2019 Presto. All rights reserved. -// - -import UIKit - -extension MissionSection.Technika3 { - - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. - func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { - let startPoint = direction.startPoint - let endPoint = direction.endPoint - switch self { - case .popMixing: - return nil - case .crewChallenge: - return nil - } - } -} diff --git a/RespectU/Sources/Extension/MissionSection.Technika3+UI.swift b/RespectU/Sources/Extension/MissionSection.Technika3+UI.swift new file mode 100644 index 0000000..3bb57f8 --- /dev/null +++ b/RespectU/Sources/Extension/MissionSection.Technika3+UI.swift @@ -0,0 +1,37 @@ +// +// MissionSection.Technika3+Gradient.swift +// RespectU +// +// Created by Presto on 10/03/2019. +// Copyright © 2019 Presto. All rights reserved. +// + +import UIKit + +extension MissionSection.Technika3 { + + var color: UIColor? { + switch self { + case .popMixing: return .popMixing + case .crewChallenge: return .crewChallenge + } + } + + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { + let startPoint = direction.startPoint + let endPoint = direction.endPoint + let locations: [NSNumber] = [0, 0.5, 1] + switch self { + case .popMixing: + return CAGradientLayer(startPoint: startPoint, + endPoint: endPoint, + colors: [#colorLiteral(red: 0.1490196078, green: 0.2666666667, blue: 0.3882352941, alpha: 1), #colorLiteral(red: 0.768627451, green: 0.6235294118, blue: 0.8666666667, alpha: 1)], + locations: locations) + case .crewChallenge: + return CAGradientLayer(startPoint: startPoint, + endPoint: endPoint, + colors: [#colorLiteral(red: 0.1490196078, green: 0.2784313725, blue: 0.4039215686, alpha: 1), #colorLiteral(red: 0.6784313725, green: 0.6784313725, blue: 0.6784313725, alpha: 1)], + locations: locations) + } + } +} diff --git a/RespectU/Sources/Extension/MissionSection.Trilogy+Gradient.swift b/RespectU/Sources/Extension/MissionSection.Trilogy+UI.swift similarity index 87% rename from RespectU/Sources/Extension/MissionSection.Trilogy+Gradient.swift rename to RespectU/Sources/Extension/MissionSection.Trilogy+UI.swift index 922a267..a87ff8a 100644 --- a/RespectU/Sources/Extension/MissionSection.Trilogy+Gradient.swift +++ b/RespectU/Sources/Extension/MissionSection.Trilogy+UI.swift @@ -10,11 +10,13 @@ import UIKit extension MissionSection.Trilogy { - /// Creates `CAGradientLayer` matching each mission section. - /// - /// - Parameter direction: The direction of gradient layer. - /// - /// - Returns: The created `CAGradientLayer`. + var color: UIColor? { + switch self { + case .tSide: return .tSide + case .rSide: return .rSide + } + } + func makeGradient(by direction: GradientDirection) -> CAGradientLayer? { let startPoint = direction.startPoint let endPoint = direction.endPoint diff --git a/RespectU/Sources/ViewControllers/Top50/Top504BTableViewController.swift b/RespectU/Sources/ViewControllers/Top50/Top504BTableViewController.swift index 017088f..1a9fcdd 100644 --- a/RespectU/Sources/ViewControllers/Top50/Top504BTableViewController.swift +++ b/RespectU/Sources/ViewControllers/Top50/Top504BTableViewController.swift @@ -28,7 +28,7 @@ extension Top504BTableViewController { let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) if case let top50Cell as Top50Cell = cell { let object = results[indexPath.row] - top50Cell.configure(with: object, button: .button8) + top50Cell.configure(with: object, button: .button4) } return cell } diff --git a/RespectU/Sources/ViewControllers/Top50/Top505BTableViewController.swift b/RespectU/Sources/ViewControllers/Top50/Top505BTableViewController.swift index c1e64d7..1dabcc7 100644 --- a/RespectU/Sources/ViewControllers/Top50/Top505BTableViewController.swift +++ b/RespectU/Sources/ViewControllers/Top50/Top505BTableViewController.swift @@ -28,7 +28,7 @@ extension Top505BTableViewController { let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) if case let top50Cell as Top50Cell = cell { let object = results[indexPath.row] - top50Cell.configure(with: object, button: .button8) + top50Cell.configure(with: object, button: .button5) } return cell } diff --git a/RespectU/Sources/ViewControllers/Top50/Top506BTableViewController.swift b/RespectU/Sources/ViewControllers/Top50/Top506BTableViewController.swift index d35e3c2..2a2d53b 100644 --- a/RespectU/Sources/ViewControllers/Top50/Top506BTableViewController.swift +++ b/RespectU/Sources/ViewControllers/Top50/Top506BTableViewController.swift @@ -28,7 +28,7 @@ extension Top506BTableViewController { let cell = tableView.dequeueReusableCell(withIdentifier: cellIdentifier, for: indexPath) if case let top50Cell as Top50Cell = cell { let object = results[indexPath.row] - top50Cell.configure(with: object, button: .button8) + top50Cell.configure(with: object, button: .button6) } return cell } diff --git a/RespectU/Sources/Views/RecordView.swift b/RespectU/Sources/Views/RecordView.swift index f659de0..4756e19 100644 --- a/RespectU/Sources/Views/RecordView.swift +++ b/RespectU/Sources/Views/RecordView.swift @@ -128,7 +128,7 @@ final class RecordView: UIView { /// The ranking label. @IBOutlet private weak var rankingLabel: UILabel! - /// The current button + /// The current button. private var currentButton: Button { return Button(rawValue: (buttonButton.title(for: .normal) ?? "4b").lowercased()) ?? .button4 } diff --git a/RespectU/Supports/Info.plist b/RespectU/Supports/Info.plist index 9f50771..83c329e 100644 --- a/RespectU/Supports/Info.plist +++ b/RespectU/Supports/Info.plist @@ -28,7 +28,7 @@ CFBundleVersion - 1 + 2 FacebookAppID 266597110540044 FacebookDisplayName