I found the answer, Use preferredScreenEdgesDeferringSystemGestures property in ViewController to do this. You can find the detail about this in https://developer.apple.com/documentation/uikit/uiviewcontroller/2887512-preferredscreenedgesdeferringsys