Skip to content
This repository was archived by the owner on Oct 30, 2024. It is now read-only.

Commit 156be57

Browse files
committed
Improvements to share extension
1 parent 323ae1b commit 156be57

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

Open in Slide/ActionViewController.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
// Copyright © 2019 Haptic Apps. All rights reserved.
77
//
88

9-
import UIKit
109
import MobileCoreServices
10+
import UIKit
1111

1212
class ActionViewController: UIViewController {
1313

@@ -24,7 +24,7 @@ class ActionViewController: UIViewController {
2424
for item in self.extensionContext!.inputItems as! [NSExtensionItem] {
2525
for provider in item.attachments! {
2626
if provider.hasItemConformingToTypeIdentifier("public.url") {
27-
provider.loadItem(forTypeIdentifier: "public.url", options: nil, completionHandler: { (url, error) -> Void in
27+
provider.loadItem(forTypeIdentifier: "public.url", options: nil, completionHandler: { (url, _) -> Void in
2828
if let shareURL = url as? NSURL {
2929
print("Got URL!")
3030
urlFound = true
@@ -46,7 +46,7 @@ class ActionViewController: UIViewController {
4646
}
4747

4848
if urlFound {
49-
// We only handle one image, so stop looking for more.
49+
//Only do first link
5050
break
5151
}
5252
}
@@ -60,6 +60,7 @@ class ActionViewController: UIViewController {
6060
}
6161
responder = responder?.next
6262
}
63+
self.extensionContext!.cancelRequest(withError: NSError())
6364
return false
6465
}
6566

Open in Slide/Base.lproj/MainInterface.storyboard

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@
3232
</navigationItem>
3333
</items>
3434
</navigationBar>
35-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Opening in Slide..." textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yTo-ny-vFD">
35+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="Opening in Slide..." textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="yTo-ny-vFD">
3636
<rect key="frame" x="21" y="105" width="278" height="76"/>
3737
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMaxY="YES"/>
38-
<fontDescription key="fontDescription" type="boldSystem" pointSize="33"/>
38+
<fontDescription key="fontDescription" type="boldSystem" pointSize="22"/>
3939
<color key="textColor" cocoaTouchSystemColor="groupTableViewBackgroundColor"/>
4040
<nil key="highlightedColor"/>
4141
</label>
4242
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" image="slide_ios_rounded" translatesAutoresizingMaskIntoConstraints="NO" id="S52-em-KOQ">
43-
<rect key="frame" x="38.924456699060556" y="200.23615657743858" width="240.00000000000003" height="128.00000000000003"/>
43+
<rect key="frame" x="39" y="200" width="240" height="128"/>
4444
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
4545
</imageView>
4646
</subviews>

0 commit comments

Comments
 (0)