冗余一致性';ViewController';至协议';分享代表';在iOS Swift中将FBSDKCore更新为5.6.0后

冗余一致性';ViewController';至协议';分享代表';在iOS Swift中将FBSDKCore更新为5.6.0后,ios,swift,facebook-share,fbsdksharekit,Ios,Swift,Facebook Share,Fbsdksharekit,目前我正在swift中开发一个iOS应用程序。在我的应用程序中,我使用FacebookShare pods(FBSDKCoreKit 4.46.0)将内容共享到Facebook。为此,我被用做FBSDKSharingDelegate。今天我将pod更新为FBSDKCoreKit,更新为5.6.0。更新后,我在代码中得到了一些建议,比如 “FBSDKSharingDelegate”已重命名为“SharingDelegate” 所以我把它改成了SharingDelegate,我的代码也改了。但现在它

目前我正在swift中开发一个iOS应用程序。在我的应用程序中,我使用FacebookShare pods(FBSDKCoreKit 4.46.0)将内容共享到Facebook。为此,我被用做FBSDKSharingDelegate。今天我将pod更新为FBSDKCoreKit,更新为5.6.0。更新后,我在代码中得到了一些建议,比如

“FBSDKSharingDelegate”已重命名为“SharingDelegate”

所以我把它改成了SharingDelegate,我的代码也改了。但现在它显示出另一个错误

“ProductDetailViewController”与协议的冗余一致性 “共享代表”

我在谷歌上搜索,没有找到任何解决方案。请帮帮我

这些是我在ViewController类中使用的协议

class customViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, MFMailComposeViewControllerDelegate, UIGestureRecognizerDelegate, UITextViewDelegate, UIScrollViewDelegate, GADBannerViewDelegate, SharingDelegate 
{

}
我不知道哪一个协议与SharingDelegate是多余的

这些是我在项目中使用的pod文件, 吊舱“Alamofire”,“~>4.5”

pod 'AlamofireImage', '~> 3.0'
pod 'SwiftyJSON'
pod 'RAMAnimatedTabBarController'

pod 'FacebookCore', '0.9.0'
pod 'FacebookLogin', '0.9.0'
pod 'FacebookShare', '0.9.0'
pod 'FBAudienceNetwork'

pod 'GoogleMaps', '~> 3.3.0'
pod 'GooglePlaces', '~> 3.3.0' 
pod 'GoogleSignIn' 
pod 'Google-Mobile-Ads-SDK' 

pod 'SideMenu'
pod "QRCode"
pod 'SwipeMenuViewController', '~> 2.0.0'
pod "ScrollingFollowView"
pod 'DLRadioButton', '~> 1.4'
pod 'AZDialogView'

pod 'Firebase/Core'
pod 'Firebase/Auth'
pod 'Firebase/Messaging'

pod 'SKActivityIndicatorView', '~> 0.1.0'
pod 'SwiftyGif'
pod 'ImageSlideshow', '~> 1.6'
pod "ImageSlideshow/Alamofire"
pod 'SDWebImage', '~> 4.0'
pod "PhotoSlider"
pod 'lottie-ios'
pod 'CardsLayout'
pod 'Fabric', '~> 1.10.2'
pod 'Crashlytics', '~> 3.13.2'
pod "SkeletonView"
我还在类中导入框架文件

import ImageSlideshow
import AlamofireImage
import CoreLocation
import FacebookShare
import MessageUI
import SKActivityIndicatorView
import FBSDKShareKit
import FBSDKCoreKit
import MapKit
import GoogleMobileAds
import FBAudienceNetwork
根据目前版本的SharingDelegate协议,它只有三个功能:

func sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) {

}

func sharer(_ sharer: Sharing, didFailWithError error: Error) {

}

func sharerDidCancel(_ sharer: Sharing) {

}
您的其他协议都不会覆盖这些函数,因此您的问题不会发生在这里

您可能有一个扩展也实现了这个协议,我可以像这样重现错误:

class FBTestViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, MFMailComposeViewControllerDelegate, UIGestureRecognizerDelegate, UITextViewDelegate, UIScrollViewDelegate, GADBannerViewDelegate, SharingDelegate {

}

extension UIViewController: SharingDelegate {

}
输出:

“FBTestViewController”与协议“SharingDelegate”的冗余一致性

