5.4 C
New York
Monday, April 7, 2025
Home Blog Page 31

ios – separate presentation logic from the view in SwiftUI


I have been making an attempt to separate presentation logic from the view itself and I discovered this sample that initially look appeared to work.

struct MyView: View {
   @StateObject var viewModel = ViewModel()

   ...
}

extension MyView {
   class ViewModel: ObservableObject {
      ...
   }
}

This works properly besides when the view is determined by a dependency owned by the mother or father view. StateObject documentation provides the next instance:

struct MyInitializableView: View {
    @StateObject non-public var mannequin: DataModel


    init(title: String) {
        // SwiftUI ensures that the next initialization makes use of the
        // closure solely as soon as in the course of the lifetime of the view, so
        // later adjustments to the view's title enter don't have any impact.
        _model = StateObject(wrappedValue: DataModel(title: title))
    }


    var physique: some View {
        VStack {
            Textual content("Title: (mannequin.title)")
        }
    }
}

Nevertheless, they instantly warn that this strategy solely works if the exterior knowledge would not change. In any other case the information mannequin will not have entry to up to date values in any of the properties.

Within the above instance, if the title enter to MyInitializableView
adjustments, SwiftUI reruns the view’s initializer with the brand new worth.
Nevertheless, SwiftUI runs the autoclosure that you simply present to the state
object’s initializer solely the primary time you name the state object’s
initializer, so the mannequin’s saved title worth doesn’t change. What
could be one of the simplest ways to separate presentation logic from the view
itself? Subscribing to publishers in a use case, calculating body
sizes, logic to find out whether or not a toddler view is seen or not, and so forth
could be higher off in a unique file that the view makes use of to attract
itself.

To keep away from having an excessive amount of logic within the view like this:

NOTE: This has nice efficiency advantages since any updates to particular person will trigger a re-render WITHOUT inflicting your entire view to be reinitialised. Its lifecycle isn’t affected

struct PersonView: View {
    let particular person: Particular person
    
    non-public let dateFormatter = DateFormatter()
    
    var physique: some View {
        VStack(alignment: .main) {
            Textual content(fullName)
            Textual content(birthday)
        }
    }
    
    var fullName: String {
        "(particular person.firstName) (particular person.lastName)"
    }
    
    var birthday: String {
        dateFormatter.dateFormat = "MMM d"
        
        return dateFormatter.string(from: particular person.dateOfBirth)
    }
}

We may separate the presentation logic for the view’s rendering like this:

struct PersonView: View {
    @StateObject non-public var viewModel: ViewModel
    
    init(particular person: Particular person) {
        self._viewModel = .init(wrappedValue: ViewModel(particular person: particular person))
    }
    
    var physique: some View {
        VStack(alignment: .main) {
            Textual content(viewModel.fullName)
            Textual content(viewModel.birthday)
        }
    }
}

extension PersonView {
    class ViewModel: ObservableObject {
        let particular person: Particular person
        
        non-public let dateFormatter: DateFormatter
        
        init(particular person: Particular person) {
            self.particular person = particular person
            
            let dateFormatter = DateFormatter()
            dateFormatter.dateFormat = "MMM d"
            
            self.dateFormatter = dateFormatter
        }
        
        var fullName: String {
            "(particular person.firstName) (particular person.lastName)"
        }
        
        var birthday: String {
            dateFormatter.string(from: particular person.dateOfBirth)
        }
    }
}

Nevertheless, as talked about within the documentation any updates to any of Particular person’s properties will not be mirrored within the view.

There are a number of methods to drive reinitialisation by altering the view’s id, however all of them include efficiency points and different unwanted effects.

Be aware of the efficiency price of reinitializing the state object
each time the enter adjustments. Additionally, altering view id can have
unwanted effects. For instance, SwiftUI doesn’t routinely animate
adjustments contained in the view if the view’s id adjustments on the similar
time. Additionally, altering the id resets all state held by the view,
together with values that you simply handle as State, FocusState, GestureState,
and so forth.

Is there a approach to obtain a extra clear separation of issues whereas nonetheless leveraging SwftUI’s optimisations when re-rendering views?

