Commit 0a1962bc authored by Soomin Lee's avatar Soomin Lee

Remove unnecessary public & open

parent bc8a2d62
......@@ -15,12 +15,12 @@ extension Notification.Name {
static let VLCAllVideosDidChangeNotification = Notification.Name("kAllVideosDidChangeNotification")
}
public class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout {
private let cellPadding: CGFloat = 5.0
private var services: Services
private var mediaType: VLCMediaType
public weak var delegate: UICollectionViewDelegate?
weak var delegate: UICollectionViewDelegate?
@available(*, unavailable)
override init() {
......@@ -33,11 +33,11 @@ public class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, U
super.init()
}
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return Int(services.mediaDataSource.numberOfFiles(subcategory: mediaType.subcategory))
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if let playlistCell = collectionView.dequeueReusableCell(withReuseIdentifier: VLCPlaylistCollectionViewCell.cellIdentifier(), for: indexPath) as? VLCPlaylistCollectionViewCell {
if let mediaObject = services.mediaDataSource.object(at: indexPath.row, subcategory: mediaType.subcategory) as? NSManagedObject {
playlistCell.mediaObject = mediaObject
......@@ -47,11 +47,11 @@ public class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, U
return UICollectionViewCell()
}
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
delegate?.collectionView!(collectionView, didSelectItemAt: indexPath)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
let numberOfCells: CGFloat = collectionView.traitCollection.horizontalSizeClass == .regular ? 3.0 : 2.0
let aspectRatio: CGFloat = 10.0 / 16.0
......@@ -65,15 +65,15 @@ public class MediaDataSourceAndDelegate: NSObject, UICollectionViewDataSource, U
return CGSize(width: cellWidth, height: cellWidth * aspectRatio)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, insetForSectionAt section: Int) -> UIEdgeInsets {
return UIEdgeInsets(top: cellPadding, left: cellPadding, bottom: cellPadding, right: cellPadding)
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumLineSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, minimumInteritemSpacingForSectionAt section: Int) -> CGFloat {
return cellPadding
}
}
......@@ -16,29 +16,29 @@ extension Notification.Name {
static let VLCThemeDidChangeNotification = Notification.Name("themeDidChangeNotfication")
}
@objcMembers public class ColorPalette: NSObject {
public let isDark: Bool
public let name: String
public let statusBarStyle: UIStatusBarStyle
public let navigationbarColor: UIColor
public let navigationbarTextColor: UIColor
public let background: UIColor
public let cellBackgroundA: UIColor
public let cellBackgroundB: UIColor
public let cellDetailTextColor: UIColor
public let cellTextColor: UIColor
public let lightTextColor: UIColor
public let sectionHeaderTextColor: UIColor
public let sectionHeaderTintColor: UIColor
public let settingsBackground: UIColor
public let settingsCellBackground: UIColor
public let settingsSeparatorColor: UIColor
public let mediaCategorySeparatorColor: UIColor
public let tabBarColor: UIColor
public let orangeUI: UIColor
public init(isDark: Bool,
@objcMembers class ColorPalette: NSObject {
let isDark: Bool
let name: String
let statusBarStyle: UIStatusBarStyle
let navigationbarColor: UIColor
let navigationbarTextColor: UIColor
let background: UIColor
let cellBackgroundA: UIColor
let cellBackgroundB: UIColor
let cellDetailTextColor: UIColor
let cellTextColor: UIColor
let lightTextColor: UIColor
let sectionHeaderTextColor: UIColor
let sectionHeaderTintColor: UIColor
let settingsBackground: UIColor
let settingsCellBackground: UIColor
let settingsSeparatorColor: UIColor
let mediaCategorySeparatorColor: UIColor
let tabBarColor: UIColor
let orangeUI: UIColor
init(isDark: Bool,
name: String,
statusBarStyle: UIStatusBarStyle,
navigationbarColor: UIColor,
......@@ -79,10 +79,10 @@ extension Notification.Name {
}
}
@objcMembers public class PresentationTheme: NSObject {
@objcMembers class PresentationTheme: NSObject {
public static let brightTheme = PresentationTheme(colors: brightPalette)
public static let darkTheme = PresentationTheme(colors: darkPalette)
static let brightTheme = PresentationTheme(colors: brightPalette)
static let darkTheme = PresentationTheme(colors: darkPalette)
static var current: PresentationTheme = {
let isDarkTheme = UserDefaults.standard.bool(forKey: kVLCSettingAppTheme)
......@@ -94,17 +94,17 @@ extension Notification.Name {
}
}
public init(colors: ColorPalette) {
init(colors: ColorPalette) {
self.colors = colors
super.init()
}
public let colors: ColorPalette
let colors: ColorPalette
}
@objc public extension UIColor {
@objc extension UIColor {
public convenience init(_ rgbValue: UInt32, _ alpha: CGFloat = 1.0) {
convenience init(_ rgbValue: UInt32, _ alpha: CGFloat = 1.0) {
let r = CGFloat((rgbValue & 0xFF0000) >> 16) / 255.0
let g = CGFloat((rgbValue & 0xFF00) >> 8) / 255.0
let b = CGFloat(rgbValue & 0xFF) / 255.0
......
......@@ -17,13 +17,13 @@ class VLCLabelCell: UICollectionViewCell {
@IBOutlet weak var iconLabel: UILabel!
}
public enum SwipeDirection {
enum SwipeDirection {
case left
case right
case none
}
public struct IndicatorInfo {
struct IndicatorInfo {
var title: String?
var accessibilityLabel: String?
......@@ -34,7 +34,7 @@ public struct IndicatorInfo {
}
}
public enum PagerScroll {
enum PagerScroll {
case no
case yes
case onlyIfOutOfScreen
......@@ -131,7 +131,7 @@ class BaseButtonBarPagerTabStripViewController<ButtonBarCellType: UICollectionVi
buttonBarView.selectItem(at: IndexPath(item: currentIndex, section: 0), animated: false, scrollPosition: [])
}
// MARK: - Public Methods
// MARK: - Methods
override func reloadPagerTabStripView() {
super.reloadPagerTabStripView()
......
......@@ -12,7 +12,7 @@
import Foundation
open class ButtonBarView: UICollectionView {
class ButtonBarView: UICollectionView {
var selectedBar: UIView!
var separatorView: UIView!
......@@ -23,7 +23,7 @@ open class ButtonBarView: UICollectionView {
var selectedIndex = 0
@available(*, unavailable, message: "use init(frame:)")
required public init?(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError()
}
......@@ -146,7 +146,7 @@ open class ButtonBarView: UICollectionView {
selectedBar.frame = selectedBarFrame
}
override open func layoutSubviews() {
override func layoutSubviews() {
super.layoutSubviews()
updateSelectedBarYPosition()
}
......
......@@ -12,7 +12,7 @@
import Foundation
@objc(VLCService)
public class Services: NSObject {
class Services: NSObject {
@objc let mediaDataSource = VLCMediaDataSource()
@objc let rendererDiscovererManager = VLCRendererDiscovererManager(presentingViewController: nil)
}
......@@ -23,12 +23,12 @@ public class Services: NSObject {
private var tabBarController: UITabBarController
private var services = Services()
@objc public init(tabBarController: UITabBarController) {
@objc init(tabBarController: UITabBarController) {
self.tabBarController = tabBarController
super.init()
}
@objc public func start() {
@objc func start() {
let tabbarCoordinator = VLCTabbarCooordinator(tabBarController: tabBarController, services: services)
tabbarCoordinator.start()
childCoordinators.append(tabbarCoordinator)
......
......@@ -10,7 +10,7 @@
* Refer to the COPYING file of the official project for license.
*****************************************************************************/
public enum SortOption: String {
enum SortOption: String {
case alphabetically = "Name"
case insertonDate = "Date"
case size = "Size"
......
......@@ -29,7 +29,7 @@ protocol RemoteNetworkDataSourceDelegate {
}
@objc(VLCRemoteNetworkDataSourceAndDelegate)
public class RemoteNetworkDataSource: NSObject, UITableViewDataSource, UITableViewDelegate {
class RemoteNetworkDataSource: NSObject, UITableViewDataSource, UITableViewDelegate {
let cloudVC = VLCCloudServicesTableViewController(nibName: "VLCCloudServicesTableViewController", bundle: Bundle.main)
let streamingVC = VLCOpenNetworkStreamViewController(nibName: "VLCOpenNetworkStreamViewController", bundle: Bundle.main)
let downloadVC = VLCDownloadViewController(nibName: "VLCDownloadViewController", bundle: Bundle.main)
......@@ -38,11 +38,11 @@ public class RemoteNetworkDataSource: NSObject, UITableViewDataSource, UITableVi
// MARK: - DataSource
public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return RemoteNetworkCellType.count
}
public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
guard let cellType = RemoteNetworkCellType(rawValue: indexPath.row) else {
assertionFailure("We're having more rows than types of cells that should never happen")
return UITableViewCell()
......@@ -83,11 +83,11 @@ public class RemoteNetworkDataSource: NSObject, UITableViewDataSource, UITableVi
// MARK: - Delegate
public func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {
return RemoteNetworkCellType(rawValue: indexPath.row) == .wifi ? nil : indexPath
}
public func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
tableView.deselectRow(at: indexPath, animated: true)
if let vc = viewController(indexPath: indexPath) {
delegate?.showViewController(vc)
......
......@@ -68,18 +68,18 @@ class VLCMediaViewController: UICollectionViewController, UISearchResultsUpdatin
}
@available(*, unavailable)
required public init?(coder aDecoder: NSCoder) {
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder: ) has not been implemented")
}
public override func viewDidLoad() {
override func viewDidLoad() {
super.viewDidLoad()
setupCollectionView()
setupSearchController()
_ = (MLMediaLibrary.sharedMediaLibrary() as! MLMediaLibrary).libraryDidAppear()
}
public override func viewWillAppear(_ animated: Bool) {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
let manager = services.rendererDiscovererManager
if manager.discoverers.isEmpty {
......@@ -109,7 +109,7 @@ class VLCMediaViewController: UICollectionViewController, UISearchResultsUpdatin
}
}
public override func viewDidAppear(_ animated: Bool) {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
reloadData()
}
......@@ -145,13 +145,13 @@ class VLCMediaViewController: UICollectionViewController, UISearchResultsUpdatin
// MARK: Renderer
public override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
collectionView?.collectionViewLayout.invalidateLayout()
}
// MARK: - MediaDatasourceAndDelegate
override public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
override func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let mediaObject = services.mediaDataSource.object(at: indexPath.row, subcategory: mediaType.subcategory) as? NSManagedObject {
delegate?.mediaViewControllerDidSelectMediaObject(self, mediaObject: mediaObject)
}
......@@ -159,16 +159,16 @@ class VLCMediaViewController: UICollectionViewController, UISearchResultsUpdatin
// MARK: - Search
public func updateSearchResults(for searchController: UISearchController) {
func updateSearchResults(for searchController: UISearchController) {
searchDataSource.shouldReloadTable(forSearch: searchController.searchBar.text, searchableFiles: services.mediaDataSource.allObjects(for: mediaType.subcategory))
collectionView?.reloadData()
}
public func didPresentSearchController(_ searchController: UISearchController) {
func didPresentSearchController(_ searchController: UISearchController) {
collectionView?.dataSource = searchDataSource
}
public func didDismissSearchController(_ searchController: UISearchController) {
func didDismissSearchController(_ searchController: UISearchController) {
collectionView?.dataSource = mediaDataSourceAndDelegate
}
......
......@@ -52,7 +52,7 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
return .none
}
override open func viewDidLoad() {
override func viewDidLoad() {
super.viewDidLoad()
containerView = UIScrollView(frame: CGRect(x: 0, y: 0, width: view.bounds.width, height: view.bounds.height))
......@@ -81,13 +81,13 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
childController.didMove(toParentViewController: self)
}
open override func viewWillAppear(_ animated: Bool) {
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
isViewAppearing = true
childViewControllers.forEach { $0.beginAppearanceTransition(true, animated: animated) }
}
open override func viewDidAppear(_ animated: Bool) {
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
lastSize = containerView.bounds.size
updateIfNeeded()
......@@ -99,22 +99,22 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
childViewControllers.forEach { $0.endAppearanceTransition() }
}
open override func viewWillDisappear(_ animated: Bool) {
override func viewWillDisappear(_ animated: Bool) {
super.viewWillDisappear(animated)
childViewControllers.forEach { $0.beginAppearanceTransition(false, animated: animated) }
}
open override func viewDidDisappear(_ animated: Bool) {
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
childViewControllers.forEach { $0.endAppearanceTransition() }
}
open override func viewDidLayoutSubviews() {
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
updateIfNeeded()
}
open override var shouldAutomaticallyForwardAppearanceMethods: Bool {
override var shouldAutomaticallyForwardAppearanceMethods: Bool {
return false
}
......@@ -273,20 +273,20 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
// MARK: - UIScrollViewDelegate
public func scrollViewDidScroll(_ scrollView: UIScrollView) {
func scrollViewDidScroll(_ scrollView: UIScrollView) {
if containerView == scrollView {
updateContent()
lastContentOffset = scrollView.contentOffset.x
}
}
public func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
func scrollViewWillBeginDragging(_ scrollView: UIScrollView) {
if containerView == scrollView {
lastPageNumber = pageFor(contentOffset: scrollView.contentOffset.x)
}
}
public func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
func scrollViewDidEndScrollingAnimation(_ scrollView: UIScrollView) {
if containerView == scrollView {
pagerTabStripChildViewControllersForScrolling = nil
(navigationController?.view ?? view).isUserInteractionEnabled = true
......@@ -296,7 +296,7 @@ class PagerTabStripViewController: UIViewController, UIScrollViewDelegate {
// MARK: - Orientation
open override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
override func viewWillTransition(to size: CGSize, with coordinator: UIViewControllerTransitionCoordinator) {
super.viewWillTransition(to: size, with: coordinator)
isViewRotating = true
pageBeforeRotate = currentIndex
......
......@@ -235,7 +235,7 @@ class VLCActionSheet: UIViewController {
// MARK: UICollectionViewDelegateFlowLayout
extension VLCActionSheet: UICollectionViewDelegateFlowLayout {
public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
return CGSize(width: collectionView.frame.width, height: cellHeight)
}
}
......@@ -243,7 +243,7 @@ extension VLCActionSheet: UICollectionViewDelegateFlowLayout {
// MARK: UICollectionViewDelegate
extension VLCActionSheet: UICollectionViewDelegate {
public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
if let delegate = delegate, let item = delegate.itemAtIndexPath(indexPath) {
delegate.actionSheet(collectionView: collectionView, didSelectItem: item, At: indexPath)
action?(item)
......@@ -255,14 +255,14 @@ extension VLCActionSheet: UICollectionViewDelegate {
// MARK: UICollectionViewDataSource
extension VLCActionSheet: UICollectionViewDataSource {
public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
if let dataSource = dataSource {
return dataSource.numberOfRows()
}
preconditionFailure("VLCActionSheet: No data source")
}
public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if let dataSource = dataSource {
return dataSource.actionSheet(collectionView: collectionView, cellForItemAt: indexPath)
}
......
......@@ -20,7 +20,7 @@
@implementation VLCDocumentPickerController
#pragma mark - Public Methods
#pragma mark - Internal Methods
- (void)showDocumentMenuViewController:(id)sender
{
......
......@@ -19,7 +19,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
private var services: Services
private var displayController: VLCPlayerDisplayController
public init(tabBarController: UITabBarController, services: Services) {
init(tabBarController: UITabBarController, services: Services) {
self.tabBarController = tabBarController
self.services = services
displayController = VLCPlayerDisplayController(services: services)
......@@ -27,7 +27,7 @@ class VLCTabbarCooordinator: NSObject, VLCMediaViewControllerDelegate {
NotificationCenter.default.addObserver(self, selector: #selector(updateTheme), name: .VLCThemeDidChangeNotification, object: nil)
}
@objc public func start() {
@objc func start() {
setupViewControllers()
updateTheme()
}
......
......@@ -62,14 +62,14 @@ enum SnapshotError: Error, CustomDebugStringConvertible {
}
@objcMembers
open class Snapshot: NSObject {
class Snapshot: NSObject {
static var app: XCUIApplication?
static var cacheDirectory: URL?
static var screenshotsDirectory: URL? {
return cacheDirectory?.appendingPathComponent("screenshots", isDirectory: true)
}
open class func setupSnapshot(_ app: XCUIApplication) {
class func setupSnapshot(_ app: XCUIApplication) {
Snapshot.app = app
......@@ -143,7 +143,7 @@ open class Snapshot: NSObject {
}
}
open class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
class func snapshot(_ name: String, timeWaitingForIdle timeout: TimeInterval = 20) {
if timeout > 0 {
waitForLoadingIndicatorToDisappear(within: timeout)
}
......
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