I put the file in my project. If I don't comment out line 17 nothing compiles. I have tried a few different things but with no luck yet. Any pointers pardon the pun, would be great.
import SwiftUI
import Foundation
// Determine the file name
let filename = "OOMA CC Temp.txt"
// Read the contents of the specified file
let contents = try! String(contentsOfFile: filename)
// Split the file into separate lines
let lines = contents.split(separator:"\n")
// Iterate over each line and print the line
func printLine()->String {
// var oneLine: String = "Hello to all"
var myCounter: Int = 0
myCounter = lines.count
myCounter += myCounter + 1
let str1 = String(myCounter)
return str1
}
struct CCdata : View {
var body: some View {
Text(printLine())
}
}