在项目中搜索那些
SharingDelegate
实现(可能在扩展中)并删除它们

编辑

在导入中,注释以下行:

//import FBSDKShareKit
FacebookShare
pod已经为您导入了它。这就是问题的根源

根据,
SharingDelegate
协议在其当前版本中只有三个功能:

func sharer(_ sharer: Sharing, didCompleteWithResults results: [String : Any]) {

}

func sharer(_ sharer: Sharing, didFailWithError error: Error) {

}

func sharerDidCancel(_ sharer: Sharing) {

}
您的其他协议都不会覆盖这些函数,因此您的问题不会发生在这里

您可能有一个扩展也实现了这个协议,我可以像这样重现错误:

class FBTestViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, UICollectionViewDelegate, UICollectionViewDataSource, UICollectionViewDelegateFlowLayout, MFMailComposeViewControllerDelegate, UIGestureRecognizerDelegate, UITextViewDelegate, UIScrollViewDelegate, GADBannerViewDelegate, SharingDelegate {

}

extension UIViewController: SharingDelegate {

}
输出:

“FBTestViewController”与协议“SharingDelegate”的冗余一致性

在项目中搜索那些
SharingDelegate
实现(可能在扩展中)并删除它们

编辑

在导入中,注释以下行:

//import FBSDKShareKit


FacebookShare
pod已经为您导入了它。这就是问题的根源

错误表示您已经遵守了该协议,不要在google中搜索,但在您的代码中我无法找到它。请帮帮我。你重建了吗?是的,我重建了。我退出了Xcode,再次安装pod,然后重新打开Xcode,仍然显示相同的错误。在更新FacebookShare播客之前,它正在工作。当我更新FacebookShare pod时,FBSDKCoreKit pod文件也更新为5.6.0。在更新之前,我使用FBSDKSharingDelegate协议,但在更新之后,我得到了将其更改为SharingDelegate的建议。之后我发现了这个问题。现在我评论了SharingDelegate协议,现在我可以将内容共享到Facebook,但在delegate方法中没有收到任何回调。但是我需要成功回调来进行API调用。错误表示您已经遵守了该协议,不要在google中搜索,但在您的代码中我无法找到它。请帮帮我。你重建了吗?是的,我重建了。我退出了Xcode,再次安装pod,然后重新打开Xcode,仍然显示相同的错误。在更新FacebookShare播客之前,它正在工作。当我更新FacebookShare pod时,FBSDKCoreKit pod文件也更新为5.6.0。在更新之前,我使用FBSDKSharingDelegate协议,但在更新之后,我得到了将其更改为SharingDelegate的建议。之后我发现了这个问题。现在我评论了SharingDelegate协议,现在我可以将内容共享到Facebook,但在delegate方法中没有收到任何回调。但是我需要成功回调来进行API调用。您好,我在整个项目中搜索了alxlives,但是除了这个类之外,我没有在我的项目的任何地方实现SharingDelegate。您能用播客文件和您在这个类中使用的导入编辑这个问题吗?此外,请检查您是否碰巧在项目中链接了手动Facebook框架,该框架可能与podHi I更新我的问题相冲突。我还检查了一下,我没有手动添加Facebook框架。在更新FacebookShare播客之前,我只通过podsIt进行了添加。当我更新FacebookShare pod时,FBSDKCoreKit pod文件也更新为5.6.0。在更新之前,我使用FBSDKSharingDelegate协议,但在更新之后,我得到了将其更改为SharingDelegate的建议。在那之后我得到了这个问题。嗨,我在我的整个项目中搜索了alxlives,但是除了这个类之外,我没有在我的项目的任何地方实现SharingDelegate。你能用你的pod文件和你在这个类中使用的导入来编辑这个问题吗?此外,请检查您是否碰巧在项目中链接了手动Facebook框架,该框架可能与podHi I更新我的问题相冲突。我还检查了一下,我没有手动添加Facebook框架。在更新FacebookShare播客之前,我只通过podsIt进行了添加。当我更新FacebookShare pod时,FBSDKCoreKit pod文件也更新为5.6.0。在更新之前,我使用FBSDKSharingDelegate协议,但在更新之后,我得到了将其更改为SharingDelegate的建议。在那之后,我得到了这个问题。