Home Blog

javascript – React Native View Peak and Peak of a div inside an internet view


I do know the title isnt clear however what im basically attempting to do is do my very own rendering for an EPUB and im presently taking a naive strategy in the direction of paginating the chapter content material and attempting to render it in a WebView after splitting the content material primarily based on the tags.

My problem begins from the purpose the place i can’t appear to precisely cut up the content material to suit into the web page, and it overflows within the rendered internet view.

I’ve a separate internet view which renders off display screen and calculates the scrollHeight of the div the place the content material is being injected in.

The web page is principally constructed block by block (tag by tag) till the div begins to overflow and the peak of the div is bigger than the View that its rendered to.

The pagination perform yields the content material gathered simply earlier than the peak is exceeded.

The issue is that it by no means suits to display screen and there’s all the time a little bit of vertical overflow left.

My goal is to in the end generate an inventory of animated WebViews the consumer can scroll via horizontally like an precise web page flip of a e book.

I might actually admire some assist in figuring out the logic or calculation flaw right here within the format top comparisons. Let me know if ive missed one thing.

Under is the react native part which does the pagination and rendering

import { EPUBChapter, epubHtmlTemplate, ParsedEPUB } from "@/lib/EpubParser";
import { useEffect, useRef, useState } from "react";
import { parseDocument, DomUtils } from "htmlparser2";
import render from "dom-serializer";
import { WebView } from "react-native-webview";
import { Textual content } from "./ui/textual content";
import { useHtmlHeightMeasurer } from "@/hooks/useHtmlHeightMeasurer";
import { View, PixelRatio, FlatList } from "react-native";

export perform WebViewCarousel({
  parsedEpub,
  currentChapterIndex = 0,
}: {
  parsedEpub: ParsedEPUB;
  currentChapterIndex: quantity;
}) {
  const chapters = parsedEpub.chapters;
  const [currentChapter, setCurrentChapter] = useState(
    undefined
  );
  const view = useRef(null);
  // const { html } = useHtmlHeightMeasurer(viewDimensions.width, viewDimensions.top);
  const { measureHtmlHeight, MeasuringWebView, resizeWebView } =
    useHtmlHeightMeasurer(355, 355);
  const [pages, setPages] = useState([]);

  async perform* pageGenerator(
    chapterHtml: string,
    dimensions: { width: quantity; top: quantity }
  ) {
    resizeWebView({ top: dimensions.width, width: dimensions.top });
    const parsedChapterHtml = parseDocument(chapterHtml);
    const htmlNodes = parsedChapterHtml.kids;
    let pageNodes: typeof parsedChapterHtml.kids = [];
    const chapterContent = DomUtils.findOne(
      (elem) => elem.title === "part",
      htmlNodes
    );
    // const pixelHeight = PixelRatio.getPixelSizeForLayoutSize(dimensions.top);
    const pixelHeight = dimensions.top;


    if (chapterContent) {
      for (const [index, node] of chapterContent.kids.entries()) {
        const testPage = render([...pageNodes, node]);
        // console.log('Node: ' + render(node));
        if (testPage.trim()) {
          const webViewHeight = await measureHtmlHeight(
            epubHtmlTemplate(testPage)
          );
          console.log("View top: " + pixelHeight);
          console.log("Measured Peak: " + webViewHeight);
          if (webViewHeight >= pixelHeight) {
            console.log("Yielding Web page");
            
            yield pageNodes;
            pageNodes = [];
          }

          pageNodes.push(node);
        }
      }
    }

    console.log("Last web page");
    return pageNodes;
  }

  // const generatePage = pageGenerator(chapters[currentChapterIndex].content material);

  async perform generatePages({
    width,
    top,
  }: {
    width: quantity;
    top: quantity;
  }) {
    const pagesToAdd = [];

    for await (const web page of pageGenerator(
      chapters[currentChapterIndex].content material,
      { width, top }
    )) {
      console.log(render(web page));
      pagesToAdd.push(render(web page));
    }

    setPages([...pages, ...pagesToAdd]);
  }

  return (
     {
        generatePages({
          top: e.nativeEvent.format.top,
          width: e.nativeEvent.format.width,
        });
      }}
    >
      
      {pages.size > 0 && (
        
      )}
    
  );
}

The offscreen part used to measure the content material till it overflows

import { epubHtmlTemplate } from "@/lib/EpubParser";
import React, { useRef, useState } from "react";
import { View } from "react-native";
import { WebView } from "react-native-webview";

const measureJs = `
  (() => {
    const observer = new MutationObserver(measure)
    let debounce;
    
    perform measure() {
      clearTimeout(debounce);
      debounce = setTimeout(() => {
        strive {
          const container = doc.getElementById('epub-content');
          if(container) {
            const top = container.scrollHeight;
            window.ReactNativeWebView.postMessage(JSON.stringify({
              kind: 'measurement',
              worth: top
            }));
          } else {
            window.ReactNativeWebView.postMessage(JSON.stringify({
              kind: 'error',
              worth: 'Lacking container with id epub-content'
            }));
          }
        } catch (error) {
          window.ReactNativeWebView.postMessage(JSON.stringify({
            kind: 'error',
            worth: error.message
          }));
        }
      }, 150);
    }

    observer.observe(doc.physique, { 
      childList: true, 
      subtree: true,
      attributes: true
    });

    measure();
  })()
`;

