Comments (3)
@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.
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.
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)
- Navigation bar disappear when presented in a sheet. HOT 3
- About swiftUI PageView content scrollview automatically slides to the top HOT 2
- Menu item error when Archive HOT 3
- Privacy Manifest HOT 2
- Propagate .options changes when SwiftUI View is updated HOT 3
- Regarding the problem that PageContentView will be reloaded when you slide it left or right. HOT 4
- Incorrect index when tab menu or swipe
- PrivacyInfo not in podspec
- Intercept PagingMenuItem click and scroll to index manually
- Why collectionView.window is nil if the pagingController is not visible ? HOT 2
- how can I set font and selected font in swiftui? HOT 1
- for the swiftUI page view, when data changes, the UI can't be changed inside each page
- Add Border on all four sides of Menu Container HOT 1
- not visible selection of paging item (if its at the end of list) HOT 2
- In SwiftUI,how to use willScroll, i want got index
- Memory leak on "ScrollViewDidScroll" function
- viewWillDispear is called in unexpected situations
- SwiftUI every time I click to switch, a new view will be generated. HOT 2
- For the below code, Where I can give Tab bar items and also last scrolling view is get replicated twice.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from parchment.