5.5 C
New York
Saturday, March 15, 2025
Home Blog Page 3780

ios – SwiftUI Lists Not Displaying in ShoppingListView Regardless of Profitable Knowledge Loading


I am engaged on a SwiftUI venture the place I’ve a ShoppingListView that masses and shows purchasing lists from Firestore. The info appears to load appropriately primarily based on print statements within the console, however the lists will not be displaying up within the UI.

Right here’s a breakdown of what’s taking place:

Knowledge Loading (loadLists Perform):

func loadLists() {
    isLoading = true
    print("🔄 loadLists: Inicio de la carga de listas.")

    guard let uid = Auth.auth().currentUser?.uid else {
        print("❌ loadLists: No se encontró UID del usuario.")
        return
    }

    let manualRef = Firestore.firestore().assortment("iFoodList").doc(uid)
    let premiumRef = Firestore.firestore().assortment("PaidShoppingLists").doc(uid)

    let group = DispatchGroup()
    var combinedLists: [String: [(item: Any, creationDate: Date?)]] = [:]

    group.enter()
    manualRef.getDocument { doc, error in
        defer { group.go away() }
        if let doc = doc, doc.exists, let knowledge = doc.knowledge() {
            combinedLists.merge(self.parseListData(knowledge, listType: .handbook)) { present, _ in present }
        } else {
            print("⚠️ loadLists: La lista 'Nueva 1' no tiene elementos para cargar.")
        }
    }

    group.enter()
    premiumRef.getDocument { doc, error in
        defer { group.go away() }
        if let doc = doc, doc.exists, let knowledge = doc.knowledge() {
            combinedLists.merge(self.parseListData(knowledge, listType: .premium)) { present, _ in present }
        } else {
            print("⚠️ loadLists: La lista 'Nueva 1' no tiene elementos para cargar.")
        }
    }

    group.notify(queue: .primary) {
        self.lists = combinedLists
        self.isLoading = false
        print("🔄 loadLists: Listas cargadas exitosamente.")
    }
}

Knowledge Parsing (parseListData Perform):

func parseListData(_ knowledge: [String: Any], listType: ListType) -> [String: [(item: Any, creationDate: Date?)]] {
    var parsedLists: [String: [(item: Any, creationDate: Date?)]] = [:]

    for (listName, listItems) in knowledge {
        if let listData = listItems as? [String: Any], let creationDate = listData["creationDate"] as? Timestamp {
            let itemsArray = (listData["items"] as? [[String: Any]]) ?? []
            let listing = itemsArray.compactMap { itemData -> (Any, Date?)? in
                if listType == .handbook {
                    if let title = itemData["title"] as? String {
                        return (ListTextField(id: itemData["id"] as? String ?? UUID().uuidString,
                                              title: title,
                                              subtitle: itemData["subtitle"] as? String ?? "",
                                              isChecked: itemData["isChecked"] as? Bool ?? false), 
                                creationDate.dateValue())
                    }
                } else if let name_es = itemData["name_es"] as? String, let name_en = itemData["name_en"] as? String {
                    return (Product(id: itemData["id"] as? String ?? UUID().uuidString,
                                    knowledge: itemData), 
                            creationDate.dateValue())
                }
                return nil
            }
            if !listing.isEmpty {
                parsedLists[listName] = listing
            }
        }
    }
    return parsedLists
}

UI Code (ShoppingListView):

var physique: some View {
    NavigationView {
        ZStack {
            if isLoading {
                ProgressView()
            } else {
                if lists.isEmpty {
                    Textual content("No lists obtainable.")
                } else {
                    Checklist {
                        ForEach(Array(lists.keys.sorted()), id: .self) { listName in
                            NavigationLink(vacation spot: destinationView(for: listName)) {
                                Textual content(listName)
                            }
                        }
                    }
                }
            }
        }
        .onAppear(carry out: loadLists)
    }
}
ViewModel:
import SwiftUI
import Mix
import FirebaseFirestore

class ListViewModel: ObservableObject {
    @Revealed var lists: [String: [(item: Any, creationDate: Date?)]] = [:]
    @Revealed var isLoading: Bool = false
    @Revealed var errorMessage: String? = nil

