diff --git a/RespectU.xcodeproj/project.pbxproj b/RespectU.xcodeproj/project.pbxproj index 542d7f9..1fb6535 100644 --- a/RespectU.xcodeproj/project.pbxproj +++ b/RespectU.xcodeproj/project.pbxproj @@ -57,6 +57,7 @@ 9C9BB24EC5E6266278706EC8E1687942 /* LanguageResponse.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9FEE52510CEADD20DE68A05F791D08EE /* LanguageResponse.swift */; }; E0045A82AD56B280294AD01E55A8F38A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 0FFF8FE8E83D48C24E4B183637AC73A8 /* LaunchScreen.storyboard */; }; EC915038C96954FF4B4502B9245CF3D0 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = B30E23955E630DE10DDEE4E073034629 /* Localizable.strings */; }; + A46B6AB28AF98D7D8895286B4094B1F3 /* Log.swift in Sources */ = {isa = PBXBuildFile; fileRef = EF5822F9291DBFD0FB7D48CB7D7D297C /* Log.swift */; }; 3B9C2AF499E89D2A4B1386181D2E464C /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 78D031E416EDBC4C34BC6B3FA0451966 /* MessageUI.framework */; }; 6873CA61A5E3DCF9DCE5B8DD11436346 /* Mission.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 58EF41D2CE42F9C421375B5B3CE8D60E /* Mission.storyboard */; }; 07E412854081E98BAA9EC7826338343C /* MissionBSTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D5735B28DC786C25122A478189A9D7A /* MissionBSTableViewController.swift */; }; @@ -69,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 */; }; @@ -285,6 +286,7 @@ 117BC6C5BE267F11B4EEF031AEA2892E /* InitViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InitViewController.swift; sourceTree = ""; }; C9846CC66092E2BF0D2992D65E7468CD /* LanguageInfo.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LanguageInfo.swift; sourceTree = ""; }; 9FEE52510CEADD20DE68A05F791D08EE /* LanguageResponse.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LanguageResponse.swift; sourceTree = ""; }; + EF5822F9291DBFD0FB7D48CB7D7D297C /* Log.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Log.swift; sourceTree = ""; }; 78D031E416EDBC4C34BC6B3FA0451966 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; }; 58EF41D2CE42F9C421375B5B3CE8D60E /* Mission.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = Mission.storyboard; sourceTree = ""; }; 2D5735B28DC786C25122A478189A9D7A /* MissionBSTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MissionBSTableViewController.swift; sourceTree = ""; }; @@ -297,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 = ""; }; @@ -631,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 */, @@ -877,6 +879,7 @@ 7994394D253D83388739913632BF52F4 /* Button.swift */, 3556AE9C2F4DBEEEF2277634864736F6 /* Difficulty.swift */, 9CB2C96445D032E82864C978003715B1 /* GradientDirection.swift */, + EF5822F9291DBFD0FB7D48CB7D7D297C /* Log.swift */, 27FD193AE2FCE3A3F96143D41ADBCC7F /* MissionSection.swift */, 9AF510989C994AF286BAC6EFC98F3D86 /* Note.swift */, D9B229B6B9B7142C2A461D7DEB2A7113 /* RUButton.swift */, @@ -1130,6 +1133,7 @@ 7E0990E3AE966B278DF432343CED2319 /* InitViewController.swift in Sources */, C663E15915C31A522FC58453C8860335 /* LanguageInfo.swift in Sources */, 9C9BB24EC5E6266278706EC8E1687942 /* LanguageResponse.swift in Sources */, + A46B6AB28AF98D7D8895286B4094B1F3 /* Log.swift in Sources */, 07E412854081E98BAA9EC7826338343C /* MissionBSTableViewController.swift in Sources */, 9DCD5A88AE046BE67E43FDE46C8F33C3 /* MissionBaseTableViewController.swift in Sources */, 8007E7D37842446EFC1FDF6AFC2639EC /* MissionCETableViewController.swift in Sources */, @@ -1139,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/Log.swift b/RespectU/Sources/Common/Log.swift new file mode 100644 index 0000000..6f82886 --- /dev/null +++ b/RespectU/Sources/Common/Log.swift @@ -0,0 +1,31 @@ +// +// Log.swift +// RespectU +// +// Created by Presto on 14/03/2019. +// Copyright © 2019 Presto. All rights reserved. +// + +import UIKit + +/// 일반 로그 찍을 때 사용하기. +func debugLog(_ message: Any, + file: String = #file, + function: String = #function, + line: Int = #line) { + #if DEBUG + let fileName = file.split(separator: "/").last ?? "" + let functionName = function.split(separator: "(").first ?? "" + print("👻 [\(fileName)] \(functionName)(\(line)): \(message)") + #endif +} + +/// 에러 로그 찍을 때 사용하기. +func errorLog(_ message: Any, + file: String = #file, + function: String = #function, + line: Int = #line) { + let fileName = file.split(separator: "/").last ?? "" + let functionName = function.split(separator: "(").first ?? "" + print("❌ [\(fileName)] \(functionName)(\(line)): \(message)") +} 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/Models/Realm/TrophyInfo.swift b/RespectU/Sources/Models/Realm/TrophyInfo.swift index 572c27a..1229476 100644 --- a/RespectU/Sources/Models/Realm/TrophyInfo.swift +++ b/RespectU/Sources/Models/Realm/TrophyInfo.swift @@ -75,7 +75,7 @@ final class TrophyInfo: Object { do { try imageData.write(to: fileURL, options: .atomic) } catch { - print(error.localizedDescription) + errorLog(error.localizedDescription) } titleInfo.english = trophyInfo.title.english titleInfo.korean = trophyInfo.title.korean @@ -117,7 +117,7 @@ final class TrophyInfo: Object { do { try FileManager.default.removeItem(at: fileURL) } catch { - print(error.localizedDescription) + errorLog(error.localizedDescription) } let imageURL = "\(APIService.baseURL)/images/\(trophyInfo.series)/\(trophyInfo.image).png" guard let url = URL(string: imageURL) else { return } @@ -125,7 +125,7 @@ final class TrophyInfo: Object { do { try imageData.write(to: fileURL, options: .atomic) } catch { - print(error.localizedDescription) + errorLog(error.localizedDescription) } guard let realm = try? Realm() else { return } try? realm.write { diff --git a/RespectU/Sources/Utils/Utils.swift b/RespectU/Sources/Utils/Utils.swift index cddbefb..f1a10ea 100644 --- a/RespectU/Sources/Utils/Utils.swift +++ b/RespectU/Sources/Utils/Utils.swift @@ -104,7 +104,6 @@ final class Utils { return (totalSkillPoint, highestSeries) case .button5: let sorted = results.sorted(byKeyPath: "button5.skillPoint", ascending: false) - print(sorted) let totalSkillPoint = sorted[0..<50].map { $0.button5?.skillPoint ?? 0 }.reduce(0, +) let highestSeries = Series(rawValue: sorted.first?.series ?? "") UserDefaults.standard.do { 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