-
Notifications
You must be signed in to change notification settings - Fork 0
/
ViewController.swift
36 lines (25 loc) · 939 Bytes
/
ViewController.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
//
// ViewController.swift
// KatesPopoverCalendarApp
//
// Created by KatesAndroid on 2021/1/28 PM 2: 40 ~ 3: 20
//
import UIKit
class ViewController: UIViewController, UIPopoverControllerDelegate, UIPopoverPresentationControllerDelegate {
override func viewDidLoad() {
super.viewDidLoad()
}
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
let pop = segue.destination.popoverPresentationController
// maybe is the UIButtonItem
if sender is UIButton {
pop?.sourceRect = (sender as! UIButton).bounds
}
pop?.delegate = self
}
// turn off the mobile-screen-size detection
// then popOver display replaces the full screen in small-screen-size target
func adaptivePresentationStyle(for controller: UIPresentationController) -> UIModalPresentationStyle {
return .none
}
}