In your main view controller:
func showModal() {
let modalViewController = ModalViewController()
modalViewController.modalPresentationStyle = .OverCurrentContext
presentViewController(modalViewController, animated: true, completion: nil)
}
In your modal view controller:
class ModalViewController: UIViewController {
override func viewDidLoad() {
view.backgroundColor = UIColor.clearColor()
view.opaque = false
}
}
If you are working with a storyboard:
Background = Clear Color
Drawing = Uncheck the Opaque checkbox
Presentation = Over Current Context
Alpha가 view에 지정되었을 때는, view 계층 아래에 속한 자식을 모두에게 alpha가 적용된다.