---
"@context": https://schema.org
"@type": TechArticle
"@id": https://www.twilio.com/docs/segment/connections/sources/catalog/libraries/mobile/apple/swift-samples#article
headline: Analytics-Swift Code Samples
description: Browse Analytics-Swift code samples, including sample applications and sample plugins, that show common use cases across iOS, macOS, watchOS, and more.
url: https://www.twilio.com/docs/segment/connections/sources/catalog/libraries/mobile/apple/swift-samples
inLanguage: en
dateModified: 2026-06-25T22:35:15.000Z
author:
  "@type": Organization
  name: Twilio Developer Education Team
publisher:
  "@type": Organization
  name: Twilio
---

# Analytics-Swift Code Samples

The following code samples show how to implement common use cases of the Analytics-Swift library across different platforms.

## Sample applications

* [Destinations](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/DestinationsExample)
* [Mac](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/MacExample)
* [Objective C](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/ObjCExample)
* [Segment Extensions](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/SegmentExtensionsExample)
* [SegmentSwiftUI](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/SegmentSwiftUIExample)
* [SegmentWeatherWidget](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/SegmentWeatherWidget)
* [watchOS](https://github.com/segmentio/analytics-swift/tree/main/Examples/apps/watchOSExample)

## Sample plugins

* [Cellular Carrier Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/CellularCarrier.swift)
* [Consent Tracking Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/ConsentTracking.swift)
* [IDFA Collection Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/IDFACollection.swift)
* [Inject Traits Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/InjectTraits.swift)
* [Notification Tracking Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/NotificationTracking.swift)
* [UIKit Screen Tracking Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/other_plugins/UIKitScreenTracking.swift)
* [Custom Screen Tracking Plugin](https://github.com/segmentio/analytics-swift/blob/main/Examples/tasks/CustomScreenTracking.swift)
* [Multi-instance Analytics Extension](https://github.com/segmentio/analytics-swift/blob/main/Examples/tasks/MultiInstance.swift)
