UIScreenEdgePanGestureRecognizer在iOS 13模拟器中不起作用

时间:2019-09-24 14:41:20

标签: swift ios13 xcode11

当我在 iOS 13 模拟器上部署时,class Program { static void Main(string[] args) { var p = new Person { Professions = new List<Profession> { new Profession("Joker"), new Profession("Smoker"), new Profession("Midnight toker") } }; var accessor = ObjectAccessor.Create(p); var professions = accessor[nameof(Person.Professions)]; if (professions is IEnumerable) { foreach (var profession in (IEnumerable)professions) { Console.WriteLine(profession); } } } } class Person { public List<Profession> Professions { get; set; } } class Profession { public string Name { get; set; } public Profession( string name) { Name = name; } public override string ToString() { return Name; } } 不会调用其操作选择器。相同的代码适用于 iOS 12 模拟器设备和真实的iOS 13硬件。

UIScreenEdgePanGestureRecognizer

我已经创建了small sample project。在iOS 12模拟器中滑动即可。在iOS 13模拟器中,不会调用选择器方法override func viewDidLoad() { super.viewDidLoad() let edgePan = UIScreenEdgePanGestureRecognizer(target: self, action: #selector(screenEdgeSwiped)) edgePan.edges = .left view.addGestureRecognizer(edgePan) } @objc func screenEdgeSwiped(_ recognizer: UIScreenEdgePanGestureRecognizer) { if recognizer.state == .recognized { print("swipe gesture recognized ✔︎") } }

1 个答案:

答案 0 :(得分:1)

尝试为iOS模拟器启用Window > Show Device Bezels。我向Apple提交了一个有关此功能不能像以前那样起作用的错误(FB7253111),但他们说这是有意更改。