0

The following UIDocument Class method override throws a compiler error:

import UIKit

class MyDocument: UIDocument {

override func loadFromContents(contents: AnyObject,
    ofType typeName: String) throws -> Bool {
         return true
}

}

Error Message:

Method does not override any method from its superclass

This didn't happen in swift 1.2, iOS 8. I can find no documentation indicating the method has been deprecated.

Companion method "contentsForType" does not draw a compiler error.

I've spent days researching this with no resolution.

R Bingham
  • 1
  • 3

1 Answers1

0

The String Type in override func loadFromContents(contents: AnyObject, ofType typeName: String) throws -> Bool { return true }

needs to be an optional override func loadFromContents(contents: AnyObject, ofType typeName: String?) throws -> Bool { return true }

R Bingham
  • 1
  • 3