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
typealias Factory = (DIContainerService) -> Any | |
protocol ServiceEntryProtocol: AnyObject{ | |
var factory: Factory { get } | |
var instance: Any? { get set } | |
} | |
final public class ServiceEntry: ServiceEntryProtocol { | |
var instance: Any? | |
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
protocol UserServiceProtocol { | |
func fetchUsers() | |
} | |
protocol RewardServiceProtocol { | |
func fetchRewards() | |
} | |
final class UserService: UserServiceProtocol { | |
func fetchUsers() { |
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
{ | |
"aps": { | |
"timestamp": 1660435557, | |
"event": "update", | |
"content-state": { | |
"courierName": "Adam", | |
"deliveryTime": 1660435557 | |
} | |
} | |
} |
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
// | |
// DeliveryTrackWidget.swift | |
// DeliveryTrackWidget | |
// | |
// Created by Batikan Sosun on 13.08.2022. | |
// | |
import ActivityKit | |
import WidgetKit | |
import SwiftUI |
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
await activity.end(dismissalPolicy: .immediate) |
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
let updatedStatus = GroceryDeliveryAppAttributes.LiveDeliveryData(courierName: "Adam", | |
deliveryTime: .now + 150) | |
await activity.update(using: updatedStatus) |
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
let attributes = GroceryDeliveryAppAttributes(numberOfGroceyItems: 12) | |
let contentState = GroceryDeliveryAppAttributes.LiveDeliveryData(courierName: "Mike", deliveryTime: .now + 120) | |
do { | |
let _ = try Activity<GroceryDeliveryAppAttributes>.request( | |
attributes: attributes, | |
contentState: contentState, | |
pushType: nil) | |
} catch (let error) { | |
print(error.localizedDescription) | |
} |
NewerOlder