Check out example codes for "DispatchGroup example swift". It will help you in understanding the concepts better.

Code Example 1

class DispatchGroupExample: UIViewController {
  private let dispatchGroup = DispatchGroup()
  
  override func viewDidLoad() {
    super.viewDidLoad()
    
    fetchData(url: xxx)
    fetchData(url: yyy)
    
    // 3: notify job done
    dispatchGroup.notify(queue: .main) {
      self.goToNext()
    }
  }
  
  private func fetchData(url: URL) {
    // 1: enter group
    dispatchGroup.enter()
    
    URLSession.shared.dataTask(with: url) { 
      [weak self] (data, urlResponse, error) in
      	// parse data
      	...
      
      	// 2: leave group
      	self?.dispatchGroup.leave()
    }
  }
}

Code Example 2

vc.setViewControllers([standingsViewController], animated: true)

Learn ReactJs, React Native from akashmittal.com