-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Feat [#80] 잠금 화면 뷰 구현 완료
- Loading branch information
Showing
20 changed files
with
503 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// | ||
// HMHMonitorExtension.swift | ||
// DeviceMonitor | ||
// | ||
// Created by 지희의 MAC on 1/15/24. | ||
// | ||
|
||
import Foundation | ||
import DeviceActivity | ||
import ManagedSettings | ||
|
||
class MyMonitorExtension: DeviceActivityMonitor { | ||
let store = ManagedSettingsStore() | ||
|
||
|
||
// You can use the `store` property to shield apps when an interval starts, ends, or meets a threshold. | ||
override func intervalDidStart(for activity: DeviceActivityName) { | ||
super.intervalDidStart(for: activity) | ||
|
||
|
||
// Shield selected applications. | ||
// let model = MyModel() | ||
// let applications = model.selectionToShield.applications | ||
// store.shield.applications = applications.isEmpty ? nil : applications | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// | ||
// ActivityReport.swift | ||
// DeviceReport | ||
// | ||
// Created by 지희의 MAC on 1/15/24. | ||
// | ||
|
||
// MARK: - Device Activity Report 관련 데이터 모델이 정의되어 있는 파일입니다. | ||
import Foundation | ||
import ManagedSettings | ||
|
||
struct ActivityReport { | ||
let totalDuration: TimeInterval | ||
let apps: [AppDeviceActivity] | ||
} | ||
|
||
struct AppDeviceActivity: Identifiable { | ||
var id: String | ||
var displayName: String | ||
var duration: TimeInterval | ||
var numberOfPickups: Int | ||
var token: ApplicationToken? | ||
} | ||
|
||
extension TimeInterval { | ||
/// TimeInterval 타입 값을 00:00 형식의 String으로 변환해주는 메서드 | ||
func toString() -> String { | ||
let time = NSInteger(self) | ||
let minutes = (time / 60) % 60 | ||
let hours = (time / 3600) | ||
return String(format: "%0.2d:%0.2d", hours,minutes) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// | ||
// UserDefault+.swift | ||
// HMH_iOS | ||
// | ||
// Created by 지희의 MAC on 1/14/24. | ||
// | ||
|
||
import Foundation | ||
|
||
public extension UserDefaults { | ||
static let shared = UserDefaults(suiteName: "group.HMH")! | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.