JcampConverter is a open-source package to convert JCAMP-DX files to spectra.
If you use this libary, it will be great if you can cite this on your works
Lan Le. (2023). jcamp-converter-ios (0.1.1). Zenodo. https://doi.org/10.5281/zenodo.8022920
JcampConverter is released as dependency package on CocoaPods.
1.1. Setting up cocoapods
You can by pass this step if your project is using cocoapods.
Open your terminal, navigate to the project's location and type
pod init
1.2. Add JcampConverter
Open Podfile
and add
pod 'JcampConverter', '~> 0.1.1'
or
pod` 'JcampConverter', :git => 'https://github.com/baolanlequang/jcamp-converter-ios'
Open your terminal, navigate to the project's location and the following commad to install MoJcampConverter to your project.
pod install
Open your <Project_Name>.xcworkspace
2.1. Import JcampConverter
import JcampConverter
2.2. Using the converter
let jcampData = "<url string or content of your jcamp file>"
let jcamp = Jcamp(jcampData)
You can clone project jcamp-viewer-ios to see how it works.