From 1739821b7e35cb342d80692eadf92f45a9d88e9f Mon Sep 17 00:00:00 2001 From: Sam Odom Date: Tue, 7 Jun 2022 08:42:50 -0700 Subject: [PATCH] Rename SharingValidation protocol to SharingValidatable Reviewed By: joesus Differential Revision: D36945783 fbshipit-source-id: 8a7b25d8f94fec0aea5a5400e2e7894fddbef3b6 --- CHANGELOG.md | 1 + .../FBSDKGamingServicesKit/GameRequestContent.swift | 2 +- .../FBSDKShareKit/Content/AppInviteContent.swift | 2 +- .../FBSDKShareKit/Content/ShareLinkContent.swift | 2 +- .../FBSDKShareKit/Content/ShareMediaContent.swift | 2 +- FBSDKShareKit/FBSDKShareKit/Content/SharePhoto.swift | 2 +- .../FBSDKShareKit/Content/SharePhotoContent.swift | 4 ++-- FBSDKShareKit/FBSDKShareKit/Content/ShareVideo.swift | 2 +- .../FBSDKShareKit/Content/ShareVideoContent.swift | 2 +- FBSDKShareKit/FBSDKShareKit/Content/SharingContent.swift | 2 +- .../{SharingValidation.swift => SharingValidatable.swift} | 8 ++++---- 11 files changed, 15 insertions(+), 14 deletions(-) rename FBSDKShareKit/FBSDKShareKit/Content/{SharingValidation.swift => SharingValidatable.swift} (68%) diff --git a/CHANGELOG.md b/CHANGELOG.md index e35054b4d9..6a0fd8a37c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -36,6 +36,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - Made `LoginManagerLoginResult.declinedPermissions` immutable. - Made `AccessToken.currentAccessToken` use a Swift name of `current`. - Made `AuthenticationToken.currentAuthenticationToken` use a Swift name of `current`. +- Renamed `SharingValidation` protocol to `SharingValidatable`. [2022-06-03](https://github.com/facebook/facebook-ios-sdk/releases/tag/v14.0.0) | [Full Changelog](https://github.com/facebook/facebook-ios-sdk/compare/v13.2.0...v14.0.0) diff --git a/FBSDKGamingServicesKit/FBSDKGamingServicesKit/GameRequestContent.swift b/FBSDKGamingServicesKit/FBSDKGamingServicesKit/GameRequestContent.swift index 5a1735d05c..4496e37281 100644 --- a/FBSDKGamingServicesKit/FBSDKGamingServicesKit/GameRequestContent.swift +++ b/FBSDKGamingServicesKit/FBSDKGamingServicesKit/GameRequestContent.swift @@ -15,7 +15,7 @@ import Foundation /// A model for a game request. @objcMembers @objc(FBSDKGameRequestContent) -public final class GameRequestContent: NSObject, SharingValidation, NSSecureCoding { +public final class GameRequestContent: NSObject, SharingValidatable, NSSecureCoding { /** Used when defining additional context about the nature of the request. diff --git a/FBSDKShareKit/FBSDKShareKit/Content/AppInviteContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/AppInviteContent.swift index ac2ff12c7e..4a32ce9f87 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/AppInviteContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/AppInviteContent.swift @@ -79,7 +79,7 @@ extension AppInviteContent: DependentAsType { // MARK: - Validation -extension AppInviteContent: SharingValidation { +extension AppInviteContent: SharingValidatable { public func validate(options bridgeOptions: ShareBridgeOptions) throws { let validator = try Self.getDependencies().validator diff --git a/FBSDKShareKit/FBSDKShareKit/Content/ShareLinkContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/ShareLinkContent.swift index 96ddbb2591..6386c94c49 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/ShareLinkContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/ShareLinkContent.swift @@ -81,7 +81,7 @@ extension ShareLinkContent: SharingContent { } } -extension ShareLinkContent: SharingValidation { +extension ShareLinkContent: SharingValidatable { /// Asks the receiver to validate that its content or media values are valid. @objc(validateWithOptions:error:) public func validate(options bridgeOptions: ShareBridgeOptions) throws { diff --git a/FBSDKShareKit/FBSDKShareKit/Content/ShareMediaContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/ShareMediaContent.swift index ee81d11a6c..e45156084a 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/ShareMediaContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/ShareMediaContent.swift @@ -68,7 +68,7 @@ extension ShareMediaContent: SharingContent { } } -extension ShareMediaContent: SharingValidation { +extension ShareMediaContent: SharingValidatable { /// Asks the receiver to validate that its content or media values are valid. @objc(validateWithOptions:error:) public func validate(options bridgeOptions: ShareBridgeOptions) throws { diff --git a/FBSDKShareKit/FBSDKShareKit/Content/SharePhoto.swift b/FBSDKShareKit/FBSDKShareKit/Content/SharePhoto.swift index a0b9bbfc0a..fccc6748cd 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/SharePhoto.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/SharePhoto.swift @@ -104,7 +104,7 @@ extension SharePhoto: DependentAsType { // MARK: - Validation -extension SharePhoto: SharingValidation { +extension SharePhoto: SharingValidatable { /// Asks the receiver to validate that its content or media values are valid. @objc(validateWithOptions:error:) public func validate(options bridgeOptions: ShareBridgeOptions) throws { diff --git a/FBSDKShareKit/FBSDKShareKit/Content/SharePhotoContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/SharePhotoContent.swift index d3f4ffd1ed..f0c61a0794 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/SharePhotoContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/SharePhotoContent.swift @@ -113,9 +113,9 @@ extension SharePhotoContent: SharingContent { } } -// MARK: - SharingValidation +// MARK: - SharingValidatable -extension SharePhotoContent: SharingValidation { +extension SharePhotoContent: SharingValidatable { // The number of photos that can be shared at once is restricted private static let photosCountRange = 1 ... 6 diff --git a/FBSDKShareKit/FBSDKShareKit/Content/ShareVideo.swift b/FBSDKShareKit/FBSDKShareKit/Content/ShareVideo.swift index 882b339856..b23e17adab 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/ShareVideo.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/ShareVideo.swift @@ -104,7 +104,7 @@ extension ShareVideo: DependentAsType { // MARK: - Validation -extension ShareVideo: SharingValidation { +extension ShareVideo: SharingValidatable { /// Asks the receiver to validate that its content or media values are valid. @objc(validateWithOptions:error:) public func validate(options bridgeOptions: ShareBridgeOptions) throws { diff --git a/FBSDKShareKit/FBSDKShareKit/Content/ShareVideoContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/ShareVideoContent.swift index 03ca782207..c6235f36d4 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/ShareVideoContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/ShareVideoContent.swift @@ -120,7 +120,7 @@ extension ShareVideoContent: SharingContent { } } -extension ShareVideoContent: SharingValidation { +extension ShareVideoContent: SharingValidatable { @objc(validateWithOptions:error:) public func validate(options bridgeOptions: ShareBridgeOptions) throws { let validator = try Self.getDependencies().validator diff --git a/FBSDKShareKit/FBSDKShareKit/Content/SharingContent.swift b/FBSDKShareKit/FBSDKShareKit/Content/SharingContent.swift index 9077094bc6..eff8ab3567 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/SharingContent.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/SharingContent.swift @@ -11,7 +11,7 @@ import Foundation /// A base interface for content to be shared. @objc(FBSDKSharingContent) -public protocol SharingContent: NSObjectProtocol, SharingValidation { +public protocol SharingContent: NSObjectProtocol, SharingValidatable { /** URL for the content being shared. diff --git a/FBSDKShareKit/FBSDKShareKit/Content/SharingValidation.swift b/FBSDKShareKit/FBSDKShareKit/Content/SharingValidatable.swift similarity index 68% rename from FBSDKShareKit/FBSDKShareKit/Content/SharingValidation.swift rename to FBSDKShareKit/FBSDKShareKit/Content/SharingValidatable.swift index 90c05bca2e..a0c243f63e 100644 --- a/FBSDKShareKit/FBSDKShareKit/Content/SharingValidation.swift +++ b/FBSDKShareKit/FBSDKShareKit/Content/SharingValidatable.swift @@ -8,11 +8,11 @@ import Foundation -/// A base interface for validation of content and media. -@objc(FBSDKSharingValidation) -public protocol SharingValidation { +/// An interface for validatable content and media. +@objc(FBSDKSharingValidatable) +public protocol SharingValidatable { /** - Asks the receiver to validate that its content or media values are valid. + Validate that this content or media contains valid values. - Parameter options: The share bridge options to use for validation. - Throws: If the values are not valid. */