From 03a33c0b50383c39411581125db8839118cf30bd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elvis=20Nu=C3=B1ez?= Date: Thu, 20 Jul 2017 13:16:25 +0200 Subject: [PATCH] Enable iPad support for modal demo --- Demo.xcodeproj/project.pbxproj | 2 ++ ModalForm/ViewController.swift | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/Demo.xcodeproj/project.pbxproj b/Demo.xcodeproj/project.pbxproj index 082e5501..c4b8e799 100644 --- a/Demo.xcodeproj/project.pbxproj +++ b/Demo.xcodeproj/project.pbxproj @@ -2237,6 +2237,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Debug; }; @@ -2254,6 +2255,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.demo.ModalForm; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 3.0; + TARGETED_DEVICE_FAMILY = "1,2"; }; name = Release; }; diff --git a/ModalForm/ViewController.swift b/ModalForm/ViewController.swift index 211ecf91..6669bd38 100644 --- a/ModalForm/ViewController.swift +++ b/ModalForm/ViewController.swift @@ -4,6 +4,11 @@ import Form class ViewController: UIViewController { @IBAction func showForm(_: UIButton) { let formController = SampleFormViewController() + + if UIDevice.current.userInterfaceIdiom == .pad { + formController.modalPresentationStyle = .formSheet + } + self.present(formController, animated: true, completion: nil) } }