Skip to content

Commit

Permalink
Merge pull request #18 from presto95/develop
Browse files Browse the repository at this point in the history
3.02 - hotfix
  • Loading branch information
presto95 authored Mar 15, 2019
2 parents 2041042 + 62d8a6a commit 080ee4d
Show file tree
Hide file tree
Showing 20 changed files with 183 additions and 173 deletions.
68 changes: 36 additions & 32 deletions RespectU.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

31 changes: 31 additions & 0 deletions RespectU/Sources/Common/Log.swift
Original file line number Diff line number Diff line change
@@ -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)")
}
73 changes: 8 additions & 65 deletions RespectU/Sources/Common/MissionSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down Expand Up @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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.
Expand All @@ -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:
Expand Down
10 changes: 6 additions & 4 deletions RespectU/Sources/Extension/CAGradientLayer+.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
28 changes: 0 additions & 28 deletions RespectU/Sources/Extension/MissionSection.Technika3+Gradient.swift

This file was deleted.

37 changes: 37 additions & 0 deletions RespectU/Sources/Extension/MissionSection.Technika3+UI.swift
Original file line number Diff line number Diff line change
@@ -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)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading

0 comments on commit 080ee4d

Please sign in to comment.