home.social

#swiftmacro — Public Fediverse posts

Live and recent posts from across the Fediverse tagged #swiftmacro, aggregated by home.social.

fetched live
  1. EDIT: I had to mark it as trusted

    I'm trying to define and use my first Swift macro. I added the package to the client project. I type import and Xcode suggests OCHamcrestMacros.

    But it complains, "No such module OCHamcrestMacros". What gives? I double-checked that I added the SPM dependency to the correct target. #Swift #SwiftMacro

  2. EDIT: I had to mark it as trusted

    I'm trying to define and use my first Swift macro. I added the package to the client project. I type import and Xcode suggests OCHamcrestMacros.

    But it complains, "No such module OCHamcrestMacros". What gives? I double-checked that I added the SPM dependency to the correct target. #Swift #SwiftMacro

  3. EDIT: I had to mark it as trusted

    I'm trying to define and use my first Swift macro. I added the package to the client project. I type import and Xcode suggests OCHamcrestMacros.

    But it complains, "No such module OCHamcrestMacros". What gives? I double-checked that I added the SPM dependency to the correct target. #Swift #SwiftMacro

  4. EDIT: I had to mark it as trusted

    I'm trying to define and use my first Swift macro. I added the package to the client project. I type import and Xcode suggests OCHamcrestMacros.

    But it complains, "No such module OCHamcrestMacros". What gives? I double-checked that I added the SPM dependency to the correct target. #Swift #SwiftMacro

  5. EDIT: I had to mark it as trusted

    I'm trying to define and use my first Swift macro. I added the package to the client project. I type import and Xcode suggests OCHamcrestMacros.

    But it complains, "No such module OCHamcrestMacros". What gives? I double-checked that I added the SPM dependency to the correct target. #Swift #SwiftMacro

  6. New release of IdentifiedEnumCases Swift Macro!

    Rename generated ID type to `CaseID` which is less likely to collide with existing code.

    Use this Swift Macro to generate an ID type for your enum cases, so that you can refer to the enum case itself when they have associated values. Requires Swift 5.9

    github.com/FullQueueDeveloper/

    #WWDC23 #WWDC #iOSDev #SwiftLang #SwiftMacro #SwiftDeveloper

  7. New release of IdentifiedEnumCases Swift Macro!

    Rename generated ID type to `CaseID` which is less likely to collide with existing code.

    Use this Swift Macro to generate an ID type for your enum cases, so that you can refer to the enum case itself when they have associated values. Requires Swift 5.9

    github.com/FullQueueDeveloper/

    #WWDC23 #WWDC #iOSDev #SwiftLang #SwiftMacro #SwiftDeveloper

  8. New release of IdentifiedEnumCases Swift Macro!

    Rename generated ID type to `CaseID` which is less likely to collide with existing code.

    Use this Swift Macro to generate an ID type for your enum cases, so that you can refer to the enum case itself when they have associated values. Requires Swift 5.9

    github.com/FullQueueDeveloper/

    #WWDC23 #WWDC #iOSDev #SwiftLang #SwiftMacro #SwiftDeveloper

  9. New release of IdentifiedEnumCases Swift Macro!

    Rename generated ID type to `CaseID` which is less likely to collide with existing code.

    Use this Swift Macro to generate an ID type for your enum cases, so that you can refer to the enum case itself when they have associated values. Requires Swift 5.9

    github.com/FullQueueDeveloper/

    #WWDC23 #WWDC #iOSDev #SwiftLang #SwiftMacro #SwiftDeveloper

  10. Introducing `StaticMemberIterable` Swift Macro!

    Confidently cover all static members in tests or in your UI. Like CaseIterable, this macro creates an array of all the static members of a type. This is useful when a type has a few instances of itself as static members.

    github.com/FullQueueDeveloper/

    #WWDC #SwiftMacro #iOSDev #SwiftLang #SwiftDeveloper #WWDC23

  11. Introducing `StaticMemberIterable` Swift Macro!

    Confidently cover all static members in tests or in your UI. Like CaseIterable, this macro creates an array of all the static members of a type. This is useful when a type has a few instances of itself as static members.

    github.com/FullQueueDeveloper/

    #WWDC #SwiftMacro #iOSDev #SwiftLang #SwiftDeveloper #WWDC23

  12. Introducing `StaticMemberIterable` Swift Macro!

    Confidently cover all static members in tests or in your UI. Like CaseIterable, this macro creates an array of all the static members of a type. This is useful when a type has a few instances of itself as static members.

    github.com/FullQueueDeveloper/

    #WWDC #SwiftMacro #iOSDev #SwiftLang #SwiftDeveloper #WWDC23

  13. Introducing `StaticMemberIterable` Swift Macro!

    Confidently cover all static members in tests or in your UI. Like CaseIterable, this macro creates an array of all the static members of a type. This is useful when a type has a few instances of itself as static members.

    github.com/FullQueueDeveloper/

    #WWDC #SwiftMacro #iOSDev #SwiftLang #SwiftDeveloper #WWDC23

  14. I've used this approach for typesafety of record IDs in my own projects, usually by manually copy-pasting. Now with Swift Macros in Swift 5.9, it's going to be so much easier.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  15. I've used this approach for typesafety of record IDs in my own projects, usually by manually copy-pasting. Now with Swift Macros in Swift 5.9, it's going to be so much easier.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  16. I've used this approach for typesafety of record IDs in my own projects, usually by manually copy-pasting. Now with Swift Macros in Swift 5.9, it's going to be so much easier.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  17. I've used this approach for typesafety of record IDs in my own projects, usually by manually copy-pasting. Now with Swift Macros in Swift 5.9, it's going to be so much easier.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  18. When passing strings or integers as IDs, the compiler doesn't tell you if you accidentally used a person ID where a blog post ID. Now with the `UniquelyTypedID`, the compiler will not let you pass the ID of a different model.

    And with the power of `ExpressibleByStringLiteral` and `ExpressibleByIntegerLiteral`, very little code will need to change.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  19. When passing strings or integers as IDs, the compiler doesn't tell you if you accidentally used a person ID where a blog post ID. Now with the `UniquelyTypedID`, the compiler will not let you pass the ID of a different model.

    And with the power of `ExpressibleByStringLiteral` and `ExpressibleByIntegerLiteral`, very little code will need to change.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  20. When passing strings or integers as IDs, the compiler doesn't tell you if you accidentally used a person ID where a blog post ID. Now with the `UniquelyTypedID`, the compiler will not let you pass the ID of a different model.

    And with the power of `ExpressibleByStringLiteral` and `ExpressibleByIntegerLiteral`, very little code will need to change.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  21. When passing strings or integers as IDs, the compiler doesn't tell you if you accidentally used a person ID where a blog post ID. Now with the `UniquelyTypedID`, the compiler will not let you pass the ID of a different model.

    And with the power of `ExpressibleByStringLiteral` and `ExpressibleByIntegerLiteral`, very little code will need to change.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  22. When passing strings or integers as IDs, the compiler doesn't tell you if you accidentally used a person ID where a blog post ID. Now with the `UniquelyTypedID`, the compiler will not let you pass the ID of a different model.

    And with the power of `ExpressibleByStringLiteral` and `ExpressibleByIntegerLiteral`, very little code will need to change.
    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  23. Introducing UniquelyTypedID, a new Swift Macro!

    Use unique types for type-safety when passing IDs around.

    Currently supports String, Int, & UUID. The default is UUID.

    ```swift
    struct BlogPost {
    @UniquelyTypedID(Int.self) let id: ID
    let text: String
    }
    ```

    github.com/FullQueueDeveloper/

    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  24. Introducing UniquelyTypedID, a new Swift Macro!

    Use unique types for type-safety when passing IDs around.

    Currently supports String, Int, & UUID. The default is UUID.

    ```swift
    struct BlogPost {
    @UniquelyTypedID(Int.self) let id: ID
    let text: String
    }
    ```

    github.com/FullQueueDeveloper/

    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  25. Introducing UniquelyTypedID, a new Swift Macro!

    Use unique types for type-safety when passing IDs around.

    Currently supports String, Int, & UUID. The default is UUID.

    ```swift
    struct BlogPost {
    @UniquelyTypedID(Int.self) let id: ID
    let text: String
    }
    ```

    github.com/FullQueueDeveloper/

    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  26. Introducing UniquelyTypedID, a new Swift Macro!

    Use unique types for type-safety when passing IDs around.

    Currently supports String, Int, & UUID. The default is UUID.

    ```swift
    struct BlogPost {
    @UniquelyTypedID(Int.self) let id: ID
    let text: String
    }
    ```

    github.com/FullQueueDeveloper/

    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  27. Introducing UniquelyTypedID, a new Swift Macro!

    Use unique types for type-safety when passing IDs around.

    Currently supports String, Int, & UUID. The default is UUID.

    ```swift
    struct BlogPost {
    @UniquelyTypedID(Int.self) let id: ID
    let text: String
    }
    ```

    github.com/FullQueueDeveloper/

    #WWDC #WWDC23 #SwiftMacro #iOSDev #SwiftLang #SwiftDev

  28. Introducing `IdentifiedEnumCases`!

    When your Swift enumeration has associated values, you can't refer to the cases without an associated value.

    I've proven this approach by manually copy-pasting in my Swift 5.7 projects. And now, this functionality is available as an easy annotation.

    ```swift
    @IdentifiedEnumCases
    enum Nightshade {
    case potato(PotatoVariety)
    case tomato(TomatoVariety)
    case chili(ChiliVariety)
    }
    ```

    github.com/FullQueueDeveloper/

    #SwiftMacro #SwiftLang #WWDC #WWDC23

  29. Introducing `IdentifiedEnumCases`!

    When your Swift enumeration has associated values, you can't refer to the cases without an associated value.

    I've proven this approach by manually copy-pasting in my Swift 5.7 projects. And now, this functionality is available as an easy annotation.

    ```swift
    @IdentifiedEnumCases
    enum Nightshade {
    case potato(PotatoVariety)
    case tomato(TomatoVariety)
    case chili(ChiliVariety)
    }
    ```

    github.com/FullQueueDeveloper/

    #SwiftMacro #SwiftLang #WWDC #WWDC23

  30. Introducing `IdentifiedEnumCases`!

    When your Swift enumeration has associated values, you can't refer to the cases without an associated value.

    I've proven this approach by manually copy-pasting in my Swift 5.7 projects. And now, this functionality is available as an easy annotation.

    ```swift
    @IdentifiedEnumCases
    enum Nightshade {
    case potato(PotatoVariety)
    case tomato(TomatoVariety)
    case chili(ChiliVariety)
    }
    ```

    github.com/FullQueueDeveloper/

    #SwiftMacro #SwiftLang #WWDC #WWDC23

  31. Introducing `IdentifiedEnumCases`!

    When your Swift enumeration has associated values, you can't refer to the cases without an associated value.

    I've proven this approach by manually copy-pasting in my Swift 5.7 projects. And now, this functionality is available as an easy annotation.

    ```swift
    @IdentifiedEnumCases
    enum Nightshade {
    case potato(PotatoVariety)
    case tomato(TomatoVariety)
    case chili(ChiliVariety)
    }
    ```

    github.com/FullQueueDeveloper/

    #SwiftMacro #SwiftLang #WWDC #WWDC23