-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into release-prep-1.6.0
- Loading branch information
Showing
14 changed files
with
112 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
import Combine | ||
|
||
final class AppState: ObservableObject { | ||
@Published var deepLink: DeepLink? = nil | ||
@Published var hudState: HUDState? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
Friendly Competitions/Models/Deep Link/DeepLink+Share.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import UIKit | ||
|
||
extension DeepLink { | ||
func share() { | ||
let activityVC = UIActivityViewController( | ||
activityItems: itemsForSharing, | ||
applicationActivities: nil | ||
) | ||
activityVC.excludedActivityTypes = [.mail, .addToReadingList, .assignToContact, .markupAsPDF, .openInIBooks, .saveToCameraRoll, .print] | ||
|
||
let keyWindow = UIApplication.shared.connectedScenes | ||
.filter { $0.activationState == .foregroundActive } | ||
.compactMap { $0 as? UIWindowScene } | ||
.first? | ||
.windows | ||
.filter(\.isKeyWindow) | ||
.first | ||
|
||
keyWindow?.rootViewController? | ||
.topViewController | ||
.present(activityVC, animated: true, completion: nil) | ||
} | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import Combine | ||
import Foundation | ||
import Resolver | ||
|
||
enum HomeTab { | ||
case dashboard | ||
case explore | ||
} | ||
|
||
final class HomeViewModel: ObservableObject { | ||
|
||
@Published var deepLinkedCompetition: Competition? | ||
@Published var deepLinkedUser: User? | ||
|
||
@Injected private var competitionsManager: AnyCompetitionsManager | ||
@Injected private var friendsManager: AnyFriendsManager | ||
|
||
func handle(url: URL) { | ||
guard let deepLink = DeepLink(from: url) else { return } | ||
switch deepLink { | ||
case .friendReferral(let id): | ||
Task { | ||
let user = try await friendsManager.user(withId: id) | ||
DispatchQueue.main.async { [weak self] in | ||
self?.deepLinkedUser = user | ||
} | ||
} | ||
case .competitionInvite(let id): | ||
Task { | ||
let competition = try await competitionsManager.search(byID: id) | ||
DispatchQueue.main.async { [weak self] in | ||
self?.deepLinkedCompetition = competition | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.