Question: 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](https://stackoverflow.com/questions/24092346/conform-to-protocol-in-viewcontroller-in-swift)

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

Answer: 
`SKPaymentTransactionProtocol` has these methods:

```
func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) 
@optional func paymentQueue(queue: SKPaymentQueue!, removedTransactions transactions: [AnyObject]!)
@optional func paymentQueue(queue: SKPaymentQueue!, restoreCompletedTransactionsFailedWithError error: NSError!)
@optional func paymentQueueRestoreCompletedTransactionsFinished(queue: SKPaymentQueue!)
@optional func paymentQueue(queue: SKPaymentQueue!, updatedDownloads downloads: [AnyObject]!)

```

The first is a required method that your class has to implement in order to conform to the protocol. Add it to your ViewController and the error will disappear.

```
class ViewController: UIViewController, UITextFieldDelegate, UIAlertViewDelegate,   
SKStoreProductViewControllerDelegate, SKPaymentTransactionObserver{
    func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!){/*...*/}
    /*...*/
}

```
For swift use this:

```
public func paymentQueue(queue: SKPaymentQueue, updatedTransactions transactions: [SKPaymentTransaction]) { /* */ }

```

Instead of this:

```
public func paymentQueue(queue: SKPaymentQueue!, updatedTransactions transactions: [AnyObject]!) { /* */ }

```