Commit 7e1b17fb authored by Soomin Lee's avatar Soomin Lee

MediaViewController: MediaDataSource: Remove unnecessary init

parent 15ef3e63
......@@ -14,12 +14,12 @@
public class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
private let cellPadding: CGFloat = 5.0
private var services: Services!
private var services: Services
public weak var delegate: UICollectionViewDelegate?
public convenience init(services: Services) {
self.init()
init(services: Services) {
self.services = services
super.init()
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
......
......@@ -19,7 +19,7 @@ import Foundation
}
public class VLCMediaViewController: UICollectionViewController, UISearchResultsUpdating, UISearchControllerDelegate {
private var services: Services!
private var services: Services
private var mediaDatasourceAndDelegate: MediaDataSourceAndDelegate?
private var searchController: UISearchController?
private let searchDataSource = VLCLibrarySearchDisplayDataSource()
......@@ -40,16 +40,12 @@ public class VLCMediaViewController: UICollectionViewController, UISearchResults
return emptyView
}()
public convenience init(services: Services) {
self.init(collectionViewLayout: UICollectionViewFlowLayout())
init(services: Services) {
self.services = services
super.init(collectionViewLayout: UICollectionViewFlowLayout())
NotificationCenter.default.addObserver(self, selector: #selector(themeDidChange), name: .VLCThemeDidChangeNotification, object: nil)
}
public override init(collectionViewLayout layout: UICollectionViewLayout) {
super.init(collectionViewLayout: layout)
}
@available(*, unavailable)
required public init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
......
......@@ -16,13 +16,13 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
private var childCoordinators: [NSObject] = []
private var tabBarController: UITabBarController
private var services: Services!
private var services: Services
private let displayController = VLCPlayerDisplayController()
public init(tabBarController: UITabBarController, services: Services) {
self.tabBarController = tabBarController
super.init()
self.services = services
super.init()
NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: .VLCThemeDidChangeNotification, object: nil)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment