본문 바로가기 메뉴 바로가기

Heecheol's blog

프로필사진
  • 글쓰기
  • 관리
  • 태그
  • 방명록
  • RSS

Heecheol's blog

검색하기 폼
  • 분류 전체보기 (225)
    • Swift (7)
    • iOS (17)
    • 프로젝트 (6)
      • Petmory (6)
    • PS (117)
    • CS (5)
      • 운영체제 (5)
    • TIL (66)
    • 코드수정 (7)
  • 방명록

코드수정 (7)
[코드 수정] 감정 다이어리, 기념일 계산기 코드 수정

수업때 배운 익스텐션과 열거형을 이용해서 이전에 했던 과제 코드를 수정해보았음. 기존에 case만 있던 enum을 다음과 같이 수정했음. caseIterable을 채택하여 배열처럼 사용 가능하도록 함. enum ButtonTag: Int, CaseIterable { case first, second, third, fourth, fifth, sixth, seventh, eighth, ninth var tagLabel: String { switch self { case .first: return "행복해 " case .second: return "사랑해 " case .third: return "좋아해 " case .fourth: return "당황해 " case .fifth: return "속상해 " cas..

코드수정 2022. 7. 19. 17:35
[코드 리뷰] 감정 다이어리, 기념일 계산기 코드 수정

새싹 프로그램에서 잭님께 받은 피드백 정리 및 코드 수정 감정 다이어리 1. 열거형을 Int로 채택한 경우 rawValue가 0부터 지정되므로 따로 선언하지 않아도 된다. 수정 전 enum ButtonTag: Int { case first = 0 case second = 1 case third = 2 case fourth = 3 case fifth = 4 case sixth = 5 case seventh = 6 case eighth = 7 case ninth = 8 } 수정 후 enum ButtonTag: Int { case first case second case third case fourth case fifth case sixth case seventh case eighth case ninth } ..

코드수정 2022. 7. 19. 00:48
이전 1 2 다음
이전 다음
최근에 올라온 글
Total
Today
Yesterday

Blog is powered by Tistory / Designed by Tistory

티스토리툴바