    non-public var cancellables = Set()

    func loadLists() {
        isLoading = true
        print("🔄 loadLists: Inicio de la carga de listas.")

        guard let uid = Auth.auth().currentUser?.uid else {
            print("❌ loadLists: No se encontró UID del usuario.")
            self.isLoading = false
            self.errorMessage = "No consumer ID discovered."
            return
        }

        let manualRef = Firestore.firestore().assortment("iFoodList").doc(uid)
        let premiumRef = Firestore.firestore().assortment("PaidShoppingLists").doc(uid)

        let group = DispatchGroup()
        var combinedLists: [String: [(item: Any, creationDate: Date?)]] = [:]

        group.enter()
        manualRef.getDocument { doc, error in
            defer { group.go away() }
            if let doc = doc, doc.exists, let knowledge = doc.knowledge() {
                combinedLists.merge(self.parseListData(knowledge, listType: .handbook)) { present, _ in present }
            } else {
                print("⚠️ loadLists: La lista 'Nueva 1' no tiene elementos para cargar.")
            }
        }

        group.enter()
        premiumRef.getDocument { doc, error in
            defer { group.go away() }
            if let doc = doc, doc.exists, let knowledge = doc.knowledge() {
                combinedLists.merge(self.parseListData(knowledge, listType: .premium)) { present, _ in present }
            } else {
                print("⚠️ loadLists: La lista 'Nueva 1' no tiene elementos para cargar.")
            }
        }

        group.notify(queue: .primary) {
            self.lists = combinedLists
            self.isLoading = false
            print("🔄 loadLists: Listas cargadas exitosamente.")
        }
    }

    non-public func parseListData(_ knowledge: [String: Any], listType: ListType) -> [String: [(item: Any, creationDate: Date?)]] {
        var parsedLists: [String: [(item: Any, creationDate: Date?)]] = [:]

        for (listName, listItems) in knowledge {
            if let listData = listItems as? [String: Any], let creationDate = listData["creationDate"] as? Timestamp {
                let itemsArray = (listData["items"] as? [[String: Any]]) ?? []
                let listing = itemsArray.compactMap { itemData -> (Any, Date?)? in
                    if listType == .handbook {
                        if let title = itemData["title"] as? String {
                            return (ListTextField(id: itemData["id"] as? String ?? UUID().uuidString,
                                                  title: title,
                                                  subtitle: itemData["subtitle"] as? String ?? "",
                                                  isChecked: itemData["isChecked"] as? Bool ?? false), 
                                    creationDate.dateValue())
                        }
                    } else if let name_es = itemData["name_es"] as? String, let name_en = itemData["name_en"] as? String {
                        return (Product(id: itemData["id"] as? String ?? UUID().uuidString,
                                        knowledge: itemData), 
                                creationDate.dateValue())
                    }
                    return nil
                }
                if !listing.isEmpty {
                    parsedLists[listName] = listing
                }
            }
        }
        return parsedLists
    }
}

Concern:

Knowledge masses efficiently, as confirmed by print statements (e.g., “🔄 loadLists: Listas cargadas exitosamente”), however the UI doesn’t show the lists.
I think a problem with how SwiftUI updates the UI or handles state.
Questions:

Is there one thing incorrect with how lists is getting used within the UI?
May the issue be associated to the lifecycle of ShoppingListView?

Cybercriminals Exploit Fashionable Software program Searches to Unfold FakeBat Malware

0


Aug 19, 2024Ravie LakshmananMalvertising / Cybercrime

Cybercriminals Exploit Fashionable Software program Searches to Unfold FakeBat Malware

Cybersecurity researchers have uncovered a surge in malware infections stemming from malvertising campaigns distributing a loader known as FakeBat.

“These assaults are opportunistic in nature, concentrating on customers searching for standard enterprise software program,” the Mandiant Managed Protection group stated in a technical report. “The an infection makes use of a trojanized MSIX installer, which executes a PowerShell script to obtain a secondary payload.”

FakeBat, additionally known as EugenLoader and PaykLoader, is linked to a risk actor named Eugenfest. The Google-owned risk intelligence group is monitoring the malware below the title NUMOZYLOD and has attributed the Malware-as-a-Service (MaaS) operation to UNC4536.

