Skip to content

Commit

Permalink
chore: run fmt command (#2126)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile committed Jun 10, 2024
1 parent acd334d commit 39fb409
Show file tree
Hide file tree
Showing 22 changed files with 56 additions and 141 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Capacitor
*/
@objc(ActionSheetPlugin)
public class ActionSheetPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "ActionSheetPlugin"
public let jsName = "ActionSheet"
public let identifier = "ActionSheetPlugin"
public let jsName = "ActionSheet"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "showActions", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "showActions", returnType: CAPPluginReturnPromise)
]
private let implementation = ActionSheet()

@objc func showActions(_ call: CAPPluginCall) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Capacitor

@objc(AppLauncherPlugin)
public class AppLauncherPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "AppLauncherPlugin"
public let jsName = "AppLauncher"
public let identifier = "AppLauncherPlugin"
public let jsName = "AppLauncher"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "canOpenUrl", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "openUrl", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "openUrl", returnType: CAPPluginReturnPromise)
]

@objc func canOpenUrl(_ call: CAPPluginCall) {
guard let urlString = call.getString("url") else {
Expand Down
8 changes: 4 additions & 4 deletions browser/ios/Sources/BrowserPlugin/BrowserPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Capacitor

@objc(CAPBrowserPlugin)
public class CAPBrowserPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "CAPBrowserPlugin"
public let jsName = "Browser"
public let identifier = "CAPBrowserPlugin"
public let jsName = "Browser"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "open", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "close", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "close", returnType: CAPPluginReturnPromise)
]
private let implementation = Browser()

