Skip to content

필수 도전 과제 1 구현 #1

Merged
Roy-wonji merged 5 commits intodevelopfrom
Feature/challenge-1
Aug 22, 2025
Merged

필수 도전 과제 1 구현 #1
Roy-wonji merged 5 commits intodevelopfrom
Feature/challenge-1

Conversation

@Roy-wonji
Copy link
Collaborator

✨ 작업 내용

  • 두 개의 Int 값을 파라미터로 받고, 하나의 String 값을 반환하는 클로저를 설계
  • 이 클로저를 상수 sum에 저장하고, 정확한 타입을 명시
  • 위에서 정의한 sum과 동일한 타입의 클로저를 파라미터로 받고, 반환 값이 없는(void) 함수 calculate를 작성
  • Swift 6 base 로 구현
  • actor 를 사용 해서 구현

Copy link

@minneee minneee left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

ENABLE_HARDENED_RUNTIME = YES;
ENABLE_HARDENED_RUNTIME = NO;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 6.0;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

튜터님께서 swift5로 진행 권장한다고 하셨는데 6로 진행하시는 이유가 있으신가요?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@minneee 아 설정을 못 바꾸어서 바꿀려고 했습니다!

Copy link

@Peter1119 Peter1119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다 ~!

Comment on lines +22 to +24
static func calculate(_ operation : (Int, Int) -> String, a: Int, b: Int){
#logDebug(operation(a, b))
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보통은 클로저를 뒤에 붙히지 않나요 ??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Peter1119 배치를 잘못 했군요 감사합니다

import Foundation
import LogMacro

final actor SumClosure {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actor로 하신 이유가 궁금합니다 ~!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Peter1119
actor는 단일 스레드에서만 접근해서 여기에서는 싱글톤 을 만들 필요까지는 없어서 actor를 사용했습니다

Comment on lines +13 to +14
static var num: Int = 3
static var num2 : Int = 10

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

static으로 하신 이유가 있으신가요 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Peter1119 전역으로 쓸려고 그렇게 지정했는데 생각 해보니 데이터 격릴 생각 하면 static 을 빼는 게 맞겠네요

@Roy-wonji Roy-wonji merged commit 043bc0a into develop Aug 22, 2025
@Roy-wonji Roy-wonji deleted the Feature/challenge-1 branch August 22, 2025 00:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants