Skip to content
This repository has been archived by the owner on Mar 7, 2021. It is now read-only.

Commit

Permalink
Enable iPad support for modal demo
Browse files Browse the repository at this point in the history
  • Loading branch information
3lvis committed Jul 20, 2017
1 parent ab360ff commit 03a33c0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -2237,6 +2237,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 3.0;
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
Expand All @@ -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;
};
Expand Down
5 changes: 5 additions & 0 deletions ModalForm/ViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}

0 comments on commit 03a33c0

Please sign in to comment.