chartbeat-labs / chartbeat-ios-sdk

Other
2 stars 3 forks source link

SwiftUI support #19

Open gwangpa opened 2 years ago

gwangpa commented 2 years ago

Hi there,

I tried to use this SDK for SwiftUI project but it doesn't seem to work

This is what I did briefly

import SwiftUI

struct MyView: View {
  var body: some View {
    Text("Hello world")
      .onAppear {
         CBTracker.shared().trackView(self, viewId: #view_id, title: #title)
      }
  }
}

And app crashed when I call the trackView(:viewId:title) with this error

2022-08-16 11:15:20.775438+1000 App[18288:236085] -[__SwiftValue bounds]: unrecognized selector sent to instance 0x600001a95c20
2022-08-16 11:15:20.783073+1000 App[18288:236085] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__SwiftValue bounds]: unrecognized selector sent to instance 0x600001a95c20'

Or am I missing something?

I wonder if you have plan to support SwiftUI?

Cheers, Dan

rabufeti commented 1 year ago

I've the same issue Is there any update on this?