 
     func animateCategoriesList(navBarVisible: Bool) {
         animate {
+            let categoryCardListTop: CGFloat
             if navBarVisible {
-                self.categoryCardList.frame.origin.y = self.navigationBar.frame.height
+                categoryCardListTop = self.navigationBar.frame.height
+            }
+            else if AppSetup.shared.isIphoneX {
+                categoryCardListTop = AppSetup.shared.statusBarHeight
             }
             else {
-                self.categoryCardList.frame.origin.y = 0
+                categoryCardListTop = 0
+            }
+
+            self.categoryCardTopConstraint.update(offset: categoryCardListTop)
+            self.categoryCardList.frame.origin.y = categoryCardListTop
+
+            if AppSetup.shared.isIphoneX {
+                let iPhoneBlackBarTop = self.categoryCardList.frame.minY - self.iPhoneBlackBar.frame.height
+                self.iPhoneBlackBarTopConstraint.update(offset: iPhoneBlackBarTop)
+                self.iPhoneBlackBar.frame.origin.y = iPhoneBlackBarTop
+                self.iPhoneBlackBar.alpha = navBarVisible ? 0 : 1
             }
         }
     }


    override func style() {
        super.style()
        backButton.setImages(.angleBracket, degree: 180)
        shareButton.alpha = 0
        shareButton.setImage(.share, imageStyle: .normal, for: .normal)

        static let buttonMargin: CGFloat = 5
    }

    enum NavBarItems {
        case onlyGridToggle
        case all
        case none
    }

    weak var delegate: CategoryScreenDelegate?
    fileprivate let usage: CategoryViewController.Usage

    init(usage: CategoryViewController.Usage) {
        self.usage = usage
        super.init(frame: .zero)
    }

    required init(frame: CGRect) {
        fatalError("init(frame:) has not been implemented")
    }

    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    var isGridView = false {
        didSet {
            gridListButton.setImage(isGridView ? .listView : .gridView, imageStyle: .normal, for: .normal)
        }
    }

    fileprivate let categoryCardList = CategoryCardListView()
    fileprivate let iPhoneBlackBar = UIView()
    fileprivate let searchField = SearchNavBarField()
    fileprivate let searchFieldButton = UIButton()
    fileprivate let backButton = UIButton()
    fileprivate let gridListButton = UIButton()
    fileprivate let shareButton = UIButton()
    fileprivate let navigationContainer = UIView()

    fileprivate var categoryCardTopConstraint: Constraint!
    fileprivate var iPhoneBlackBarTopConstraint: Constraint!
    fileprivate var backVisibleConstraint: Constraint!
    fileprivate var backHiddenConstraint: Constraint!
    fileprivate var shareVisibleConstraint: Constraint!