New modelling instrument may assist defend wildlife from offshore developments



New modelling instrument may assist defend wildlife from offshore developments

A brand new useful resource has been developed in a bid to raised defend seabirds from the impacts of offshore wind farms. The group behind it says the modern modelling instrument has the potential to save lots of wildlife, whereas making certain the efficient and sustainable improvement of renewable vitality sources.

Led by researchers on the College of Glasgow, the brand new modelling instrument, printed within the journal Strategies in Ecology and Evolution, is the primary of its variety to precisely predict house use of seabird colonies with out requiring in depth satellite tv for pc monitoring information, which is commonly not obtainable.

Seabird environmental evaluation instruments are used to tell planning choices for offshore windfarms. Whereas helpful, present evaluation strategies can differ in accuracy and should result in offshore windfarms being in-built areas with excessive fowl density. Conversely, offshore windfarm developments could also be inadvertently rejected primarily based on overestimates of seabirds at sea.

Many seabird species nest in colonies on small items of land, together with clusters of rocks off the coast. From there, birds fly and forage round a neighborhood space at sea – their house vary – which varies in dimension relying on colony dimension and site. Due to these attribute behaviours, central-place foragers similar to seabirds, are significantly delicate to environmental stressors of their native environment, together with the event of wind farms, which can have extreme impacts on colony numbers and wellbeing.

Utilizing GPS monitoring information from 8 Northern gannet colonies to confirm their predictions, the researchers present that their new instrument roughly doubles on the predictive energy of different business normal strategies. The brand new instrument was 73% correct on common, compared to 41% and 31% accuracy of present seabird evaluation instruments. Present strategies additionally over- and underestimated colony publicity to offshore wind farms in several eventualities.

Researchers imagine their new instrument could possibly be transformative for offshore windfarm planning, permitting us to guard wildlife whereas additionally safely constructing sources of renewable vitality.

Lead writer of the examine, PhD scholar Holly Niven from the Faculty of Biodiversity, One Well being & Veterinary Drugs, stated: “Correct estimation of the impacts of offshore wind farms and different stressors on seabirds may help us make extra knowledgeable choices about offshore wind farm plans and defend the species dwelling round our coasts.”

Moreover, researchers say the brand new modelling instrument may be used to precisely predict the house use of different colonial wildlife, together with seals, bats and bees.

Jason Matthiopoulos, Professor of Spatial and Inhabitants Ecology who supervised the examine, stated: “Paradoxically, totally different environmentally constructive actions similar to wildlife conservation and our progress in the direction of inexperienced vitality can come into battle with one another. Resolving these conflicts depends on good information, however equally, on state-of-the-art pc modelling strategies.”

Jana Jeglinski, Analysis Fellow and co-supervisor of the examine, stated: “Many seabird colonies are positioned at distant islands or cliffs that make GPS monitoring research extraordinarily difficult and even not possible. Our methodology can predict biologically life like house ranges and publicity for such inaccessible colonies and it will probably additionally forecast future house ranges given the dimensions of a colony – that is vital since offshore windfarm development will drastically improve within the close to future.”

The examine, ‘In the direction of biologically life like estimates of house vary and spatial publicity for colonial animals’ is printed in Strategies in Ecology and Evolution. The work was funded by the UK Authorities Division for Vitality Safety & Internet Zeros Offshore Vitality Strategic Environmental Evaluation OESEA program.

Lucid PhaaS Hits 169 Targets in 88 International locations Utilizing iMessage and RCS Smishing

0


Lucid PhaaS Hits 169 Targets in 88 International locations Utilizing iMessage and RCS Smishing

A brand new refined phishing-as-a-service (PhaaS) platform referred to as Lucid has focused 169 entities in 88 nations utilizing smishing messages propagated through Apple iMessage and Wealthy Communication Providers (RCS) for Android.

Lucid’s distinctive promoting level lies in its weaponizing of legit communication platforms to sidestep conventional SMS-based detection mechanisms.

“Its scalable, subscription-based mannequin permits cybercriminals to conduct large-scale phishing campaigns to reap bank card particulars for monetary fraud,” Swiss cybersecurity firm PRODAFT mentioned in a technical report shared with The Hacker Information.

