Trying to add a protocol to a Class signature in swift

krisacorn

I'm trying to create an in-app purchase in swift. In my class signature, I have the following:

class ViewController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate,   
SKStoreProductViewControllerDelegate, SKPaymentTransactionObserver{

However, I get an error message: type "ViewController" does not conform to protocol: SKPaymentTransactionObserver

I've read this: https://developer.apple.com/library/prerelease/mac/documentation/Swift/Conceptual/BuildingCocoaApps/WritingSwiftClassesWithObjective-CBehavior.html and Conform to protocol in ViewController, in Swift

The SKSoreProductViewControllerDelegate works fine. What am I missing, please?

Dean Davids

Have you implemented the required methods in your class?

paymentQueue:updatedTransactions: and paymentQueue:updatedDownloads: are required methods and you will get a warning if they are not implemented.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Add class property to protocol in Swift

Class to protocol conversation in swift

Swift Protocol of a particular class

Swift Protocol on a specific class?

Trying to understand protocol/delegates in Swift

Swift Class Pointer as? Class Protocol?

Swift: Is it possible to add a protocol extension to a protocol?

When to use `protocol` and `protocol: class` in Swift?

ios swift class conforming protocol

Requiring Protocol and Class in Swift Properties

Swift Property that conforms to a Protocol and Class

Swift protocol & weak references with class

Swift: the type of a class that implements a protocol

Swift Protocol as Generic Parameter to Class

Protocol Extension in Swift Where Object Is a Class and conforms to a Protocol

Are mixed class/protocol type constraints allowed in Swift protocol extensions?

Swift 3, function in protocol that return object of class that conforms to a protocol

How to conform a class to a protocol in Swift and can protocol methods be overridden?

Swift 2 add protocol conformance to protocols

Swift class "does not implement (objc) protocol"

Swift protocol in Objective-C class

Object initialization with protocol and class name in swift

How to convert/cast from a protocol to a class in swift?

Importing a Swift protocol in Objective-C class

How to make a class conform to a protocol in Swift?

Class conforming to protocol as function parameter in Swift

Swift Class Extension Only When Conforming to Protocol

Implementing Objective-C protocol in Swift class

Swift Generic Protocol Class Type in Array