Cybersecurity

Assault chains propagating the malware make use of drive-by obtain strategies to push customers looking for standard software program towards bogus lookalike websites that host booby-trapped MSI installers. Among the malware households delivered by way of FakeBat embody IcedID, RedLine Stealer, Lumma Stealer, SectopRAT (aka ArechClient2), and Carbanak, a malware related to the FIN7 cybercrime group.

“UNC4536’s modus operandi entails leveraging malvertising to distribute trojanized MSIX installers disguised as standard software program like Courageous, KeePass, Notion, Steam, and Zoom,” Mandiant stated. “These trojanized MSIX installers are hosted on web sites designed to imitate respectable software program internet hosting websites, luring customers into downloading them.”

FakeBat Malware

What makes the assault notable is the usage of MSIX installers disguised as Courageous, KeePass, Notion, Steam, and Zoom, which have the flexibility to execute a script earlier than launching the primary software by way of a configuration known as startScript.

UNC4536 is actually a malware distributor, that means FakeBat acts as a supply car for next-stage payloads for his or her enterprise companions, together with FIN7.

“NUMOZYLOD gathers system data, together with working system particulars, area joined, and antivirus merchandise put in,” Mandiant stated. “In some variants, it gathers the general public IPv4 and IPv6 deal with of the host and sends this data to its C2, [and] creates a shortcut (.lnk) within the StartUp folder as its persistence.”

Cybersecurity

The disclosure comes slightly over a month after Mandiant additionally detailed the assault lifecycle related to anther malware downloader named EMPTYSPACE (aka BrokerLoader or Vetta Loader), which has been utilized by a financially motivated risk cluster dubbed UNC4990 to facilitate knowledge exfiltration and cryptojacking actions concentrating on Italian entities.

Discovered this text fascinating? Observe us on Twitter and LinkedIn to learn extra unique content material we publish.



Apple celebrates America’s nationwide parks

0



Ransomware Kingpin Who Known as Himself “J P Morgan” Extradited to america


An investigation courting again virtually ten years has seen the extradition this week to america of a person suspected to be the top of 1 the world’s most prolific Russian-speaking cybercriminal gangs.

The UK’s Nationwide Crime Company (NCA) says it has been investigating a cybercriminal utilizing the net deal with “J P Morgan” since 2015, alongside parallel investigations run by america FBI and Secret Service.

The primary notable look of the moniker “J P Morgan” dates again to 2011, when he and associates launched the Reveton ransomware.

Early variations of Reveton posed as a warning from police that victims’ computer systems had been locked as a consequence of unspecified copyright offences, and demanding with the specter of legal proceedings {that a} “superb” be paid inside 48 hours.

Later variations of Reveton took a extra sinister flip, locking computer systems with claims that they’d been used to view photographs of kid abuse on-line.

Reveton would even detect a sufferer’s webcam and show a picture of the person alongside the demand for cost – scary them into paying a “superb” by means of worry of being imprisoned.

The Reveton assaults had been changing into extra subtle over time, changing into the primary ever malware to undertake the ransomware-as-a-service (RaaS) enterprise mannequin.

Tens of hundreds of thousands of {dollars} are thought to have been extorted from customers worldwide by the criminals’ malware.

“J P Morgan” and his associates are described by the NCA, as “elite cybercriminals” who’ve taken excessive measures over a few years to guard their identifies and keep away from detention by regulation enforcement businesses.

Nonetheless, investigators say they’ve efficiently recognized, tracked, and situated the people throughout Europe who’re mentioned to have been chargeable for the event and distribution of varied strains of ransomware, together with Reveton and Ransom Cartel, in addition to the infamous Angler exploit equipment.

Spanish police, supported by officers from UK and US regulation enforcement businesses, arrested 38-year-old Maksim Silnikau, also called Maksym Silnikov, at an condominium in Estepona, southern Spain, in July 2023.

Silnikau, from Belarus, is believed by police to have used the “J P Morgan” moniker inside the cybercriminal group, in addition to different handles together with “xxx” and “lansky”.

