@capacitor/ios 9.0.0-rc.1 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -36,11 +36,31 @@ import WebKit
|
|
|
36
36
|
return bridge?.config.getPluginConfig(pluginName) ?? PluginConfig(config: JSObject())
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Configure popover sourceRect, sourceView and permittedArrowDirections to show it centered
|
|
41
|
+
*/
|
|
42
|
+
func setCenteredPopover(_ viewController: UIViewController) {
|
|
43
|
+
guard let hostView = bridge?.viewController?.view else { return }
|
|
44
|
+
viewController.popoverPresentationController?.sourceRect = CGRect(x: hostView.center.x, y: hostView.center.y, width: 0, height: 0)
|
|
45
|
+
viewController.popoverPresentationController?.sourceView = hostView
|
|
46
|
+
viewController.popoverPresentationController?.permittedArrowDirections = []
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
func setCenteredPopover(_ viewController: UIViewController, size: CGSize) {
|
|
50
|
+
guard let hostView = bridge?.viewController?.view else { return }
|
|
51
|
+
viewController.popoverPresentationController?.sourceRect = CGRect(x: hostView.center.x, y: hostView.center.y, width: 0, height: 0)
|
|
52
|
+
viewController.preferredContentSize = size
|
|
53
|
+
viewController.popoverPresentationController?.sourceView = hostView
|
|
54
|
+
viewController.popoverPresentationController?.permittedArrowDirections = []
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@objc extension CAPPlugin {
|
|
59
|
+
open func notifyListeners(_ eventName: String, data: [String: Any]?) {
|
|
40
60
|
notifyListeners(eventName, data: data, retainUntilConsumed: false)
|
|
41
61
|
}
|
|
42
62
|
|
|
43
|
-
func notifyListeners(_ eventName: String, data: [String: Any]?, retainUntilConsumed retain: Bool) {
|
|
63
|
+
open func notifyListeners(_ eventName: String, data: [String: Any]?, retainUntilConsumed retain: Bool) {
|
|
44
64
|
guard let listenersForEvent = eventListeners?.object(forKey: eventName) as? NSArray,
|
|
45
65
|
listenersForEvent.count > 0 else {
|
|
46
66
|
if retain, let data = data {
|
|
@@ -61,7 +81,7 @@ import WebKit
|
|
|
61
81
|
}
|
|
62
82
|
}
|
|
63
83
|
|
|
64
|
-
func removeListener(_ call: CAPPluginCall) {
|
|
84
|
+
open func removeListener(_ call: CAPPluginCall) {
|
|
65
85
|
guard let eventName = call.options["eventName"] as? String,
|
|
66
86
|
let callbackId = call.options["callbackId"] as? String else { return }
|
|
67
87
|
if let storedCall = bridge?.savedCall(withID: callbackId) {
|
|
@@ -70,31 +90,11 @@ import WebKit
|
|
|
70
90
|
bridge?.releaseCall(withID: callbackId)
|
|
71
91
|
}
|
|
72
92
|
|
|
73
|
-
func removeAllListeners(_ call: CAPPluginCall) {
|
|
93
|
+
open func removeAllListeners(_ call: CAPPluginCall) {
|
|
74
94
|
eventListeners?.removeAllObjects()
|
|
75
95
|
call.resolve()
|
|
76
96
|
}
|
|
77
97
|
|
|
78
|
-
/**
|
|
79
|
-
* Configure popover sourceRect, sourceView and permittedArrowDirections to show it centered
|
|
80
|
-
*/
|
|
81
|
-
func setCenteredPopover(_ viewController: UIViewController) {
|
|
82
|
-
guard let hostView = bridge?.viewController?.view else { return }
|
|
83
|
-
viewController.popoverPresentationController?.sourceRect = CGRect(x: hostView.center.x, y: hostView.center.y, width: 0, height: 0)
|
|
84
|
-
viewController.popoverPresentationController?.sourceView = hostView
|
|
85
|
-
viewController.popoverPresentationController?.permittedArrowDirections = []
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
func setCenteredPopover(_ viewController: UIViewController, size: CGSize) {
|
|
89
|
-
guard let hostView = bridge?.viewController?.view else { return }
|
|
90
|
-
viewController.popoverPresentationController?.sourceRect = CGRect(x: hostView.center.x, y: hostView.center.y, width: 0, height: 0)
|
|
91
|
-
viewController.preferredContentSize = size
|
|
92
|
-
viewController.popoverPresentationController?.sourceView = hostView
|
|
93
|
-
viewController.popoverPresentationController?.permittedArrowDirections = []
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@objc extension CAPPlugin {
|
|
98
98
|
/**
|
|
99
99
|
* Default implementation of the capacitor 3.0 permission pattern
|
|
100
100
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@capacitor/ios",
|
|
3
|
-
"version": "9.0.0
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Capacitor: Cross-platform apps with JavaScript and the web",
|
|
5
5
|
"homepage": "https://capacitorjs.com",
|
|
6
6
|
"author": "Ionic Team <hi@ionic.io> (https://ionic.io)",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"xc:test": "cd .. && xcodebuild test -scheme Capacitor-Package -destination 'platform=iOS Simulator,name=iPhone 17,OS=27.0' -collect-test-diagnostics never"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
|
-
"@capacitor/core": "^9.0.0
|
|
28
|
+
"@capacitor/core": "^9.0.0"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|