Skip to content

Commit

Permalink
Refactor FXIOS-10205 [Swiftlint] Resolve 1 implicitly_unwrapped_optio…
Browse files Browse the repository at this point in the history
…nal violations in TopTabsViewController (#23835)

Resolve warnings in TopTabsViewController using a lazy var instead of implicitly unwrapping
  • Loading branch information
tonell-m authored Dec 18, 2024
1 parent 46718b8 commit 956a5a5
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions firefox-ios/Client/Frontend/Browser/TopTabsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,15 @@ class TopTabsViewController: UIViewController, Themeable, Notifiable, FeatureFla
// MARK: - Properties
let tabManager: TabManager
weak var delegate: TopTabsDelegate?
private var topTabDisplayManager: TopTabDisplayManager!

private lazy var topTabDisplayManager = TopTabDisplayManager(
collectionView: collectionView,
tabManager: tabManager,
tabDisplayer: self,
reuseID: TopTabCell.cellIdentifier,
profile: profile
)

var tabCellIdentifier: TabDisplayerDelegate.TabCellIdentifier = TopTabCell.cellIdentifier
var profile: Profile
var themeManager: ThemeManager
Expand Down Expand Up @@ -122,11 +130,6 @@ class TopTabsViewController: UIViewController, Themeable, Notifiable, FeatureFla
self.themeManager = themeManager
self.notificationCenter = notificationCenter
super.init(nibName: nil, bundle: nil)
topTabDisplayManager = TopTabDisplayManager(collectionView: self.collectionView,
tabManager: self.tabManager,
tabDisplayer: self,
reuseID: TopTabCell.cellIdentifier,
profile: profile)
collectionView.dataSource = topTabDisplayManager
collectionView.delegate = tabLayoutDelegate
}
Expand Down

0 comments on commit 956a5a5

Please sign in to comment.