I’m trying to develop an app that uses 3 different view controllers on the first tab. I have 3 options: 1 - embed the view controllers in an uipageviewcontroller 2 - embed the view controllers in a uiscrollview 3 - use containers controlled by a uisegmentedcontroller - with hidden property true or false… Each of these viewcontrollers are using collectionviews to present photos downloaded asynch from a remote server. Using 3, the photos from all view controllers, loads at the same time, so, this isn’t a good solution I think. Which one is the best solution to choose in this scenario?
相关问题
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
- SwiftUI: UIImage (QRCode) does not load after call
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- Using if let syntax in switch statement
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- Enum with associated value conforming to CaseItera
- Swift - hide pickerView after value selected
- Is there a Github markdown language identifier for
If you're worried about downloading large images simultaneously then only begin the download process in
viewDidAppear
. Unless the user opens one of your view controllers the download process will not kick in.If you're worried about multiple view controllers sitting in memory then you should design them well. Using a
UITableViewController
or aUICollectionView
will help you keep your memory usage low by reusing views.In my opinion you should pick a solution according to your UI design and simply build your code efficiently so you won't have to worry about large downloads or running out of memory
You didn't mention a tab bar controller, which is another viable option. (Or maybe that's what you meant instead of UISegmentedControl?)
Which is best depends on the UX you want for your app more than anything.
I would put the segmented control at the bottom of the list. It's a non-standard UI, and will also require a lot of custom work from you.