Learn Courses My Dashboard

Import Exel Data into Array with SwiftUi

I’m using SwiftUi and trying to write code that has the user select an excel worksheet on the iPhone Files App and then import the data into an Array.

The worksheet contains rows of integer data.

Any tips on example code or help topics/tutorials that can help me in my quest?

Hello, there are a few options, first to to “convert” your excel file into a CSV . this will make the data into an easily readable format using the normal file reading option for swift
its still a bit complicated and requires some permissions but here should be good place to start Reading, Writing, and Deleting Files in Swift | by Corey Davis | Medium

if you are part of our CWC+ membership you can check out the "iOS Bento (UIKit) on the list of courses there should be a how to read from a file bento here as well

or you can try to look for a cocoapods that can read excel data and use it on your project. check out cocoapods here if you are not familiar CocoaPods Tutorial using Swift and Xcode