On Friday 9 August 2024, Silnikau was extradited from Poland to america the place he faces prices associated to cybercrime, alongside Vladimir Kadariya, 38, from Belarus, and 33-year-old Andrei Tarasov, from Russia.

“These are extremely subtle cyber criminals who, for various years, had been adept at masking their exercise and identities. Their impression goes far past the assaults they launched themselves,” mentioned NCA Deputy Director Paul Foster. “They basically pioneered each the exploit equipment and ransomware-as-a-service fashions, which have made it simpler for individuals to change into concerned in cybercrime and proceed to help offenders.”


Editor’s Observe: The opinions expressed on this and different visitor creator articles are solely these of the contributor and don’t essentially mirror these of Tripwire.

Edge Orchestration Platforms: Navigating the Subsequent Wave of Innovation

0


In an period the place digital transformation is not only a buzzword however a enterprise crucial, edge orchestration platforms are rising as a cornerstone for modern enterprises. As these platforms evolve, understanding the right way to navigate their adoption, deployment, and future developments is essential. This weblog delves into important preparations and strategic insights, guiding SMBs and huge enterprises alike by the intricate panorama of edge orchestration.

Setting the Stage for Profitable Deployment

Preparation for Adoption
Earlier than adopting an edge orchestration platform, it’s very important to evaluate your group’s present infrastructure and determine particular wants that the platform will tackle. Conducting a radical stock of your current IT property and mapping out how they work together with potential edge deployments can stop many complications. Participating with stakeholders throughout departments to align the platform’s capabilities with enterprise objectives is one other important step.

Key Issues for Totally different Enterprise Sizes
SMBs ought to search for platforms that supply scalability and ease of integration with out requiring substantial upfront funding. Flexibility in adapting to altering wants is essential for sustaining development. For bigger enterprises, the power to handle advanced, multisite deployments with strong security measures and complete analytics capabilities ought to be a precedence. Enterprises ought to search platforms that may present detailed insights into knowledge processing and machine administration throughout their broader community.

Frequent Pitfalls and Easy methods to Keep away from Them
A frequent misstep in deploying edge orchestration is underestimating the complexity of integrating legacy programs with new edge applied sciences. Corporations typically overlook the necessity for expert personnel to handle this transition. Investing in coaching for present IT workers or hiring new expertise with particular experience in edge applied sciences can mitigate this subject. One other widespread problem is failing to determine clear knowledge governance and safety insurance policies, that are important in managing the elevated knowledge visitors and storage on the edge.

Wanting Forward: The Evolving Panorama of Edge Orchestration

Rising Applied sciences and Market Shifts
Over the following 12-24 months, we are able to count on important developments in AI capabilities inside edge platforms, enhancing automated decision-making and real-time knowledge processing. Integration with 5G expertise can even speed up, broadening the scope of edge purposes, significantly in industries like manufacturing, healthcare, and retail.

Anticipating Sector Adjustments
The market is prone to witness a consolidation of edge platform suppliers as main gamers attempt to increase their ecosystems by strategic acquisitions and partnerships. This might result in a extra standardized method to edge computing, decreasing compatibility points and simplifying administration for end-users.

Strategic Preparations for Organizations
To remain forward, organizations ought to start by fostering a tradition that embraces steady studying and flexibility. Constructing partnerships with edge expertise suppliers and collaborating in trade consortia can present early insights into rising traits and applied sciences. Moreover, investing in superior analytics and AI will equip firms to harness the total potential of edge orchestration, driving innovation and aggressive benefit.

Subsequent Steps

Edge orchestration platforms symbolize a dynamic and important component of contemporary IT methods. By getting ready totally for his or her adoption, understanding the precise wants of your small business measurement, and staying abreast of future developments, organizations can’t solely overcome the challenges but in addition considerably profit from the alternatives these applied sciences supply. Because the panorama continues to evolve, the power to adapt and innovate can be paramount in leveraging the sting to its fullest potential.

To study extra, check out GigaOm’s edge orchestration platforms Key Standards and Radar experiences. These experiences present a complete overview of the market, define the factors you’ll need to take into account in a purchase order determination, and consider how a lot of distributors carry out in opposition to these determination standards.

For those who’re not but a GigaOm subscriber, join right here.