export perform useHtmlHeightMeasurer(width: quantity, top: quantity) {
  const [html, setHtml] = useState("");
  const resolver = useRef<(h: quantity) => void>();
  const webViewRef = useRef(null);
  const [webViewDimensions, setWebViewDimensions] = useState({
    top: 0,
    width: 0
  });

  const measureHtmlHeight = (htmlString: string) =>
    new Promise((resolve) => {
      resolver.present = resolve;
      setHtml(htmlString);
    });
  
  const resizeWebView = ({ width, top }: { width: quantity, top: quantity }) => {
    setWebViewDimensions({ width, top })
  }

  const MeasuringWebView = () => (
    
       {
          const knowledge = JSON.parse(occasion.nativeEvent.knowledge);
          if(knowledge.kind === 'error') {
            console.error(knowledge.worth)
          }
          if (knowledge.kind === "measurement") {
            const h = Quantity(knowledge.worth);
            if (resolver.present) {
              resolver.present(h);
              resolver.present = undefined;
            }
          }
        }}
        fashion={{ width: webViewDimensions.width, top: webViewDimensions.top, backgroundColor: "clear" }}
      />
    
  );

  return { measureHtmlHeight, MeasuringWebView, resizeWebView };
}

Genetically-engineered immune cells present promise for stopping organ rejection – NanoApps Medical – Official web site


A Medical College of South Carolina group experiences in Frontiers in Immunology that it has engineered a brand new sort of genetically modified immune cell that may exactly goal and neutralize antibody-producing cells complicit in organ rejection. Related methods have been used to stimulate the immune system in opposition to sure cancers, however Ferreira’s group is the primary to indicate its utility in tamping down immune responses that may result in organ rejection.

Greater than 50,000 organ transplants happen annually within the U.S. Whereas usually lifesaving, these procedures rely on a exact match between donor and recipient genes to keep away from rejection. When the immune system detects international tissue, it may assault the transplanted organ.

For many years, medical doctors have used immunosuppressant medicine to decrease the danger of rejection. However these medicine work broadly, suppressing your complete immune system. This will result in unwanted effects and shorten the lifetime of the transplanted organ.

The MUSC group, led by Leonardo Ferreira, Ph.D., an assistant professor of Pharmacology and Immunology, confirmed the feasibility of focused immunosuppression after transplant that would someday scale back rejection with out leaving sufferers weak to an infection and different unwanted effects. This technique may additionally degree the enjoying discipline for sufferers who’ve restricted eligibility for organs as a result of they’re particularly susceptible to rejection.

Jaime Valentín-Quiroga, first creator of the article and a Ph.D. candidate at College Hospital La Paz in Madrid, Spain, working within the lab of Eduardo Lopez Collazo, Ph.D., can be co-advised by Ferreira. López-Collazo’s analysis group supplied the affected person samples for the examine.

Spain is without doubt one of the main nations worldwide in organ transplantation and presents the proper platform to maneuver from bench to bedside. I’m fortunate to be co-advised by Dr. Ferreira. His analysis combines my favourite matters, fine-tuning the immune system and utilizing cutting-edge biotechnology to reinforce immune cells’ pure capabilities.”

Jaime Valentín-Quiroga, first creator of the article

Balancing the immune system

When in working stability, the immune system protects the physique in opposition to outdoors invaders with out attacking its personal tissues. B-cells launch antibodies that assault pathogens and contaminated cells. Regulatory T-cells, or Tregs, hold the immune response from going too far, stopping tissue injury and autoimmune illnesses.

“Whenever you prick your finger, it is very important mount a powerful immune response to kill all of the micro organism that entered your finger,” Ferreira mentioned. “However it’s additionally necessary to deliver that immune response to a halt when all of the micro organism have been killed. In any other case, you might lose your finger within the course of, and the treatment could be as unhealthy because the illness.”

A key goal for B-cells are human leukocyte antigen (HLA) proteins, which assist the immune system to inform self from non-self. Docs attempt to match donor and recipient HLA proteins as intently as attainable, however with greater than 40,000 HLA variants, excellent matches are uncommon.

One variant, HLA-A2, is present in almost one-third of the worldwide inhabitants. Sufferers who’ve had earlier publicity to HLA-A2 are thought-about “pre-sensitized,” which means their immune methods are primed to answer it and launch very giant quantities of anti-HLA-A2 antibodies. These embody earlier transplant sufferers; ladies who, throughout being pregnant, carried a baby with HLA-A2 inherited from their companions; and recipients of HLA-A2-positive blood transfusions. Pre-sensitized sufferers have a way more tough time discovering a appropriate donor organ.

The CHAR method

Ferreira’s group has developed a novel manner for the Tregs to seek out and neutralize particularly the B-cells producing anti-HLA-A2 antibodies. They’ve fitted the Tregs with a CHAR – quick for chimeric anti-HLA antibody receptor – which detects the suitable B-cells and alerts the Tregs to suppress them. When CHARs detect and connect to B-cells secreting anti-HLA-A2 antibodies, they alert the Tregs to neutralize these problematic B-cells, primarily signaling the immune system to face down and never assault the organ. On this manner, not solely do CHARs act like heat-seeking missiles to seek out the best B-cells to focus on, however in addition they maintain the important thing to the Treg’s ignition, activating its equipment to elicit a extra exact immunosuppressive response and stop it from going overboard.

Ferreira’s group examined the efficacy of CHAR-Tregs in cells from dialysis sufferers with a historical past of kidney rejection. The cells confirmed excessive ranges of anti-HLA-A2 antibodies, however publicity to CHAR-Tregs dramatically decreased antibody ranges.

