AboveWindow
Description
AboveWindow a second window above base window, which supports to hide into a ball.
Installation
CocoaPods
pod 'AboveWindow'
Carthage
not support yet.
Usage
// init AboveWindow
AboveWindow.shared.ballWidth = 60
AboveWindow.shared.isShowPanExitView = true // pan to show exit view
AboveWindow.shared.ballImage = UIImage(named: "thiago")
/* optional: set init stay postion (default: right of screen edge, middle of horizon)
let screenSize = UIScreen.main.bounds
AboveWindow.shared.stayPoint = CGPoint(x: screenSize.width - AboveWindow.shared.ballWidth - 10, y: 600)
// */
// push a new controller to AboveWindow
let controller = UIViewController()
controller.view.backgroundColor = .blue
AboveWindow.shared.push(root: controller, in: self.navigationController)
// hide the controller in AboveWindow
AboveWindow.shared.hide()
// show the origin controller in AboveWindow
AboveWindow.shared.show()
// or destroy the controller in AboveWindow
AboveWindow.shared.destroy()
// other properties
AboveWindow.shared.ballView.addSubview(customView) // add custom view into ball you like
AboveWindow.shared.nav = currentNav // change nav, push method set this property
AboveWindow.shared.imageView = customImageView
if AboveWindow.shared.isHideIntoBall {
// hide into ball, do something
}
Requirements
- iOS 9.0+
- Swift 4.2 to 5.1
License
AboveWindow is under the MIT license.