Add SwiftLint to YetiActionExtension
This commit is contained in:
@@ -274,6 +274,7 @@
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
3A6382BC2D4C7F3300B09B07 /* PBXTargetDependency */,
|
||||
);
|
||||
fileSystemSynchronizedGroups = (
|
||||
3AC2CDAB2D4683AD00A6DEDB /* YetiActionExtension */,
|
||||
@@ -401,6 +402,10 @@
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
3A6382BC2D4C7F3300B09B07 /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
productRef = 3A6382BB2D4C7F3300B09B07 /* SwiftLintBuildToolPlugin */;
|
||||
};
|
||||
3AA480CC2D3DECF20052A05C /* PBXTargetDependency */ = {
|
||||
isa = PBXTargetDependency;
|
||||
target = 3AA480B72D3DECF10052A05C /* Yeti */;
|
||||
@@ -808,6 +813,11 @@
|
||||
/* End XCRemoteSwiftPackageReference section */
|
||||
|
||||
/* Begin XCSwiftPackageProductDependency section */
|
||||
3A6382BB2D4C7F3300B09B07 /* SwiftLintBuildToolPlugin */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = 3AA480F82D3DF0820052A05C /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */;
|
||||
productName = "plugin:SwiftLintBuildToolPlugin";
|
||||
};
|
||||
3AA480F92D3DF10E0052A05C /* SwiftLintBuildToolPlugin */ = {
|
||||
isa = XCSwiftPackageProductDependency;
|
||||
package = 3AA480F82D3DF0820052A05C /* XCRemoteSwiftPackageReference "SwiftLintPlugins" */;
|
||||
|
||||
@@ -22,14 +22,13 @@ class YetiActionExtensionViewController: UIViewController {
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
let textDataType = UTType.plainText.identifier
|
||||
guard itemProvider.hasItemConformingToTypeIdentifier(textDataType) else {
|
||||
done()
|
||||
return
|
||||
}
|
||||
|
||||
itemProvider.loadItem(forTypeIdentifier: textDataType , options: nil) { (providedText, error) in
|
||||
itemProvider.loadItem(forTypeIdentifier: textDataType, options: nil) { (providedText, error) in
|
||||
if let error {
|
||||
self.done(signedEvent: error.localizedDescription)
|
||||
return
|
||||
@@ -44,9 +43,9 @@ class YetiActionExtensionViewController: UIViewController {
|
||||
// set up constraints
|
||||
contentView.view.translatesAutoresizingMaskIntoConstraints = false
|
||||
contentView.view.topAnchor.constraint(equalTo: self.view.topAnchor).isActive = true
|
||||
contentView.view.bottomAnchor.constraint (equalTo: self.view.bottomAnchor).isActive = true
|
||||
contentView.view.bottomAnchor.constraint(equalTo: self.view.bottomAnchor).isActive = true
|
||||
contentView.view.leftAnchor.constraint(equalTo: self.view.leftAnchor).isActive = true
|
||||
contentView.view.rightAnchor.constraint (equalTo: self.view.rightAnchor).isActive = true
|
||||
contentView.view.rightAnchor.constraint(equalTo: self.view.rightAnchor).isActive = true
|
||||
}
|
||||
} else {
|
||||
self.done()
|
||||
@@ -54,7 +53,11 @@ class YetiActionExtensionViewController: UIViewController {
|
||||
}
|
||||
}
|
||||
|
||||
NotificationCenter.default.addObserver(forName: NSNotification.Name("done"), object: nil, queue: nil) { notification in
|
||||
NotificationCenter.default.addObserver(
|
||||
forName: NSNotification.Name("done"),
|
||||
object: nil,
|
||||
queue: nil
|
||||
) { notification in
|
||||
DispatchQueue.main.async {
|
||||
self.done(signedEvent: notification.object as? String)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user