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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions HMH_iOS/DeviceMonitor/DeviceMonitor.entitlements
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.family-controls</key>
<true/>
</dict>
<dict>
<key>com.apple.developer.family-controls</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.HMH</string>
</array>
</dict>
</plist>
12 changes: 8 additions & 4 deletions HMH_iOS/DeviceReport/DeviceReport.entitlements
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.developer.family-controls</key>
<true/>
</dict>
<dict>
<key>com.apple.developer.family-controls</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.HMH</string>
</array>
</dict>
</plist>
343 changes: 343 additions & 0 deletions HMH_iOS/HMH_iOS.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "36E531A52B4C789300B4BBE3"
BuildableName = "ShiledAction.appex"
BlueprintName = "ShiledAction"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1510"
wasCreatedForAppExtension = "YES"
version = "2.0">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "36E531B72B4C78A900B4BBE3"
BuildableName = "ShiledConfig.appex"
BlueprintName = "ShiledConfig"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = ""
selectedLauncherIdentifier = "Xcode.IDEFoundation.Launcher.PosixSpawn"
launchStyle = "0"
askForAppToLaunch = "Yes"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"
askForAppToLaunch = "Yes"
launchAutomaticallySubstyle = "2">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "0B50F9C62B369813000C5046"
BuildableName = "HMH_iOS.app"
BlueprintName = "HMH_iOS"
ReferencedContainer = "container:HMH_iOS.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
6 changes: 6 additions & 0 deletions HMH_iOS/HMH_iOS/Global/Literals/String/String.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ enum StringLiteral {
static var appListDeleteHeaderButtonText = "삭제"
static var appListCancelHeaderButtonText = "취소"
}

enum GoalTime {
static var titleText = "선택한 앱의 목표 이용 시간을\n설정해 주세요"
static var subTitleText = "목표 이용 시간은 최대 1시간 59분까지\n설정할 수 있어요"
}

enum Idetifier {
static var titleHeaderViewId = "TitleSectionHeader"
static var appListHeaderViewId = "AppSectionHeader"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
// Created by 지희의 MAC on 1/4/24.
//

import Foundation
import SwiftUI
import FamilyControls
import ManagedSettings

final class BlockingApplicationModel: ObservableObject {
static let shared = BlockingApplicationModel()

@Published var newSelection: FamilyActivitySelection = .init() {
didSet {
updateAppList()
}
}
@Published var newSelection: FamilyActivitySelection = .init()

@Published private(set) var appList: [String] = []
var onModelUpdate: (() -> Void)?
Expand All @@ -28,6 +23,7 @@ final class BlockingApplicationModel: ObservableObject {

init() {
updateAppList()
print(appList)
}

var selectedAppsTokens: Set<ApplicationToken> {
Expand Down
8 changes: 8 additions & 0 deletions HMH_iOS/HMH_iOS/Global/SupportingFiles/AppGroup/MyStore.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
//
// MyStore.swift
// HMH_iOS
//
// Created by 지희의 MAC on 1/9/24.
//

import Foundation
4 changes: 4 additions & 0 deletions HMH_iOS/HMH_iOS/HMH_iOS.entitlements
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,9 @@
</array>
<key>com.apple.developer.family-controls</key>
<true/>
<key>com.apple.security.application-groups</key>
<array>
<string>group.HMH</string>
</array>
</dict>
</plist>
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ final class TitleCollectionReusableView: UICollectionReusableView {

static let identifier = "TitleCollectionReusableView"

var isButtonTapped = false

private let subTitleLabel = UILabel().then {
$0.text = StringLiteral.Challenge.Date.dateHeaderSubTitle
$0.font = .iosText5Medium16
Expand Down Expand Up @@ -56,4 +58,13 @@ final class TitleCollectionReusableView: UICollectionReusableView {
}
}

@objc func deleteButtonDidTapped() {
if isButtonTapped {

} else {

}
isButtonTapped.toggle()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
//

import SwiftUI
import UIKit
import FamilyControls

//class AppAddButtonViewModel: ObservableObject {
// @Published var newSerlection: FamilyActivitySelection
//
// init(newSelection: FamilyActivitySelection) {
// self.newSelection = newSelection
// }
//}

struct AppAddButtonView: View {

Expand All @@ -22,11 +32,25 @@ struct AppAddButtonView: View {
}
.frame(width: 335, height: 68)
.familyActivityPicker(isPresented: $isPresented, selection: $model.newSelection)
.onChange(of: isPresented) { oldValue, newValue in
if newValue == false {
let mainViewController = TabBarController()
let navigationController = UINavigationController(rootViewController: mainViewController)
let sceneDelegate = UIApplication.shared.connectedScenes.first?.delegate as? SceneDelegate
guard let delegate = sceneDelegate else {
return
}
delegate.window?.rootViewController = navigationController
navigationController.pushViewController(GoalTimeSelectViewController(), animated: true)
}
}

}
.background(Color(.clear))
}
}

#Preview {
AppAddButtonView()
.environmentObject(BlockingApplicationModel.shared)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// SwiftUIView.swift
// HMH_iOS
//
// Created by 지희의 MAC on 1/10/24.
//

import SwiftUI
import FamilyControls

struct SwiftUIView: View {
@EnvironmentObject var model: BlockingApplicationModel

var body: some View {
FamilyActivityPicker(selection: $model.newSelection)

}
}

#Preview {
SwiftUIView()
}
Loading