Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

[Fix] enum StatusIcon이 일정 상태에 따라 tintColor로 랜더링된 이미지를 리턴해 줄 수 있도록 리팩토링 #50

@ChoiysApple

Description

@ChoiysApple

image

현재 동작

enum StatusIcon: String {
    
    // TODO: String 대신 tintColor로 랜더링된 UIImage를 받을 수 있도록 리팩토링
    case upcoming = "status.upcomming"
    case proceeding = "status.proceeding"
    case completed = "status.completed"
    case skipped = "status.start"
    
    case start = "date.start"
    case end = "date.end"
}
public func editValue(status: StatusIcon, title: String) {
    self.icon.image = UIImage(systemName: status.rawValue)!.withTintColor(.gray400)
    self.label.text = title
}

기대 동작

UIImage를 리턴하는 함수 또는 Computed Property를 enum안에 구현한다
리턴되는 UIImage는 색상이 입혀진 상태

public func editValue(status: StatusIcon, title: String) {
    self.icon.image = status.image
    self.label.text = title
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions