diff --git a/MoViesC/Controller/MovieListing/MovieListingPageManager.swift b/MoViesC/Controller/MovieListing/MovieListingPageManager.swift index becf013..d1e7a13 100644 --- a/MoViesC/Controller/MovieListing/MovieListingPageManager.swift +++ b/MoViesC/Controller/MovieListing/MovieListingPageManager.swift @@ -13,13 +13,12 @@ protocol MovieListingPager: AnyObject { class MovieListingPageManager { var totalItems: Int { return totalMovies } - var isFetchInProgress: Bool { return _isFetchInProgress } var isInFirstPage: Bool { return currentPage == 1 } + private(set) var isFetchInProgress: Bool = false private let pager: MovieListingPager private var currentPage = 1 private var totalMovies = 0 - private var _isFetchInProgress: Bool = false init(pager: MovieListingPager) { self.pager = pager @@ -31,15 +30,15 @@ class MovieListingPageManager { } func fetchPage(currentCount: Int, completionHandler: @escaping ((MoviePage?) -> Void)) { - guard !_isFetchInProgress else { + guard !isFetchInProgress else { return } - _isFetchInProgress = true + isFetchInProgress = true let page = currentPage self.pager.fetchPage(page: page) { moviePage in - self._isFetchInProgress = false + self.isFetchInProgress = false if let moviePage = moviePage { self.currentPage += 1 self.totalMovies = moviePage.totalResults diff --git a/MoViesC/Controller/MovieSharing.swift b/MoViesC/Controller/MovieSharing.swift index 0e3fe85..584da39 100644 --- a/MoViesC/Controller/MovieSharing.swift +++ b/MoViesC/Controller/MovieSharing.swift @@ -25,9 +25,8 @@ class MovieSharing { weak var delegate: MovieSharingDelegate? - var isInitialized: Bool { _isInitialized } + private(set) var isInitialized: Bool = false private let multiPeer: MultiPeer - private var _isInitialized = false private init() { self.multiPeer = MultiPeer.instance @@ -42,7 +41,7 @@ class MovieSharing { multiPeer.initialize(serviceType: Self.serviceType) multiPeer.autoConnect() multiPeer.delegate = self - self._isInitialized = true + self.isInitialized = true } private func onReceive(movieId: Int) {