“Lucid leverages Apple iMessage and Android’s RCS expertise, bypassing conventional SMS spam filters and considerably rising supply and success charges.”

Lucid is assessed to be the work of a Chinese language-speaking hacking crew referred to as the XinXin group (aka Black Expertise), with the phishing campaigns primarily focusing on Europe, the UK, and the USA with an intent to steal bank card knowledge and personally identifiable data (PII).

Cybersecurity

The menace actors behind the service, extra importantly, have developed different PhaaS platforms like Lighthouse and Darcula, the latter of which has been up to date with capabilities to clone any model’s web site to create a phishing model. The developer of Lucid is a menace actor codenamed LARVA-242, who can be a key determine within the XinXin group.

All three PhaaS platforms share overlaps in templates, goal swimming pools, and techniques, alluding to a flourishing underground financial system the place Chinese language-speaking actors are leveraging Telegram to promote their warez on a subscription foundation for profit-driven motives.

Phishing campaigns counting on these companies have been discovered to impersonate postal companies, courier corporations, toll cost methods, and tax refund businesses, using convincing phishing templates to deceive victims into offering delicate data.

The big-scale actions are powered on the backend through iPhone machine farms and cellular machine emulators working on Home windows methods to ship tons of of hundreds of rip-off messages containing bogus hyperlinks in a coordinated trend. The cellphone numbers to be focused are acquired by varied strategies reminiscent of knowledge breaches and cybercrime boards.

“For iMessage’s link-clicking restrictions, they make use of ‘please reply with Y’ strategies to determine two-way communication,” PRODAFT defined. “For Google’s RCS filtering, they continually rotate sending domains/numbers to keep away from sample recognition.”

iMessage and RCS Smishing

“For iMessage, this entails creating momentary Apple IDs with impersonated show names, whereas RCS exploitation leverages service implementation inconsistencies in sender verification.”

In addition to providing automation instruments that simplify the creation of customizable phishing web sites, the pages themselves incorporate superior anti-detection and evasion strategies like IP blocking, user-agent filtering, and time-limited single-use URLs.

Lucid additionally helps the power to observe sufferer exercise and document each single interplay with the phishing hyperlinks in real-time through a panel, permitting its clients to extract the entered data. Bank card particulars submitted by victims are subjected to extra verification steps. The panel is constructed utilizing the open-source Webman PHP framework.

“The Lucid PhaaS panel has revealed a extremely organized and interconnected ecosystem of phishing-as-a-service platforms operated by Chinese language-speaking menace actors, primarily underneath the XinXin group,” the corporate mentioned.

“The XinXin group develops and makes use of these instruments and income from promoting stolen bank card data whereas actively monitoring and supporting the event of comparable PhaaS companies.”

Cybersecurity

It is price noting that the findings from PRODAFT mirror that of Palo Alto Networks Unit 42, which not too long ago referred to as out unspecified menace actors for using the area sample “com-” to register over 10,000 domains for propagating varied SMS phishing scams through Apple iMessage.

The event comes as Barracuda warned of a “huge spike” in PhaaS assaults in early 2025 utilizing Tycoon 2FA, EvilProxy, and Sneaky 2FA, with every service accounting for 89%, 8%, and three% of all of the PhaaS incidents, respectively.

“Phishing emails are the gateway for a lot of assaults, from credential theft to monetary fraud, ransomware, and extra,” Barracuda safety researcher Deerendra Prasad mentioned. “The platforms that energy phishing-as-a-service are more and more complicated and evasive, making phishing assaults each more durable for conventional safety instruments to detect and extra highly effective when it comes to the harm they’ll do.”

Discovered this text fascinating? Comply with us on Twitter and LinkedIn to learn extra unique content material we submit.



European cloud group invests to create what it dubs “Trump-proof cloud providers”



However analysts have questioned whether or not the Microsoft transfer actually addresses these European enterprise considerations. Phil Brunkard, government counselor at Data-Tech Analysis Group UK, stated, commenting on final month’s announcement of the EU Information Boundary for the Microsoft Cloud,  “Microsoft says that buyer knowledge will stay saved and processed within the EU and EFTA, however doesn’t assure true knowledge sovereignty.”

