Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
タスクアプリ(モチベーション維持)
Search
Ken Ishioka
October 15, 2022
Business
75
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
タスクアプリ(モチベーション維持)
Ken Ishioka
October 15, 2022
More Decks by Ken Ishioka
See All by Ken Ishioka
タスクアプリ_モチベーション維持_紹介スライド.pdf
ken20215
0
180
Other Decks in Business
See All in Business
AIと働く実践 Agentがあなたの生産性を上げてくれない理由
ozakiomumkj
1
170
2026.10_中途採用資料.pdf
superstudio
PRO
5
120k
会社説明資料
xinghr
0
3.7k
クリヤマホールディングス㈱採用資料
uemura2024
0
9.3k
丸石グループ会社紹介
maruishi
0
300
採用デック
roms
0
200
営業が見てきた"AI導入ガバナンス"のリアル — あなたの会社は今どのステージ?
kuraryu0128
0
190
株式会社スピークバディ 会社紹介資料
speakbuddy
1
230k
Crisp Code inc.|わたしたちの事例 / 実績 - Works
so_kotani
0
2.4k
SmartHRの全社AI推進は、どう始まったか
yoshikikonishi_
3
3.1k
会社案内資料
auditech2022
0
350
コーポレートストーリー(新規投資家様向け会社説明資料)
gatechnologies
2
21k
Featured
See All Featured
Docker and Python
trallard
47
4.2k
What the history of the web can teach us about the future of AI
inesmontani
PRO
2
740
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
The Cult of Friendly URLs
andyhume
79
7k
Between Models and Reality
mayunak
4
500
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
18k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
630
How STYLIGHT went responsive
nonsquared
100
6.3k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
330
How to train your dragon (web standard)
notwaldorf
96
6.9k
Transcript
λεΫΞϓϦʢϞνϕʔγϣϯҡ࣋ʣ
͜ͷΞϓϦͰ࣮ݱͰ͖Δ͜ͱʂ •Βͳ͚ΕͳΒͳ͍λεΫΛݟ͑ΔԽͰ͖Δ ɹ→Βͳ͚ΕͳΒͳ͍λεΫΛཧ͠ɺ಄ͷதΛΫϦΞʹͤ͞৺ʹ༨༟Λ࣋ͨͤΔɻ •̍ݸͮͭλεΫΛ͜ͳ͢͜ͱʹΑͬͯɺલʹਐΉײ֮ΛಘΒΕΔɻ ɹˠલʹਐΜͰ͍Δײ֮ΛಘͯϞνϕʔγϣϯΛ্ͤ͞Δɻ
ΞϓϦʹඞཁͳػೳͱͯ͠ CoreDataΛ׆༻ʂ ೖྗจࣈͳͲΛσʔλอଘ͢ΔػೳΛ࣮ʂ
• ʑͷλεΫҎ֎ʹເඪͳͲొ͢Δ͜ͱ͕Ͱ͖·͢ʂ • λεΫొ̐ͭͷ༏ઌΧςΰϦʔ͔ΒબͿࣄ͕Ͱ͖·͢ɻ • Γ͍ͨࣄʹ͚ͯ̍าͮͭલਐ͢Δײ֮ΛຯΘ͍Ϟνϕʔ γϣϯΛߴΊ·͢ɻ
֤ΧςΰϦʔʹొ͢Δࢀߟͷ༰ ۓٸ͔ͭॏཁ •ظݶͷ͋Δࣄձٞ •ΫϨʔϜॲཧ •յΕͨػثπʔϧͷमཧ •ࠩ͠ഭͬͨ ۓٸ͔ͭॏཁͰͳ͍ •༧ •ษڧ͍ͨ͜͠ͱʹ͚͍ͭͨεΩϧ •దͳӡಈ
•কདྷͷܭը ۓٸͰͳ͍͕ɺॏཁ •ॏཁͰͳ͍ϝʔϧɺSNSɺి •ॏཁͰͳ͍ձٞ •ಥવͷདྷ๚ •ແҙຯͳ͖߹͍ ۓٸͰͳ͍͕ɺॏཁͰͳ͍ •μϥμϥͱͨ͠ి •ͪ࣌ؒʹ͢ΔՋͭͿ͠ •ݱ࣮ಀආ
͜ͷΞϓϦͷλʔήοτ 20͔Β60ͷஉঁΛλʔήοτʹ͠·ͨ͠ʂ एஉঁ෯͍ͷํʹ͝ར༻͍͖͍ͨͩͨͰ͢ɻ
• ༏ઌॱҐΛܾΊΔϘλϯΛ̐ͭHomeViewʹஔͯ͠·͢ɻ • ͍ͣΕ͔ͷϘλϯΛλοϓͨ͠Βɺͦͷ༏ઌͷΧςΰϦʔʹͷΈλεΫΛొ͢ΔΑ͏ʹઃܭ͠·ͨ͠ɻ
ίʔυͰ༏ઌຖʹλεΫొΛߦ͏ɻ ᶃ֤༏ઌΛܾΊΔButtonΛهड़͠ɺλοϓͨ͠Β༏ઌΛཧ͢Δঢ়ଶมtapPriorityʹ ɹ༏ઌͷ໊শΛཧͨ͠ྻڍܕͷΛೖ͢Δɻ ᶄϘλϯΛλοϓͨ͠Βͦͷ··λεΫొը໘sheetϞσΟϑΝΠΞͰը໘ભҠ͠·͢ɻ ᶅҾʹ༏ઌΛཧ͢Δঢ়ଶมtapPriorityΛ͠·͢ɻ ίʔυͷྲྀΕɹͦͷ1
struct HomeView: View { @Environment(\.managedObjectContext) private var viewContext @Environment(\.dismiss) private
var dismiss @Environment(\.presentationMode) private var presentationMode @State private var isShowTap: Bool = false // PriorityModelViewͷྻڍܕͷΛΠϯελϯεมʹॳظԽͯ͋͛͠Δɻ @State private var tapPriority: PriorityEnum = .emergencyHighAndImportantHigh var body: some View { ZStack { VStack { HStack { Text("ୡͤ͞ΔλεΫΛೖྗ͠Α͏ʂ") .font(.system(size: 20, weight: .bold, design: .default)) .foregroundColor(Color.orange) .padding(.horizontal) .padding(.top) } .frame(width: 450, height: 90) .background(Color.black) Spacer() VStack { Text("ٸ͍ͰΒͳ͍ͱ͍͚ͳ͍ࣄ\n͍͔ͭୡ͍ͤͨ͞ເඪ\n͋ͳͨͷୡ͍ͨ͠ࣄΛొ͠·͠ΐ͏ɻ") .font(.callout) .frame(width: 400, height: 150) .padding(35) HStack { Button(action: { // ༏ઌΛܾΊΔϘλϯΛλοϓͨ͠Βɺࢦఆͷ༏ઌॱҐͷจࣈ͕ೖ͍ͬͯྻڍܕͷʮemergencyHighAndImportantHighʯΛೖ͢Δɻ tapPriority = .emergencyHighAndImportantHigh isShowTap.toggle() }) { // ۓٸ͔ͭॏཁ // PriorityViewModelͰఆٛͨ֨͠ೲܕมΛΠϯελϯε͠ݺͼग़͢ɻ Text(PriorityEnum.emergencyHighAndImportantHigh.displayString) .frame(width: 140, height: 140) .foregroundColor(Color.white) .background(Color("Task1Color")) .sheet(isPresented: $isShowTap) { RegistrationView(selectedPriority: $tapPriority) } } // ʮۓٸ͔ͭॏཁʯButton͜͜·Ͱ Button(action: { // ༏ઌΛܾΊΔϘλϯΛλοϓͨ͠Βɺࢦఆͷ༏ઌॱҐͷจࣈ͕ೖ͍ͬͯྻڍܕͷʮ.emergencyHighAndImportantLowʯΛೖ͢Δɻ tapPriority = .emergencyHighAndImportantLow isShowTap.toggle() }) { // ۓٸ͕ͩॏཁͰͳ͍ // PriorityViewModelͰఆٛͨ֨͠ೲܕมΛΠϯελϯε͠ݺͼग़͢ɻ Text(PriorityEnum.emergencyHighAndImportantLow.displayString) .frame(width: 140, height: 140) .foregroundColor(Color.black) .background(Color("Task4Color")) .sheet(isPresented: $isShowTap) { RegistrationView(selectedPriority: $tapPriority) } } // ʮۓٸ͕ͩॏཁͰͳ͍ʯButton͜͜·Ͱ } // Hstack͜͜·Ͱ HStack { Button(action: { // ༏ઌΛܾΊΔϘλϯΛλοϓͨ͠Βɺࢦఆͷ༏ઌॱҐͷจࣈ͕ೖ͍ͬͯྻڍܕͷʮ.emergencyLowAndImportantHighʯΛೖ͢Δɻ tapPriority = .emergencyLowAndImportantHigh isShowTap.toggle() }) { // ۓٸͰͳ͍͕ॏཁ // PriorityViewModelͰఆٛͨ֨͠ೲܕมΛΠϯελϯε͠ݺͼग़͢ɻ Text(PriorityEnum.emergencyLowAndImportantHigh.displayString) .frame(width: 140, height: 140) .foregroundColor(Color.black) .background(Color.green) .sheet(isPresented: $isShowTap) { RegistrationView(selectedPriority: $tapPriority) } } // ʮۓٸͰͳ͍͕ॏཁʯButton͜͜·Ͱ Button(action: { // ༏ઌΛܾΊΔϘλϯΛλοϓͨ͠Βɺࢦఆͷ༏ઌॱҐͷจࣈ͕ೖ͍ͬͯྻڍܕͷʮ.emergencyLowAndImportantLowʯΛೖ͢Δɻ tapPriority = .emergencyLowAndImportantLow isShowTap.toggle() }) { //ɹۓٸͰͳ͘ॏཁͰͳ͍ // PriorityViewModelͰఆٛͨ֨͠ೲܕมΛΠϯελϯε͠ݺͼग़͢ɻ Text(PriorityEnum.emergencyLowAndImportantLow.displayString) .frame(width: 140, height: 140) .foregroundColor(Color.black) .background(Color("Task2Color")) .sheet(isPresented: $isShowTap) { RegistrationView(selectedPriority: $tapPriority) } } // ʮۓٸͰͳ͘ॏཁͰͳ͍ʯButton͜͜·Ͱ } // Hstack͜͜·Ͱ Spacer() } // Vstack͜͜·Ͱ Spacer() } // Vstack͜͜·Ͱ .navigationBarTitle("Task") } } ༏ઌΛཧ͢Δঢ়ଶม ֤༏ઌͷϘλϯΛஔͯ͠·͢ɻ λοϓͨ͠Βঢ়ଶมtapPriorityʹ༏ઌͷΛೖ ӈʹهࡌ͍ͯ͠ΔͷHomeViewͷίʔυͰ͢ɻ HomeViewͷίʔυհ
ίʔυͷྲྀΕɹͦͷ2 ొը໘RegistrationViewʹભҠɻొը໘Ͱ༏ઌͷ࠶ઃఆ͕ՄೳͰ͢ɻ ᶃ.onAppearͰafterPriorityʹHomeView͔Βडऔͬͨ༏ઌͷselectedPriorityΛ ɹೖ͠·͢ɻ ᶄ໊݅ɺλεΫ༰ɺظɺ༏ઌΛઃఆ͢Δɻ ɹ˞༏ઌͷ࠶ઃఆPickerΛར༻͠ɺҾselectionʹafterPriorityΛηοτͯ͠·͢ɻ ᶅӈԼʹ͋Δ੨ͷϓϥεؙϘλϯΛλοϓͨ͠ΒCoreDataʹΛొ͠·͢ɻ
ϙΠϯτMVVMͰ࣮ͯ͠·͢ import SwiftUI import CoreData class RegistrationViewModel: ObservableObject { let
viewContext = PersistenceController.shared.container.viewContext @Published var subject = "" @Published var content = "" @Published var date = Date() @Published var priority = "" func memoInputText(dismiss: DismissAction) { // อଘ͢ΔCoreDataͷMemoܕΠϯελϯεมΛ࡞ɾॳظԽ͢Δɻ // CoreDataʹ֨ೲ͢ΔλΠϛϯάɺશͯͷCoreDataʹొ͢Δ͕ἧͬͨλΠ ϛϯάͰొΛߦ͏ɻ // ଞͷϑΝΠϧͳͲผʑʹొΛߦΘͳ͍͜ͱɻ let inputItem = Memo(context: viewContext) inputItem.subject = subject inputItem.content = content inputItem.date = date inputItem.priority = priority // ʮtry? viewContext.save()ʯͰσʔλΛอଘ͢Δɻ try? viewContext.save() // ը໘Λด͡Δ dismiss() } } ໊݅ɺλεΫ༰ɺظɺ༏ઌͷ࠶ઃఆΛViewModelͰߦ͍·͢ɻ RegistrationViewͰˏPublishedΛ༩ͨ͠มΛݺͼग़͠ɺCoreDataʹొ͠·͢ɻ RegistrationViewModel
ίʔυͷྲྀΕɹͦͷ3 ᶃCoreDataʹొͨ͠λεΫΛ༏ઌຖʹදࣔͤ͞·͢ɻ ᶄSavedViewͷը໘্෦ʹηοτ͍ͯ͠ΔϘλϯΛλοϓ͢Δͱɺ͜͜ͰListදࣔΛཧ͢Δঢ়ଶมpriorityCategoryʹ༏ઌͷΛೖ͠·͢ɻ ᶅListදࣔΛ୲͢ΔTaskListViewʹΛ͢ࡍʹɺCoreDataʹొͨ͠༏ઌͷpriorityͱpriorityCategoryΛൺֱͤ͞ɺ දࣔͤ͞Δ༏ઌΛબ͢Δɻ struct SavedView: View { @Environment(\.managedObjectContext)
private var viewContext @Environment(\.dismiss) private var dismiss @StateObject private var saveItems = SavedViewModel() // PriorityModelViewͰఆٛͨ͠ྻڍΛrawValueΛ༻͠ɺStringܕͰදࣔͰ͖ΔΑ͏ʹࢦࣔ͢Δɻ @State private var prioritys: [String] = [ PriorityEnum.emergencyHighAndImportantHigh.rawValue, PriorityEnum.emergencyHighAndImportantLow.rawValue, PriorityEnum.emergencyLowAndImportantLow.rawValue, PriorityEnum.emergencyLowAndImportantHigh.rawValue ] @State private var priorityCategory = PriorityEnum.emergencyHighAndImportantHigh.rawValue @State private var index: Int = 0 @State private var showEdit: Bool = false var body: some View { Group { VStack { if showEdit == false { VStack { // show͕trueͰ͋ΕTextʢTasksʣΛදࣔͤ͞Δɻ HStack { Text("λεΫҰཡ") // จࣈαΠζΛมߋ .font(.system(size: 45, weight: .bold, design: .default)) .foregroundColor(Color.orange) Spacer() } // ScrollView͜͜·Ͱ } // Vstack͜͜·Ͱ .edgesIgnoringSafeArea(.top) .edgesIgnoringSafeArea(.horizontal) .padding(.top) .padding(.horizontal) .background(Color.black) } Spacer() // ฤूը໘͕දࣔ͞ΕΔࡍʹɺ্ͷTextʮTasksʯͱ༏ઌΛܾΊΔϘλϯͷදࣔΛແ͍ͨ͘͠ɻ TaskListView(items: FetchRequest(sortDescriptors: [NSSortDescriptor(keyPath: \Memo.date, ascending: true)], predicate: NSPredicate(format: "priority == %@", priorityCategory), animation: .default), showEdit: $showEdit) Spacer() } // VStack͜͜·Ͱ } // Groop͜͜·Ͱ } // var body͜͜·Ͱ } // SaveView͜͜·Ͱ SavedView
• SavedViewͰొͨ͠λεΫΛListදࣔ͠·͢ɻ • ֤༏ઌॱҐͷϘλϯΛλοϓͨ͠Βɺͦͷ༏ઌͰొͨ͠λεΫͷΈදࣔ͢ΔΑ͏ʹͯ͠·͢ɻ