@@ -87,7 +87,7 @@ To capture all errors, initialize the SDK as soon as possible, such as in your `
8787
8888<PlatformSection notSupported = { [" apple.tvos" , " apple.watchos" , " apple.visionos" ]} >
8989
90- ``` swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12 ", "profiling": "14-24 "}}
90+ ``` swift {tabTitle:Swift} {"onboardingOptions": {"performance": "13-16 ", "profiling": "18-28 "}}
9191import Sentry
9292
9393func application (_ application : UIApplication,
@@ -97,13 +97,13 @@ func application(_ application: UIApplication,
9797 options.dsn = " ___PUBLIC_DSN___"
9898 options.debug = true // Enabled debug when first installing is always helpful
9999
100- // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
101- // We recommend adjusting this value in production.
102- options.tracesSampleRate = 1.0
103-
104100 // Adds IP for users.
105101 // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
106102 options.sendDefaultPii = true
103+
104+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
105+ // We recommend adjusting this value in production.
106+ options.tracesSampleRate = 1.0
107107 }
108108
109109 // Manually call startProfiler and stopProfiler to profile any code that runs in between.
@@ -121,7 +121,7 @@ func application(_ application: UIApplication,
121121}
122122```
123123
124- ``` objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11 ", "profiling": "13-23 "}}
124+ ``` objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "12-15 ", "profiling": "17-27 "}}
125125@import Sentry;
126126
127127- (BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
@@ -130,13 +130,13 @@ func application(_ application: UIApplication,
130130 options .dsn = @" ___PUBLIC_DSN___" ;
131131 options .debug = YES ; // Enabled debug when first installing is always helpful
132132
133- // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
134- // We recommend adjusting this value in production.
135- options .tracesSampleRate = @1.0 ;
136-
137133 // Adds IP for users.
138134 // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
139135 options .sendDefaultPii = YES
136+
137+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
138+ // We recommend adjusting this value in production.
139+ options .tracesSampleRate = @1.0 ;
140140 } ] ;
141141
142142 // Manually call startProfiler and stopProfiler to profile any code that runs in between.
@@ -154,7 +154,7 @@ func application(_ application: UIApplication,
154154}
155155```
156156
157- ``` swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "9-12 ", "profiling": "13-16 "}}
157+ ``` swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "13-16 ", "profiling": "18-28 "}}
158158import Sentry
159159
160160@main
@@ -164,26 +164,33 @@ struct SwiftUIApp: App {
164164 options.dsn = " ___PUBLIC_DSN___"
165165 options.debug = true // Enabled debug when first installing is always helpful
166166
167+ // Adds IP for users.
168+ // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
169+ options.sendDefaultPii = true
170+
167171 // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
168172 // We recommend adjusting this value in production.
169173 options.tracesSampleRate = 1.0
174+ }
170175
171- // Sample rate for profiling, applied on top of TracesSampleRate.
172- // We recommend adjusting this value in production.
173- options.profilesSampleRate = 1.0
176+ // Manually call startProfiler and stopProfiler to profile any code that runs in between.
177+ SentrySDK.startProfiler ()
174178
175- // Adds IP for users.
176- // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
177- options.sendDefaultPii = true
178- }
179+ //
180+ // ...anything here will be profiled...
181+ //
182+
183+ // Calls to stopProfiler are optional - if you don't stop the profiler, it will keep profiling
184+ // your application until the process exits, the app goes to the background, or stopProfiling is called.
185+ SentrySDK.stopProfiler ()
179186 }
180187}
181188```
182189</PlatformSection >
183190
184191<PlatformSection notSupported = { [" apple.ios" , " apple.macos" ]} >
185192
186- ``` swift {tabTitle:Swift} {"onboardingOptions": {"performance": "9-12 "}}
193+ ``` swift {tabTitle:Swift} {"onboardingOptions": {"performance": "13-16 "}}
187194import Sentry
188195
189196func application (_ application : UIApplication,
@@ -193,20 +200,20 @@ func application(_ application: UIApplication,
193200 options.dsn = " ___PUBLIC_DSN___"
194201 options.debug = true // Enabled debug when first installing is always helpful
195202
196- // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
197- // We recommend adjusting this value in production.
198- options.tracesSampleRate = 1.0
199-
200203 // Adds IP for users.
201204 // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
202205 options.sendDefaultPii = true
206+
207+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
208+ // We recommend adjusting this value in production.
209+ options.tracesSampleRate = 1.0
203210 }
204211
205212 return true
206213}
207214```
208215
209- ``` objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "8-11 "}}
216+ ``` objc {tabTitle:Objective-C} {"onboardingOptions": {"performance": "12-15 "}}
210217@import Sentry;
211218
212219- (BOOL )application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
@@ -215,20 +222,20 @@ func application(_ application: UIApplication,
215222 options .dsn = @" ___PUBLIC_DSN___" ;
216223 options .debug = YES ; // Enabled debug when first installing is always helpful
217224
218- // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
219- // We recommend adjusting this value in production.
220- options .tracesSampleRate = @1.0 ;
221-
222225 // Adds IP for users.
223226 // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
224227 options .sendDefaultPii = YES
228+
229+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
230+ // We recommend adjusting this value in production.
231+ options .tracesSampleRate = @1.0 ;
225232 } ] ;
226233
227234 return YES;
228235}
229236```
230237
231- ``` swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "9-12 "}}
238+ ``` swift {tabTitle:SwiftUI with App conformer} {"onboardingOptions": {"performance": "13-16 "}}
232239import Sentry
233240
234241@main
@@ -238,13 +245,13 @@ struct SwiftUIApp: App {
238245 options.dsn = " ___PUBLIC_DSN___"
239246 options.debug = true // Enabled debug when first installing is always helpful
240247
241- // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
242- // We recommend adjusting this value in production.
243- options.tracesSampleRate = 1.0
244-
245248 // Adds IP for users.
246249 // For more information, visit: https://docs.sentry.io/platforms/apple/data-management/data-collected/
247250 options.sendDefaultPii = true
251+
252+ // Set tracesSampleRate to 1.0 to capture 100% of transactions for performance monitoring.
253+ // We recommend adjusting this value in production.
254+ options.tracesSampleRate = 1.0
248255 }
249256 }
250257}
0 commit comments