And European firms are actually rethinking what knowledge sovereignty means to them. They’re shifting past having it discuss with the place the information sits to specializing in which distributors management it, and who controls them.

Responding to the brand new Euro cloud plan, one other analyst, IDC VP Dave McCarthy, noticed the hassle as “signaling a rising European push for knowledge management and independence.”

“US suppliers may face harder competitors from EU firms that leverage this tech to supply sovereignty-friendly options. Though €1 million isn’t a game-changer by itself, it’s a transparent signal Europe needs to construct its personal cloud ecosystem—doubtlessly on the expense of US market share,” McCarthy stated. “For US suppliers, this might imply investing in additional EU-based knowledge facilities or reconfiguring techniques to make sure European clients’ knowledge stays inside the area. This isn’t only a compliance checkbox. It’s a shift that would hike operational prices and complexity, particularly for firms used to operating centralized setups.”

Including to the potential unhealthy information for US hyperscalers, McCarthy stated that there was little motive to consider that this development could be restricted to Europe.

“If Europe pulls this off, different areas may take be aware and push for related sovereignty guidelines. US suppliers may discover themselves adapting to a patchwork of laws worldwide, forcing a rethink of their international methods,” McCarthy stated. “This isn’t only a European headache, it’s a preview of what may grow to be a broader problem.”

Agility Robotics exhibits off newest advances for Digit humanoid

0


Agility Robotics exhibits off newest advances for Digit humanoid

Digit humanoid demonstrates its newest performance at ProMat 2025. Supply: Agility Robotics

At ProMat final month, Agility Robotics Inc. unveiled new capabilities for Digit that the corporate mentioned broaden the humanoid robotic’s utility for its rising person base.

“These upgrades enable Agility to broaden Digit’s capabilities to fulfill our increasing business and buyer wants,” acknowledged Melonee Clever, chief product officer at Agility Robotics. “Collectively, they reinforce our dedication to cooperative security, and display a path for Digit and human colleagues to in the future work aspect by aspect.”

Salem, Ore.-based Agility Robotics mentioned its robotic is designed to reinforce the human workforce. Digit was named the 2024 RBR50 Robotic of the 12 months for being the primary humanoid to start business trials and deployments in warehouses and manufacturing services.


SITE AD for the 2025 Robotics Summit registration.
Register now so you do not miss out!


Agility Robotics provides options

Working carefully with prospects, Agility Robotics designed options that it mentioned will help fast and scaled deployment of Digit fleets, together with:

  • Expanded and extra environment friendly battery energy with a period of as much as 4 hours
  • Autonomous docking onto charging stations
  • Streamlined manufacturing of the bipedal, multipurpose cell manipulation robotic (MMR)
  • New sturdy limbs and finish effectors, giving Digit a wider vary of greedy angles and unlocking new use circumstances with expanded prospects for manipulation

Digit built-in with AMRs

“Humanoid robots ought to be designed to work alongside autonomous cell robots (AMRs), not substitute them, and Digit is not any exception,” famous Agility Robotics. “Humanoids excel at advanced manipulation, greedy, and navigating human-centric areas, whereas AMRs are masters of environment friendly transportation over longer distances.”

Digit can autonomously dispatch an AMR to ship gadgets to places corresponding to packout stations. This reduces the necessity for fixed human intervention, maximizing effectivity and permitting employees to give attention to extra advanced duties, the firm mentioned. It has been working with AMR suppliers to allow this communcation.

Agility mentioned its Arc cloud robotic platform now can name and dispatch AMRs. Digit has already been working alongside AMRs at its deployment with GXO Logistics close to Atlanta. The corporate additionally demonstrated integration with AMRs from Cell Industrial Robots and Zebra Applied sciences at ProMat in Chicago.

New robots handle security considerations

