Giter VIP home page Giter VIP logo

Comments (3)

aiKrice avatar aiKrice commented on September 23, 2024 1

@ruofeilyu My opinion on your usecase is that it's very special and maybe you are going wrong on either:

  • Product side: Is the UX of your product is really optimized
  • Tech side: maybe consider going custom rather than use a lib if this part is a core feature with such a request

from parchment.

rechsteiner avatar rechsteiner commented on September 23, 2024

Hi @ruofeilyu! What's the motivation for disabling pre-loading? If you have some operation you only want to be called when showing the view I would recommend moving it into viewWillAppear/viewDidAppear. The problem with removing preloading is that you could potentially allocate a lot of instances, and they will all be allocated while scrolling. Imagine if a user is swiping slightly back-and-forth on the current page. Each time you hit the edge (which could happen a lot), you would need to allocate a whole new view controller.

from parchment.

ruofeilyu avatar ruofeilyu commented on September 23, 2024

My case is that I use parchment as a navigation tab, so you can think its tab's tab. I have already cache every controller so it will not be recreated,

My implementation is that I need to add my swiftUI in each viewcontroller viewdidLoad (the reason that I don't use parchment swiftUI is that it will reset my previous view if I have multiple page because every page is a struct, I don't want to reset every page, i wanna to maintain its original position, same reason if you switch the tab, you don't want your previous tab got reset), Ok, now my networking got triggered at each swiftUI onTask(), this will got triggered immediately on viewDidLoad, so here is that problem,I don't want to trigger networking if this page is not shown yet and I know I can trigger networking in viewWillAppear, but it's kinda break my design, I want my swiftUI doing everything rather than delegate some action to its wrapper view controller.

So that's the reason I want to disable preloading. I know it's a little complicated case....

from parchment.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.