Skip to content

Commit

Permalink
Tipsを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
KaitoMuraoka committed Jul 8, 2024
1 parent faf6c18 commit 74d788c
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions PasswordBox.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
3F99FC592C39258B001ED4B2 /* Entry.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3F99FC582C39258B001ED4B2 /* Entry.swift */; };
3FC77A5F2C313B5900B56E75 /* SettingIconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FC77A5E2C313B5900B56E75 /* SettingIconView.swift */; };
3FC77A612C313C4500B56E75 /* IconView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FC77A602C313C4500B56E75 /* IconView.swift */; };
3FEE0F162C3C2EDE0057EE2F /* AppTips.swift in Sources */ = {isa = PBXBuildFile; fileRef = 3FEE0F152C3C2EDE0057EE2F /* AppTips.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -88,6 +89,7 @@
3F99FC582C39258B001ED4B2 /* Entry.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Entry.swift; sourceTree = "<group>"; };
3FC77A5E2C313B5900B56E75 /* SettingIconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingIconView.swift; sourceTree = "<group>"; };
3FC77A602C313C4500B56E75 /* IconView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IconView.swift; sourceTree = "<group>"; };
3FEE0F152C3C2EDE0057EE2F /* AppTips.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppTips.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -287,6 +289,7 @@
3F99FC4E2C390873001ED4B2 /* Images.swift */,
3F99FC502C390D65001ED4B2 /* IconStyles.swift */,
3F026F432C3A789500ED696C /* URLs.swift */,
3FEE0F152C3C2EDE0057EE2F /* AppTips.swift */,
);
path = Resources;
sourceTree = "<group>";
Expand Down Expand Up @@ -435,6 +438,7 @@
3F026F272C399A4100ED696C /* PasswordKeychain.swift in Sources */,
3F13F9C62C1DECF30068908E /* InfomationViewModel.swift in Sources */,
3F13F9CB2C1DEE020068908E /* PasswordFormView.swift in Sources */,
3FEE0F162C3C2EDE0057EE2F /* AppTips.swift in Sources */,
3F026F442C3A789500ED696C /* URLs.swift in Sources */,
3F99FC512C390D65001ED4B2 /* IconStyles.swift in Sources */,
3F8C85C72C189F230032277E /* CellView.swift in Sources */,
Expand Down
13 changes: 13 additions & 0 deletions PasswordBox/Resources/AppTips.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import TipKit

struct AppTips {
struct ChangeIcon: Tip {
var title: Text {
Text("アイコンとタイトルを変更")
}
var message: Text? {
Text("アイコンとタイトルはこちらから編集することができます。")
}
}

}
8 changes: 8 additions & 0 deletions PasswordBox/UI/Common/PasswordFormView.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import SwiftUI
import TipKit

struct PasswordFormView: View {
@Binding var title: String
Expand Down Expand Up @@ -30,6 +31,7 @@ struct PasswordFormView: View {
.sheet(isPresented: $isShowingIconView, content: {
SettingIconView(title: $title, iconString: $iconString)
})
.popoverTip(AppTips.ChangeIcon())
}
.padding(.bottom, 20)

Expand Down Expand Up @@ -74,5 +76,11 @@ struct PasswordFormView: View {
.padding(.horizontal, 20)
}
}
.task {
try? Tips.configure([
.displayFrequency(.immediate),
.datastoreLocation(.applicationDefault),
])
}
}
}

0 comments on commit 74d788c

Please sign in to comment.