Skip to content

Commit 0048914

Browse files
committed
fmt
1 parent 7d82581 commit 0048914

File tree

2 files changed

+15
-25
lines changed

2 files changed

+15
-25
lines changed

ios/Plugin/Plugin.swift

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ import Capacitor
77
*/
88
@objc(NativeMarket)
99
public class NativeMarket: CAPPlugin {
10-
10+
1111
@objc func openStoreListing(_ call: CAPPluginCall) {
1212
if let appId = call.getString("appId") {
1313
let url = "itms-apps://itunes.apple.com/app/" + appId
1414
let appUrl = URL(string: url)
15-
15+
1616
DispatchQueue.main.async {
1717
if UIApplication.shared.canOpenURL(appUrl!) {
18-
UIApplication.shared.open(appUrl!, options: [:]) { (success) in
18+
UIApplication.shared.open(appUrl!, options: [:]) { (_) in
1919
call.resolve()
2020
}
2121
}
@@ -24,26 +24,26 @@ public class NativeMarket: CAPPlugin {
2424
call.reject("appId is missing")
2525
}
2626
}
27-
27+
2828
@objc func openDevPage(_ call: CAPPluginCall) {
2929
call.resolve() // TODO: Implement
3030
}
31-
31+
3232
@objc func openCollection(_ call: CAPPluginCall) {
3333
call.resolve() // TODO: Implement
3434
}
35-
35+
3636
@objc func openEditorChoicePage(_ call: CAPPluginCall) {
3737
call.resolve() // TODO: Implement
3838
}
39-
39+
4040
@objc func search(_ call: CAPPluginCall) {
4141
if let terms = call.getString("terms") {
4242
let url = "itms-apps://itunes.apple.com/search?term=" + terms
4343
let appUrl = URL(string: url)
44-
44+
4545
if UIApplication.shared.canOpenURL(appUrl!) {
46-
UIApplication.shared.open(appUrl!, options: [:]) { (success) in
46+
UIApplication.shared.open(appUrl!, options: [:]) { (_) in
4747
call.resolve()
4848
}
4949
}

ios/PluginTests/PluginTests.swift

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,23 @@ import Capacitor
33
@testable import Plugin
44

55
class PluginTests: XCTestCase {
6-
7-
override func setUp() {
8-
super.setUp()
9-
// Put setup code here. This method is called before the invocation of each test method in the class.
10-
}
11-
12-
override func tearDown() {
13-
// Put teardown code here. This method is called after the invocation of each test method in the class.
14-
super.tearDown()
15-
}
16-
6+
177
func testEcho() {
188
// This is an example of a functional test case for a plugin.
199
// Use XCTAssert and related functions to verify your tests produce the correct results.
20-
10+
2111
let value = "Hello, World!"
2212
let plugin = MyPlugin()
23-
13+
2414
let call = CAPPluginCall(callbackId: "test", options: [
2515
"value": value
26-
], success: { (result, call) in
16+
], success: { (result, _) in
2717
let resultValue = result!.data["value"] as? String
2818
XCTAssertEqual(value, resultValue)
29-
}, error: { (err) in
19+
}, error: { (_) in
3020
XCTFail("Error shouldn't have been called")
3121
})
32-
22+
3323
plugin.echo(call!)
3424
}
3525
}

0 commit comments

Comments
 (0)