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/#122] watchOS 기능 구현 #126

Merged
merged 15 commits into from
Jul 7, 2023
Merged

Conversation

mooyoung2309
Copy link
Member

PR 요약

Jul-05-2023 23-29-44

    public func sendPumpingTimerData(from timers: [PumpingTimer], isHardPush: Bool = false) {
        DispatchQueue.main.async {
            do {
                let pumpingTimerData = PumpingTimerData(
                    timers: timers,
                    updatedTime: Date().timeIntervalSince1970,
                    isHardPush: true)
                let data = try JSONEncoder().encode(pumpingTimerData)
                self.session?.sendMessageData(data, replyHandler: nil)
                debugPrint("iOS send data: \(data)")
            } catch {
                print(error)
            }
        }
    }
public struct PumpingTimerData: Codable, Equatable {
    public let timers: [PumpingTimer]
    public let updatedTime: Double
    public let isHardPush: Bool

    public init(timers: [PumpingTimer], updatedTime: Double, isHardPush: Bool = false) {
        self.timers = timers
        self.updatedTime = updatedTime
        self.isHardPush = isHardPush
    }
}

주고 받는 데이터를 묶어서 보내도록 하였습니다. 기본적으로 iOS와 WatchOS가 서로 정보를 교환해줘야하는 상황이 있기 때문에 updateTime과 isHardPush를 사용할 것인데. isHardPush는 사용자가 시작 버튼을 눌렀을때 강제로 업데이트를 쳐야하는 상황일 것입니다. 특히 워치에서 시작 버튼을 누를 수도 있고, 아요에서 누를 수도 있는 상황을 고려했고. updateTime은 기본적으로 아이폰이 꺼져있거나, 워치가 꺼져있을때 정보를 업데이트 하기위해서 시간 변수를 두었습니다.

안녕하세요. 드디어 해냈습니다 . . 우선 이따가 pr을 좀 더 자세히 적겠습니다.

📌 변경 사항

✅ PR check list

Linked Issue

close #122

@github-actions
Copy link

github-actions bot commented Jul 5, 2023

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@parkhj0423
Copy link
Member

고생 많았어! 엣지케이스많은 기획이니까 일단 기능 구현에 초점을 맞추고 예외사항들은 같이 고민하면서 처리해 나가자!

Copy link
Collaborator

@derrickkim0109 derrickkim0109 left a comment

Choose a reason for hiding this comment

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

진짜 많이 했네!
고생했어

public let updatedTime: Double
public let isHardPush: Bool

public init(timers: [PumpingTimer], updatedTime: Double, isHardPush: Bool = false) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

개행을 추가해야 할 거 같아.

public let updatedTime: Double
public let isHardPush: Bool

public init(timers: [PumpingTimer], updatedTime: Double, isHardPush: Bool = false) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

여기도 개행이 빠진거 같아.

@@ -24,6 +27,29 @@ public class WatchConnectivityDelegate: NSObject, ObservableObject ,WCSessionDel
self.session?.activate()
}

public func sendMessage(key: String, value: Any) {
DispatchQueue.main.async {
Copy link
Collaborator

Choose a reason for hiding this comment

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

DispatchQueue를 사용한 부분들은 @MainActor로 다 대체할 수 있지 않을까?

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@github-actions
Copy link

github-actions bot commented Jul 7, 2023

This PR exceeds the recommended size of 1000 lines. Please make sure you are NOT addressing multiple issues with one PR. Note this PR might be rejected due to its size.

@mooyoung2309 mooyoung2309 merged commit 7589819 into develop Jul 7, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[feat] watchOS 기능 구현
3 participants