Skip to content

Commit 92cfc05

Browse files
author
Momo Ozawa
committed
Refactor: always use scroll view as root view regardless of MSD feature flag
Previously, we were only using the new view hiearchy (scroll view as root view) if the MSD feature flag was enabled.
1 parent e644f7e commit 92cfc05

File tree

1 file changed

+3
-29
lines changed

1 file changed

+3
-29
lines changed

WordPress/Classes/ViewRelated/Blog/My Site/MySiteViewController.swift

Lines changed: 3 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,6 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
9393
}
9494

9595
get {
96-
guard FeatureFlag.mySiteDashboard.enabled else {
97-
return blogDetailsViewController?.blog
98-
}
99-
10096
return sitePickerViewController?.blog
10197
}
10298
}
@@ -164,35 +160,23 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
164160
}
165161

166162
private func updateSegmentedControl(for blog: Blog) {
167-
guard FeatureFlag.mySiteDashboard.enabled else {
168-
return
169-
}
170-
171163
// The segmented control should be hidden if the blog is not a WP.com/Atomic/Jetpack site, or if the device is an iPad
172-
segmentedControlContainerView.isHidden = !blog.isAccessibleThroughWPCom() || UIDevice.isPad()
164+
segmentedControlContainerView.isHidden = !FeatureFlag.mySiteDashboard.enabled || !blog.isAccessibleThroughWPCom() || UIDevice.isPad()
173165
}
174166

175167
private func setupView() {
176168
view.backgroundColor = .listBackground
177169
}
178170

179-
/// If the My Site Dashboard feature flag is enabled, then this method builds a layout with the following
180-
/// view hierarchy:
171+
/// This method builds a layout with the following view hierarchy:
181172
///
182173
/// - Scroll view
183174
/// - Stack view
184175
/// - Segmented control container view
185176
/// - Segmented control
186177
/// - Child view controller
187-
///
188-
/// Otherwise, if the My Site Dashboard feature flag is disabled, this method does nothing and the
189-
/// child vc is added directly to the root view of the view controller in showBlogDetails.
190178
///
191179
private func setupConstraints() {
192-
guard FeatureFlag.mySiteDashboard.enabled else {
193-
return
194-
}
195-
196180
view.addSubview(scrollView)
197181
view.pinSubviewToAllEdges(scrollView)
198182
scrollView.addSubview(stackView)
@@ -527,13 +511,7 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
527511

528512
addMeButtonToNavigationBar(email: blog.account?.email, meScenePresenter: meScenePresenter)
529513

530-
if FeatureFlag.mySiteDashboard.enabled {
531-
embedChildInStackView(blogDetailsViewController)
532-
} else {
533-
add(blogDetailsViewController)
534-
blogDetailsViewController.view.translatesAutoresizingMaskIntoConstraints = false
535-
view.pinSubviewToAllEdges(blogDetailsViewController.view)
536-
}
514+
embedChildInStackView(blogDetailsViewController)
537515

538516
blogDetailsViewController.showInitialDetailsForBlog()
539517
}
@@ -557,10 +535,6 @@ class MySiteViewController: UIViewController, NoResultsViewHost {
557535
}
558536

559537
private func addSitePickerIfNeeded(for blog: Blog) {
560-
guard FeatureFlag.mySiteDashboard.enabled else {
561-
return
562-
}
563-
564538
guard sitePickerViewController == nil else {
565539
return
566540
}

0 commit comments

Comments
 (0)