WordPress-iOS icon indicating copy to clipboard operation
WordPress-iOS copied to clipboard

Cleanup `splitViewControllerIsHorizontallyCompact` and `isViewHorizontallyCompact`

Open nheagy opened this issue 7 years ago • 1 comments

In #5158 we removed a duplicate definition of isViewHorizontallyCompact. Since then the project has been reorganized a few times, with the result that isViewHorizontallyCompact now resides inside WordPressComStatsiOS with the second implementation named hasHorizontallyCompactView() existing inside the WordPressUI-iOS pod.

An example is in splitViewControllerIsHorizontallyCompact:

extension UIViewController {
    @objc var splitViewControllerIsHorizontallyCompact: Bool {
        return splitViewController?.isViewHorizontallyCompact() ?? isViewHorizontallyCompact()
    }
}

This should probably change to using hasHorizontallyCompactView(), which is defined in WordPressUI-iOS which is probably a more appropriate location for it, and we should consider removing isViewHorizontallyCompact entirely, since stats has the UI pod as a dependency.

nheagy avatar Oct 18 '18 18:10 nheagy

I searched isViewHorizontallyCompact in the project and didn't see any results. Should this be closed?

Screenshot 2024-04-23 at 1 17 45 PM

megmil avatar Apr 23 '24 17:04 megmil

The referenced code was removed in one of the earlier version and the Split View enable/disable logic simplified – closing.

kean avatar May 02 '24 22:05 kean