Premium Features: - Journal notes and photo attachments for mood entries - Data export (CSV and PDF reports) - Privacy lock with Face ID/Touch ID - Apple Health integration for mood correlation - 4 new personality packs (Motivational Coach, Zen Master, Best Friend, Data Analyst) Settings Tab Reorganization: - Combined Customize and Settings into single tab with segmented control - Added upgrade banner with trial countdown above segment - "Why Upgrade?" sheet showing all premium benefits - Subscribe button opens improved StoreKit 2 subscription view UI Improvements: - Enhanced subscription store with feature highlights - Entry detail view for viewing/editing notes and photos - Removed duplicate subscription banners from tab content 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
55 lines
1.1 KiB
Swift
55 lines
1.1 KiB
Swift
//
|
|
// DataControllerUPDATE.swift
|
|
// Feels
|
|
//
|
|
// SwiftData UPDATE operations.
|
|
//
|
|
|
|
import SwiftData
|
|
import Foundation
|
|
|
|
extension DataController {
|
|
@discardableResult
|
|
func update(entryDate: Date, withMood mood: Mood) -> Bool {
|
|
guard let entry = getEntry(byDate: entryDate) else {
|
|
return false
|
|
}
|
|
|
|
entry.moodValue = mood.rawValue
|
|
saveAndRunDataListeners()
|
|
|
|
EventLogger.log(event: "update_entry")
|
|
return true
|
|
}
|
|
|
|
// MARK: - Notes
|
|
|
|
@discardableResult
|
|
func updateNotes(forDate date: Date, notes: String?) -> Bool {
|
|
guard let entry = getEntry(byDate: date) else {
|
|
return false
|
|
}
|
|
|
|
entry.notes = notes
|
|
saveAndRunDataListeners()
|
|
|
|
EventLogger.log(event: "update_notes")
|
|
return true
|
|
}
|
|
|
|
// MARK: - Photo
|
|
|
|
@discardableResult
|
|
func updatePhoto(forDate date: Date, photoID: UUID?) -> Bool {
|
|
guard let entry = getEntry(byDate: date) else {
|
|
return false
|
|
}
|
|
|
|
entry.photoID = photoID
|
|
saveAndRunDataListeners()
|
|
|
|
EventLogger.log(event: "update_photo")
|
|
return true
|
|
}
|
|
}
|