“We took sufferers’ cells which were proven to make an especially sturdy response in opposition to HLA-A2-expressing cells, and we confirmed that the novel CHAR-Tregs calmed them down,” mentioned Ferreira. “I believe that’s probably the most thrilling a part of our examine – we present that this technique works within the cells of precise pre-sensitized sufferers.”

Supply:

Journal reference:

Valentín-Quiroga, J., et al. (2025) Chimeric anti-HLA antibody receptor engineered human regulatory T cells suppress alloantigen-specific B cells from pre-sensitized transplant recipients. Frontiers in Immunology. doi.org/10.3389/fimmu.2025.1601385.

Cisco Companion Hybrid Workspace Transformation Insights


Cisco has been exhausting at work remodeling our workplaces across the globe. From New York and Atlanta to Milan, Paris, and London Metropolis, every area is a mannequin of what the way forward for hybrid work can appear like when world-class design meets Cisco innovation.

However we’re not the one ones making daring strikes. Lots of our companions have additionally made important investments to reimagine their very own areas utilizing Cisco applied sciences. They’re not simply upgrading workplaces. They’re creating immersive experiences that show the total energy of our options.

Earlier this yr, I had the prospect to go to Softcat’s new location in London. The area was beautiful, totally enabled with Cisco—from DNA Areas to immersive video collaboration. As I walked via, it struck me that this wasn’t a one-off. A number of of our companions have created their very own variations of the Cisco expertise. 

Showcasing Companion Innovation Worldwide

We’ve been amazed by the creativity and innovation our companions deliver to their workspace transformations. Throughout over 70 companion workplaces across the globe, we’re seeing demo-ready environments, customer-friendly assembly areas, and examples of hybrid work executed proper. 

To higher help our area groups in connecting prospects with these real-world examples, we’ve created an inside Cisco Collaboration Companion Workspace Catalog that helps our groups establish 80 companion areas the place prospects can expertise hands-on demonstrations of Cisco expertise in motion. 

Some standout examples from our companion neighborhood embrace:

These areas are an extension of Cisco’s imaginative and prescient, delivered to life by our companions.

Why This Issues

Hybrid work will not be theoretical. It’s right here, and our companions ar serving to to make it tangible. With areas like these spanning the globe, we will join prospects instantly with environments that present the way forward for work in movement, proper in their very own areas.

Collectively, we’re scaling what’s doable. And if your organization has created a Cisco-enabled workspace that showcases our expertise and ought to be thought of for inclusion in our inside catalog, we’d love to listen to about it. Your area might be the right demonstration atmosphere for patrons in your market.

Let’s preserve constructing the way forward for work collectively.

 


We’d love to listen to what you assume. Ask a Query, Remark Under, and Keep Related with #CiscoPartners on social!

Cisco Companions Fb  |  @CiscoPartners X/Twitter  |  Cisco Companions LinkedIn

Share:



Main the Way forward for IoT Mobility: Cisco Wins Frost & Sullivan Award Two Years Operating


We’re honored to kick off our new fiscal 12 months with a second of satisfaction and gratitude as a result of Cisco has been named Frost & Sullivan’s 2025 World Firm of the 12 months for Cell IoT Platforms—for the second 12 months in a row! This prestigious recognition displays the belief our prospects and companions place in us and underscores the affect we’ve made collectively in probably the most dynamic segments of the {industry}. To be acknowledged consecutively by Frost & Sullivan—recognized for its rigorous analysis of innovation, buyer affect, and market management—is a strong affirmation.

This honor locations Cisco among the many prime 1% of {industry} leaders shaping the way forward for connectivity, and highlights how our versatile, safe, and open IoT options are serving to enterprises, service suppliers, and companions throughout the globe confidently navigate a quickly evolving digital panorama.

We need to prolong our heartfelt gratitude to our prospects and companions who proceed to collaborate with us, co-innovate with us, and most significantly belief in Cisco innovation and experience as a pioneer in mobility IoT options—our partnerships gas our continued drive for innovation and affect.

A one-stop platform for all issues mobility

On the coronary heart of Cisco management is a transparent technique: to ship on the promise of the platform, simplify complexity, and embrace openness for the companion ecosystem to innovate with us. The Cisco Mobility Providers Platform exemplifies this imaginative and prescient—serving as a one-stop store for enterprise mobility wants throughout individuals, areas, and issues. This open, cloud-native platform helps 5G, Narrowband IoT (NB-IoT), Lengthy Time period Evolution for Machines (LTE-M), and satellite tv for pc integrations, whereas enabling seamless SIM lifecycle administration, edge providers, and industry-specific functions. Whether or not it’s linked autos, sensible power grids, industrial automation, or fleet operations, our platform empowers service suppliers and enterprises to launch differentiated providers sooner and scale them intelligently throughout international markets.

On prime of this platform, Cisco affords tailor-made capabilities, together with:

  • IoT Management Middle is a cloud-native, SaaS-based platform that empowers enterprises to handle “issues” corresponding to SIMs, connectivity, and system utilization at scale, lowering prices and accelerating time to income. It additionally affords zero-touch provisioning and rule-based automation to speed up IoT service deployment and simplify operations. Constructed-in diagnostics, anomaly detection, and automatic billing assist prospects cut back extra prices and streamline administration. Finish-to-end safety ensures scalable and dependable deployments and allows a shift to recurring income fashions.
  • Non-public 5G delivers safe, high-performance wi-fi connectivity in mission-critical environments corresponding to ports, utilities, and sensible campuses—connecting bodily “areas” with resilience and reliability with unified identification, safety, and observability throughout enterprise Wi-Fi and 5G entry know-how. Prospects profit from seamless mobility, constant consumer expertise, and centralized visibility—all with simplified operations and diminished complexity.
  • Programmable Core is a cloud-native, core-as-a-service resolution that helps service suppliers simplify cell infrastructure and speed up service innovation. It removes multivendor complexity by means of a unified, SaaS-hosted core, with streamlined APIs and subscriber administration instruments. This allows sooner deployment of latest mobility providers and unlocks income alternatives in an built-in ecosystem. Designed with hyperscaler ideas, it affords prospects versatile scalability, lowers working bills, and protects towards legacy lock-in.

