2016-02-20 78 views

回答

0

你可以嘗試

override func touchesBegan(touches: Set<UITouch>, withEvent event: UIEvent?) { 
    let p = touches.first?.locationInView(self.window) 
    if CGRectContainsPoint(UIApplication.sharedApplication().statusBarFrame, p!){ 
     // do something you want 
    } 

它是在窗口頂部的窗口,窗口的windowLevel是狀態欄,它是keywindow.you可以創建一個新的窗口,並設置alertLevel以上。