Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat [#36] 스크린타임 API 연결 #66

Merged
merged 16 commits into from
Jan 13, 2024
Merged

Conversation

Zoe0929
Copy link
Member

@Zoe0929 Zoe0929 commented Jan 13, 2024

👾 작업 내용

스크린타임 API 연결을 위한 세팅을 완료했습니다.

🚀 PR Point

아직 미완성입니다!!!

브랜치가 너무 오래되어 한번 끊고 코드리뷰 받으려 합니다.

  • Shield / ShieldConfig : 이용 시간 완료 후 잠금 뷰에 대한 커스텀을 위해 필요한 Target 입니다. (추가완료)
  • 스크린타임 권한 허용 로직 : 탭바에 진입할 때 마다 스크린타임 권한을 확인합니다. 이 작업은 ViewWillAppear(: ) 에서 호출됩니다.
    private func requestAuthorization() {
    if authorizationCenter.authorizationStatus == .approved {
    print("ScreenTime 권한 허용 완료")
    } else {
    Task {
    do {
    try await authorizationCenter.requestAuthorization(for: .individual)
    } catch {
    print(error.localizedDescription)
    }
    }
    }
    }
  • 앱 추가 시 앱 전달 (CollectionView에 추가) 로직은 아직 미완성입니다.
  • 나머지 기능 설명은 추후 완성 후에 적도록 하겠습니다.

📸 스크린샷

구현 내용 스크린샷
앱 추가 로직 Simulator Screen Recording - iPhone 13 mini - 2024-01-13 at 06 23 01
실기기 테스트\n(시뮬레이터에는 앱이 추가되어 있지 않아,\n실기기 테스트 첨부합니다. https://github.com/Team-HMH/HMH-iOS/assets/68178395/c0dd2232-e4b5-4f9b-9920-42cff499e3ee

🚀 기기 대응

기기명 Iphone 13 mini Iphone 14 Iphone 15 pro Iphone SE(3rd)
스크린샷 Simulator Screenshot - iPhone 13 mini - 2024-01-13 at 06 23 13 image Simulator Screenshot - iPhone 15 Pro - 2024-01-13 at 06 24 29 Simulator Screenshot - iPhone SE (3rd generation) - 2024-01-13 at 06 31 33

✅ Issue

Resolved #36

@Zoe0929 Zoe0929 added 🐰지희 지희의 issue ⚒️ set 세팅할 시 labels Jan 13, 2024
@Zoe0929 Zoe0929 self-assigned this Jan 13, 2024
@Zoe0929 Zoe0929 linked an issue Jan 13, 2024 that may be closed by this pull request
Copy link
Member

@kim-seonwoo kim-seonwoo 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 +15 to +39

private let goalTimeView = GoalTimeSelectView()

override func loadView() {
self.view = goalTimeView
}

override func viewDidLoad() {
configureViewController()

super.viewDidLoad()
}

private func configureViewController() {
mainTitleText = StringLiteral.Challenge.GoalTime.titleText
subTitleText = StringLiteral.Challenge.GoalTime.subTitleText
nextButton.setTitle("완료", for: .normal)
step = 6
}

override func onTapButton() {
self.navigationController?.popToRootViewController(animated: false)
}

}
Copy link
Member

Choose a reason for hiding this comment

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

p5. 이 부분 전 뷰와의 연결을 위해 추후에 제가 수정해도 될까요?

Copy link
Member Author

Choose a reason for hiding this comment

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

네! 당연하죠🐹

Comment on lines 14 to 43
class GoalTimeSelectView: UIView {

var screenTime = ScreenTime.shared
private let picker = SpecificTimePickerView()

override init(frame: CGRect) {
super.init(frame: frame)
setUI()
configureView()

}

required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
private func setUI(){
setHierarchy()
setConstraints()
}

private func setHierarchy() {
self.addSubviews(picker)
}

private func setConstraints() {
picker.snp.makeConstraints {
$0.center.equalToSuperview()
$0.width.equalTo(335.adjusted)
}
}
Copy link
Member

Choose a reason for hiding this comment

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

p5. 이 부분도 totalPickerView와의 통일성을 위해서 수정이 필요할 것 같습니다!

Copy link
Contributor

@boyeon0119 boyeon0119 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 +16 to +17
private let authorizationCenter = AuthorizationCenter.shared

Copy link
Contributor

Choose a reason for hiding this comment

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

p2. 줄바꿈 놉

@Zoe0929 Zoe0929 merged commit 357ea63 into develop Jan 13, 2024
@Zoe0929 Zoe0929 deleted the feat/#36/ScreenTimeAPI branch January 13, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
⚒️ set 세팅할 시 🐰지희 지희의 issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feat] 스크린 타임 가져오기
3 participants