These options are already trusted by greater than 32,000 enterprise prospects and 50+ of the highest international service suppliers. Their success with the Cisco Mobility Providers Platform is mirrored in sturdy adoption, loyalty, and consumption development, driving innovation, operational effectivity, and measurable enterprise affect.

Constructed for scale. Confirmed within the subject.

The Cisco Mobility Providers Platform isn’t simply revolutionary—it’s constructed to function at large scale with unmatched reliability and safety. We help 284 million IoT endpoints and energy 100 million+ linked autos—numbers that replicate our potential to ship in real-world, mission-critical environments. Safety is built-in into each layer, from system to cloud, enabling us to guard even probably the most constrained IoT belongings. Our use of open requirements, TM Discussion board-aligned APIs, and pre-integrated service packages considerably reduces friction and accelerates deployment—permitting cell community operators (MNOs) and cell digital community operators (MVNOs) to ship distinctive providers with out reinventing their infrastructure. Operational excellence isn’t just about quantity; it’s about lowering complexity, bettering effectivity, and driving sustainable enterprise worth—and that’s what Cisco delivers daily throughout verticals like automotive, logistics, manufacturing, power, and sensible cities.

The highway forward: Partnering for sturdy innovation and development

The Cell IoT panorama is present process vital, fast transformation, pushed by the phase-out of legacy 2G/3G networks and the rise of superior applied sciences like 5G, NB-IoT, LTE-M, and rising architectures corresponding to 5G Decreased Capability (RedCap) and Non-terrestrial Networks (NTN). These improvements are unlocking new prospects for scalable, ultra-efficient connectivity—but they’ve arrived at a time of mounting challenges, together with multivendor complexity, heightened safety dangers, fragmented provide chains, and the necessity to handle various system sorts with vastly completely different necessities.

Regardless of these hurdles, the chance is big: GlobalData tasks the IoT market will develop from $959.6 billion in 2023 to $1.8 trillion by 2028, fueled by enterprise functions and AI-powered providers. Frost & Sullivan emphasizes that cell operators, MNOs, and MVNOs should navigate this complexity whereas dealing with declining ARPU and rising operational calls for—making it important to companion with platforms that ship agility, safety, and scalable intelligence.making it important to companion with platforms that ship agility, safety, and scalable intelligence.

As we glance forward, the trail ahead is evident: the cell IoT world will solely grow to be extra interconnected, clever, and indispensable. We need to prolong our gratitude to our prospects and companions who’re already constructing the way forward for IoT with Cisco. Your belief, collaboration, and innovation encourage the whole lot we do.

To these not but on the journey with us: now could be the time. The tempo of change is accelerating, and ready dangers being left behind, as your rivals are scaling sooner, launching new providers faster, and unlocking recent income streams with urgency. Cisco is uniquely positioned that will help you transfer with agility, safety, and confidence. Our co-innovation mannequin—which includes working carefully with builders, OEMs, vertical software program firms, and {industry} specialists—delivers richer, extra adaptable options tailor-made to your objectives. From developer portals to consent-driven APIs, we provide the instruments and ecosystem help that will help you innovate, differentiate, and lead.

Be part of us now, to form the subsequent wave of cell IoT innovation collectively!

 

Discover out extra about

 

Discover out extra about Cisco IoT options
Cisco IoT Management Middle
Cisco Supplier Mobility Assets web page
Frost & Sullivan Touchdown Web page

 

 

Share:

ios – ViewThatFits inflicting crash


Whereas testing on simulators, I’ve hit a problem the place ViewThatFits seems to have a threading challenge. This will trigger warnings or a crash.

The surroundings is the next:

  • Xcode 26.0 beta 5
  • Swift 6 with strict concurrency checking
  • minimal deployment goal iOS 17.0
  • debug construct configuration
  • iPhone 16 simulator operating iOS 18.5 (causes crash)
  • iPhone 15 simulator operating iOS 17.5 (causes warnings)

The next code can be utilized to breed the issue when operating with the next textual content dimension:

Screenshot

struct ContentView: View {
    let item1 = "The fast brown fox jumps over the lazy canine."
    let item2 = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua."
    @State non-public var isExpanded = false

    enum LayoutHint {
        case regular
        case spaceIsTight
        case scrolling
    }

    non-public func itemList(gadgets: [String], trace: LayoutHint) -> some View {
        VStack(alignment: .main, spacing: 9) {
            ForEach(Array(gadgets.enumerated()), id: .offset) { _, textual content in
                Textual content(textual content)
                    .font(.footnote)
            }
        }
        .body(maxWidth: .infinity, alignment: .main)
        .fixedSize(horizontal: false, vertical: true)
    }

    non-public func expandedExplanation(gadgets: [String]) -> some View {
        ViewThatFits(in: .vertical) {

            // If any of those 3 views are commented out, it really works
            itemList(gadgets: gadgets, trace: .regular)
            itemList(gadgets: gadgets, trace: .spaceIsTight)
            ScrollView {
                itemList(gadgets: gadgets, trace: .scrolling)
            }
        }
    }

