domain | swiftbysundell.com |
summary | When using static string literals as URLs, we need to perform a conversion that may fail and return an optional. This can feel unnecessary for such URLs. To solve this problem, we can create a new macro-based Swift package called "StaticURL" via the command line with the following command: swift package init --type macro --name StaticURL. Macro packages come pre-filled with most of the boilerplate code needed to define and vend the macro to other targets that wish to use it. The built-in stringify macro serves as an example of the type of macro we are looking for: a freestanding expression macro. |
title | Swift by Sundell |
description | Weekly Swift articles, podcasts and tips by John Sundell |
keywords | swift, string, macro, urls, static, code, time, using, above, type, have, components, article, articles, work, first, value |
upstreams |
persistent.info |
downstreams |
|
nslookup | A 172.67.73.61, A 104.26.3.236, A 104.26.2.236 |
created | 2024-11-30 |
updated | 2025-04-02 |
summarized | 2025-04-02 |
|
|