I am trying to do a simple table scan with AWS and DynamoDB using Swift. I am new to apple programming and not sure what the issue is. The documentation for AWS SDK is all in objective C and the examples AWS give for Swift are rubbish.
The best info I got was from a question here so I have been trying to work through it.
Best way to make Amazon AWS DynamoDB queries using Swift?
There are too many error for one question so I will break it up into multiple questions:
The first part I tried to do is my class item which defines the mapping from the database "Item"
I have written my code and the errors I am getting underneath each line in bold:
class Item : NSObject, AWSDynamoDBModel, AWSDynamoDBModeling {
'Item' does not conform to protocol 'AWSDynamoDBModeling'
var Artist : String = ""
var SongTitle : String = ""
var AlbumTitle : String = ""
var Category : String = ""
var PictureURL : String = ""
var SongURL : String = ""
var Location : String = ""
var AVGMusicianRating : Int = 0
var AVGUserRating : Int = 0
var SongDuration : Int = 0
var SongID : Int = 0
override init!() { super.init() }
Failable initializer 'init()' cannot override a non-failable initializer
required init!(coder: NSCoder!) {
fatalError("init(coder:) has not been implemented")
}
class func dynamoDBTableName() -> String! {
return "Songs"
}
class func hashKeyAttribute() -> Int! {
return SongID
}
Instance member 'SongID' cannot be used on type 'Item' (My hash Key is an int not string)
//required to let DynamoDB Mapper create instances of this class
override init(dictionary dictionaryValue: [NSObject : AnyObject]!, error: NSErrorPointer)
Initializer does not override a designated initializer from its superclass
{
super.init(dictionary: dictionaryValue, error: error)
}
//workaround to possible XCode 6.1 Bug : "Type NotificationAck" does not conform to protocol "NSObjectProtocol"
override func isEqual(anObject: AnyObject?) -> Bool {
return super.isEqual(anObject)
}
}
Thanks in advance.