Comments (9)
Hey @surayashivji good question. When ViewController is instantiated ViewDidLoad method is called. Check FeedVC. I'm calling fetchItemsList method to download items. You can call the method to download data here.
Same is true for ViewDidAppear. After selecting tab ViewControllers appears and starts to download images. However relying on ViewDidAppear method is not a good idea since we are instantiating ViewControllers programmatically. I will suggest you to call method to load data once viewControllers are instantiated and added to collectionview. Check "MainViewController" line 85.
from youtube-ios.
P.S. Don't hesitate to ask any questions. Will be happy to answer
from youtube-ios.
Hi! Thanks for the great information.
If I need to load more data every time the tab is selected (ie load more posts from the database, or change the content depending on what table view row was selected), how should I go about loading the data?
Thank you!!
from youtube-ios.
it that case you should keep strong pointer to that viewController and directly call a method. Like this way.
var vc: MainViewController()
override viewDidLoad{
super.viewDidLoad()
let viewController = self.storyboard?. instantiateViewController(withIdentifier: "name") as! MainViewController
// you should point to this vc
self.vc = viewController
}
//later if you want to call a method to get data
MainViewController.fetchData()
// where fetchData is a method in that ViewController to download something
from youtube-ios.
Hi aslanyanhaik! I apologize for my late follow up-- happy new year!
I tried keeping the strong pointer to my ProfileViewController (the view controller I'm trying to load data in each time its tab is selected), but haven't been able to get it working.
I'm trying to load new data each time the last tab, ProfileViewControler.swift
, is selected.
For reference, I'm working on this project: https://github.com/surayashivji/PotterPics
Any idea how to integrate this implementation?
All of your help is much appreciated! :)
from youtube-ios.
Happy new year :) Let me check the source code
from youtube-ios.
Hey Suraya, seems I can't run the app. Do you want to do a screencast? So we can together go through all issues
from youtube-ios.
Oh how odd-- what's the error that you're getting? Sure that'd be awesome!
from youtube-ios.
there are some APIs deprecated in iOS 10, and also can't login with Facebook
my skype id: aslanyanhaik
from youtube-ios.
Related Issues (20)
- errors building with carthage... HOT 1
- Programmatically Changing Tab HOT 6
- Auto layouts for view controllers are Not Working HOT 2
- Video Player Covers tab bar items when minimized
- Domain where images and other information is pulled from is down HOT 4
- View are only working in 4.7 inch devices. Support other screen size. HOT 5
- REACT NATIVE BRIDGE HELP.
- Navigation Right bar button items not hiding HOT 1
- Auto-layout issue of trending page on 4 inch screens
- swift4
- Layout
- Minimize view can not margin bottom
- [Question] viewWillAppear not working when i selected tab? HOT 1
- Can we put text below icon of each tabBar? HOT 1
- How to change Navigation Bar to Tab Bar?
- Signing Error
- AVPlayerLayer frame doesn't fit into UIView for video player HOT 1
- Fullscreen HOT 2
- Can we make collection view in TabBar to be scrolled if there are many items in TabBar? HOT 1
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 youtube-ios.