Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Lennaert van Dijke
    @Lennaert

    When I follow the examples, I'm getting this error in the latest Xcode version & Swift2 :
    Value of type '(AnyObject) throws -> T' has no member 'DecodedType'

    (When I try decode(object))

    Sho Ikeda
    @ikesyo
    I'm not sure what is happening here, could you please more detailed sample code? And also the exact Xcode version ("latest" means Xcode 7.0 or 7.1 beta?).
    Lennaert van Dijke
    @Lennaert

    Sorry for being unclear, I actually I just tried this https://github.com/ishkawa/APIKit (Your pull request to use it in combination with Himotoki).
    I just used the example there, and it get stuck on this:

    func responseFromObject(object: AnyObject, URLResponse: NSHTTPURLResponse) -> Response? {
            return decode(object) // get Response from AnyObject using Himotoki
    }

    With latest I actually meant 7.0 from the AppStore.

    Sho Ikeda
    @ikesyo
    I understand the situation, the decode function signature is changed to decode(AnyObject) throws -> T that was decode(AnyObject) -> T? previously. The change is introduced by ikesyo/Himotoki#31.
    So you should do as follows now in responseFromObject: return try? decode(object)
    Lennaert van Dijke
    @Lennaert
    Thank you very much ikesyo! That was a simple fix ;) facepalm. All the best!
    Sho Ikeda
    @ikesyo
    No problem and thank you too for your attention to this library! :relaxed:
    Lennaert van Dijke
    @Lennaert
    Yes it's a great way to handle JSON and I also use it to learn more Swift. Thank you for sharing it!
    Cons Bulaqueña
    @consbulaquena
    Superb library, ikesyo! I am trying to learn from your code. :)
    Florian Krüger
    @floriankrueger
    Hi there, I really like Himotoki, thank you very much for creating and maintaining it! Since the 2.0-beta I have an issue. Before that, I decoded ISO 8601 Date Strings in JSON using this snippet: https://gist.github.com/floriankrueger/9e69cbe33706e6bd016ebe0cee2fe175
    Now, it says that decode needs to return Self instead of NSDate and I can't currently wrap my head around why this is. I checked your code multiple times but as far as I can see it should still work .. maybe you people are able to give me a hint?
    marcmatta
    @marcmatta
    Hi. Great Library! after updating to version 2.0 however i am now also having the decode needs to return Self when used in non final classes. Problem is i can't make it final as i need to subclass. I've opened an issue for this exactly with all the details of my implementation in Github Himotoki issues. Can someone help please?
    marcmatta
    @marcmatta
    This message was deleted
    Punita Ojha
    @punitaojha
    This message was deleted
    Mark Robinson
    @SparkyRobinson_twitter
    How do I map or transform a single element
    line: (e <| "line").map { (e: Extractor) throws -> SegmentLine in
                    let style = try String.decode(e.value("style"))
                    return try (style == "sold" ? SolidSegmentLine.decode(e) : ThroughLineSegmentLine.decode(e))
                }
    that obviously is not correct, as (e <| "line") is not an array
    but that's the functionality I wish to have
    Mark Robinson
    @SparkyRobinson_twitter
    line: Transformer { (e: Extractor) throws -> SegmentLine in
                    let style = try String.decode(e.value("style"))
                    return try (style == "sold" ? SolidSegmentLine.decode(e) : ThroughLineSegmentLine.decode(e))
                }.apply(e <| "line")
    is that correct?
    Mark Robinson
    @SparkyRobinson_twitter
    anyone ?