@objc func open(_ call: CAPPluginCall) {
Expand Down
16 changes: 8 additions & 8 deletions camera/ios/Sources/CameraPlugin/CameraPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -256,18 +256,18 @@ extension CameraPlugin: UIImagePickerControllerDelegate, UINavigationControllerD
extension CameraPlugin: PHPickerViewControllerDelegate {
public func picker(_ picker: PHPickerViewController, didFinishPicking results: [PHPickerResult]) {
picker.dismiss(animated: true, completion: nil)

guard !results.isEmpty else {
self.call?.reject("User cancelled photos app")
return
}

self.fetchProcessedImages(from: results) { [weak self] processedImageArray in
guard let processedImageArray else {
self?.call?.reject("Error loading image")
return
}

if self?.multiple == true {
self?.returnImages(processedImageArray)
} else if var processedImage = processedImageArray.first {
Expand All @@ -276,9 +276,9 @@ extension CameraPlugin: PHPickerViewControllerDelegate {
}
}
}

private func fetchProcessedImages(from pickerResultArray: [PHPickerResult], accumulating: [ProcessedImage] = [], _ completionHandler: @escaping ([ProcessedImage]?) -> Void) {
func loadImage(from pickerResult: PHPickerResult,_ completionHandler: @escaping (UIImage?) -> Void) {
func loadImage(from pickerResult: PHPickerResult, _ completionHandler: @escaping (UIImage?) -> Void) {
let itemProvider = pickerResult.itemProvider
if itemProvider.canLoadObject(ofClass: UIImage.self) {
// extract the image
Expand All @@ -295,9 +295,9 @@ extension CameraPlugin: PHPickerViewControllerDelegate {
}
}
}

guard let currentPickerResult = pickerResultArray.first else { return completionHandler(accumulating) }

loadImage(from: currentPickerResult) { [weak self] loadedImage in
guard let self, let loadedImage else { return completionHandler(nil) }
var asset: PHAsset?
Expand All @@ -306,7 +306,7 @@ extension CameraPlugin: PHPickerViewControllerDelegate {
}
let newElement = self.processedImage(from: loadedImage, with: asset?.imageData)
self.fetchProcessedImages(
from: Array(pickerResultArray.dropFirst()),
from: Array(pickerResultArray.dropFirst()),
accumulating: accumulating + [newElement],
completionHandler
)
Expand Down
8 changes: 4 additions & 4 deletions network/ios/Sources/NetworkPlugin/NetworkPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Capacitor

@objc(CAPNetworkPlugin)
public class NetworkPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "CAPNetworkPlugin"
public let jsName = "Network"
public let identifier = "CAPNetworkPlugin"
public let jsName = "Network"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "getStatus", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "getStatus", returnType: CAPPluginReturnPromise)
]
private var implementation: Network?

override public func load() {
Expand Down
10 changes: 0 additions & 10 deletions network/ios/Tests/NetworkPluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,6 @@ import XCTest

class NetworkTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

func testStatus() {
do {
let implementation = try Network()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import Capacitor

@objc(PreferencesPlugin)
public class PreferencesPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "PreferencesPlugin"
public let jsName = "Preferences"
public let identifier = "PreferencesPlugin"
public let jsName = "Preferences"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "configure", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "get", returnType: CAPPluginReturnPromise),
Expand All @@ -13,8 +13,8 @@ public class PreferencesPlugin: CAPPlugin, CAPBridgedPlugin {
CAPPluginMethod(name: "keys", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "clear", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "migrate", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "removeOld", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "removeOld", returnType: CAPPluginReturnPromise)
]
private var preferences = Preferences(with: PreferencesConfiguration())

@objc func configure(_ call: CAPPluginCall) {
Expand Down
10 changes: 0 additions & 10 deletions preferences/ios/Tests/PreferencesPluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,4 @@ import XCTest

class PreferencesTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ enum PushNotificationsPermissions: String {

@objc(PushNotificationsPlugin)
public class PushNotificationsPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "PushNotificationsPlugin"
public let jsName = "PushNotifications"
public let identifier = "PushNotificationsPlugin"
public let jsName = "PushNotifications"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "register", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "unregister", returnType: CAPPluginReturnPromise),
Expand All @@ -27,8 +27,8 @@ public class PushNotificationsPlugin: CAPPlugin, CAPBridgedPlugin {
CAPPluginMethod(name: "removeDeliveredNotifications", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "createChannel", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "listChannels", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "deleteChannel", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "deleteChannel", returnType: CAPPluginReturnPromise)
]
private let notificationDelegateHandler = PushNotificationsHandler()
private var appDelegateRegistrationCalled: Bool = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
@testable import PushNotificationsPlugin

class PushNotificationsTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import Capacitor

@objc(ScreenOrientationPlugin)
public class ScreenOrientationPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "ScreenOrientationPlugin"
public let jsName = "ScreenOrientation"
public let identifier = "ScreenOrientationPlugin"
public let jsName = "ScreenOrientation"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "orientation", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "lock", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "unlock", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "unlock", returnType: CAPPluginReturnPromise)
]

private let implementation = ScreenOrientation()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
@testable import ScreenOrientationPlugin

class ScreenOrientationTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Capacitor

@objc(ScreenReaderPlugin)
public class ScreenReaderPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "ScreenReaderPlugin"
public let jsName = "ScreenReader"
public let identifier = "ScreenReaderPlugin"
public let jsName = "ScreenReader"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "speak", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "isEnabled", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "isEnabled", returnType: CAPPluginReturnPromise)
]
static let stateChangeEvent = "stateChange"

override public func load() {
Expand Down
10 changes: 0 additions & 10 deletions screen-reader/ios/Tests/ScreenReaderPluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,4 @@ import XCTest

class ScreenReaderTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

}
8 changes: 4 additions & 4 deletions share/ios/Sources/SharePlugin/SharePlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Capacitor

@objc(SharePlugin)
public class SharePlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "SharePlugin"
public let jsName = "Share"
public let identifier = "SharePlugin"
public let jsName = "Share"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "canShare", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "share", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "share", returnType: CAPPluginReturnPromise)
]

@objc func canShare(_ call: CAPPluginCall) {
call.resolve([
Expand Down
9 changes: 0 additions & 9 deletions share/ios/Tests/SharePluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
@testable import SharePlugin

class ShareTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import Capacitor

@objc(SplashScreenPlugin)
public class SplashScreenPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "SplashScreenPlugin"
public let jsName = "SplashScreen"
public let identifier = "SplashScreenPlugin"
public let jsName = "SplashScreen"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise),
CAPPluginMethod(name: "hide", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "hide", returnType: CAPPluginReturnPromise)
]
private var splashScreen: SplashScreen?

override public func load() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,4 @@ import XCTest
@testable import SplashScreenPlugin

class SplashScreenTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
8 changes: 4 additions & 4 deletions text-zoom/ios/Sources/TextZoomPlugin/TextZoomPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Capacitor

@objc(TextZoomPlugin)
public class TextZoomPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "TextZoomPlugin"
public let jsName = "TextZoom"
public let identifier = "TextZoomPlugin"
public let jsName = "TextZoom"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "getPreferred", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "getPreferred", returnType: CAPPluginReturnPromise)
]
private let textZoom = TextZoom()

@objc func getPreferred(_ call: CAPPluginCall) {
Expand Down
10 changes: 0 additions & 10 deletions text-zoom/ios/Tests/TextZoomPluginTests/PluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,4 @@ import XCTest
@testable import TextZoomPlugin

class TextZoomTests: XCTestCase {

override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}
}
8 changes: 4 additions & 4 deletions toast/ios/Sources/ToastPlugin/ToastPlugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import Capacitor

@objc(ToastPlugin)
public class ToastPlugin: CAPPlugin, CAPBridgedPlugin {
public let identifier = "ToastPlugin"
public let jsName = "Toast"
public let identifier = "ToastPlugin"
public let jsName = "Toast"
public let pluginMethods: [CAPPluginMethod] = [
CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise),
]
CAPPluginMethod(name: "show", returnType: CAPPluginReturnPromise)
]

@objc func show(_ call: CAPPluginCall) {
guard let text = call.getString("text") else {
Expand Down
9 changes: 0 additions & 9 deletions toast/ios/Tests/ToastPluginTests/ToastPluginTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,5 @@ import XCTest
@testable import ToastPlugin

class ToastTests: XCTestCase {
override func setUp() {
super.setUp()
// Put setup code here. This method is called before the invocation of each test method in the class.
}

override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
super.tearDown()
}

}

0 comments on commit 39fb409

Please sign in to comment.