Requirements exist for machine and robotic security, however security requirements for “dynamically secure industrial cell robots” corresponding to Digit that require balancing are nonetheless within the growth. Agility Robotics mentioned it’s engaged on cooperative security functions to fulfill the requirements of OSHA-regulated environments obligatory for humanoids to work alongside people.

The corporate asserted that the newest model of Digit adheres to security requirements for industrial cell robots. Agility mentioned the brand new options signify a big step towards deploying cooperative security functions.

Digit’s enhanced person interface now options at-a-glance, back and front shows that assist monitor Wi-Fi standing, connectivity, connection to Agility Arc, battery ranges and upkeep ports, making it simpler to watch and handle the robotic.

The brand new security options embrace:

  • A Class 1, or CAT1 cease, which maintains energy to the machine actuators through the deceleration course of, permitting the machine to cease easily and safely earlier than a shutdown.
  • A security programmable logic controller (PLC) supplies security features that meet Efficiency Degree d (PLd).
  • An emergency cease or E-stop button on a robotic is designed to right away halt all robotic actions and operations in case of an emergency. Its most important functions embrace stopping accidents, making certain employee security, complying with security rules, defending tools, and offering fast response management.
  • FailSafe over EtherCAT (FSoE) is a security protocol utilized in robotics and industrial automation to make sure protected communication between units over an EtherCAT community. It allows the transmission of safety-critical information, corresponding to emergency cease alerts and sensor suggestions, whereas additionally sustaining real-time efficiency.

Agility Robotics mentioned it’s dedicated to security and is working to adjust to a number of requirements because it develops robots to ultimately work alongside individuals.

Agility Arc supplies management within the cloud

Agility Arc is a cloud-based platform that provides prospects management of their automation for a variety of logistics and manufacturing workflows. Agility claimed that it’s the first humanoid fleet administration system to efficiently combine and deploy humanoid robots in a business atmosphere.

As a part of its newest options, Agility Arc permits prospects to speak with AMRs and their corresponding platforms. Different new Agility Arc options embrace:

  • Digit help
  • Charger help
  • Workcell EMS help
  • Simple webhook integration
  • Distant monitor, help, and upkeep of Digit and all equipment
  • Continued and expanded Enterprise Programs Integration (MES, WMS, WES, PLC)

At ProMat, Digit demonstrated new use circumstances – together with these built-in with AMRs – corresponding to stacking and unstacking of totes, goods-to-person (G2P) or Unit Sorter, AMR loading and unloading, palletizing and depalletizing, nesting, flowrack and carts, and automatic putwall.

Final month, Agility Robotics additionally introduced that it’s increasing its collaboration with NVIDIA Corp., increasing adoption of robotic simulation and studying frameworks to coach and check behaviors on Digit, in addition to to make Digit fashions accessible to companions on NVIDIA Omniverse.

Study extra about humanoids on the Robotics Summit

Humanoids can be distinguished on the 2025 Robotics Summit & Expo, which can be on April 30 and Could 1 in Boston. Aaron Saunders, chief know-how officer of Boston Dynamics, is giving the opening keynote on Day 2 of the occasion. He’ll talk about the just lately redesigned Atlas robotic and share his ideas concerning the future humanoids.

The primary day of the present will characteristic a panel concerning the state of humanoids with Pras Velagapudi, CTO at Agility Robotics; Aaron Prather, director of robotics and autonomous techniques at ASTM Worldwide; and Al Makke, director of engineering at Schaeffler (which can also be testing Digit). The panel will discover the technical and enterprise challenges shaping the event of humanoids. It should additionally share insights from early deployments, what’s on the horizon, and the continued efforts to ascertain security requirements.

The Robotics Summit & Expo will brings collectively greater than 5,000 builders centered on constructing robots for a wide range of business industries. Attendees can acquire insights into the newest enabling applied sciences, engineering greatest practices, and rising developments.

The occasion may even embrace over 200 exhibitors60-plus audio system on stage, greater than 10 hours of devoted networking time, a Ladies in Robotics Breakfast, a profession honest, startup showcase, and extra. Returning to the present is the RBR50 Pavilion and RBR50 Awards Dinner, which can honor the winners of the annual RBR50 Robotics Innovation Awards.

Registration is now open.