Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Swift List of Int type #3036

Closed
sudeep23 opened this issue Dec 25, 2015 · 3 comments
Closed

Swift List of Int type #3036

sudeep23 opened this issue Dec 25, 2015 · 3 comments
Assignees
Labels

Comments

@sudeep23
Copy link

I need to create an array of Int like [1,2,3].
But i cannot use
var days = List<Int>()
So, what is the workaround to get this?

Following is the complete class which extends Object and Mappable for ObjectMapper

class OfficeTimingData:Object, Mappable{
    dynamic var fromHour:String?
    dynamic var toHour:String?
    //var days: [Int]?
    var days = List<Int>()

    required convenience init?(_ map: Map) {
        self.init()
    }

    func mapping(map: Map) {
        fromHour <- map["fromHour"]
        toHour <- map["toHour"]
        days <- map["days"]
    }
}
@mrackwitz mrackwitz self-assigned this Dec 25, 2015
@mrackwitz
Copy link
Contributor

Lists of primitives are not supported yet. There is issue #1120 to track adding support for that. You'll find there some ideas how you can workaround that currently.

@borut-t
Copy link

borut-t commented Jan 5, 2016

+1

@realm-ci realm-ci removed the pending label Jan 5, 2016
@mrackwitz
Copy link
Contributor

Closing this issue in favor of #1120.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants