The official Swiss OeV Icons in Swift! 🚞 | Read-only mirror of https://github.com/openTdataCH/oev-icons-swift — SBB. Issues & pull requests at the source.
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2025-05-07 17:42:34 +02:00
preview Fix preview image 2025-01-29 10:36:53 +01:00
sbb-icons@5227b94d4d update submodules and get latest icons 2025-05-07 11:29:14 +02:00
sbb-pictograms@158774de08 Add sbb-icons and sbb-pictograms as submodules 2024-11-29 17:06:26 +01:00
Sources/OEVIcons 🙈 enum creation didn't find its way to github 2025-05-07 16:08:27 +02:00
.gitignore Initial Version of script to generate .xcassets and enum 2024-11-29 22:26:18 +01:00
.gitmodules Add sbb-icons and sbb-pictograms as submodules 2024-11-29 17:06:26 +01:00
copy-svgs-to-assets.swift 🙈 enum creation didn't find its way to github 2025-05-07 16:08:27 +02:00
LICENSE Update Readme.md after import to https://github.com/openTdataCH and add a license 2025-01-28 17:54:23 +01:00
Package.swift Rename target and basic icon set 2024-12-02 10:44:48 +01:00
Readme.md Fix preview image 2025-01-29 10:36:53 +01:00

OeV Icons Swift

oev-icons-preview

This project exposes the official swiss OeV Icons as a Swift Package to be used on Apple platform applications.

Background

SBB publishes these icon sets on GitHub under an Apache License. SBB Icons and Timetable Icons are published on sbb-design-systems/sbb-icons. The Pictograms are published on sbb-design-systems/sbb-pictograms.

This project adds those two repositories as submodules and imports the Timetable Icons and Pictograms to an importable Swift Package.

⚠️ Due to usage restrictions on SBB Icons, those assets are excluded from the package.

For more details about icon sets visit

Usage

Add the Swift Package to your project

Add OEVIconsto your project using Swift Package Manger:

dependencies: [
    .package(url: "https://github.com/openTdataCH/oev-icons-swift.git", branch: "main"),
]

Display the icons

import SwiftUI
import OEVIcons

struct SampleView: View {
    var body: some View {
        // Directly reference assets
        Pictograms.train_right_framed
        OEVIcons.tgv


        // Display asset using image name
        Image("electric-bike-charging-station-left", bundle: Pictograms.bundle)
        Image("ev-77", bundle: OEVIcons.bundle)
    }
}

TODO

  • check if project can be added to opentransportdata
  • transform icon names in generated enum to pascal-case
  • maybe add helper functions from OJP Sample App
  • decide about a kotlin/android version

Import icons and update this project

In order to import the latest icons you have to update the submodules and run ./copy-svgs-to-assets.swift. Commit the changes on a new branch and create a pull request.

When the pull request is approved and merged, a new version tag will be set.

License

The original icons and this project are published under an Apache License. Make sure you comply with the right of use.