Habit app

import SwiftUI
import CloudKit

// MARK: – Habit Model
struct Habit: Identifiable {
var id: CKRecord.ID?
var title: String
var streak: Int
var isCompleted: Bool

init(record: CKRecord) {
self.id = record.recordID
self.title = record[“title”] as? String ?? “”
self.streak = record[“streak”] as? Int ?? 0
self.isCompleted = record[“isCompleted”] as? Bool ?? false }

func toCKRecord() -> CKRecord {
let record = CKRecord(recordType: “Habit”)
record[“title”] = title as CKRecordValue
record[“streak”] = streak as CKRecordValue
record[“isCompleted”] = isCompleted as CKRecordValue
return record
}
}

// MARK: – CloudKit Manager
class CloudKitManager: ObservableObject {
private var database = CKContainer.default().publicCloudDatabase @Published var habits: [Habit] = []

func fetchHabits() {
let query = CKQuery(recordType: “Habit”, predicate: NSPredicate(value: true))
database.perform(query, inZoneWith: nil) { [weak self] records, error in if let error = error {
print(“Error fetching habits: \(error.localizedDescription)”) return
}

DispatchQueue.main.async {
self?.habits = records?.compactMap { Habit(record: $0) } ?? [] }
}
}

func addHabit(title: String) {
let habit = Habit(id: nil, title: title, streak: 0, isCompleted: false) let record = habit.toCKRecord()

database.save(record) { [weak self] _, error in
if let error = error {
print(“Error saving habit: \(error.localizedDescription)”) } else {
self?.fetchHabits()
}
}
}

func updateHabit(_ habit: Habit) {
guard let recordID = habit.id else { return }

database.fetch(withRecordID: recordID) { [weak self] record, error in if let record = record, error == nil {
record[“streak”] = habit.streak as CKRecordValue record[“isCompleted”] = habit.isCompleted as CKRecordValue
self?.database.save(record) { _, error in
if let error = error {
print(“Error updating habit: \(error.localizedDescription)”) } else {
self?.fetchHabits()
}
}
}
}
}
}

// MARK: – Habit Row View
struct HabitRowView: View {
var habit: Habit
@ObservedObject var manager: CloudKitManager

var body: some View {
HStack {
Text(habit.title)
Spacer()
Text(“Streak: \(habit.streak)”)
Button(action: {
var updatedHabit = habit
if !updatedHabit.isCompleted {
updatedHabit.isCompleted = true
updatedHabit.streak += 1
}
manager.updateHabit(updatedHabit)
}) {
Image(systemName: habit.isCompleted ? “checkmark.circle.fill” : “circle”) }
}
}
}

// MARK: – Habit List View
struct HabitListView: View {
@ObservedObject var manager = CloudKitManager()
@State private var newHabitTitle = “”

var body: some View {
NavigationView {
VStack {
HStack {
TextField(“New Habit”, text: $newHabitTitle) .textFieldStyle(RoundedBorderTextFieldStyle()) Button(action: {
if !newHabitTitle.isEmpty {
manager.addHabit(title: newHabitTitle) newHabitTitle = “”
}
}) {
Text(“Add”)
}
}.padding()

List(manager.habits) { habit in
HabitRowView(habit: habit, manager: manager) }
}
.navigationTitle(“Micro-Habits”)
.onAppear {
manager.fetchHabits()
}
}
}
}

// MARK: – App Entry Point
@main
struct HabitAppApp: App {
var body: some Scene {
WindowGroup {
HabitListView()
}
}
}

Habit app

import SwiftUI import CloudKit

// MARK: – Habit Model struct Habit: Identifiable { var id: CKRecord.ID? var title: String var streak: Int var isCompleted: Bool init(record: CKRecord) { self.id = record.recordID self.title = record["title"] as? String ?? "" self.streak = record["streak"] as? Int ?? 0 self.isCompleted = record["isCompleted"] as? Bool ?? false } func toCKRecord() -> CKRecord { let record = CKRecord(recordType: "Habit") record["title"] = title as CKRecordValue record["streak"] = streak as CKRecordValue record["isCompleted"] = isCompleted as CKRecordValue return record } }

// MARK: – CloudKit Manager class CloudKitManager: ObservableObject { private var database = CKContainer.default().publicCloudDatabase @Published var habits: [Habit] = [] func fetchHabits() { let query = CKQuery(recordType: "Habit", predicate: NSPredicate(value: true)) database.perform(query, inZoneWith: nil) { [weak self] records, error in if let error = error { print("Error fetching habits: \(error.localizedDescription)") return } DispatchQueue.main.async { self?.habits = records?.compactMap { Habit(record: $0) } ?? [] } } } func addHabit(title: String) { let habit = Habit(id: nil, title: title, streak: 0, isCompleted: false) let record = habit.toCKRecord() database.save(record) { [weak self] _, error in if let error = error { print("Error saving habit: \(error.localizedDescription)") } else { self?.fetchHabits() } } } func updateHabit(_ habit: Habit) { guard let recordID = habit.id else { return } database.fetch(withRecordID: recordID) { [weak self] record, error in if let record = record, error == nil { record["streak"] = habit.streak as CKRecordValue record["isCompleted"] = habit.isCompleted as CKRecordValue self?.database.save(record) { _, error in if let error = error { print("Error updating habit: \(error.localizedDescription)") } else { self?.fetchHabits() } } } } } }

