Skip to content

SafariServices iOS xcode13.0 beta1

tj_devel709 edited this page Jul 13, 2021 · 3 revisions

#SafariServices.framework https://github.com/xamarin/xamarin-macios/pull/12102

diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariApplication.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariApplication.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariApplication.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariApplication.h	2021-06-02 12:48:21.000000000 -0400
@@ -0,0 +1,10 @@
+// Copyright © 2021 Apple Inc. All rights reserved.
+
+#import <Foundation/Foundation.h>
+#import <SafariServices/SFFoundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+SF_EXTERN NSString * const SFExtensionMessageKey API_AVAILABLE(ios(15.0));
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h	2021-03-16 08:48:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewController.h	2021-06-02 12:45:23.000000000 -0400
@@ -11,6 +11,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @class SFSafariViewControllerConfiguration;
+@class SFSafariViewControllerPrewarmingToken;
 @protocol SFSafariViewControllerDelegate;
 
 typedef NS_ENUM(NSInteger, SFSafariViewControllerDismissButtonStyle) {
@@ -77,6 +78,21 @@
  */
 @property (nonatomic) SFSafariViewControllerDismissButtonStyle dismissButtonStyle API_AVAILABLE(ios(11.0));
 
+/*! @abstract Prewarms a connection to each URL. SFSafariViewController will automatically use a
+    prewarmed connection if possible when loading its initial URL.
+    @param URLs the URLs of servers that SFSafariViewController should prewarm connections to.
+    Only supports URLs with http:// or https:// schemes.
+    @result Returns a token object that corresponds to the requested URLs. You must keep a strong
+    reference to this token as long as you expect the prewarmed connections to remain open. If the same
+    server is requested in multiple calls to this method, all of the corresponding tokens must be
+    invalidated or released to end the prewarmed connection to that server.
+    @discussion This method uses a best-effort approach to prewarming connections, but may delay
+    or drop requests based on the volume of requests made by your app. Use this method when you expect
+    to present SFSafariViewController soon. Many HTTP servers time out connections after a few minutes.
+    After a timeout, prewarming delivers less performance benefit.
+ */
++ (SFSafariViewControllerPrewarmingToken *)prewarmConnectionsToURLs:(NSArray<NSURL *> *)URLs NS_SWIFT_NAME(prewarmConnections(to:)) API_AVAILABLE(ios(15.0));
+
 @end
 
 API_AVAILABLE(ios(9.0)) API_UNAVAILABLE(watchos)
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerActivityButton.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerActivityButton.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerActivityButton.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerActivityButton.h	2021-06-02 12:48:22.000000000 -0400
@@ -0,0 +1,53 @@
+//
+//  SFSafariViewControllerActivityButton.h
+//  SafariServices Framework
+//
+//  Created by Louie Livon-Bemel on 12/8/17.
+//  Copyright © 2017 Apple Inc. All rights reserved.
+//
+
+#import <SafariServices/SFFoundation.h>
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@class SFSafariViewController;
+
+/*!
+ @class SFSafariViewControllerActivityButton
+ A custom button to show in SFSafariViewController's toolbar. When tapped, it will invoke a Share or Action Extension bundled with your app.
+ @discussion The default VoiceOver description of this button is the `CFBundleDisplayName` set in the extension's Info.plist.
+ To set a different description for VoiceOver to read, set this object's `accessibilityLabel` property.
+ */
+SF_EXTERN API_AVAILABLE(ios(15.0))
+NS_SWIFT_NAME(SFSafariViewController.ActivityButton)
+@interface SFSafariViewControllerActivityButton : NSObject <NSCopying, NSSecureCoding>
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+/*! @abstract Initializes an SFSafariViewControllerActivityButton with the given image, accessibility label, and extension bundle identifier.
+    @param templateImage the image to show in SFSafariViewController's toolbar. This is a template image that will get the same color as all
+        other buttons, defined by @link -[SFSafariViewController preferredControlTintColor] @/link. This image should look similar to the
+        other buttons in SFSafariViewController, and should be close to a 1:1 aspect ratio.
+    @param extensionIdentifier the bundle identifier of the Action or Sharing Extension to run when the button is tapped. The extension can run
+        JavaScript and present a view controller, as if it were selected from the UIActivityViewController in Safari or SFSafariViewController.
+        This extension must be part of your app or another app with the same Team ID.
+ */
+- (instancetype)initWithTemplateImage:(UIImage *)templateImage extensionIdentifier:(NSString *)extensionIdentifier NS_DESIGNATED_INITIALIZER;
+
+/*! @abstract A template image to use for the toolbar button. This button should look similar to the rest of SFSafariViewController's buttons,
+    and be close to a 1:1 aspect ratio. The button will inherit the tint color set by @link -[SFSafariViewController preferredControlTintColor] @/link.
+ */
+@property (nonatomic, nullable, readonly, copy) UIImage *templateImage;
+
+/*! @abstract The Bundle Identifier of the extension that should be ran when the button is tapped. This extension can run JavaScript
+    and present a UIViewController, just as if it was selected from the UIActivityViewController in Safari or SFSafariViewController.
+    This extension must be part of your app or another app with the same Team ID.
+ */
+@property (nonatomic, nullable, readonly, copy) NSString *extensionIdentifier;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h	2021-03-16 08:48:41.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerConfiguration.h	2021-06-02 12:48:22.000000000 -0400
@@ -8,6 +8,8 @@
 #import <SafariServices/SFFoundation.h>
 #import <UIKit/UIKit.h>
 
+@class SFSafariViewControllerActivityButton;
+
 NS_ASSUME_NONNULL_BEGIN
 
 SF_EXTERN API_AVAILABLE(ios(11.0))
@@ -25,6 +27,11 @@
  */
 @property (nonatomic) BOOL barCollapsingEnabled;
 
+/*! @abstract An additional button to be shown in SFSafariViewController's toolbar. See @link SFSafariViewControllerActivityButton @/link for more details.
+ @discussion This allows the user to access powerful functionality from your extension without needing to first show the UIActivityViewController.
+ */
+@property (nonatomic, nullable, copy) SFSafariViewControllerActivityButton *activityButton API_AVAILABLE(ios(15.0));
+
 @end
 
 NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerPrewarmingToken.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerPrewarmingToken.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerPrewarmingToken.h	1969-12-31 19:00:00.000000000 -0500
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SFSafariViewControllerPrewarmingToken.h	2021-06-02 12:48:21.000000000 -0400
@@ -0,0 +1,21 @@
+// Copyright © 2021 Apple Inc. All rights reserved.
+
+#import <SafariServices/SFFoundation.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+SF_EXTERN API_AVAILABLE(ios(15.0))
+NS_SWIFT_NAME(SFSafariViewController.PrewarmingToken)
+@interface SFSafariViewControllerPrewarmingToken : NSObject
+
+- (instancetype)init NS_UNAVAILABLE;
++ (instancetype)new NS_UNAVAILABLE;
+
+/*! @abstract Ends all prewarmed connections associated with the token, except for connections
+    that are also kept alive by other tokens.
+ */
+- (void)invalidate;
+
+@end
+
+NS_ASSUME_NONNULL_END
diff -ruN /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h
--- /Applications/Xcode_12.5.0.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h	2021-03-16 08:41:33.000000000 -0400
+++ /Applications/Xcode_13.0.0-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/System/Library/Frameworks/SafariServices.framework/Headers/SafariServices.h	2021-06-01 23:10:27.000000000 -0400
@@ -10,6 +10,9 @@
 #import <SafariServices/SFContentBlockerState.h>
 #import <SafariServices/SFError.h>
 #import <SafariServices/SFFoundation.h>
+#import <SafariServices/SFSafariApplication.h>
 #import <SafariServices/SFSafariViewController.h>
+#import <SafariServices/SFSafariViewControllerActivityButton.h>
 #import <SafariServices/SFSafariViewControllerConfiguration.h>
+#import <SafariServices/SFSafariViewControllerPrewarmingToken.h>
 #import <SafariServices/SSReadingList.h>
Clone this wiki locally