xml - Implementing a custom Decoder in Swift 4 -


i'd decode xml document using new decodable protocol introduced in swift 4, however, there doesn't seem existing implementation xml decoder conforms decoder protocol.

my plan use swxmlhash library parse xml, possibly make xmlindexer class in library extend decoder protocol model can initialized instance of xmlindexer (xmlindexer returned swxmlhash.parse(xmlstring)).

xmlindexer+decoder.swift

my issue have no clue how implement decoder protocol , can't seem find resources online explain how it's done. every resource i've found strictly mentions jsondecoder class included swift standard library , no resource i've found addresses issue of creating own custom decoder.


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -