bugsnag / bugsnag-cocoa-performance

Monitor the start-up, screen loading and network requests of your iOS app and see the results in your BugSnag dashboard.
https://docs.bugsnag.com/performance/integration-guides/ios
MIT License
11 stars 8 forks source link

Add API to support UIViewControllers that use generics #250

Closed kstenerud closed 4 months ago

kstenerud commented 4 months ago

Goal

UIViewControllers that use generics are no longer Objective-C classes, and can therefore not be automatically instrumented (they're bound at compile time and cannot be swizzled). We therefore need another way to instrument them.

Design

Since a bug in Apple code causes it to crash when an NSProxy is used for a UIViewController, the next best thing is to create a transparent wrapper view to put around the view we're interested in.

Changeset

Added an API .bugsnagTraced() which is similar to the approach used for SwiftUI

Testing

Added e2e test.

github-actions[bot] commented 4 months ago

BugsnagPerformance.framework binary size increased by 376 bytes from 509,888 to 510,264

    FILE SIZE        VM SIZE    
 --------------  -------------- 
  +0.1%    +248  +0.1%    +248    String Table
  +0.1%    +128  +0.1%    +128    Symbol Table
  +0.1%    +104  +0.1%    +104    __TEXT,__text
  +0.3%     +34  +0.3%     +34    __TEXT,__objc_methname
  +0.3%     +32  +0.3%     +32    __TEXT,__objc_stubs
  +0.3%     +12  +0.3%     +12    __TEXT,__unwind_info
  +0.3%      +8  +0.3%      +8    __DATA,__objc_selrefs
  +0.0%      +4  +0.0%      +4    __TEXT,__gcc_except_tab
  -0.1%      -8  -0.1%      -8    [__DATA]
  -0.4%    -186  -0.4%    -186    [__TEXT]
  [ = ]       0  -2.6%    -376    [__LINKEDIT]
  +0.1%    +376  [ = ]       0    TOTAL

Generated by :no_entry_sign: Danger