    non-public var chevronUp: some View {
        Picture(systemName: "chevron.compact.up")
            .imageScale(.medium)
            .font(.title)
            .fontWeight(.semibold)
            .foregroundStyle(.grey)

            // If vertical padding is added, it really works
            // .padding(.vertical, 10)
            .body(maxWidth: .infinity)
    }

    non-public var expandedContent: some View {
        VStack(alignment: .main, spacing: 20) {
            expandedExplanation(gadgets: [item1, item2])

            // If chevronUp is commented out, it really works
            chevronUp
        }
        .padding()
    }

    non-public var collapsedContent: some View {
        Textual content("Present expanded")
            .foregroundStyle(Shade(.hyperlink))
            .padding()
            .body(maxWidth: .infinity)
    }

    var physique: some View {
        ZStack(alignment: .high) {
            if isExpanded {
                expandedContent
            } else {
                collapsedContent
            }
        }
        .clipped()
        .contentShape(.rect)
        .background {
            UnevenRoundedRectangle(
                topLeadingRadius: 0,
                bottomLeadingRadius: 20,
                bottomTrailingRadius: 20,
                topTrailingRadius: 0
            )
            .fill(Shade(.systemGray6))
            .ignoresSafeArea(edges: .high)
        }
        .onTapGesture {
            withAnimation(.easeInOut(period: 0.25)) {
                isExpanded.toggle()
            }
        }
        .body(maxHeight: .infinity, alignment: .high)
    }
}

Right here is the way it ought to look when the highest part is expanded (notice the textual content dimension):

Screenshot

The crash that occurs when operating on the iPhone 16 simulator with iOS 18.5 is as follows:

