---
title: "Comment by Stijn Willems on \"Automatically run Swift code when your framework gets initialized\" | Hashnode"
description: "Did you ever find a was to do a this with a swift package library? You cannot have mixed targets there. I'm thinking of using this https://github.com/bscothern/"
url: "https://hashnode.com/posts/automatically-run-swift-code-when-your-framework-gets-initialized/63d8a05f17b32e37db256704/comment/65f97bdc8f7cb02750dff347"
---

[Discussion](https://hashnode.com/posts/automatically-run-swift-code-when-your-framework-gets-initialized/63d8a05f17b32e37db256704)

Comment [Automatically run Swift code when your framework gets initialized](https://hashnode.com/posts/automatically-run-swift-code-when-your-framework-gets-initialized/63d8a05f17b32e37db256704)

[Stijn Willems](https://hashnode.com/@dooZMen)

[Mar 19, 2024](https://hashnode.com/posts/automatically-run-swift-code-when-your-framework-gets-initialized/63d8a05f17b32e37db256704/comment/65f97bdc8f7cb02750dff347)

Did you ever find a was to do a this with a swift package library? You cannot have mixed targets there. I'm thinking of using this [github.com/bscothern/Once](https://github.com/bscothern/Once) with some other still to define way of working. Do you have a recommended approach?
