mirror of
https://github.com/groue/GRDB.swift
synced 2026-11-26 04:07:50 +00:00
Remove UIImage experiment
This commit is contained in:
1 parent
0c8da84ecb
commit
0bb481c93e
2 files changed
-38
No files matched your search
@@ -158,7 +158,6 @@
|
||||
5623E0901B4AFACC00B20B7F /* GRDBTestCase.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GRDBTestCase.swift; sourceTree = "<group>"; };
|
||||
5683C2681B4D445E00296494 /* libsqlite3.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libsqlite3.dylib; path = Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.4.sdk/usr/lib/libsqlite3.dylib; sourceTree = DEVELOPER_DIR; };
|
||||
56997A8D1B5390D4005EBEED /* DatabaseErrorFromSelectStatementTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseErrorFromSelectStatementTests.swift; sourceTree = "<group>"; };
|
||||
56A237FE1B9C69E60082EB20 /* UIImage.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UIImage.swift; sourceTree = "<group>"; };
|
||||
56A238011B9C6A650082EB20 /* DatabaseDateComponents.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DatabaseDateComponents.swift; sourceTree = "<group>"; };
|
||||
56A238041B9C6D670082EB20 /* NSDate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NSDate.swift; sourceTree = "<group>"; };
|
||||
56A238081B9C6DD20082EB20 /* StandardLibraryTypes.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = StandardLibraryTypes.swift; sourceTree = "<group>"; };
|
||||
@@ -296,14 +295,6 @@
|
||||
path = DatabaseError;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56A237FD1B9C69DA0082EB20 /* UIKit */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
56A237FE1B9C69E60082EB20 /* UIImage.swift */,
|
||||
);
|
||||
path = UIKit;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
56A238001B9C6A1E0082EB20 /* Foundation */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
@@ -557,7 +548,6 @@
|
||||
56A238911B9C750B0082EB20 /* Migrations */,
|
||||
56A2389F1B9C753B0082EB20 /* RowModel */,
|
||||
56A238071B9C6DAD0082EB20 /* Swift */,
|
||||
56A237FD1B9C69DA0082EB20 /* UIKit */,
|
||||
DC37743319C8CFCE004FCF85 /* Supporting Files */,
|
||||
);
|
||||
path = GRDB;
|
||||
|
||||
@@ -1,28 +0,0 @@
|
||||
import UIKit
|
||||
|
||||
// UIImage experiment.
|
||||
// This code is not included in any public target.
|
||||
extension UIImage : DatabaseValueConvertible {
|
||||
/// Returns a value that can be stored in the database.
|
||||
public var databaseValue: DatabaseValue {
|
||||
if let data = UIImagePNGRepresentation(self) {
|
||||
return data.databaseValue
|
||||
} else {
|
||||
return .Null
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
Returns an UIImage initialized from *databaseValue*, if possible.
|
||||
|
||||
- parameter databaseValue: A DatabaseValue.
|
||||
- returns: An optional UIImage.
|
||||
*/
|
||||
public static func fromDatabaseValue(databaseValue: DatabaseValue) -> Self? {
|
||||
if let data = NSData.fromDatabaseValue(databaseValue) {
|
||||
return self.init(data: data)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user