Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
5190376
no more create button, just move on
Daggerpov Sep 19, 2025
562556f
Merge branch 'main' into various-bug-fixes
Daggerpov Sep 19, 2025
af6b220
Update project.pbxproj
Daggerpov Sep 20, 2025
7989841
Merge branch 'main' into various-bug-fixes
Daggerpov Sep 20, 2025
1db5b67
1.3 + removed file title comments
Daggerpov Sep 20, 2025
e535d54
fix long activity types
Daggerpov Sep 20, 2025
d503476
onboarding skip for existing users completed onboarding
Daggerpov Sep 20, 2025
d44c572
fallback nav tab bars for ios < 17
Daggerpov Sep 20, 2025
7bd7359
nav bar done for iOS < 17
Daggerpov Sep 21, 2025
dc8f0d4
mapview for ios < 17
Daggerpov Sep 22, 2025
dad95df
don't show "distance unavailable"
Daggerpov Sep 22, 2025
bfe919b
onboarding completion api call to avoid repetition on new devices
Daggerpov Sep 22, 2025
02ead9b
refresh activities periodically and always upon opening app
Daggerpov Sep 22, 2025
3474aba
amend to activity refresh
Daggerpov Sep 22, 2025
8ac7962
amend to activity distance availability UI
Daggerpov Sep 22, 2025
7e443d1
nav bar conditional padding
Daggerpov Sep 22, 2025
73900a8
nav bar & bot padding
Daggerpov Sep 22, 2025
13bb6cb
fix activity type unpin issue
Daggerpov Sep 22, 2025
7433830
credit
Daggerpov Sep 22, 2025
42c45a6
unified map view
Daggerpov Sep 22, 2025
55ab603
deployment target: ios 16 + map view consolidated
Daggerpov Sep 22, 2025
dc7d453
refactoring map view further into sub-components
Daggerpov Sep 24, 2025
ea113fb
Revert "refactoring map view further into sub-components"
Daggerpov Sep 24, 2025
713da36
min ios 17.0
Daggerpov Sep 24, 2025
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
32 changes: 17 additions & 15 deletions Spawn-App-iOS-SwiftUI.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
attributes = {
BuildIndependentTargetsInParallel = 1;
LastSwiftUpdateCheck = 1610;
LastUpgradeCheck = 1610;
LastUpgradeCheck = 2600;
TargetAttributes = {
65D503582CD86EB300923A01 = {
CreatedOnToolsVersion = 16.1;
Expand Down Expand Up @@ -409,13 +409,14 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
MTL_FAST_MATH = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_ACTIVE_COMPILATION_CONDITIONS = "DEBUG $(inherited)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -470,12 +471,13 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LOCALIZATION_PREFERS_STRING_CATALOGS = YES;
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
MTL_ENABLE_DEBUG_INFO = NO;
MTL_FAST_MATH = YES;
SDKROOT = iphoneos;
STRING_CATALOG_GENERATE_SYMBOLS = YES;
SWIFT_COMPILATION_MODE = wholemodule;
VALIDATE_PRODUCT = YES;
VERSIONING_SYSTEM = "apple-generic";
Expand Down Expand Up @@ -503,12 +505,12 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUI";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down Expand Up @@ -539,12 +541,12 @@
INFOPLIST_KEY_UILaunchScreen_Generation = YES;
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPad = "UIInterfaceOrientationPortrait UIInterfaceOrientationPortraitUpsideDown UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
INFOPLIST_KEY_UISupportedInterfaceOrientations_iPhone = "UIInterfaceOrientationPortrait UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight";
IPHONEOS_DEPLOYMENT_TARGET = 16.2;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.2;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUI";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -561,8 +563,8 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
MARKETING_VERSION = 1.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand All @@ -579,8 +581,8 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 18.1;
MARKETING_VERSION = 1.1;
IPHONEOS_DEPLOYMENT_TARGET = 17.0;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand All @@ -596,7 +598,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUIUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand All @@ -612,7 +614,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
GENERATE_INFOPLIST_FILE = YES;
MARKETING_VERSION = 1.1;
MARKETING_VERSION = 1.3;
PRODUCT_BUNDLE_IDENTIFIER = "danielagapov.Spawn-App-iOS-SwiftUIUITests";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_EMIT_LOC_STRINGS = NO;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,7 @@ extension Notification.Name {
// Friend system notifications
static let friendRequestsDidChange = Notification.Name("friendRequestsDidChange")
static let friendsDidChange = Notification.Name("friendsDidChange")

// Activity refresh notifications
static let shouldRefreshActivities = Notification.Name("shouldRefreshActivities")
}
14 changes: 14 additions & 0 deletions Spawn-App-iOS-SwiftUI/Extensions/View+PlaceholderExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,18 @@ extension View {
self
}
}

/// Conditionally applies a modifier to a view
/// - Parameters:
/// - condition: Boolean condition to check
/// - transform: Transformation to apply if condition is true
/// - Returns: Modified view if condition is true, otherwise original view
@ViewBuilder
func `if`<Content: View>(_ condition: Bool, transform: (Self) -> Content) -> some View {
if condition {
transform(self)
} else {
self
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ActivityCreationResponseDTO.swift
// Spawn-App-iOS-SwiftUI
//
// Created by AI Assistant on 2025-01-03.
// Created By Daniel Agapov on 2025-01-03.
//

import Foundation
Expand Down
17 changes: 12 additions & 5 deletions Spawn-App-iOS-SwiftUI/Models/DTOs/User/BaseUserDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,24 @@ struct BaseUserDTO: Identifiable, Codable, Hashable, Nameable {
var name: String?
var bio: String?
var email: String?
var hasCompletedOnboarding: Bool?

init(
id: UUID,
username: String? = nil,
profilePicture: String? = nil,
name: String? = nil,
bio: String? = nil,
email: String? = nil
email: String? = nil,
hasCompletedOnboarding: Bool? = nil
) {
self.id = id
self.username = username
self.profilePicture = profilePicture
self.name = name
self.bio = bio
self.email = email
self.hasCompletedOnboarding = hasCompletedOnboarding
}
}

Expand All @@ -52,7 +55,8 @@ extension BaseUserDTO {
profilePicture: friendUser.profilePicture,
name: friendUser.name,
bio: friendUser.bio,
email: friendUser.email
email: friendUser.email,
hasCompletedOnboarding: true // Assume existing friends have completed onboarding
)
}

Expand All @@ -64,7 +68,8 @@ extension BaseUserDTO {
profilePicture: "Daniel_Agapov_pfp",
name: "Daniel Agapov",
bio: "This is my bio.",
email: "daniel@agapov.com"
email: "daniel@agapov.com",
hasCompletedOnboarding: true
)
}()

Expand All @@ -76,7 +81,8 @@ extension BaseUserDTO {
profilePicture: "Daniel_Lee_pfp",
name: "Daniel Lee",
bio: "This is my bio.",
email: "daniel2456@gmail.com"
email: "daniel2456@gmail.com",
hasCompletedOnboarding: true
)
}()

Expand All @@ -86,7 +92,8 @@ extension BaseUserDTO {
profilePicture: "Haley_pfp",
name: "Haley",
bio: "This is my bio.",
email: "haley@gmail.com"
email: "haley@gmail.com",
hasCompletedOnboarding: true
)

static let mockUsers: [BaseUserDTO] = {
Expand Down
14 changes: 10 additions & 4 deletions Spawn-App-iOS-SwiftUI/Models/DTOs/User/UserDTO.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ struct UserDTO: Identifiable, Codable, Hashable, Nameable {
var name: String?
var bio: String?
var email: String
var hasCompletedOnboarding: Bool?

init(
id: UUID,
Expand All @@ -27,7 +28,8 @@ struct UserDTO: Identifiable, Codable, Hashable, Nameable {
profilePicture: String? = nil,
name: String? = nil,
bio: String? = nil,
email: String
email: String,
hasCompletedOnboarding: Bool? = nil
) {
self.id = id
self.friendUserIds = friendUserIds
Expand All @@ -36,6 +38,7 @@ struct UserDTO: Identifiable, Codable, Hashable, Nameable {
self.name = name
self.bio = bio
self.email = email
self.hasCompletedOnboarding = hasCompletedOnboarding
}
}

Expand All @@ -50,7 +53,8 @@ extension UserDTO {
profilePicture: "Daniel_Agapov_pfp",
name: "Daniel Agapov",
bio: "This is my bio.",
email: "daniel@agapov.com"
email: "daniel@agapov.com",
hasCompletedOnboarding: true
)
}()

Expand All @@ -63,7 +67,8 @@ extension UserDTO {
profilePicture: "Daniel_Lee_pfp",
name: "Daniel Lee",
bio: "This is my bio.",
email: "daniel2456@gmail.com"
email: "daniel2456@gmail.com",
hasCompletedOnboarding: true
)
}()

Expand All @@ -74,7 +79,8 @@ extension UserDTO {
profilePicture: "Haley_pfp",
name: "Haley",
bio: "This is my bio.",
email: "haley@gmail.com"
email: "haley@gmail.com",
hasCompletedOnboarding: true
)

static let mockUsers: [UserDTO] = {
Expand Down
8 changes: 8 additions & 0 deletions Spawn-App-iOS-SwiftUI/Services/ActivityColorService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,14 @@ class ActivityColorService: ObservableObject {

/// Get color for an activity, assigning a new one if needed
func getColorForActivity(_ activityId: UUID) -> Color {
print("🔍 DEBUG: getColorForActivity called for ID: \(activityId)")
// Return cached color if available
if let existingColor = activityColors[activityId] {
print("🔍 DEBUG: Found cached color for activity: \(activityId)")
return existingColor
}

print("🔍 DEBUG: Assigning new color for activity: \(activityId)")
// Assign new color with even distribution
let newColor = assignNextColor()
activityColors[activityId] = newColor
Expand All @@ -59,6 +62,7 @@ class ActivityColorService: ObservableObject {
// Save to cache
saveToCache()

print("🔍 DEBUG: Assigned color for activity \(activityId): \(newColor)")
return newColor
}

Expand Down Expand Up @@ -110,6 +114,7 @@ class ActivityColorService: ObservableObject {

/// Assign the next color using round-robin distribution
private func assignNextColor() -> Color {
print("🔍 DEBUG: assignNextColor called, nextColorIndex: \(nextColorIndex), availableColors.count: \(availableColors.count)")
// Ensure nextColorIndex is within bounds before accessing array
guard !availableColors.isEmpty else {
print("⚠️ ActivityColorService: No available colors, using default")
Expand All @@ -122,8 +127,11 @@ class ActivityColorService: ObservableObject {
nextColorIndex = 0
}

print("🔍 DEBUG: Accessing availableColors[\(nextColorIndex)]")
let color = availableColors[nextColorIndex]
print("🔍 DEBUG: Got color: \(color)")
nextColorIndex = (nextColorIndex + 1) % availableColors.count
print("🔍 DEBUG: Updated nextColorIndex to: \(nextColorIndex)")
return color
}

Expand Down
2 changes: 1 addition & 1 deletion Spawn-App-iOS-SwiftUI/Services/ContactsService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ContactsService.swift
// Spawn-App-iOS-SwiftUI
//
// Created by AI Assistant on 2025-01-30.
// Created By Daniel Agapov on 2025-01-30.
//

import Contacts
Expand Down
19 changes: 19 additions & 0 deletions Spawn-App-iOS-SwiftUI/Services/CustomAppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ class CustomAppDelegate: NSObject, UIApplicationDelegate, ObservableObject, Mess
}
}

// Handle when app will enter foreground
func applicationWillEnterForeground(_ application: UIApplication) {
print("🔄 CustomAppDelegate: App will enter foreground - refreshing activities")
Task {
await AppCache.shared.refreshActivities()
// Notify all listeners to refresh activities
NotificationCenter.default.post(name: .shouldRefreshActivities, object: nil)
}
}

// Handle when app becomes active
func applicationDidBecomeActive(_ application: UIApplication) {
print("🔄 CustomAppDelegate: App became active")
// Additional refresh if needed
Task {
AppCache.shared.cleanupExpiredActivities()
}
}

func messaging(_ messaging: Messaging, didReceiveRegistrationToken fcmToken: String?) {
if let deviceToken = fcmToken {
print("✅ FCM registration token: \(deviceToken)")
Expand Down
4 changes: 2 additions & 2 deletions Spawn-App-iOS-SwiftUI/Services/ProfilePictureCache.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// ProfilePictureCache.swift
// Spawn-App-iOS-SwiftUI
//
// Created by AI Assistant on 2025-01-03.
// Created By Daniel Agapov on 2025-01-03.
//

import Foundation
Expand Down Expand Up @@ -406,4 +406,4 @@ private struct CacheMetadata: Codable {
let cachedAt: Date
var lastAccessed: Date
let fileSize: Int64
}
}
Loading