A Objective-C wrapper around MobiWriter (https://github.com/cafaxo/MobiWriter)
Using the Swift Package Manager. Add
.package(url: "https://github.com/shinjukunian/MobiWriter-Cocoa.git", .branch("master"))
to dependencies:[]
in your target.
Convert .html files (no / minimal CSS, see the original library for restrictions) or HTML text to the mobipocket format.
import MobiWriter
let page=MobiPage(htmLatURL: htmlURL)
let writer=MobiExporter()
writer.author="Shakespeare"
writer.add(page)
let success=writer.write(to: #myURL)
MIT for the wrapper. See MobiWriter (https://github.com/cafaxo/MobiWriter) for the original library.
Many thanks to the original author.