Can I use Swift Charts in MacOS?

Viewed 87
  1. I created a Xcode project (Xcode 13), it is MacOS App only (not iOS)
  2. run "pod init" to create a Podfile
  3. add "pod 'Charts'" into Podfile
  4. run "pod install" to install the Charts successfully
  5. open Xcode project by open file ".xcworkspace"
  6. import Charts
  7. build pass! but, when I write code below, I have error.
import SwiftUI
import Charts

struct StockPriceView: View {
    var body: some View {
        VStack{
            Charts{ //error: Cannot call value of non-function type 'module<Charts>'
                
            }
            }
        }
}

Does that mean this Chart only available for iOS? thank you very much!

0 Answers
Related