// MARK: – Habit Row View struct HabitRowView: View { var habit: Habit @ObservedObject var manager: CloudKitManager var body: some View { HStack { Text(habit.title) Spacer() Text("Streak: \(habit.streak)") Button(action: { var updatedHabit = habit if !updatedHabit.isCompleted { updatedHabit.isCompleted = true updatedHabit.streak += 1 } manager.updateHabit(updatedHabit) }) { Image(systemName: habit.isCompleted ? "checkmark.circle.fill" : "circle") } } } }

// MARK: – Habit List View struct HabitListView: View { @ObservedObject var manager = CloudKitManager() @State private var newHabitTitle = "" var body: some View { NavigationView { VStack { HStack { TextField("New Habit", text: $newHabitTitle) .textFieldStyle(RoundedBorderTextFieldStyle()) Button(action: { if !newHabitTitle.isEmpty { manager.addHabit(title: newHabitTitle) newHabitTitle = "" } }) { Text("Add") } }.padding() List(manager.habits) { habit in HabitRowView(habit: habit, manager: manager) } } .navigationTitle("Micro-Habits") .onAppear { manager.fetchHabits() } } } }

// MARK: – App Entry Point @main struct HabitAppApp: App { var body: some Scene { WindowGroup { HabitListView() } } }

Appointment needed

Next week works for me.

On Wed, Oct 23, 2024 at 11:09 AM Andrew L. Linhardt <Andrew.Linhardt> wrote:

I’m actually going to be gone all of November.

So we can do this week or next.

Andrew Linhardt

Social Worker

Department of Integrated Services for Individuals with Disabilities (DISID)

138 East Marine Corps Drive

Jones & Guerrero Commercial Plaza, Suite C101

Hagatna, Guam 96910

(671) 475-4624

APP making sites

There are several app-making platforms that are affordable or even free, ideal for creating apps quickly without heavy coding. Here are some popular ones:

1. Adalo

A no-code platform where you can design and launch apps. It’s user-friendly and offers a free plan with basic features, with paid plans starting at $45/month for more advanced options.

2. Thunkable

Allows you to build apps using drag-and-drop components, making it beginner-friendly. They offer a free tier, though advanced features require a paid plan starting at $13/month.

3. Glide

Turns Google Sheets into mobile apps. It’s excellent for creating simple apps with a free version available. Pro versions with more features start at $25/month.

4. Appy Pie

Known for affordability, it provides easy app creation for both iOS and Android. They offer a free plan with basic features, and paid plans start at $16/month.

5. Kodular

A free, open-source app development platform based on a visual block coding system, making it suitable for beginners.

6. MIT App Inventor

A free, educational platform that allows you to build Android apps using a visual, drag-and-drop interface. It’s great for creating functional apps without cost.

7. Bubble

A no-code platform focused on web apps, but can also be adapted for mobile use. Free tier is available, with paid plans starting at $25/month.

Each of these services provides different levels of complexity, so the best one will depend on the specific features and functionalities you need for your app.

Mahalo

SIGNATURE:
Clifford "RAY" Hackett www.rayis.me RESUME: www.rayis.me/resume

I founded www.adapt.org in 1980 it now has over 50 million members.
$500 of material=World’s fastest hydrofoil sailboat. http://sunrun.biz

Marriage fraud complaint

USCIS Guam Field Office

770 East Sunset Boulevard

Tiyan, Barrigada, GU 96913

Subject: Urgent Complaint Regarding Inaction on Marriage Fraud Case

To Whom It May Concern,

I am writing to formally express my deep concern and frustration regarding the lack of action on a marriage fraud case that I have repeatedly reported to your office. Despite providing detailed information and documentation on multiple occasions, there appears to have been no significant progress or investigation initiated by your office.

[Clifford Ray Hackett general delivery BARRIGADA GUAM 96913 email crh2123 phone 671-787-2345

1. USCIS Contact Center:

You can reach out to USCIS via the online e-Request tool or by calling the USCIS Contact Center at 1-800-375-5283. This can help track case inquiries or complaints.

2. Report Marriage Fraud:

Marriage fraud can be reported through the USCIS Tip Form online at uscis.gov/report-fraud. You can submit detailed information here about suspected marriage fraud.

3. Online Inquiry:

If you have an existing case, you can inquire about it through the USCIS Case Status Online tool at uscis.gov, or submit a service request through the same portal if you feel there’s been inaction.

4. Office of the Inspector General (OIG):

If you believe there’s been misconduct or neglect in handling the case, you may consider filing a complaint with the Department of Homeland Security Office of Inspector General at oig.dhs.gov.

These are the primary methods for submitting complaints or reporting issues with USCIS. Unfortunately, there is no direct email submission for marriage fraud cases.

Mahalo

SIGNATURE:
Clifford "RAY" Hackett www.rayis.me RESUME: www.rayis.me/resume

I founded www.adapt.org in 1980 it now has over 50 million members.
$500 of material=World’s fastest hydrofoil sailboat. http://sunrun.biz

USCIS Guam Field Office 770 East Sunset Boulevard Tiyan, Barrigada, GU 96913 I

USCIS Guam Field Office 770 East Sunset Boulevard Tiyan, Barrigada, GU 96913 I

Mahalo

SIGNATURE:
Clifford "RAY" Hackett www.rayis.me RESUME: www.rayis.me/resume

I founded www.adapt.org in 1980 it now has over 50 million members.
$500 of material=World’s fastest hydrofoil sailboat. http://sunrun.biz