#0  0x0000000102506e28 in _dispatch_assert_queue_fail ()
#1  0x000000010253c388 in dispatch_assert_queue$V2.chilly.1 ()
#2  0x0000000102506db0 in dispatch_assert_queue ()
#3  0x0000000249df246c in swift_task_isCurrentExecutorWithFlagsImpl ()
#4  0x0000000102e80504 in closure #1 in closure #1 in ContentView.itemList(gadgets:trace:) ()
#5  0x0000000102e807d4 in thunk for @escaping @callee_guaranteed (@unowned Int, @assured String) -> (@owned Textual content) ()
#6  0x00000001d4c8cd24 in closure #1 () -> τ_0_2 in SwiftUI.ForEachState.merchandise(at: τ_0_0.Index, offset: Swift.Int) -> SwiftUI.ForEachState.Merchandise ()
#7  0x00000001d4c94dac in partial apply forwarder for closure #1 () -> τ_0_2 in SwiftUI.ForEachState.merchandise(at: τ_0_0.Index, offset: Swift.Int) -> SwiftUI.ForEachState.Merchandise ()
#8  0x00000001d4a7004c in closure #1 (Swift.UnsafeMutablePointer>) throws -> τ_0_0 in SwiftUI._withObservation(do: () throws -> τ_0_0) throws -> (worth: τ_0_0, accessList: Swift.Optionally available) ()
#9  0x00000001d473a6d8 in partial apply forwarder for closure #1 (Swift.UnsafeMutablePointer>) throws -> τ_0_0 in SwiftUI._withObservation(do: () throws -> τ_0_0) throws -> (worth: τ_0_0, accessList: Swift.Optionally available) ()
#10 0x00000001d48c9288 in withUnsafePointer ()
#11 0x00000001d4c8c160 in merchandise ()
#12 0x00000001d4c8e24c in forEachItem ()
#13 0x00000001d4c94b38 in perform signature specialization  of SwiftUI.ForEachList.applyNodes(from: inout Swift.Int, model: SwiftUI._ViewList_IteratorStyle, checklist: Swift.Optionally available>, rework: inout SwiftUI._ViewList_SublistTransform, to: (inout Swift.Int, SwiftUI._ViewList_IteratorStyle, SwiftUI._ViewList_Node, inout SwiftUI._ViewList_SublistTransform) -> Swift.Bool) -> Swift.Bool ()
#14 0x00000001d4c92ec8 in protocol witness for SwiftUI.ViewList.applyNodes(from: inout Swift.Int, model: SwiftUI._ViewList_IteratorStyle, checklist: Swift.Optionally available>, rework: inout SwiftUI._ViewList_SublistTransform, to: (inout Swift.Int, SwiftUI._ViewList_IteratorStyle, SwiftUI._ViewList_Node, inout SwiftUI._ViewList_SublistTransform) -> Swift.Bool) -> Swift.Bool in conformance SwiftUI.ForEachList : SwiftUI.ViewList in SwiftUI ()
#15 0x00000001d49a8374 in applySublists ()
#16 0x00000001d49a501c in applySublists ()
#17 0x00000001d460d09c in generic specialization  of SwiftUI.DynamicContainerInfo.updateItems(disableTransitions: Swift.Bool) -> (modified: Swift.Bool, hasDepth: Swift.Bool) ()
#18 0x00000001d460c258 in generic specialization  of SwiftUI.DynamicContainerInfo.updateValue() -> () ()
#19 0x00000001d462b764 in generic specialization > of implicit closure #1 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer) -> AttributeGraph.Attribute in AttributeGraph.Attribute.init(τ_1_0) -> AttributeGraph.Attribute ()
#20 0x00000001c00ca438 in AG::Graph::UpdateStack::replace ()
#21 0x00000001c00cac04 in AG::Graph::update_attribute ()
#22 0x00000001c00d24dc in AG::Graph::input_value_ref_slow ()
#23 0x00000001c00e8054 in AGGraphGetValue ()
#24 0x00000001d496010c in SwiftUI.DynamicLayoutComputer.containerInfo.getter : Swift.Optionally available ()
#25 0x00000001d4960248 in updateValue ()
#26 0x00000001d4947d58 in partial apply forwarder for implicit closure #1 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer) -> AttributeGraph.Attribute in AttributeGraph.Attribute.init(τ_1_0) -> AttributeGraph.Attribute ()
#27 0x00000001c00ca438 in AG::Graph::UpdateStack::replace ()
#28 0x00000001c00cac04 in AG::Graph::update_attribute ()
#29 0x00000001c00d22f0 in AG::Graph::input_value_ref_slow ()
#30 0x00000001c00e7e14 in AGGraphGetInputValue ()
#31 0x00000001d47d1904 in dimension ()
#32 0x00000001d4aab49c in sizeThatFits ()
#33 0x00000001d4aabe74 in protocol witness for SwiftUI.UnaryLayout.sizeThatFits(in: SwiftUI._ProposedSize, context: SwiftUI.SizeAndSpacingContext, little one: SwiftUI.LayoutProxy) -> __C.CGSize in conformance SwiftUI._FlexFrameLayout : SwiftUI.UnaryLayout in SwiftUI ()
#34 0x00000001d4934fcc in merged SwiftUI.UnaryLayoutEngine.sizeThatFits(SwiftUI._ProposedSize) -> __C.CGSize ()
#35 0x00000001d4934cf4 in protocol witness for SwiftUI.LayoutEngine.sizeThatFits(SwiftUI._ProposedSize) -> __C.CGSize in conformance SwiftUI.UnaryLayoutEngine : SwiftUI.LayoutEngine in SwiftUI ()
#36 0x00000001d4b700ac in sizeThatFits ()
#37 0x00000001d47d1970 in dimension ()
#38 0x00000001d4664b3c in protocol witness for SwiftUI.UnaryLayout.sizeThatFits(in: SwiftUI._ProposedSize, context: SwiftUI.SizeAndSpacingContext, little one: SwiftUI.LayoutProxy) -> __C.CGSize in conformance SwiftUI._FixedSizeLayout : SwiftUI.UnaryLayout in SwiftUI ()
#39 0x00000001d4934fcc in merged SwiftUI.UnaryLayoutEngine.sizeThatFits(SwiftUI._ProposedSize) -> __C.CGSize ()
#40 0x00000001d4934cf4 in protocol witness for SwiftUI.LayoutEngine.sizeThatFits(SwiftUI._ProposedSize) -> __C.CGSize in conformance SwiftUI.UnaryLayoutEngine : SwiftUI.LayoutEngine in SwiftUI ()
#41 0x00000001d4b700ac in sizeThatFits ()
#42 0x00000001d4b6ee60 in sizeThatFits ()
#43 0x00000001d3b4e35c in closure #1 (SwiftUI._ViewOutputs, Swift.Bool) -> Swift.Bool in closure #1 () -> () in SwiftUI.SizeFittingLayoutComputer.Engine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#44 0x00000001d3b4cfec in closure #1 (SwiftUI._ViewList_Sublist) -> Swift.Bool in SwiftUI.SizeFittingState.applyChildren(selectLast: Swift.Bool, to: (SwiftUI._ViewOutputs, Swift.Bool) -> Swift.Bool) -> () ()
#45 0x00000001d49a7640 in applySublists ()
#46 0x00000001d49b09e8 in merged partial apply forwarder for closure #1 (inout Swift.Int, SwiftUI._ViewList_IteratorStyle, SwiftUI._ViewList_Node, inout SwiftUI._ViewList_SublistTransform) -> Swift.Bool in SwiftUI._ViewList_Node.applySublists(from: inout Swift.Int, model: SwiftUI._ViewList_IteratorStyle, rework: inout SwiftUI._ViewList_SublistTransform, to: (SwiftUI._ViewList_Sublist) -> Swift.Bool) -> Swift.Bool ()
#47 0x00000001d49abddc in applyNodes ()
#48 0x00000001d49a8374 in applySublists ()
#49 0x00000001d49a501c in applySublists ()
#50 0x00000001d3b4c190 in applyChildren ()
#51 0x00000001d3b4e144 in closure #1 () -> () in SwiftUI.SizeFittingLayoutComputer.Engine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#52 0x00000001c00cafb0 in AG::Graph::with_update ()
#53 0x00000001d3b4e524 in protocol witness for SwiftUI.LayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available in conformance SwiftUI.SizeFittingLayoutComputer.Engine : SwiftUI.LayoutEngine in SwiftUI ()
#54 0x00000001d4b70194 in explicitAlignment ()
#55 0x00000001d4c16cfc in perform signature specialization  Swift.Optionally available in SwiftUI.StackLayout.(UnmanagedImplementation in _00690F480F8D293143B214DBE6D72CD0).placeChildren(in: SwiftUI.ProposedViewSize) -> (), Argument Varieties : [Swift.Optional]> of SwiftUI.StackLayout.UnmanagedImplementation.sizeChildrenGenerallyWithConcreteMajorProposal(in: SwiftUI.ProposedViewSize, minorProposalForChild: (SwiftUI.StackLayout.Little one) -> Swift.Optionally available) -> () ()
#56 0x00000001d4c1779c in perform signature specialization  Swift.Optionally available in SwiftUI.StackLayout.(UnmanagedImplementation in _00690F480F8D293143B214DBE6D72CD0).placeChildren(in: SwiftUI.ProposedViewSize) -> (), Argument Varieties : [Swift.Optional]> of SwiftUI.StackLayout.UnmanagedImplementation.placeChildren1(in: SwiftUI.ProposedViewSize, minorProposalForChild: (SwiftUI.StackLayout.Little one) -> Swift.Optionally available) -> () ()
#57 0x00000001d4c15fb4 in placeChildren ()
#58 0x00000001d4c15c84 in explicitAlignment ()
#59 0x00000001d4c14664 in explicitAlignment ()
#60 0x00000001d47a46a8 in merged protocol witness for SwiftUI.Format.explicitAlignment(of: SwiftUI.HorizontalAlignment, in: __C.CGRect, proposal: SwiftUI.ProposedViewSize, subviews: SwiftUI.LayoutSubviews, cache: inout τ_0_0.Cache) -> Swift.Optionally available in conformance SwiftUI._VStackLayout : SwiftUI.Format in SwiftUI ()
#61 0x00000001d496875c in closure #1 (Swift.UnsafeMutablePointer) -> Swift.Optionally available in closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#62 0x00000001d49684c4 in closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#63 0x00000001d496ab24 in partial apply forwarder for closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#64 0x00000001d48c9288 in withUnsafePointer ()
#65 0x00000001d496837c in explicitAlignment ()
#66 0x00000001d4968df0 in protocol witness for SwiftUI.LayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available in conformance SwiftUI.ViewLayoutEngine : SwiftUI.LayoutEngine in SwiftUI ()
#67 0x00000001d4b70194 in explicitAlignment ()
#68 0x00000001d47d26f0 in explicitAlignment ()
#69 0x00000001d4934c68 in explicitAlignment ()
#70 0x00000001d4934d08 in protocol witness for SwiftUI.LayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available in conformance SwiftUI.UnaryLayoutEngine : SwiftUI.LayoutEngine in SwiftUI ()
#71 0x00000001d4b70194 in explicitAlignment ()
#72 0x00000001d4663040 in SwiftUI.ViewDimensions.subscript.getter : (SwiftUI.AlignmentKey) -> CoreGraphics.CGFloat ()
#73 0x00000001d4569c74 in perform signature specialization  __C.CGPoint in SwiftUI._ZStackLayout.placeSubviews(in: __C.CGRect, proposal: SwiftUI.ProposedViewSize, subviews: SwiftUI.LayoutSubviews, cache: inout ()) -> (), Argument Varieties : [SwiftUI._ZStackLayout]> of generic specialization , SwiftUI.ViewDimensions>, __C.CGPoint> of Swift.Sequence.cut back(τ_1_0, (τ_1_0, τ_0_0.Aspect) throws -> τ_1_0) throws -> τ_1_0 ()
#74 0x00000001d458d844 in perform signature specialization  of SwiftUI._ZStackLayout.placeSubviews(in: __C.CGRect, proposal: SwiftUI.ProposedViewSize, subviews: SwiftUI.LayoutSubviews, cache: inout ()) -> () ()
#75 0x00000001d4967e0c in closure #1 (Swift.UnsafeMutablePointer) -> () in SwiftUI.ViewLayoutEngine.childGeometries(at: SwiftUI.ViewSize, origin: __C.CGPoint) -> Swift.Array ()
#76 0x00000001d4967bb8 in childGeometries ()
#77 0x00000001d4968aa4 in static SwiftUI.ViewLayoutEngine.defaultAlignment(_: SwiftUI.AlignmentKey, dimension: SwiftUI.ViewSize, information: Swift.UnsafeMutableRawPointer) -> Swift.Optionally available ()
#78 0x00000001d4968e10 in protocol witness for static SwiftUI.DefaultAlignmentFunction.defaultAlignment(_: SwiftUI.AlignmentKey, dimension: SwiftUI.ViewSize, information: Swift.UnsafeMutableRawPointer) -> Swift.Optionally available in conformance SwiftUI.ViewLayoutEngine : SwiftUI.DefaultAlignmentFunction in SwiftUI ()
#79 0x00000001d495287c in merged protocol witness for SwiftUI.Format.explicitAlignment(of: SwiftUI.HorizontalAlignment, in: __C.CGRect, proposal: SwiftUI.ProposedViewSize, subviews: SwiftUI.LayoutSubviews, cache: inout τ_0_0.Cache) -> Swift.Optionally available in conformance SwiftUI._ZStackLayout : SwiftUI.Format in SwiftUI ()
#80 0x00000001d496875c in closure #1 (Swift.UnsafeMutablePointer) -> Swift.Optionally available in closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#81 0x00000001d49684c4 in closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#82 0x00000001d496ab24 in partial apply forwarder for closure #1 (Swift.UnsafeMutablePointer>) -> Swift.Optionally available in SwiftUI.ViewLayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available ()
#83 0x00000001d48c9288 in withUnsafePointer ()
#84 0x00000001d496837c in explicitAlignment ()
#85 0x00000001d4968df0 in protocol witness for SwiftUI.LayoutEngine.explicitAlignment(_: SwiftUI.AlignmentKey, at: SwiftUI.ViewSize) -> Swift.Optionally available in conformance SwiftUI.ViewLayoutEngine : SwiftUI.LayoutEngine in SwiftUI ()
#86 0x00000001d4b70194 in explicitAlignment ()
#87 0x00000001d4663040 in SwiftUI.ViewDimensions.subscript.getter : (SwiftUI.AlignmentKey) -> CoreGraphics.CGFloat ()
#88 0x00000001d4aaa9f0 in generic specialization  of SwiftUI.FrameLayoutCommon.commonPlacement(of: SwiftUI.LayoutProxy, in: SwiftUI.PlacementContext, childProposal: SwiftUI._ProposedSize) -> SwiftUI._Placement ()
#89 0x00000001d49336cc in generic specialization  of SwiftUI.UnaryLayoutEngine.childPlacement(at: SwiftUI.ViewSize) -> SwiftUI._Placement ()
#90 0x00000001d4947910 in partial apply forwarder for generic specialization  of closure #1 (inout SwiftUI.UnaryLayoutEngine) -> SwiftUI._Placement in SwiftUI.UnaryChildGeometry.worth.getter : SwiftUI.ViewGeometry ()
#91 0x00000001d48c33f0 in partial apply forwarder for generic specialization , SwiftUI._Placement> of closure #1 (inout τ_0_0) -> τ_0_1 in SwiftUI.LayoutComputer.withMutableEngine(kind: τ_0_0.Kind, do: (inout τ_0_0) -> τ_0_1) -> τ_0_1 ()
#92 0x00000001d4b70d10 in partial apply forwarder for closure #1 (Swift.UnsafeMutablePointer) -> τ_1_1 in SwiftUI.LayoutEngineBox.mutateEngine(as: τ_1_0.Kind, do: (inout τ_1_0) -> τ_1_1) -> τ_1_1 ()
#93 0x00000001d48c9288 in withUnsafePointer ()
#94 0x00000001d4b6fe08 in mutateEngine ()
#95 0x00000001d49318d4 in generic specialization  of SwiftUI.UnaryChildGeometry.worth.getter : SwiftUI.ViewGeometry ()
#96 0x00000001d49413a4 in merged generic specialization > of implicit closure #1 (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 () -> (Swift.UnsafeMutableRawPointer, __C.AGAttribute) -> () in closure #1 (Swift.UnsafePointer) -> AttributeGraph.Attribute in AttributeGraph.Attribute.init(τ_1_0) -> AttributeGraph.Attribute ()
#97 0x00000001c00ca438 in AG::Graph::UpdateStack::replace ()
#98 0x00000001c00cac04 in AG::Graph::update_attribute ()
#99 0x00000001c00d80b4 in AG::Subgraph::replace ()
#100    0x00000001d4d6f118 in SwiftUI.ViewGraph.updateOutputs(async: Swift.Bool) -> () ()
#101    0x00000001d4d6f618 in closure #2 () -> () in SwiftUI.ViewGraph.updateOutputsAsync(at: SwiftUI.Time) -> Swift.Optionally available ()
#102    0x00000001c00e70f8 in AGGraphWithMainThreadHandler ()
#103    0x00000001d4d69a90 in updateOutputsAsync ()
#104    0x00000001d4d643c4 in renderAsync ()
#105    0x00000001d3b436d4 in displayLinkTimer ()
#106    0x00000001d3b43eb4 in SwiftUI.DisplayLink.displayLinkTimer(__C.CADisplayLink) -> () ()
#107    0x00000001d3b444c0 in @objc SwiftUI.DisplayLink.displayLinkTimer(__C.CADisplayLink) -> () ()
#108    0x000000018b3e2e44 in CA::Show::DisplayLinkItem::dispatch_ ()
#109    0x000000018b3def44 in CA::Show::DisplayLink::dispatch_items ()
#110    0x000000018b4e7a40 in display_timer_callback ()
#111    0x00000001803ed914 in __CFMachPortPerform ()
#112    0x0000000180429a6c in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ ()
#113    0x0000000180429084 in __CFRunLoopDoSource1 ()
#114    0x000000018042397c in __CFRunLoopRun ()
#115    0x0000000180422cec in CFRunLoopRunSpecific ()
#116    0x0000000180f0e38c in -[NSRunLoop(NSRunLoop) runMode:beforeDate:] ()
#117    0x0000000180f0e55c in -[NSRunLoop(NSRunLoop) run] ()
#118    0x00000001d3b45830 in perform signature specialization  of static SwiftUI.DisplayLink.asyncThread(arg: Swift.Optionally available) -> () ()
#119    0x00000001d3b44520 in @objc static SwiftUI.DisplayLink.asyncThread(arg: Swift.Optionally available) -> () ()
#120    0x0000000180f35148 in __NSThread__start__ ()
#121    0x0000000102cee5f0 in _pthread_start ()

The warning that’s seen when operating on the iPhone 15 simulator with iOS 17.5 is as follows:

warning: information race detected: @MainActor perform at StackOverflow/ContentView.swift:52 was not referred to as on the principle thread

Line 52 is the ForEach contained in the perform itemList.

It appears to me that this have to be a SwiftUI bug, particularly since it is just underneath sure circumstances. For instance, the problem will not be seen when any of the next modifications are made:

  • a distinct textual content dimension is used
  • the second textual content merchandise is shorter (1 line as a substitute of three)
  • any 1 of the three views inside ViewthatFits is commented out
  • vertical padding is added to the chevron
  • the chevron is faraway from view.

These modifications should not fixing the issue, they’re simply stopping it from occurring for the setup described. So I would like a extra dependable repair. Specifically, I’m questioning if there could be a method to stop the issue with some sort of annotation or actor directive within the code?

How can the code be fastened in order that the problems should not seen when operating as described?