2016-09-18 5 views
0

페이스 북에서 내 응용 프로그램의 비디오를 공유 할 방법을 찾고 있습니다. 페이스 북에 SDK를 설치하고 지침을 따르지 만 비디오를 공유 할 수없는 이유를 모르겠습니다. 내 클래스 ShareViewController에서 오전iOS Facebook share video Swift

Cannot convert value of type 'ShareViewController' to expected argument type 'FBSDKSharingDelegate!' 

참고 :

let fbVideo:FBSDKShareVideo = FBSDKShareVideo() 
fbVideo.videoURL = url 
let content: FBSDKShareVideoContent = FBSDKShareVideoContent() 
content.video = fbVideo 
FBSDKShareDialog.showFromViewController(self, withContent: content, delegate: self) 

나는 매개 변수 위임 한 오류가 있습니다.

다른 방법으로 페이스 북에서 비디오를 공유 할 수 있습니까? 감사합니다

답변

0

showFromViewController:withContent:delegate: 메서드는 대리자 인수가 FBSDKSharingDelegate이 될 것으로 예상합니다. 해당보기 컨트롤러가 해당 유형을 준수하지 않음을 의미하는 ShareViewController이 아닌 값 (FBSDKSharingDelegate)을 제공하고 있습니다. 보기 컨트롤러를 유형 FBSDKSharingDelegate에 맞게 만들어야합니다. 예를 들어 :

class ShareViewController: UIViewController, FBSDKSharingDelegate { 
    // code 
} 

또는 FBSDKSharingDelegate를 입력 따르는 다른 객체에 전달합니다.

+0

답변 해 주셔서 감사합니다. 그러나 FBSDKSharingDelegate 모듈을 구현하려고 할 때 클래스가 적합하지 않다고 말했다. 나는 (내 지식으로) FBSDKSharingDelegate 유형의 객체를 가지고 있지 않다. –