Skip to content

Commit 0913f5d

Browse files
committed
Fix UIImage extension example
Signed-off-by: Stephen Celis <stephen@stephencelis.com>
1 parent 575c881 commit 0913f5d

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

Documentation/Index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,15 +1156,16 @@ We can bridge any type that can be initialized from and encoded to `NSData`.
11561156
``` swift
11571157
// assumes NSData conformance, above
11581158
extension UIImage: Value {
1159-
class var declaredDatatype: String {
1160-
return NSData.declaredDatatype
1159+
public class var declaredDatatype: String {
1160+
return Blob.declaredDatatype
11611161
}
1162-
class func fromDatatypeValue(blobValue: Blob) -> Self {
1163-
return self(data: NSData.fromDatatypeValue(blobValue))
1162+
public class func fromDatatypeValue(blobValue: Blob) -> UIImage {
1163+
return UIImage(data: NSData.fromDatatypeValue(blobValue))!
11641164
}
1165-
var datatypeValue: Blob {
1166-
return UIImagePNGRepresentation(self).datatypeValue
1165+
public var datatypeValue: Blob {
1166+
return UIImagePNGRepresentation(self)!.datatypeValue
11671167
}
1168+
11681169
}
11691170
```
11701171

0 commit comments

Comments
 (0)