{"title":"Jaanus","subtitle":"Yep.","generator":"Jekyll","link":[{"@attributes":{"rel":"self","type":"application\/atom+xml","href":"https:\/\/jaanus.com\/feed.xml"}},{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com"}}],"updated":"2025-08-29T11:45:01+03:00","id":"https:\/\/jaanus.com\/","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com\/","email":"hello@jaanus.com"},"entry":[{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/which-side-are-you-on-apple\/"}},"id":"https:\/\/jaanus.com\/which-side-are-you-on-apple","published":"2025-02-19T10:03:00+02:00","updated":"2025-02-19T10:03:00+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>In about four months, Apple will have its annual WWDC event for developers. Some new technology and products will be announced. Some changes will be good, some will be meh. Apple will release new operating systems with some new features, and developers like me will whine about how they should slow down the pace and fix old bugs instead. It\u2019s all predictable, and routine.<\/p>\n\n<p>What are you most excited about? What is your biggest question? Is it the new products? Developer tools and APIs? Next steps in Apple Intelligence?<\/p>\n\n<p>I am a developer in the Apple ecosystem, and this year, I do not care about any of that. At all. Seriously.<\/p>\n\n<p>This year, I only have one question to Apple:<\/p>\n\n<p>Which side are you on?<\/p>\n\n<p>Is it your users and developers?<\/p>\n\n<p>Or is it the United States federal government?<\/p>\n\n<p>I ask because I predict that in 2025, the interests of these two groups will collide, and you will need to pick a side.<\/p>\n\n<h2 id=\"the-apple-privacy-story\">The Apple privacy story<\/h2>\n\n<p><img src=\"\/images\/apple-privacy.jpg\" alt=\"Privacy. That\u2019s Apple.\" \/><\/p>\n\n<p>Apple has made privacy central in its offering, and claims that it protects user data better than some other big tech companies. It also makes sense business-wise, because Apple\u2019s business is about selling devices and services, not user data.<\/p>\n\n<p>As a security- and privacy-minded developer in the Apple ecosystem, I can assert that Apple so far has been serious about privacy, and it is reflected in the design and implementation in their technology. Much of the computation happens on the device side, not in the cloud. The data on devices is sandboxed, and apps can\u2019t see each other\u2019s data. iCloud and CloudKit are designed in a way where I as a developer literally do not have access to the user data. Users can opt in to Advanced Data Protection to get end-to-end encryption protection for both Apple and third-party developer app data. The cloud side of Apple Intelligence, Private Cloud Compute, is designed and built in a privacy-conscious way.<\/p>\n\n<p>To me as a developer, this so far has been a consistent and trustworthy picture. I am building <a href=\"https:\/\/justtact.com\">Tact<\/a>, a messaging app based on Apple platform, which is sort of an experiment of building such an app only with Apple technologies, including on the cloud side. Tact stores its data in iCloud with CloudKit, and I say that it has the same level of privacy as Photos.<\/p>\n\n<p>iCloud data privacy has so far been with a positive sign for me. In 2025, I am no longer certain of this.<\/p>\n\n<h2 id=\"the-new-political-reality\">The new political reality<\/h2>\n\n<p>US voters elected Donald Trump as their president in November 2024, which has changed many things about how the federal government operates. One thing we have seen that is relevant to this post, is how the DOGE team goes around US government institutions and collects data, often illegally. I don\u2019t want to speculate on their goals, but the fact is that they are doing this.<\/p>\n\n<p>I have no doubt that the new US federal government will try to collect data from private companies for political purposes. As a specific example, imagine that you are an iPhone app developer in the space of reproductive health, and you keep your user data in iCloud, because so far you have believed the Apple privacy story, as I have.<\/p>\n\n<p>It\u2019s not far fetched to imagine that the US government will walk up to Apple and demand data about the users of your app, including the data they have stored with your app.<\/p>\n\n<p>How will Apple respond?<\/p>\n\n<p>That is the point of this post. I don\u2019t know. I would like to know.<\/p>\n\n<h2 id=\"apples-stance-in-this-new-political-reality\">Apple\u2019s stance in this new political reality<\/h2>\n\n<p>To my knowledge, there haven\u2019t yet been such cases of such conflict. But we have seen other ways of Apple trying to be on the good side of the current US federal government.<\/p>\n\n<p><a href=\"https:\/\/www.theverge.com\/2025\/1\/3\/24335290\/apple-donation-donald-trump-inauguration-tim-cook\">Tim Cook donated $1 million to Trump\u2019s inauguration.<\/a><\/p>\n\n<p><a href=\"https:\/\/apnews.com\/article\/apple-maps-gulf-of-mexico-gulf-of-america-ea9f17241ad5c42880708f27ffe18baf\">The case of Gulf of Mexico\/America.<\/a><\/p>\n\n<p><a href=\"https:\/\/www.theverge.com\/news\/611967\/apple-resumes-x-twitter-ad-spending-boycott\">Apple starts advertising on X again.<\/a> X and Elon Musk are just not a good site and a good person to be associated with.<\/p>\n\n<p>There is also <a href=\"https:\/\/www.bbc.com\/news\/articles\/c20g288yldko\">UK demanding access to Apple users\u2019 encrypted data,<\/a> including data that is protected with Advanced Data Protection. This is not related to US federal government, but it does illustrate that Apple is operating in an increasingly hostile political environment.<\/p>\n\n<p>Apple complies with local laws. There is likely a different attitude to data that Apple has to Chinese users\u2019 data in China. I don\u2019t even know exactly, but there is probably less security and privacy there, and the government has more access to the data. Many of us haven\u2019t paid attention, because \u201cChina is China\u201d, and that\u2019s just how it is there, while we have remained on the side of freedom, and the government not interfering with companies and user data in this way.<\/p>\n\n<p>It\u2019s possible that in 2025 the US law will change to compel private companies to furnish data to government for political purposes, or that the government will demand such things outside of law.<\/p>\n\n<p>All these developments make me uncomfortable as a developer and custodian of my users\u2019 data, and I have less reason to believe that in the face of the political reality of 2025, Apple\u2019s privacy story will remain entirely true.<\/p>\n\n<h2 id=\"whats-apple-to-do\">What\u2019s Apple to do?<\/h2>\n\n<p>What could Apple do to make me as a developer comfortable?<\/p>\n\n<p><strong>General \u2013 give us reassurance about commitment to privacy.<\/strong> I don\u2019t know what this would look like. Perhaps tell us specific stories about how Apple is committed to people\u2019s privacy? At many Apple marketing events, there are now segments about how Apple Watch has saved people\u2019s lives by letting them contact emergency services. Preserving people\u2019s privacy is an equally noble goal, and there could be stories shared around that. It\u2019s more controversial because it might be at odds with what the government wants, but who said this would be easy?<\/p>\n\n<p><strong>Specific and technical - make it easier to me as a third-party developer to understand how data protection in iCloud works<\/strong>, including Advanced Data Protection, and how sharing plays into this.<\/p>\n\n<p>I have <a href=\"https:\/\/blog.justtact.com\/advanced-data-protection\/\">previously written this technical post<\/a> about third-party CloudKit apps and data protection, which outlines some rough edges. It would be helpful if Apple provided security audits of CloudKit and ADP, were more clear about how sharing and ADP interact, and provided more tools for developers like me to provide assurances to our users, including assurance about end-to-end encryption.<\/p>\n\n<p><a href=\"https:\/\/support.apple.com\/et-ee\/102651\">iCloud data security overview<\/a> has this paragraph about third-party app data, which I think has been added since I wrote that post. It answers the base technical question of what\u2019s protected, but doesn\u2019t address the parts about sharing and reassuring the users.<\/p>\n\n<blockquote>\n  <p>Third-party app data stored in iCloud is always encrypted in transit and on server. When you turn on Advanced Data Protection, third-party app data stored in iCloud Backup and CloudKit encrypted fields and assets are end-to-end encrypted.<\/p>\n<\/blockquote>\n\n<p>Will Apple do any of these things? I think it\u2019s unlikely and low on their priority list. I don\u2019t actually expect to get anything out of WWDC this year in this area.<\/p>\n\n<h2 id=\"the-shareholder-view\">The shareholder view<\/h2>\n\n<p>Note that I left out one group in the list of conflicting parties above: the shareholders.<\/p>\n\n<p>I think there are Apple shareholders on both sides, and probably more on the side that prefers compliance over privacy. Business means complying with law, and if the law (or environment of de facto law) changes, so be it.<\/p>\n\n<p>Besides being a developer, I own some Apple stock, and will continue to own it, because it has been a good investment. I have no doubt that Apple will prioritize my interests as an investor over my interests as an Apple ecosystem developer. It\u2019s just that up to this point, my interests as an investor and developer were largely aligned, and I think they will now align less.<\/p>\n\n<h2 id=\"conclusion\">Conclusion<\/h2>\n\n<p>There is no conclusion to this story today. The question remains open, and I\u2019ll be looking for signals and evidence through the coming months and years, to inform my career and technology choices as an Apple platforms developer and user.<\/p>\n\n<p>Which side are you on, Apple?<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/which-side-are-you-on-apple\/\">Which side are you on, Apple?<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on February 19, 2025.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/social-media-audit\/"}},"id":"https:\/\/jaanus.com\/social-media-audit","published":"2025-01-04T20:03:00+02:00","updated":"2025-01-04T20:03:00+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Happy 2025.<\/p>\n\n<p>I thought I\u2019d do a small audit of my online presence for the end of the year. What sites do I use to publish things about myself? For what purpose? How has this evolved over time?<\/p>\n\n<p>The trigger for this was me reviewing my personal expenses. For the longest time, I\u2019ve been paying for <a href=\"https:\/\/flickr.com\">Flickr Pro<\/a> to host my photos. I paid once a year and for the past few years, I kept asking myself\u2026\u00a0why am I doing this? Is it worth it for me? This triggered a bit broader introspection.<\/p>\n\n<p>For reference, <a href=\"\/redirecting-my-misc-random-site-to-friendfeed-and-work-update\/\">here is a similar post<\/a> from a very long time ago. Many of the sites mentioned there no longer exist, or I deleted my account on them. But I do keep using a few.<\/p>\n\n<h2 id=\"preface\">Preface<\/h2>\n\n<p>Before I dig in to specific sites, here\u2019s how I think about Internet and (social) media landscape today, and how I see myself as part of that.<\/p>\n\n<p>Internet and social media used to be a happier place. In the early days, it felt like we are all in this together, including the people and companies building these new things. We truly thought that we can harness the Internet for good, and create good faith hive minds and digital town squares for the betterment of our communities.<\/p>\n\n<p>Fast forward to 2024, and (social) media is a far more sinister, cynical genre. Many sites and media channels now don\u2019t hide that their true purpose is force the (political or oligarch) agenda of their owners down the throat of the audience, and not do any journalism or be a neutral platform. Low-quality AI slop pollutes everyone\u2019s feeds and minds. Chinese and russian troll factories use any media to push their poison and propaganda into Western brains. Engagement farming and intentionally raising other people\u2019s anxiety levels are a thing.<\/p>\n\n<p>Many people mistake all of this to be the general state of the world: indeed, that is what many (social) media companies want you to think. But it is just not so. I remain optimistic about the state of the world and humanity; it\u2019s just that (social) media now provides an increasingly dark and distorted picture of it.<\/p>\n\n<p>russia\u2019s full scale invasion of Ukraine in February 2022 provides yet another twist on the whole media space. I changed my use of social media shortly after it happened, and <a href=\"\/twitter-editorial-statement\/\">posted a statement<\/a> about the change, which has aged quite well. I do much of my social media usage these days not as my full self regular human being persona, but as a <a href=\"https:\/\/en.wikipedia.org\/wiki\/NAFO_(group)\">NAFO<\/a> brain damaged cartoon dog. NAFO is an online movement that fights russian poison and lies, and collects material assistance for defenders of Ukraine.<\/p>\n\n<p>I continue to use different sites for different purposes and with different personas. This site remains my home base, from where different things branch out.<\/p>\n\n<p>Here are the sites relevant in this context, categorized into whether my usage of them decreased, remained the same, or increased.<\/p>\n\n<h2 id=\"use-less-of\">Use less of<\/h2>\n\n<h3 id=\"twitter-x\">Twitter (X)<\/h3>\n\n<p>Rebranding Twitter to X must be one of the dumbest rebrands ever. So, it remains Twitter for me. It turned into garbage after Elon Musk bought it. <a href=\"https:\/\/jaanus.substack.com\/p\/i-refuse-to-be-a-flying-monkey\">Here is my longer writeup<\/a> about how Twitter, and staying on Twitter, these days is harmful and amplifies the extremism and hate there.<\/p>\n\n<p><a href=\"https:\/\/x.com\/jaanus\">I continue to use Twitter<\/a>, but it is no longer a serious place, and my heart is no longer there. I just do my NAFO work, and I fully expect to get banned soon. I have exported all my content from there, and I have nothing to lose. I have been on Twitter since 2007 and I was sort of attached to it in the past, but letting go of things, especially intangible things in your head, is a valuable life skill. It is unhealthy and dangerous to tie yourself and your identity too much to any single social media account.<\/p>\n\n<h3 id=\"facebook-threads-instagram\">Facebook, Threads, Instagram<\/h3>\n\n<p>I still have a Facebook account, mostly because of Messenger and some private groups related to my kids\u2019 activities. I find zero value in the public part of Facebook, and I deleted all my public content from there. (Kudos to Facebook for <a href=\"https:\/\/www.facebook.com\/help\/289066827791446\/\">providing a tool<\/a> that lets you review and delete all your past activity.)<\/p>\n\n<p>I\u2019m interested in social media as a tool where we make sense of the world and our communities. Facebook, Threads, and Instagram are intentionally designed to work against this purpose, and <a href=\"https:\/\/open.substack.com\/pub\/taylorlorenz\/p\/democracy-dies-on-instagram?r=9nnr1&amp;utm_medium=ios\">suppress political content<\/a>:<\/p>\n\n<blockquote>\n  <p>\u201cMeta\u2019s decision to artificially limit the reach of political content on Threads, [Instagram, and Facebook] is itself a POLITICAL decision,\u201d Judd Legum posted last year. \u201cIt privileges those who benefit from the political status quo by suppressing information that could disrupt the status quo while elevating entertainment, sports and other topics that do not threaten the powerful.\u201d<\/p>\n<\/blockquote>\n\n<blockquote>\n  <p>Meta deems any content that discusses social justice or identity (things like LGBTQ rights, reproductive justice, etc) as \u201cpolitical\u201d. The company says it will restrict any image, video, or text post that \u201cidentifies a problem that impacts people and is caused by the action or inaction of others,\u201d which is an incredibly wide swath of content. If you speak about these things on Meta, your reach will be limited and your account will be surfaced to fewer people.<\/p>\n<\/blockquote>\n\n<blockquote>\n  <p>Meta\u2019s undue restrictions on \u201cpolitical\u201d content matter because social media has a profound impact on how people understand their communities and the world.<\/p>\n<\/blockquote>\n\n<p>I tried out Threads, but I did not find any value in it. I just don\u2019t seem to resonate well with Mark Zuckerberg and his universe any more.<\/p>\n\n<h3 id=\"flickr\">Flickr<\/h3>\n\n<p>I have nothing bad to say about <a href=\"https:\/\/flickr.com\">Flickr<\/a>. To the contrary: I give it high praise, and can recommend using it. It is a rare example of an online thing that has not enshittified over many years, and just keeps doing its thing. I had photos on Flickr from 18 (yes, eighteen) years ago. Back in the day, Flickr gave me the code to embed them to my website, and these embeds just remained working for all these years. That is remarkable and worth praising, given that the modern Internet environment is such that no one gives a damn about the longevity of anything, and things break and get modified regularly with little warning.<\/p>\n\n<p>Having said all that, I asked myself two questions: (1) why am I paying 70\u20ac a year for Flickr Pro? (2) why do I keep all these photo galleries from my past publicly available there?<\/p>\n\n<p>I simply decided that I don\u2019t need to do either of these things any more. I ended my subscription, and replaced all the Flickr embeds on my blogs here with just regular images that I host myself. It was a lovely trip down the memory lane as I wrote some interesting travelogues in the past years that were now also interesting for myself to read and reflect upon. My Apple Photos albums also had got a bit out of control over the years as I had\u2019t kept them all that tidy, so this prompted me to tidy up my local albums as well.<\/p>\n\n<p>So, I still very much recommend Flickr if you need a reliable place to host and share your photos online. It\u2019s just that this need disappeared from my own life.<\/p>\n\n<h3 id=\"rss\">RSS<\/h3>\n\n<p>I am very much a believer in open web, and the original vision of Internet: that anyone, anywhere can host and publish their own content, and that there are no gatekeepers. This blog and my own site is a small part of open web as well. People hosting their own blogs and reading other people\u2019s blogs with RSS is a good example of open web in practice.<\/p>\n\n<p>I used to read a lot of content via RSS with <a href=\"https:\/\/feedbin.com\">Feedbin<\/a> and <a href=\"https:\/\/netnewswire.com\">NetNewsWire<\/a>, and was actively interested in NNW development. But over the past few years, this just\u2026 faded. I found myself not doing this any more because everything else (since 2022, this largely means russia\u2019s invasion of Ukraine) took priority. It\u2019s kind of sad and ironic that my open web and RSS use declined given how much I believe in the theory behind these, but again, letting go of things and not being religiously and fanatically attached to anything is a valuable life skill. So, I just canceled my Feedbin subscription and saved my subscriptions from there in a safe place for possible future use.<\/p>\n\n<p><img src=\"\/images\/goodbye-feedbin.png\" alt=\"Goodbye, Feedbin\" \/><\/p>\n\n<p>Again, I only have good things to say about Feedbin. (And I was one of their early users and was grandfathered into a ridiculously cheap plan until the very end now years later, which was totally unnecessary but very kind of them.) If you are looking for a good \u201cRSS server\u201d which aggregates things for you and provides a nice reading experience and backend for many RSS reader apps, definitely check it out. Same for NNW and many other RSS clients. I hope a day will come when I shift more of my media use back to RSS.<\/p>\n\n<h2 id=\"unchanged\">Unchanged<\/h2>\n\n<h3 id=\"linkedin\">LinkedIn<\/h3>\n\n<p>My LinkedIn use is unchanged in the sense that I haven\u2019t been using it all that much to begin with. <a href=\"https:\/\/www.linkedin.com\/in\/jaanuskase\">I have a profile there<\/a> and I use it for some private messaging and a directory of professional profiles. But I don\u2019t find much value in the content, feed, and social parts of LinkedIn. I very rarely post things there, mainly things that I think would be useful for people to see about me in a professional context. But LinkedIn was one of the early promoters of low-quality \u201cAI slop\u201d and provided AI writing tools for its users even before they took off in mainstream.<\/p>\n\n<p>I don\u2019t really trust the content on that site. I would never make judgements about anyone based (only) on what their feed and content look like, since it can all be gamed. I\u2019m really not interested in any of the influencers and engagement type of activities going on there.<\/p>\n\n<h2 id=\"use-more-of\">Use more of<\/h2>\n\n<h3 id=\"substack\">Substack<\/h3>\n\n<p><a href=\"https:\/\/jaanus.substack.com\">I started a newsletter this year!<\/a> The initial motivation for this was that I had written some threads on Twitter which I thought are worth preserving and re-publishing in a less toxic environment. So I queued some posts up and got a publication started. It\u2019s like my second blog, focused on the topics around russia and Ukraine. I could also have hosted it on the open web, but I wanted to try a new service and see how it helps with distribution, since I do want this content to actually get in front of people. And I did not want to have this content here on my main site, since I want to keep this site more neutral and professional.<\/p>\n\n<p>Substack is again VC-funded and at enshittification risk. It seems to be alright so far for me, both for publishing and for some of the long-form content that I subscribe to and read there. Some of my RSS reading has now shifted to Substack.<\/p>\n\n<h3 id=\"bluesky\">Bluesky<\/h3>\n\n<p><a href=\"https:\/\/jaanus.bsky.social\">Here is my Bluesky.<\/a> I use Bluesky these days mostly with my NAFO persona. It is working well as a Twitter replacement for me, and a real source of news and insights about russia\u2019s invasion of Ukraine and everything around that.<\/p>\n\n<p>I have my doubts about Bluesky. It is VC-funded, and most such things eventually enshittify. For now, I can say that I haven\u2019t seen Bluesky management or owners inject themselves as forcefully into the discourse as Elon Musk has on Twitter, and moderation seems by and far alright so far.<\/p>\n\n<p>These things may change, but the migration from Twitter to Bluesky was relatively painless for me and many other friends of Ukraine and NAFO. If Bluesky enshittifies too much, I think we would just move somewhere else again.<\/p>\n\n<h3 id=\"mastodon\">Mastodon<\/h3>\n\n<p><a href=\"https:\/\/iosdev.space\/@jaanus\">My Mastodon account<\/a> is where I keep my professional and technical content, which these days is a lot about development on Apple and Flutter platforms. There is a happy subsection of Apple developer community that found a new home on Mastodon a few years ago after one of the numerous Twitter exoduses, living on both iosdev.space and other Mastodon instances.<\/p>\n\n<p>Mastodon is the closest big social media platform to open web vision because it\u2019s not VC-funded, and I think has the least risk of enshittification.<\/p>\n\n<h2 id=\"conclusion\">Conclusion<\/h2>\n\n<p>I\u2019m on several platforms with different personas and goals. I don\u2019t think there will be, or should be, a single privately owned social media platform where everyone is present. Our communities, societies, and the discussion networks that power them are too important to be exposed to the whims of any single VC-funded private entrepreneur.<\/p>\n\n<p>Both Mastodon and Bluesky have a take on \u201cfederation\u201d. I think by and large, social media federation is a good idea, and pretty close to the open web vision. In any case, my take from the past few years is that I expect multiple networks to thrive, rather than picking one single winner to tie my whole identity to.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/social-media-audit\/\">My social media audit for the end of 2024<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on January 04, 2025.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/swift-string-catalogs\/"}},"id":"https:\/\/jaanus.com\/swift-string-catalogs","published":"2024-04-16T10:03:00+03:00","updated":"2024-04-16T10:03:00+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Apple platforms have always supported localizing your apps. <a href=\"https:\/\/developer.apple.com\/documentation\/xcode\/localizing-and-varying-text-with-a-string-catalog\">String Catalogs<\/a> are a new addition to the toolkit that were released at WWDC 23 with Xcode 15. They compile down to good old strings files, but the frontend is nicer.<\/p>\n\n<p>I was curious how to use the new string catalogs in a modularized project that has all its features, including UI, split into different Swift Package modules, that seems to be a good practice these days. It\u2019s quite straighforward, but there are some nooks and crannies that were not obvious to me, so I did a small experiment around that.<\/p>\n\n<p>String catalogs are just a nicer frontend to good old string files. While this post is about the new string catalogs, most of the concepts apply to string files as well.<\/p>\n\n<h2 id=\"tldr\">TL;DR<\/h2>\n\n<p><a href=\"https:\/\/github.com\/jaanus\/StringCatalogToy\">Check out the toy project.<\/a><\/p>\n\n<p><img src=\"\/images\/string-catalog-toy.png\" alt=\"String catalogs toy\" \/><\/p>\n\n<p>Following is a review of some of the concepts and tips around this topic.<\/p>\n\n<h2 id=\"basic-api\">Basic API<\/h2>\n\n<p>I will use examples from a SwiftUI app.<\/p>\n\n<p>In a top-level app target, you simply use this API to display text.<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">Text<\/span><span class=\"p\">(<\/span><span class=\"s\">\"Some string\"<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>If you have a key called <code class=\"language-plaintext highlighter-rouge\">Some string<\/code> in your strings catalog, this will display a localized string.<\/p>\n\n<p>If your code lives in a SPM module and you have a strings file or catalog in the same module, you\u2019d use this code:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">Text<\/span><span class=\"p\">(<\/span><span class=\"s\">\"Some string\"<\/span><span class=\"p\">,<\/span> <span class=\"nv\">bundle<\/span><span class=\"p\">:<\/span> <span class=\"o\">.<\/span><span class=\"n\">module<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>This tells the system to load the string resources from the bundle of the current module.<\/p>\n\n<h2 id=\"using-strings-from-another-module\">Using strings from another module<\/h2>\n\n<p>How do you use strings from another module?<\/p>\n\n<p>The use case for this might be that you are providing all your strings from a single module, both to other modules and the top-level app target.<\/p>\n\n<p>I didn\u2019t find a standard approach for this. So what I came up with is that you put your strings in a separate module with a strings catalog file, and then have this piece of code in the module:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kd\">public<\/span> <span class=\"kd\">struct<\/span> <span class=\"kt\">StringsExporter<\/span> <span class=\"p\">{<\/span>\n  <span class=\"kd\">public<\/span> <span class=\"kd\">static<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">bundle<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Bundle<\/span> <span class=\"p\">{<\/span> <span class=\"kt\">Bundle<\/span><span class=\"o\">.<\/span><span class=\"n\">module<\/span> <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>What this does is it simply exports the bundle resources of this module to be used by other modules.<\/p>\n\n<p>At the call site in another module, you will then do this:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">Text<\/span><span class=\"p\">(<\/span><span class=\"s\">\"ChildHello\"<\/span><span class=\"p\">,<\/span> <span class=\"nv\">bundle<\/span><span class=\"p\">:<\/span> <span class=\"kt\">StringsExporter<\/span><span class=\"o\">.<\/span><span class=\"n\">bundle<\/span><span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>This tells SwiftUI to load the string resources from the specified bundle, and seems to work fine.<\/p>\n\n<h2 id=\"allow-mixed-localized-resources\">Allow mixed localized resources<\/h2>\n\n<p>I set up my demo app project so that it does not have any localized strings or other localized resources in the top level app target. This works fine, but you have to do this one extra thing if you use this approach: you have to set <code class=\"language-plaintext highlighter-rouge\">CFBundleAllowMixedLocalizations<\/code> to <code class=\"language-plaintext highlighter-rouge\">true<\/code> in your top-level app <code class=\"language-plaintext highlighter-rouge\">Info.plist<\/code>.<\/p>\n\n<p><img src=\"\/images\/mixed-localized-resources.png\" alt=\"Mixed localized resources\" \/><\/p>\n\n<p>If you don\u2019t do this, the localizations provided by the modules are filtered by whatever localizations are present in the top level app target. The localizations that are not present in the app target will simply be discarded. If you set this key, this filtering won\u2019t be done, and whatever localizations are provided by modules will be used.<\/p>\n\n<p><a href=\"https:\/\/forums.swift.org\/t\/swift-package-localization-always-using-english-localization\/48988\/5\">There is a thread in Swift forums that discusses the risks of this.<\/a> If you are using modules from other vendors, you may end up in situations like \u201cToday is Montag, le 1er de\u0301cembre.\u201d But if you are controlling all the code, it should be fine.<\/p>\n\n<h2 id=\"conclusion\">Conclusion<\/h2>\n\n<p>Xcode strings catalogs work fine across module boundaries if you add the glue to export and import them, and allow mixed resources if your top-level app target does not include all localizations. String catalogs can be used flexibly across modules and string tables. All projects can find an approach that suits their needs and fits their project setup.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/swift-string-catalogs\/\">How to use string catalogs across Swift package modules<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on April 16, 2024.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/nafo-zakharova\/"}},"id":"https:\/\/jaanus.com\/nafo-zakharova","published":"2023-07-12T10:03:00+03:00","updated":"2023-07-12T10:03:00+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p><em><a href=\"https:\/\/e.jaanus.com\/nafo-zahharova\/\">Saadaval ka eesti keeles.<\/a><\/em><\/p>\n\n<p>I had a fun weekend in Vilnius with my fellas.<\/p>\n\n<p>This week, NATO Summit is happening in Vilnius. I was not invited there. The weekend before that, there was NAFO Summit at the same place. I was very much invited there, and took part.<\/p>\n\n<p>As result of our collective fun and games over the weekend, both the spokesperson of russian imperialist barbarian federation ministry of foreign affairs Maria Zakharova and one of Team Navalny key figures Maria Pevchikh became so upset that they pronounced nonsense and attacks towards NAFO.<\/p>\n\n<p><img src=\"https:\/\/e.jaanus.com\/images\/nafo-zakharova.jpeg\" alt=\"Zakharova whine\" \/><\/p>\n\n<p><img src=\"https:\/\/e.jaanus.com\/images\/nafo-pevchikh-1.png\" alt=\"Pevchikh whine 1\" \/><\/p>\n\n<p><img src=\"https:\/\/e.jaanus.com\/images\/nafo-pevchikh-2.png\" alt=\"Pevchikh whine 2\" \/><\/p>\n\n<p>There is nothing interesting in the attack content \u2013 the usual russian vomit, \u201crussophobia,\u201d playing victim etc. Most interesting is that they did it at all, and moreover, with such similar content. This is a big accomplishment and a weekend well spent for NAFO, and myself personally.<\/p>\n\n<h2 id=\"what-is-nafo\">What is NAFO?<\/h2>\n\n<p>NAFO is a collective of people around the world who counter russian lies and propaganda online, and donate and drive donations to Ukraine.<\/p>\n\n<p>You can find many stories of NAFO in the press. <a href=\"https:\/\/edition.cnn.com\/2023\/07\/11\/europe\/ukraine-nafo-russian-trolls-intl\/index.html\">This recent story in CNN<\/a> is good and explains most of it, I won\u2019t re-explain the basics here.<\/p>\n\n<h2 id=\"nafo-vilnius-summit\">NAFO Vilnius Summit<\/h2>\n\n<p>A while ago, the idea emerged to organize a real-life NAFO gathering, and Vilnius right before the NATO summit turned out to be a suitable time and place. Over the weekend, about a hundred fellas gathered, and we had a great conference with an interesting program.<\/p>\n\n<p>There was a public live stream from the talks. <a href=\"https:\/\/www.youtube.com\/watch?v=nADl1rj8tWM\">Watch the recording here.<\/a> If you are into topics like information war and russian lies and propaganda, I can recommend it. What you see on the stage, and how people dress, talk and behave is an accurate representation of the NAFO character. The topics are serious, but we talk about them tongue-in-cheek, using jokes and absurd, not taking ourselves too seriously. Still, all remains tasteful and informed by our mission, which always guides all our work.<\/p>\n\n<p>As expected, some russians were watching the live stream. This is where the events took an interesting turn. On the stage, you can see an inflatable shark with a bunch of other toys. These were never mentioned on stage and they were just silly props, where you can see references to several NAFO memes, for example \u201cCrimea beach party.\u201d You can of course interpret the shark as a reference to the accident with a tourist in Egypt if you want. What\u2019s important to know is that these props never were mentioned in the discussions and we didn\u2019t explicitly bring them up while at the venue.<\/p>\n\n<h2 id=\"sharkgate\">Sharkgate<\/h2>\n\n<p>russians saw the shark on stage in the video stream. They themselves decided to completely independently and freely to take the bait and get offended. They published a narrative that NAFO is inhumane because it brazenly and shamelessly in a public video stream laughs and cheers at the death of an innocent russian tourist in Egypt.<\/p>\n\n<p>I was in the room the whole time. I can assure you that the only NAFO contribution to this narrative was placing an inflatable toy shark on the stage. All the rest is added and interpreted by russians.<\/p>\n\n<p>Back when the shark incident happened, NAFO and Ukrainians spread many memes around it, with many topics like \u201ceven the sharks hate russians\u201d and all. Some of them perhaps crossed the line of good taste (and this line is highly debatable in an environment of real and information war). I didn\u2019t spread some of them, but I absolutely will not condemn the people who did. Dark humor helps Ukrainians during the war.<\/p>\n\n<p>This was already a while ago. The toy shark on the stage brought all this back to russians, and both the government and Navalny banged the drum on this. The only thing that they accomplished, of course, is to point out once again that russians cry harder over one tourist than they do over many thousands of Ukrainians whom their own russian soldiers continue to kill, deport and gang rape every day.<\/p>\n\n<p><img src=\"https:\/\/e.jaanus.com\/images\/nafo-kate-tweet.png\" alt=\"Fotodega s\u00e4uts\" \/><\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">One of these photos caused an uproar of indignation among russians worldwide <a href=\"https:\/\/t.co\/cC4B1jL0tI\">pic.twitter.com\/cC4B1jL0tI<\/a><\/p>&mdash; Kate Levchuk \ud83c\uddfa\ud83c\udde6 (@KateGoesTech) <a href=\"https:\/\/twitter.com\/KateGoesTech\/status\/1678407068246573061?ref_src=twsrc%5Etfw\">July 10, 2023<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<p>My own little contribution is at play here, which justifies the title of this post. All Sunday, we walked around Vilnius and did different activities, with this silly shark staying with us the whole time. On Sunday night, we participated at a rally to support Ukraine membership of NATO, and I happened to take and publish this photo with the shark there. It could as well have been someone else and there wasn\u2019t much planning or thought around this. Just took and published a photo, that\u2019s all. But the photo and russian reaction to the Sharkgate quite well summarizes the nature of NAFO, and the absurdity of russian narrative and crocodile tears. And is good study material to those who still think Navalny is anyone\u2019s friend and savior.<\/p>\n\n<h2 id=\"kaja-kallas-and-russian-embassy\">Kaja Kallas and russian embassy<\/h2>\n\n<p>Some other events happened at the NAFO Summit which perhaps contributed to Zakharova\u2019s angst.<\/p>\n\n<p>Lithuanian Foreign Minister Gabrielius Landsbergis honored the summit with an address in person, and Kaja Kallas sent us a video greeting. This lent credibility to the event and of course upset russians. What silly events do these Baltic ministers go to, and who are they, anyway?<\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">Greetings to <a href=\"https:\/\/twitter.com\/hashtag\/NAFOfellas?src=hash&amp;ref_src=twsrc%5Etfw\">#NAFOfellas<\/a> at the first-ever <a href=\"https:\/\/twitter.com\/hashtag\/NAFOSummit?src=hash&amp;ref_src=twsrc%5Etfw\">#NAFOSummit<\/a> in Vilnius.<a href=\"https:\/\/twitter.com\/hashtag\/NAFO?src=hash&amp;ref_src=twsrc%5Etfw\">#NAFO<\/a> is a living example of how to disarm Russian disinformation with humour, intelligence and enthusiasm. Behind every Fella is a real person who believes in <a href=\"https:\/\/twitter.com\/hashtag\/Ukraine?src=hash&amp;ref_src=twsrc%5Etfw\">#Ukraine<\/a>\u2019s victory.<br \/><br \/>Thank you for your service. <a href=\"https:\/\/t.co\/VWOkAe3udr\">pic.twitter.com\/VWOkAe3udr<\/a><\/p>&mdash; Kaja Kallas (@kajakallas) <a href=\"https:\/\/twitter.com\/kajakallas\/status\/1677659297600217091?ref_src=twsrc%5Etfw\">July 8, 2023<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<p>In her address, Kaja Kallas said these words:<\/p>\n\n<p>\u201cBehind every fella is a real person who believes in Ukraine\u2019s victory.\u201d<\/p>\n\n<p>This was not the main point of the address, but it touched people\u2019s hearts and took off. Fellas took this as an invitation to post their real photo next to their avatar. When you look at the stream of these photos, you see that NAFO is diverse. russian trolls of course like to lie that we are a bunch of losers in our parents\u2019 basements. In reality, we are men, women, young old, from all countries and all walks of life. Search \u201cbehind every fella\u201d from Twitter to see us. This is a powerful message when fighting with anonymous trolls, because the russian lie factory cannot respond with the same.<\/p>\n\n<p>Also, we went to troll the russian embassy in Vilnius on Sunday. Well, \u201ctrolling\u201d is doing a lot of work there. We just hung out for a little while and took some photos. But I bet the nerves in the embassy were tight before the NATO summit, and 50 people, many in Ukrainian gear, surely got their attention, and a report was sent to Moscow.<\/p>\n\n<p><img src=\"https:\/\/e.jaanus.com\/images\/nafo-vilnius.jpeg\" alt=\"NAFO Vilnius\" \/><\/p>\n\n<p>When I look back at the whole weekend and especially Zakharova\u2019s and Pevchikh reactions, I can\u2019t help but think, \u201cif the russians are howling, we did it right.\u201d<\/p>\n\n<h2 id=\"donate-to-ukraine\">Donate to Ukraine<\/h2>\n\n<p>Fun and games aside, the war situation remains serious. Ukrainians continue to defend the freedom of Europe on the battlefield, and they need our help. Me and you cannot buy tanks and airplanes. What we can do is send vehicles, drones, medical equipment, and many other supplies that the defenders continue to need in large quantities.<\/p>\n\n<p>There are may people in Ukraine, Europe and elsewhere in the world who organize the equipment and assistance projects all day, and very much need our contributions. Unfortunately we have had some scams and scandals where donations have not reached where needed. The full-scale war has lasted for over a year. It may seem that the Ukrainians are already winning, and we can afford to get tired and look away.<\/p>\n\n<p>No, we can\u2019t. russian invasion continues, and we cannot look away. Please donate to Ukraine and help them in any other way that you can.<\/p>\n\n<p>Where to donate? My Twitter profile has some links to safe projects endorsed by Ukrainians. There are also local efforts in many countries, but I don\u2019t know them all and don\u2019t wish to unfairly showcase some while not mentioning others. There\u2019s info in social and regular media. Please look it up, verify which ones are trustworthy, and continue to spread the word and donate.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/nafo-zakharova\/\">How I displeased Maria Zakharova<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on July 12, 2023.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/snapshot-testing-xcode-cloud\/"}},"id":"https:\/\/jaanus.com\/snapshot-testing-xcode-cloud","published":"2023-06-20T08:09:21+03:00","updated":"2023-06-20T08:09:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p><a href=\"https:\/\/github.com\/pointfreeco\/swift-snapshot-testing\">swift-snapshot-testing<\/a> by Point-Free is an excellent modern approach to Swift snapshot (screenshot) testing. It doesn\u2019t work out of the box with Xcode Cloud. This post is about how I made it work correctly with Xcode Cloud.<\/p>\n\n<p>TL;DR: <a href=\"https:\/\/gist.github.com\/jaanus\/7e14b31f7f445435aadac09d24397da8\">gist with the code.<\/a><\/p>\n\n<h2 id=\"background\">Background<\/h2>\n\n<p>snapshot-testing default behavior assumes that the environment running the tests has access to the source repository where the reference snapshots are kept. This is a fine assumption when developing and testing locally and also in many CI environments, but not so in Xcode Cloud. Xcode Cloud is designed so that building and executing the tests are two discrete steps that happen in different environments, and the test runner does not have access to the source code, except the <code class=\"language-plaintext highlighter-rouge\">ci_scripts<\/code> folder that seems to get special treatment.<\/p>\n\n<p>When you set up snapshot-testing with its minimal default configuration and test locally, everything works. When you push your code and tests to Xcode Cloud and run them, the tests will fail because they do not find reference screenshots. You will see the error about snapshot-testing saving new screenshots, but of course the environment is cleaned with every run, so next run will have the same failure.<\/p>\n\n<p><a href=\"https:\/\/github.com\/pointfreeco\/swift-snapshot-testing\/discussions\/553\">Many people have devised clever solutions about hacking the screenshots to be saved into ci_scripts<\/a>, so that they get transferred across environments. This felt too hacky for me, so I thought about a better way to do this. Turns out that there is one: you can package the screenshots into the test bundle.<\/p>\n\n<h2 id=\"storing-snapshots-into-the-test-bundle\">Storing snapshots into the test bundle<\/h2>\n\n<p>I asked about this in WWDC 2023 Ask Apple session, and got this helpful comment.<\/p>\n\n<p><img src=\"\/images\/snapshot-testing-ask-apple.png\" alt=\"Ask Apple suggestion about bundling the screenshots\" \/><\/p>\n\n<p>I had of course previously used resources bundled in tests, but hadn\u2019t thought too much about it in the context of snapshot testing. It makes sense - the test bundle is cleanly transferred to the test runner in Xcode Cloud, and can use the snapshots that are bundled there.<\/p>\n\n<p>With this in mind, I set myself the following design goals for my solution.<\/p>\n\n<p><strong>Minimal deviation from standard snapshot-testing behavior.<\/strong> I like what snapshot-testing does out of the box: for example, storing the snapshots in <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folder adjacent to the test code. Whatever I do for Xcode Cloud should be a thin clean layer on top of this.<\/p>\n\n<p><strong>Should work with both SPM test targets as well as top-level \u201cxcodeproj\u201d unit test targets.<\/strong> I have tests, including snapshot tests, that are run and built in both of these ways. Both kinds of snapshot tests should run correctly in Xcode Cloud.<\/p>\n\n<p><strong>Support testing multiple locales.<\/strong> I specifically test with multiple locales to assure that my localization is correct.<\/p>\n\n<p><strong>Minimal impact to call site.<\/strong> The snapshot testing API from the test functions should change as little as possible. When you build the tests, you shouldn\u2019t need to know about Xcode Cloud.<\/p>\n\n<p><strong>Easy to understand and maintain.<\/strong> I don\u2019t want to think too much about this. Whatever I do should be resilient and remain working with minimal maintenance. This is why I am doing this blog post and have comments in the code\u2013mostly for my own future self.<\/p>\n\n<p>So here\u2019s my solution to make swift-snapshot-testing work correctly in Xcode Cloud in three easy steps.<\/p>\n\n<h2 id=\"step-1-get-comfortable-with-snapshot-testing-locally\">Step 1: get comfortable with snapshot-testing locally<\/h2>\n\n<p>Before talking about Xcode Cloud, youy should have snapshot-testing set up and working locally. My solution builds on its standard behavior of storing snapshots next to your unit test classes in <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folder. It\u2019s fine if you customize it, you\u2019ll just need to accordingly customize the next steps then.<\/p>\n\n<p>If you now run your tests in Xcode Cloud, you should see snapshot-tests failing with \u201cno snapshot found, storing a new one.\u201d<\/p>\n\n<h2 id=\"step-2-bundle-your-snapshots-into-the-test-bundle\">Step 2: bundle your snapshots into the test bundle<\/h2>\n\n<p>This step will vary depending on if you are working with SPM targets or xcodeproj app target.<\/p>\n\n<p>For SPM, you just add the copy step into <code class=\"language-plaintext highlighter-rouge\">Package.swift<\/code> in your test target:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"o\">.<\/span><span class=\"nf\">testTarget<\/span><span class=\"p\">(<\/span>\n  <span class=\"nv\">name<\/span><span class=\"p\">:<\/span> <span class=\"s\">\"MyViewTests\"<\/span><span class=\"p\">,<\/span>\n  <span class=\"nv\">path<\/span><span class=\"p\">:<\/span> <span class=\"s\">\"If\/There\/Is\/Custom\/Path\"<\/span><span class=\"p\">,<\/span>\n  <span class=\"nv\">resources<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span>\n    <span class=\"o\">.<\/span><span class=\"nf\">copy<\/span><span class=\"p\">(<\/span><span class=\"s\">\"__Snapshots__\"<\/span><span class=\"p\">)<\/span>\n  <span class=\"p\">]<\/span>\n<span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>For xcodeproj app target, you should add the folder containing the snapshots into the test target: make sure the \u201cTarget membership\u201d has the test target checked for the folder.<\/p>\n\n<p>You may first attempt to add multiple <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folders from different tests into the test bundle. When you do this, Xcode will return this kind of build error.<\/p>\n\n<p><img src=\"\/images\/snapshot-testing-multiple-commands-error.png\" alt=\"Error for duplicate Snapshots folder\" \/><\/p>\n\n<p>It doesn\u2019t like multiple <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folders being added into the same test target. I thought that it would be smart and consolidate the contents of those folders into a single top-level <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code>, but it doesn\u2019t do that.<\/p>\n\n<p>The solution is to not add the <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folders to the test target, but add the folders under them, one level down. The names of those folders should match the names of your test classes and are hopefully unique across your project. I did this by removing references to the <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folder from my Xcode project, and dragging the lower-level folders with snapshots into the project instead, which I added as members of the test target.<\/p>\n\n<p>At the end of this step, everything looks like before: your snapshot tests continue to run locally and fail in Xcode Cloud. However, if you inspect your <code class=\"language-plaintext highlighter-rouge\">xctest<\/code> bundles in <code class=\"language-plaintext highlighter-rouge\">DerivedData<\/code>, you should see the screenshots bundled in them for both SPM targets and xcodeproj targets. In the first case, screenshots are in <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folder, and in the second, they are directly contained in the test resources.<\/p>\n\n<p>Here\u2019s what the folders look like for one of my SPM targets. The <code class=\"language-plaintext highlighter-rouge\">xctest<\/code> target looks like this.<\/p>\n\n<p><img src=\"\/images\/snapshot-testing-settings-xctest.png\" alt=\"SPM xctest bundle contents\" \/><\/p>\n\n<p>If you inspect the <code class=\"language-plaintext highlighter-rouge\">Library_SettingsTest.bundle<\/code> that contains the resources, you should see the screenshots.<\/p>\n\n<p><img src=\"\/images\/snapshot-testing-settings-xctest-resources.png\" alt=\"SPM xctest bundle resourcrs\" \/><\/p>\n\n<p>It will look similar for the app target, except that the <code class=\"language-plaintext highlighter-rouge\">xctest<\/code> is inside your app target <code class=\"language-plaintext highlighter-rouge\">Plugins<\/code>, and there are no intermediate <code class=\"language-plaintext highlighter-rouge\">Library_something.bundle<\/code> and <code class=\"language-plaintext highlighter-rouge\">__Snapshots__<\/code> folders.<\/p>\n\n<p>By this point, you should see that the screenshots are present in your test bundle. Let\u2019s now make the snapshot testing library pick them up, which will make the tests to run correctly in Xcode Cloud.<\/p>\n\n<h2 id=\"step-3-instruct-snapshot-testing-to-use-screenshots-from-the-test-bundle\">Step 3: instruct snapshot-testing to use screenshots from the test bundle<\/h2>\n\n<p><a href=\"https:\/\/gist.github.com\/jaanus\/7e14b31f7f445435aadac09d24397da8\">Here is my test function<\/a> that implements this.<\/p>\n\n<p>The core idea is that the test runner checks whether a screenshot is present the test bundle. When true (which is the case for Xcode Cloud when everything is set up correctly), the runner uses screenshots inside the bundle. When false (which may be the case if you have written a test locally but not yet recorded snapshots), the runner falls back to snapshot-testing default behavior of using a folder adjacent to the test code, auto-recording the snapshot if needed.<\/p>\n\n<p>When calling this function from SPM tests, use this:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nf\">assertSnapshot<\/span><span class=\"p\">(<\/span>\n  <span class=\"nv\">view<\/span><span class=\"p\">:<\/span> <span class=\"n\">someSwiftUIView<\/span><span class=\"p\">,<\/span>\n  <span class=\"nv\">testBundleResourceURL<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Bundle<\/span><span class=\"o\">.<\/span><span class=\"n\">module<\/span><span class=\"o\">.<\/span><span class=\"n\">resourceURL<\/span><span class=\"o\">!<\/span>\n<span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>When calling in top-level xcodeproj app target tests, use this:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"nf\">assertSnapshot<\/span><span class=\"p\">(<\/span>\n  <span class=\"nv\">view<\/span><span class=\"p\">:<\/span> <span class=\"n\">sut<\/span><span class=\"p\">,<\/span>\n  <span class=\"nv\">testBundleResourceURL<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Bundle<\/span><span class=\"p\">(<\/span><span class=\"nv\">for<\/span><span class=\"p\">:<\/span> <span class=\"nf\">type<\/span><span class=\"p\">(<\/span><span class=\"nv\">of<\/span><span class=\"p\">:<\/span> <span class=\"k\">self<\/span><span class=\"p\">))<\/span><span class=\"o\">.<\/span><span class=\"n\">resourceURL<\/span><span class=\"o\">!<\/span>\n<span class=\"p\">)<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>The <code class=\"language-plaintext highlighter-rouge\">testBundleResourceURL<\/code> parameter is a bit unwiedly, but I couldn\u2019t think of a better way to pass the information cleanly and correctly over to the function from both contexts.<\/p>\n\n<p>I\u2019ve written it up as a gist rather than a SPM package, because the requirements may vary, and this is currently implemented for only one device and fixed view size. If you are comfortable with snapshot-testing, you can surely adjust this to your own needs.<\/p>\n\n<p>One other thing you need to do when using my solution is to adjust your Xcode workflow to use just \u201ciPhone 14 Pro\u201d instead of \u201cRecommended iPhones\u201d.<\/p>\n\n<p>If you have done everything above correctly and followed the above steps and I didn\u2019t mistype anything, you should now see your snapshot tests passing in Xcode Cloud. \ud83c\udf89<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/snapshot-testing-xcode-cloud\/\">Using Swift snapshot testing with Xcode Cloud<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on June 20, 2023.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/canopy\/"}},"id":"https:\/\/jaanus.com\/canopy","published":"2023-06-02T08:09:21+03:00","updated":"2023-06-02T08:09:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I released <a href=\"https:\/\/github.com\/Tact\/Canopy\">Canopy<\/a>: a library that helps you isolate CloudKit dependency and write testable code using CloudKit.<\/p>\n\n<p>Canopy is the portion of Tact code that interacts with CloudKit, to transfer the content to and from the cloud. I\u2019ve been working on Tact using CloudKit for a few years now, and accumulated a lot of insights and opinions on the way.<\/p>\n\n<p>A while ago, I had the idea to extract the CloudKit part of Tact and release it separately like this. I had a few goals in mind.<\/p>\n\n<p>First, I believe that it does provide real value to developers who use CloudKit, and want to have cleanly testable code and isolate all dependencies. I have been working with <a href=\"https:\/\/github.com\/pointfreeco\/swift-composable-architecture\">The Composable Architecture<\/a> a lot lately, and it certainly has influenced my thinking about isolating dependencies and testable code, which you see reflected in Canopy. You can use Canopy with or without TCA and <a href=\"https:\/\/github.com\/pointfreeco\/swift-dependencies\">swift-dependencies.<\/a><\/p>\n\n<p>Beyond the functionality, Canopy is also an expression of myself as a developer, and a public showcase project. I don\u2019t have other recent examples of code online, and wanted to have something that I can show if needed. That\u2019s why I took the time to make Canopy a complete project: it includes not only the library itself, but a <a href=\"https:\/\/canopy-docs.justtact.com\/\">documentation site<\/a> and <a href=\"https:\/\/github.com\/Tact\/Thoughts\">example app.<\/a><\/p>\n\n<p>I had several \u201cfirsts\u201d in this project. For example, the documentation site was the first site I have built with <a href=\"https:\/\/developer.apple.com\/documentation\/docc\">DocC.<\/a> There were third-party tools available to generate documentation, but I find more and more that I make my own life easier if I stick with first-party technology that comes straight from Apple. DocC is one such example, and I had a pretty good time with it in this project.<\/p>\n\n<p>I greatly enjoyed putting the whole package together. For better or worse, it reflects my shape as a maker of things on Apple platforms as of early 2023. In the spirit of testable code, Canopy itself is well tested, and the important parts have 100% or near-100% test coverage. I\u2019m pretty happy to see this coverage.<\/p>\n\n<p><img src=\"\/images\/canopy-test-coverage.png\" alt=\"Canopy test coverage\" \/><\/p>\n\n<p>Shipping things naturally includes compromises. I carefully thought through the scope of the project, and wrote it up on the <a href=\"https:\/\/canopy-docs.justtact.com\/documentation\/canopy\/motivation-and-scope\">project motivation page.<\/a> One compromise I chose to make is that Canopy produces a number of warnings with Xcode 14.3. Halfway working through Canopy, Apple shipped Xcode 14.3 with Swift 5.8 that enables Sendable warnings for many Apple system types, including CloudKit types like CKRecord. Canopy does indeed ship these types across actor boundaries, which currently produces warnings like this.<\/p>\n\n<p><img src=\"\/images\/canopy-warnings.png\" alt=\"Canopy warnings\" \/><\/p>\n\n<p>It annoys me a lot, but I chose to ship with these and not rethink my whole approach halfway through. I anticipate that WWDC 23 will bring updates to Apple technology platform and direction regarding the continued migration towards Sendable types, and this will inform future work on Canopy. My goal is to make Canopy safe and warning-free with clean code and without any tricks.<\/p>\n\n<p>I don\u2019t have much feedback about Canopy, other than it has over 100 stars on GitHub as of June 2023. I have no idea if anybody actually uses it. There\u2019s no issues filed, which tells me that either it works fine for people, or nobody else besides me uses it. The latter is fine\u2013I did release Canopy mainly as a showcase project, and am not chasing numbers as the immediate goal.<\/p>\n\n<p>I intend to keep working on Canopy and maintaining it, first and foremost to support the needs of Tact, but also for the benefit of anyone else who might be using it. If you have any thoughts or feedback, please do reach out.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/canopy\/\">Canopy: write better, testable CloudKit apps<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on June 02, 2023.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/mastodon-monitoring-prometheus-grafana\/"}},"id":"https:\/\/jaanus.com\/mastodon-monitoring-prometheus-grafana","published":"2023-01-11T07:09:21+02:00","updated":"2023-01-11T07:09:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I\u2019m not much of a \u201cserver person\u201d. But there\u2019s no escaping servers and cloud if you are serious about working in technology. Applications and data live in the cloud, and it\u2019s always good to have understanding of how it works, even if you mostly work on the client side.<\/p>\n\n<p>Recent surge of interest in Mastodon took me to setting up some instances and helping to operate them\u2013some on my own, and some as part of a group. Such projects are a useful vehicle to learn new things in the context of a real application, and one of the areas I was interested in, is monitoring.<\/p>\n\n<p>I went through the process of setting up monitoring for some Mastodon instances with Prometheus and Grafana. I haven\u2019t worked with these systems before, so it was a basic crash course to me, which I think I somewhat passed, as I understand the basic concepts now. This post is mainly a set of notes and copypastable instructions for my future self, but there\u2019s nothing secret here, and it may be of value to others too.<\/p>\n\n<p>This material is largely based on the excellent series of blog posts by IPng Networks: <a href=\"https:\/\/ipng.ch\/s\/articles\/2022\/11\/20\/mastodon-1.html\">part 1<\/a>, <a href=\"https:\/\/ipng.ch\/s\/articles\/2022\/11\/24\/mastodon-2.html\">part 2<\/a>, <a href=\"https:\/\/ipng.ch\/s\/articles\/2022\/11\/27\/mastodon-3.html\">part 3<\/a>. That series assumes a bit more background knowledge and doesn\u2019t cover the basics, like installing Grafana and Prometheus. So my post fills in some gaps in those.<\/p>\n\n<p>Okay. Let\u2019s dig in<\/p>\n\n<h2 id=\"mental-model-of-grafana-and-prometheus\">Mental model of Grafana and Prometheus<\/h2>\n\n<p>Here is a naive explanation of what these are. <a href=\"https:\/\/prometheus.io\">Prometheus<\/a> is a tool for collecting metrics, and <a href=\"https:\/\/grafana.com\">Grafana<\/a> displays those metrics on dashboards.<\/p>\n\n<p>Here\u2019s how I think about them.<\/p>\n\n<p><img src=\"\/images\/prometheus-grafana.png\" alt=\"Diagram about Prometheus and Grafana\" \/><\/p>\n\n<p>Prometheus has the concept of <strong>exporters<\/strong> - they export metrics about a particular application or subsystem from a particular host. One key exporter provided by Prometheus is <strong>node exporter<\/strong>. It has nothing to do with Node.js - it means \u201cnode\u201d as in a physical machine instance (which may be really physical or a VM).<\/p>\n\n<p>The exporters all run a small web server which exports metrics in specific text format. There is a <a href=\"https:\/\/github.com\/prometheus\/prometheus\/wiki\/Default-port-allocations\">list of canonical port allocations<\/a> for exporters.<\/p>\n\n<p>Next, there is a central \u201cprometheus\u201d agent, which collects and stores metrics from the individual exporters, and exposes yet another small web server. Prometheus also has its own web UI to visualize the metrics, but I won\u2019t look at that since I\u2019ll use Grafana.<\/p>\n\n<p>Grafana can consume data from many sources, with Prometheus being one (and in this post, the only) source. It visualizes the data as dashboards. It can do many other thigns like generate alerts, which is not covered in this post.<\/p>\n\n<p>This was a very quick and naive explanation to help establish a basic mental model. These systems have a lot more depth which is beyond the scope of this basic post.<\/p>\n\n<p>So with the basic mental model in place, let\u2019s install some software.<\/p>\n\n<h2 id=\"starting-point\">Starting point<\/h2>\n\n<p>I assume the following starting point.<\/p>\n\n<ul>\n  <li>I have a Ubuntu host running Mastodon.<\/li>\n  <li>I have superuser access on the host, and know how to run some basic Linux configuration and sudo. (If I already got Mastodon up and running, I am more than covered here.)<\/li>\n  <li>I will install all monitoring on the same host.<\/li>\n<\/ul>\n\n<h2 id=\"install-grafana\">Install Grafana<\/h2>\n\n<p>Let\u2019s get an empty Grafana up and running before we fill it with data. Grafana is present in many APT repositories, but the version of Grafana that comes from my hosting provider is very old. Fortunately, Grafana provides its own APT repository. <a href=\"https:\/\/grafana.com\/docs\/grafana\/latest\/setup-grafana\/installation\/debian\/\">Follow the instructions here.<\/a> I chose to install the open source version.<\/p>\n\n<p>Now, you follow the instructions, you start the daemon, the server is running\u2026 or is it? How do you know?<\/p>\n\n<p>Here is one important command you should use throughout this setup process: <code class=\"language-plaintext highlighter-rouge\">sudo lsof -nP | grep LISTEN<\/code>. This shows all applications that are listening on some ports. I mentioned above that we\u2019ll be installing a bunch of small web servers, and this is a good way to confirm they are actually running.<\/p>\n\n<p>When you get to this point, and look for grafana in the list of running servers, you won\u2019t see it at first. What is going on?<\/p>\n\n<p>By default, both Grafana and Mastodon listen at port 3000. Since Mastodon is already running on that port, Grafana couldn\u2019t, and fails to run.<\/p>\n\n<p>To confirm this, here is another useful command: <code class=\"language-plaintext highlighter-rouge\">sudo journalctl -u grafana-server<\/code> (replace \u201cgrafana-server\u201d with whatever daemon you are interested in). You will likely see something like this.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>Jan 11 08:01:35 example grafana-server[584534]: logger=server t=2023-01-11T08:01:35.790401765Z level=error msg=\"Stopped background service\" service=*api.HTTPServer reason=\"failed to open listener on address 0.0.0.0:3000: listen tcp 0.0.0.0:3000: bind: address already in use\"\nJan 11 08:01:35 example grafana-server[584534]: logger=secret.migration t=2023-01-11T08:01:35.796920608Z level=error msg=\"Stopped secret migration service\" service=*migrations.DataSourceSecretMigrationService reason=\"context canceled\"\nJan 11 08:01:35 example grafana-server[584534]: logger=infra.lockservice t=2023-01-11T08:01:35.797571767Z level=error msg=\"Failed to release the lock\" error=\"context canceled\"\nJan 11 08:01:35 example grafana-server[584534]: logger=server t=2023-01-11T08:01:35.798076811Z level=error msg=\"Server shutdown\" error=\"*api.HTTPServer run error: failed to open listener on address 0.0.0.0:3000: listen tcp 0.0.0.0:3000: bind: address already in use\"\nJan 11 08:01:35 example grafana-server[584534]: *api.HTTPServer run error: failed to open listener on address 0.0.0.0:3000: listen tcp 0.0.0.0:3000: bind: address already in use\nJan 11 08:01:35 example systemd[1]: grafana-server.service: Main process exited, code=exited, status=1\/FAILURE\nJan 11 08:01:35 example systemd[1]: grafana-server.service: Failed with result 'exit-code'.\nJan 11 08:01:36 example systemd[1]: grafana-server.service: Scheduled restart job, restart counter is at 5.\nJan 11 08:01:36 example systemd[1]: Stopped Grafana instance.\nJan 11 08:01:36 example systemd[1]: grafana-server.service: Start request repeated too quickly.\nJan 11 08:01:36 example systemd[1]: grafana-server.service: Failed with result 'exit-code'.\nJan 11 08:01:36 example systemd[1]: Failed to start Grafana instance.\n<\/code><\/pre><\/div><\/div>\n\n<p>To fix this, edit <code class=\"language-plaintext highlighter-rouge\">\/etc\/grafana\/grafana.ini<\/code>. Add some port where there isn\u2019t anything running already, for example 3100:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code># The http port  to use\nhttp_port = 3100\n<\/code><\/pre><\/div><\/div>\n\n<p>Restart the server with <code class=\"language-plaintext highlighter-rouge\">sudo systemctl restart grafana-server<\/code>. You should now see it in the list of servers:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>sudo lsof -nP | grep LISTEN\n\n\u2026\ngrafana-s 584598                           grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584607 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584608 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584609 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584610 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584611 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584612 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584613 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584614 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584615 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\ngrafana-s 584598 584616 grafana-s          grafana    9u     IPv6            5587781       0t0        TCP *:3100 (LISTEN)\n<\/code><\/pre><\/div><\/div>\n\n<h2 id=\"install-nginx-frontend-for-grafana\">Install nginx frontend for Grafana<\/h2>\n\n<p>Your Grafana isn\u2019t available from the public Internet. Or at least shouldn\u2019t be. Check that you can\u2019t publicly access http:\/\/grafana.example.com:3100. If you can, use some firewall or network configuration on your host or hosting provider to limit access to this port from the public Internet.<\/p>\n\n<p>A common practice for public servers is to have nginx frontend which does HTTPS termination and reverse-proxies to the actual application. This is also what Mastodon itself does. We will now do this for Grafana.<\/p>\n\n<p>I will walk through the nginx host setup in typical steps.<\/p>\n\n<p>First, update your DNS to point <code class=\"language-plaintext highlighter-rouge\">grafana.example.com<\/code> to the IP of this server.<\/p>\n\n<p>Next, add <code class=\"language-plaintext highlighter-rouge\">grafana<\/code> into <code class=\"language-plaintext highlighter-rouge\">\/etc\/nginx\/sites-available<\/code>, with the following content:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>server {\n  listen 80;\n  listen [::]:80;\n  root \/var\/www\/html;\n  server_name grafana.example.com;\n  index index.html index.htm index.nginx-debian.html;\n  location \/ {\n    # First attempt to serve request as file, then\n    # as directory, then fall back to displaying a 404.\n    try_files $uri $uri\/ =404;\n  }\n}\n<\/code><\/pre><\/div><\/div>\n\n<p>Link it to <code class=\"language-plaintext highlighter-rouge\">\/etc\/nginx\/sites-enabled<\/code>. Test your configuration: <code class=\"language-plaintext highlighter-rouge\">sudo nginx -t<\/code>. If it looks OK, restart nginx. <code class=\"language-plaintext highlighter-rouge\">sudo nginx -s reload<\/code>. You should now see a default site when you go to http:\/\/grafana.example.com.<\/p>\n\n<p>Now, add HTTPS to the site. Easiest is to use <a href=\"https:\/\/letsencrypt.org\">Let\u2019s Encrypt<\/a>, and have their certbot do all the work. Run <code class=\"language-plaintext highlighter-rouge\">sudo certbot<\/code> and follow the prompts. This sets up HTTPS certificates for grafana, as well as the automatic cetificate rotation (Let\u2019s Encrypt certificates are short-lived and must be automatically rotated). When you did this correctly, you can now go to https:\/\/grafana.example.com and see a default site, served correctly over HTTPS without warnings.<\/p>\n\n<p>Finally, set up the reverse proxy from nginx. Here\u2019s what I use, and what your <code class=\"language-plaintext highlighter-rouge\">\/etc\/nginx\/sites-available\/grafana<\/code> should look like in the end.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>server {\n\n  server_name grafana.example.com;\n\n  location \/ {\n    proxy_pass http:\/\/localhost:3100;\n    proxy_http_version 1.1;\n    proxy_set_header Upgrade $http_upgrade;\n    proxy_set_header Connection 'upgrade';\n    proxy_set_header Host $host;\n    proxy_cache_bypass $http_upgrade;\n  }\n\n  listen [::]:443 ssl ipv6only=on; # managed by Certbot\n  listen 443 ssl; # managed by Certbot\n  ssl_certificate \/etc\/letsencrypt\/live\/grafana.example.com\/fullchain.pem; # managed by Certbot\n  ssl_certificate_key \/etc\/letsencrypt\/live\/grafana.example.com\/privkey.pem; # managed by Certbot\n  include \/etc\/letsencrypt\/options-ssl-nginx.conf; # managed by Certbot\n  ssl_dhparam \/etc\/letsencrypt\/ssl-dhparams.pem; # managed by Certbot\n}\n\nserver {\n    if ($host = grafana.example.com) {\n      return 301 https:\/\/$host$request_uri;\n    } # managed by Certbot\n\n    listen 80;\n    listen [::]:80;\n\n    server_name grafana.example.com;\n    return 404; # managed by Certbot\n}\n<\/code><\/pre><\/div><\/div>\n\n<p>Test your configuration: <code class=\"language-plaintext highlighter-rouge\">sudo nginx -t<\/code>. Restart nginx: <code class=\"language-plaintext highlighter-rouge\">sudo nginx -s reload<\/code>.<\/p>\n\n<h2 id=\"launch-grafana-set-up-admin-password-and-users\">Launch Grafana, set up admin password and users<\/h2>\n\n<p>Finally you can start to see something in your browser. Go to https:\/\/grafana.example.com. You should see Grafana UI.<\/p>\n\n<p><img src=\"\/images\/grafana.png\" alt=\"Grafana\" \/><\/p>\n\n<p>The first login is with user \u201cadmin\u201d and password \u201cadmin\u201d. It will prompt you to set a secure password. Do that. You can then continue using Grafana as admin, or set up another admin user for yourself. You can also invite more people. We haven\u2019t set up e-mail sending in Grafana by this point, so e-mail invitations won\u2019t work. Just copy the invitation links from the web UI and share those yourself.<\/p>\n\n<h2 id=\"install-prometheus-and-node-exporter\">Install Prometheus and node-exporter<\/h2>\n\n<p>Install Prometheus from latest official binary <a href=\"https:\/\/devopscube.com\/install-configure-prometheus-linux\/\">following these instructions.<\/a> Ignore the part about \u201cfirewall rules opened for accessing Prometheus port 9090\u201d because we won\u2019t access Prometheus from public Internet.<\/p>\n\n<p>You should now see that Prometheus is listening on your server:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>sudo lsof -nP | grep LISTEN\n\n\u2026\nprometheu 585995                        prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\nprometheu 585995 585996 prometheu       prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\nprometheu 585995 585997 prometheu       prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\nprometheu 585995 585998 prometheu       prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\nprometheu 585995 585999 prometheu       prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\nprometheu 585995 586003 prometheu       prometheus    7u     IPv6            5612824       0t0        TCP *:9090 (LISTEN)\n<\/code><\/pre><\/div><\/div>\n\n<p>Install node_exporter from <a href=\"https:\/\/prometheus.io\/download\/\">the official downloads page.<\/a> (Replace the URL with the latest version.)<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>curl -OL https:\/\/github.com\/prometheus\/node_exporter\/releases\/download\/v1.5.0\/node_exporter-1.5.0.linux-amd64.tar.gz\ntar xzvf node_exporter-1.5.0.linux-amd64.tar.gz\nsudo cp node_exporter-1.5.0.linux-amd64\/node_exporter \/usr\/local\/bin\n<\/code><\/pre><\/div><\/div>\n\n<p>Create <code class=\"language-plaintext highlighter-rouge\">\/etc\/systemd\/system\/node_exporter.service<\/code> with the following content:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>[Unit]\nDescription=Node Exporter\nAfter=network.target\n\n[Service]\nUser=prometheus\nGroup=prometheus\nType=simple\nExecStart=\/usr\/local\/bin\/node_exporter\n\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre><\/div><\/div>\n\n<p>Add the service and check its status. All should look good:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>sudo systemctl daemon-reload\nsudo systemctl start node_exporter\nsudo systemctl status node_exporter\n<\/code><\/pre><\/div><\/div>\n\n<p>You should now see the node metrics being exported. You can manually query the URL with curl and you\u2019ll see a ton of metrics.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>$ curl http:\/\/localhost:9100\/metrics\n# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 0\ngo_gc_duration_seconds{quantile=\"0.25\"} 0\ngo_gc_duration_seconds{quantile=\"0.5\"} 0\ngo_gc_duration_seconds{quantile=\"0.75\"} 0\ngo_gc_duration_seconds{quantile=\"1\"} 0\ngo_gc_duration_seconds_sum 0\ngo_gc_duration_seconds_count 0\n# HELP go_goroutines Number of goroutines that currently exist.\n\u2026\n<\/code><\/pre><\/div><\/div>\n\n<p>Add the newly added node_exporter to prometheus configuration. Edit \/etc\/prometheus\/prometheus.yml and add this into <code class=\"language-plaintext highlighter-rouge\">scrape_configs<\/code>:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>- job_name: node\n    # If prometheus-node-exporter is installed, grab stats about the local\n    # machine by default.\n    static_configs:\n      - targets: ['localhost:9100']\n<\/code><\/pre><\/div><\/div>\n\n<p>Restart prometheus for the new configuration to take effect: <code class=\"language-plaintext highlighter-rouge\">sudo systemctl restart prometheus<\/code><\/p>\n\n<h2 id=\"add-your-first-grafana-dashboard\">Add your first Grafana dashboard<\/h2>\n\n<p>We have done a lot of work but not yet seeing any dashboards. Let\u2019s add our first dashboard to Grafana which exposes metrics from the node exporter that you just set up.<\/p>\n\n<p>Go to https:\/\/grafana.example.com. Add Prometheus as data source. The only thing you need to enter here is the URL.<\/p>\n\n<p><img src=\"\/images\/grafana-add-prometheus.png\" alt=\"Add Prometheus as Grafana data source\" \/><\/p>\n\n<p>Add the dashboard. Select \u201cImport dashboard\u201d and add 1860 as the dashboard ID. This is the <a href=\"https:\/\/grafana.com\/grafana\/dashboards\/1860-node-exporter-full\/\">official full node_exporter dashboard.<\/a><\/p>\n\n<p><img src=\"\/images\/grafana-import-dashboard.png\" alt=\"Import dashboard to Grafana\" \/><\/p>\n\n<p>Click \u201cLoad\u201d. In the next screen, select Prometheus as data source. Congratulations, you should now see your first dashboard.<\/p>\n\n<p><img src=\"\/images\/grafana-node-dashboard.png\" alt=\"Node exporter dashboard in Grafana\" \/><\/p>\n\n<h2 id=\"add-mastodon-statsd-exporter-and-dashboard\">Add Mastodon statsd exporter and dashboard<\/h2>\n\n<p>Let\u2019s now add the Mastodon-specific dashboard that IPng Networks describes in <a href=\"https:\/\/ipng.ch\/s\/articles\/2022\/11\/27\/mastodon-3.html\">part 3 of their Mastodon blog series.<\/a><\/p>\n\n<p>Download a recent binary version from the <a href=\"https:\/\/github.com\/prometheus\/statsd_exporter\/releases\">package releases page.<\/a><\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>curl -OL https:\/\/github.com\/prometheus\/statsd_exporter\/releases\/download\/v0.23.0\/statsd_exporter-0.23.0.linux-amd64.tar.gz\ntar xzvf statsd_exporter-0.23.0.linux-amd64.tar.gz\nsudo cp statsd_exporter-0.23.0.linux-amd64\/statsd_exporter \/usr\/local\/bin\n<\/code><\/pre><\/div><\/div>\n\n<p>Install the statsd mapping file provided by IPng Networks:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>curl -OL https:\/\/ipng.ch\/assets\/mastodon\/statsd-mapping.yaml\nsudo cp statsd-mapping.yaml \/etc\/prometheus\n<\/code><\/pre><\/div><\/div>\n\n<p>Create <code class=\"language-plaintext highlighter-rouge\">\/etc\/default\/statsd_exporter<\/code> with this content:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>ARGS=\"--statsd.mapping-config=\/etc\/prometheus\/statsd-mapping.yaml\"\n<\/code><\/pre><\/div><\/div>\n\n<p>Create <code class=\"language-plaintext highlighter-rouge\">statsd_exporter.service<\/code> in <code class=\"language-plaintext highlighter-rouge\">\/etc\/systemd\/system\/<\/code> with this content:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>[Unit]\nDescription=Statsd exporter\nAfter=network.target\n\n[Service]\nRestart=always\nUser=prometheus\nEnvironmentFile=\/etc\/default\/statsd_exporter\nExecStart=\/usr\/local\/bin\/statsd_exporter $ARGS\nExecReload=\/bin\/kill -HUP $MAINPID\nTimeoutStopSec=20s\nSendSIGKILL=no\n\n[Install]\nWantedBy=multi-user.target\n<\/code><\/pre><\/div><\/div>\n\n<p>Add this to <code class=\"language-plaintext highlighter-rouge\">\/etc\/prometheus\/prometheus.yml<\/code>:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>  - job_name: statsd_exporter\n    static_configs:\n    - targets: ['localhost:9102']\n<\/code><\/pre><\/div><\/div>\n\n<p>Add this to your Mastodon <code class=\"language-plaintext highlighter-rouge\">.env.production<\/code>:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>STATSD_ADDR=localhost:9125\n<\/code><\/pre><\/div><\/div>\n\n<p>Restart the daemons:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>sudo systemctl daemon-reload\nsudo systemctl start statsd_exporter\nsudo systemctl restart prometheus\nsudo systemctl restart mastodon-sidekiq\nsudo systemctl restart mastodon-streaming\nsudo systemctl restart mastodon-web\n<\/code><\/pre><\/div><\/div>\n\n<p>Verify that you see some output from the exporter:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>$ curl http:\/\/localhost:9102\/metrics\n\n# HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\n# TYPE go_gc_duration_seconds summary\ngo_gc_duration_seconds{quantile=\"0\"} 1.5989e-05\ngo_gc_duration_seconds{quantile=\"0.25\"} 3.2811e-05\ngo_gc_duration_seconds{quantile=\"0.5\"} 5.1658e-05\ngo_gc_duration_seconds{quantile=\"0.75\"} 6.6586e-05\ngo_gc_duration_seconds{quantile=\"1\"} 0.000104236\ngo_gc_duration_seconds_sum 0.000498889\ngo_gc_duration_seconds_count 9\n\u2026\n<\/code><\/pre><\/div><\/div>\n\n<p>Import the dashboard to Grafana. <a href=\"https:\/\/grafana.com\/grafana\/dashboards\/17492-mastodon-stats\/\">Dashboard ID is 17492.<\/a><\/p>\n\n<p><img src=\"\/images\/grafana-mastodon-dashboard.png\" alt=\"Grafana Mastodon dashboard\" \/><\/p>\n\n<h2 id=\"add-more-exporters\">Add more exporters<\/h2>\n\n<p>You can now add more exporters, such as for PostgreSQL, Redis, nginx, and ElasticSearch if you have ES enabled. I am not going to provide the details for each exporter here, but you saw the basic pattern above, and it\u2019s the same for all exporters:<\/p>\n\n<ul>\n  <li>Install the exporter software<\/li>\n  <li>Set up configuration for it in \/etc\/default<\/li>\n  <li>Set up a system service for it in \/etc\/systemd\/system (if you install it yourself) or make sure it exists in \/lib\/systemd\/system (if installed by package manager). <a href=\"https:\/\/unix.stackexchange.com\/questions\/206315\/whats-the-difference-between-usr-lib-systemd-system-and-etc-systemd-system#\">Difference explained here.<\/a><\/li>\n  <li>Add any other needed configuration and permissions. See the specific exporter docs. E.g for PostgreSQL, you will need to set up a special database user to read the database stats.<\/li>\n  <li>Add a link to the exporter to prometheus.yml to make Prometheus aware of it<\/li>\n  <li>Restart the services, check manually that the exporter is indeed exporting<\/li>\n  <li>Add a dashboard to Grafana<\/li>\n<\/ul>\n\n<h2 id=\"where-to-go-from-here\">Where to go from here<\/h2>\n\n<p>This was a naive post that only covered the basics of monitoring Mastodon with Grafana and Prometheus. You can do many more things with these systems that I did not cover, like build your own dashboards, set up alerts, monitor things across hosts etc.<\/p>\n\n<p>In more advanced devops environments, many of the things I do here manually are automated, templatized, containerized, scripted etc. This is just a basic manual set up with one host.<\/p>\n\n<p>For more inspiration about Mastodon monitoring (which I may further dig into myself one day and improve my own dashboards) see lots of info from Hachyderm. For example:<\/p>\n\n<ul>\n  <li><a href=\"https:\/\/grafana.hachyderm.io\/public\">the public Hachyderm dashboard<\/a><\/li>\n  <li><a href=\"https:\/\/hachyderm.io\/@nova\/109587552895685371\">announcement by @nova<\/a><\/li>\n  <li><a href=\"https:\/\/hachyderm.io\/@dma\/109587894954362203\">this post by @dma<\/a> which links to <a href=\"https:\/\/gist.github.com\/dmah42\/f2edb5d46fd4cb9127daa129f3e6de92\">their dashboard source<\/a> and <a href=\"https:\/\/medium.com\/@dma42\/observing-hachyderms-24e0f35529a5\">a longer writeup<\/a><\/li>\n<\/ul>\n\n  <p><a href=\"https:\/\/jaanus.com\/mastodon-monitoring-prometheus-grafana\/\">How to set up monitoring for your Mastodon instance with Prometheus and Grafana<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on January 11, 2023.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/tact-app-store\/"}},"id":"https:\/\/jaanus.com\/tact-app-store","published":"2022-11-28T14:09:21+02:00","updated":"2022-11-28T14:09:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Tact is now available in the iOS and macOS App Stores. <a href=\"https:\/\/justtact.com\/blog\/tact-is-now-available-in-the-ios-and-macos-app-stores\">Read our official announcement.<\/a> <a href=\"https:\/\/dl.justtact.com\">Get it here.<\/a><\/p>\n\n<p><img src=\"\/images\/2022-11-tact-app-store.png\" alt=\"Tact app store version on macOS and iOS\" \/><\/p>\n\n<p>With this release, one chapter in the history of Tact ends, and another one begins. It goes from a silly little idea, to a real app in the store. While still being quite small, and possibly silly.<\/p>\n\n<h2 id=\"looking-back\">Looking back<\/h2>\n\n<p>I\u2019ve written quite a bit about Tact over the past few years. About why we made it, and how it has evolved.<\/p>\n\n<p>February 2021. <a href=\"https:\/\/jaanus.com\/my-hobby-project-tact\/\">Initial announcement<\/a><\/p>\n\n<p>December 2021. <a href=\"https:\/\/blog.justtact.com\/tact-is-now-available-as-public-beta\/\">Public beta announcement<\/a> and <a href=\"https:\/\/jaanus.com\/tact-public-beta\/\">my reflection on it<\/a><\/p>\n\n<p>I just re-read these. Everything that I wrote before still holds true today.<\/p>\n\n<p>Here is a key thought from my public beta reflection:<\/p>\n\n<blockquote>\n  <p>We designed Tact to be a safe environment, where you can be free from unwanted intrusion. The Internet can be unwelcoming and hostile. We can\u2019t fix all of it, but we can design our own little corner of it, where you only hear from those who you want to hear from.<\/p>\n<\/blockquote>\n\n<p>As I work on Tact, I keep going back to this idea, and it still very much keeps guiding how we think about the project. Today, I also add the aspects of sustainability and predictability. We have been running the project for a few years, and can continue running it in its current form for many more. We won\u2019t need to \u201cpull the rug\u201d and surprise you with abrupt changes to our business or product. It will keep evolving, but in a fashion that extends, rather than disrupts.<\/p>\n\n<h2 id=\"looking-forward\">Looking forward<\/h2>\n\n<p>I ask you to do three things.<\/p>\n\n<h3 id=\"try\">Try<\/h3>\n<p>Just get it from the App Store, and try starting a chat with someone. It\u2019s free and easy to get started, and you don\u2019t have to pay anything if you have three or fewer chats.<\/p>\n\n<p>If you don\u2019t have anybody to chat with, here are the links for <a href=\"https:\/\/go.justtact.com\/1on1\/P8TYVA8yGUTQ6uG5mZtPm2?from=Jaanus\">myself<\/a>, <a href=\"https:\/\/go.justtact.com\/1on1\/5WerMvkKNYjfMyMd7MhmY8?from=Priidu\">Priidu<\/a>, and <a href=\"https:\/\/github.com\/tact\/public\/discussions\/104\">our big Everyone joinable chat<\/a>.<\/p>\n\n<h3 id=\"buy\">Buy<\/h3>\n\n<p>If you end up having more than three chats in Tact, it tells me you find it valuable and useful. Tact then asks you to buy a monthly or yearly subscription to create and join unlimited chats. You can also choose to buy the subscription even before you hit the chat limit.<\/p>\n\n<p><strong>The future development speed of Tact depends on how many people buy it.<\/strong> This does not concern operating Tact in its current form, or doing ongoing maintenance. There are very few ongoing operating costs, and we can keep the lights on basically forever in its current \u201cside project\u201d form, even if nobody buys it. We would very much like to spend more time and effort on Tact, but it will directly depend on how many people find it valuable and are willing to pay for it.<\/p>\n\n<p>You may look at the current offering and say \u201cTact is expensive, and there are more feature-rich products out there for free.\u201d And you\u2019d be right. I humbly ask you to think of this partly as crowdfunding, and consider not only the current form of the product, but also where we can take the Tact vision further with your contribution.<\/p>\n\n<h3 id=\"say\">Say<\/h3>\n\n<p>Don\u2019t be a stranger. After trying Tact, and especially after paying for it, you have every bit of right to say what should happen next.<\/p>\n\n<p>Tact is not \u201cdone\u201d by any means. It has bugs like any software, and many features we chose to postpone, some of which you could even say are \u201cessential\u201d for this kind of chat app. What should we do next, and in what order?<\/p>\n\n<p>Please let us know, and let\u2019s keep building it together. I won\u2019t promise that we will immediately build every idea that you think of, but we do value and consider all your thoughts and discussion.<\/p>\n\n<p>Speak with us:<\/p>\n\n<p>Chat in Tact:  <a href=\"https:\/\/go.justtact.com\/1on1\/P8TYVA8yGUTQ6uG5mZtPm2?from=Jaanus\">myself<\/a>, <a href=\"https:\/\/go.justtact.com\/1on1\/5WerMvkKNYjfMyMd7MhmY8?from=Priidu\">Priidu<\/a>, and <a href=\"https:\/\/github.com\/tact\/public\/discussions\/104\">a big \u201cEveryone\u201d joinable group<\/a><\/p>\n\n<p>Bugs and discussions: <a href=\"https:\/\/github.com\/Tact\/public\">our public community on GitHub<\/a><\/p>\n\n<p>Email: <a href=\"mailto:support@justtact.com\">support@justtact.com<\/a><\/p>\n\n<p>Twitter: <a href=\"https:\/\/twitter.com\/justtact\">@justtact<\/a><\/p>\n\n<p>Mastodon: <a href=\"https:\/\/indieapps.space\/@tact\">@tact<\/a><\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/tact-app-store\/\">The end, and the beginning, as Tact enters App Store<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on November 28, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/twitter-editorial-statement\/"}},"id":"https:\/\/jaanus.com\/twitter-editorial-statement","published":"2022-04-17T23:09:21+03:00","updated":"2022-04-17T23:09:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Hi, new followers.<\/p>\n\n<p>I\u2019m Jaanus. Welcome to my personal social media accounts. These days, I\u2019m mainly active on Twitter.<\/p>\n\n<p>My goal with this editorial statement is to outline who I am, why I post what I post, and what you can and can\u2019t expect when following me.<\/p>\n\n<p>Russia attacked Ukraine on Feb 24, 2022 (which also happens to be Estonian Independence Day). Russia\u2019s war of aggression is also being waged in the information space and in all of our minds.<\/p>\n\n<h2 id=\"why\">Why<\/h2>\n\n<p>Standing against the Russian invasion in Ukraine is the greatest cause of our time. Previously I\u2019d tweet about all sorts of random trivia, technology and work stuff. But none of this matters now as much as beating Russia in Ukraine. I decided to convert my account over to information warfare, and join in.<\/p>\n\n<p>My greatest motivation is <strong>signal boosting<\/strong>. I want to amplify the signals that I think need to be amplified, to help Ukraine win. Ukraine is doing very well in the information space, but Putin\u2019s strategic corruption in the West is deep, and our work is not done until there is no more talk of \u201cappeasement\u201d and \u201creset\u201d and such. Russia does not belong in the family of civilized nations. Our goal right now, beyond beating them militarily on the territory of Ukraine, is complete economic, military, cultural and mental blockade and isolation.<\/p>\n\n<p>We don\u2019t exactly know how Twitter algorithm works, but all likes and retweets help. I hope that all my likes, retweets and posts will help surface the material that needs to reach wide audiences. The content of my own account, what you see when you follow me, is almost a side effect and not my main goal.<\/p>\n\n<p>Some other motivations:<\/p>\n\n<p><strong>I\u2019m Estonian.<\/strong> I was born in Soviet Union, in occupied Estonia. Today, I live in free Estonia and European Union. <a href=\"https:\/\/twitter.com\/IndrekIbrus\/status\/1514251160852574212\">We know what is at stake.<\/a><\/p>\n\n<p><strong>I\u2019m Ukrainian.<\/strong> I don\u2019t mean spiritually, like \u201cwe are all Ukrainians now in our hearts.\u201d I mean it literally. One of my grandmothers was born in Ukraine. Thus, I\u2019m 1\/4 Ukrainian. I haven\u2019t shared it too widely, and due to various life circumstances, I haven\u2019t been in touch with that side of my family all that much. Perhaps that will change now. But I do all the more feel it viscerally. This is my war. It is my people, my kids and grandmas, whom Russian orcs are raping, torturing and killing right now.<\/p>\n\n<h2 id=\"principles\">Principles<\/h2>\n\n<p>I follow these principles when selecting what to like, retweet and especially, what to post on my own.<\/p>\n\n<p><strong>I\u2019m a free man.<\/strong> I have no connections with any government agency or international organizations. I work in technology, my work and customers are completely unrelated to the Russian aggression war. This means I don\u2019t have any inside info about anything, but it also means I\u2019m not accountable to anybody, and can post what I like. I am only accountable to my own conscience.<\/p>\n\n<p><strong>I\u2019m not an expert.<\/strong> You should not trust me, as you shouldn\u2019t trust most things you see on the Internet. I am a layperson about most economic, military and political matters. I am curious, though, and try to keep myself informed and educated.<\/p>\n\n<p><strong>I cross boundaries.<\/strong> I mediate the world and Ukrainian affairs to my Estonian followers, and vice versa.<\/p>\n\n<p><strong>I work across languages.<\/strong> Twitter official app and website have a fantastic \u201cTranslate tweet\u201d feature. I share tweets originally written in Ukrainian, Russian, German, Estonian, English and many other languages, posting my commentary in either Estonian or English. The machine translation is sometimes lossy and weird, but I understand the gist of the message in most cases, and often rephrase it in my own terms.<\/p>\n\n<p><strong>I follow the <a href=\"https:\/\/legal-lingo.com\/new-york-times-rule\">New York Times rule.<\/a><\/strong> Especially in my own posts and commentary, I stand by everything that I post.<\/p>\n\n<p><strong>A balance of rational and emotional.<\/strong> Humans operate as a perfect union between the brain and the heart. My posts also cover both sides. So I don\u2019t only do facts: emotions matter as well, if not more, than the cold hard facts.<\/p>\n\n<p><strong>Culture and stories.<\/strong> I take great interest in stories, culture, music, as they relate to the war. I try to share the ones that matter to me.<\/p>\n\n<p><strong>Lossy and sparse.<\/strong> There is a lot going on, and I don\u2019t aim to cover everything. I have some time to spend on Twitter every day, but I have my limits and I myself have unfollowed accounts simply because they post too much. I try to share less, but more relevant things, and mostly when they speak to me directly in light of all the other principles.<\/p>\n\n<p><strong>Humor and clarity.<\/strong> I often quote-tweet stories that strike me, with my own comment. I try to be light-hearted, and on the humor side. Often, I rephrase technical language into something that\u2019s more human.<\/p>\n\n<p><strong>More love, less fear.<\/strong> I believe that we as humans have two main motivators for anything we do: love or fear. I try to live my life geared more towards love. Thus, my posts ultimately also are about love of life and freedom for Ukraine, Estonia, Europe, and all of the free world. I don\u2019t fear or hate Russians: I simply wish they would leave Ukraine, stop bothering other nations, and figure out for themselves who or why they are.<\/p>\n\n<h2 id=\"cover-image\">Cover image<\/h2>\n\n<p>I want to talk about a photo that I used as my Twitter cover image for a while. It appeared during the first weeks of the war, and deeply struck me. There are many iconic photos from the war, and surely there will be more. This one has stayed the most deeply with me so far.<\/p>\n\n<p>I have since replaced the cover image with my NAFO fella, but if you look carefully enough, you can find a reference to this photo on my cover image.<\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">A striking picture. And a metaphor for the whole war. She is Ukraine. \ud83c\uddfa\ud83c\udde6 <a href=\"https:\/\/t.co\/vkKCIg6X3S\">https:\/\/t.co\/vkKCIg6X3S<\/a><\/p>&mdash; Jaanus Kase \ud83c\udf3b\ud83d\udc99\ud83d\udc9b (@jaanus) <a href=\"https:\/\/twitter.com\/jaanus\/status\/1502276066731343881?ref_src=twsrc%5Etfw\">March 11, 2022<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<p><a href=\"https:\/\/www.facebook.com\/oleksii.m.kyrychenko\/posts\/2984467695199156\">Here is the primary source.<\/a> <a href=\"https:\/\/www.facebook.com\/oleksii.m.kyrychenko\/posts\/2985928788386380\">Here is another Facebook post from the same author explaining the background of the photo.<\/a> The girl is the photographer\u2019s 9-year-old daughter, the photo was taken on Feb 22 two days before the invasion started, and the shotgun was of course unloaded.<\/p>\n\n<p>The photo speaks to me on so many levels. Most obviously the behavior of Russian invader orcs towards girls, women, boys, toddlers, infants, and really anyone. Raping, killing, torture. She is ready to confront it. On a more abstract level, she also is a metaphor for Ukraine, Europe, and the whole free world. There is the duality of her being ready, and the whole situation being so unfair. She is a child who should be in school and not carrying a gun. She did nothing, Ukraine did nothing, to deserve this. She is not guilty of anything. Our grandparents in Ukraine, Estonia and the whole Eastern Europe gave no cause to the fascist invaders of 1939 and 2022 to come rape and kill us. This photo has it all.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/twitter-editorial-statement\/\">My Twitter editorial statement for the Russian aggression war in Ukraine<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on April 17, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/chernobyl\/"}},"id":"https:\/\/jaanus.com\/chernobyl","published":"2022-04-09T23:09:21+03:00","updated":"2022-04-09T23:09:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I visited Kyiv with some friends a few years ago. The most remarkable part of the trip for me was our day tour to Chernobyl. I wasn\u2019t aware of this, but turns out you can visit the area, and it is perfectly safe if you follow the instructions and precautions. There are organized day trips which we took.<\/p>\n\n<p>Now with the war, currently there is no tourism to Ukraine, and the status of the Chernobyl area is unknown. Russian orc troops were there, and it\u2019s not clear how much they destroyed or what happened (other than some of them getting radiated). I hope tourism to Ukraine resumes soon, and you can visit Chernobyl again too.<\/p>\n\n<p>I previously shared this series on Instagram a few years ago. I\u2019ve since closed my Instagram account, and, well, the Russian invasion to Ukraine happened. Feels like a good occasion to re-post the memories.<\/p>\n\n<p>Abandoned kindergarten.<\/p>\n\n<p><img src=\"\/images\/chernobyl-abandoned-kindergarten-1.jpg\" alt=\"Abandoned kindergarten in Chernobyl area\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-abandoned-kindergarten-2.jpg\" alt=\"Abandoned kindergarten in Chernobyl area\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-abandoned-kindergarten-3.jpg\" alt=\"Abandoned kindergarten in Chernobyl area\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-abandoned-kindergarten-4.jpg\" alt=\"Abandoned kindergarten in Chernobyl area\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-abandoned-kindergarten-5.jpg\" alt=\"Abandoned kindergarten in Chernobyl area\" \/><\/p>\n\n<p>The ginormous <a href=\"https:\/\/en.wikipedia.org\/wiki\/Duga_radar\">Duga radar installation.<\/a> 150m high, 800m long. Secret Soviet military complex in the Chernobyl region. Not strictly part of the nuclear power plant area, just happens to be nearby. Though the radar did use so much power that it used a significant part of the power plant output.<\/p>\n\n<p><img src=\"\/images\/chernobyl-duga-1.jpg\" alt=\"Duga radar installation\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-duga-2.jpg\" alt=\"Duga radar installation\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-duga-3.jpg\" alt=\"Duga radar installation\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-duga-4.jpg\" alt=\"Duga radar installation\" \/><\/p>\n\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Pripyat_amusement_park\">Pripyat Amusement Park.<\/a> It was scheduled to be opened on May 1, 1986. On April 26, disaster struck. A few days later, the city was evacuated. No kids have ever been on these rides.<\/p>\n\n<p><img src=\"\/images\/pripyat-amusement-park-1.jpg\" alt=\"Pripyat amusement park\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-amusement-park-2.jpg\" alt=\"Pripyat amusement park\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-amusement-park-3.jpg\" alt=\"Pripyat amusement park\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-amusement-park-4.jpg\" alt=\"Pripyat amusement park\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-amusement-park-5.jpg\" alt=\"Pripyat amusement park\" \/><\/p>\n\n<p>What\u2019s so interesting about this average-looking bunch of trees? Well\u2026 30 years ago, this used to be the football stadium of Pripyat. Incredible how quickly and completely nature returns.<\/p>\n\n<p><img src=\"\/images\/pripyat-football-1.jpg\" alt=\"Pripyat football field\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-football-2.jpg\" alt=\"Pripyat football field\" \/><\/p>\n\n<p>Pripyat ghost town.<\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-1.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-2.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-3.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-4.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-5.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-6.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-7.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p><img src=\"\/images\/pripyat-ghost-town-8.jpg\" alt=\"Pripyat ghost town\" \/><\/p>\n\n<p>Ground Zero. Inside this dome is Chernobyl Reactor 4 that exploded on April 26, 1986. How can I be so close to it? It\u2019s perfectly safe these days. For many years, we were all at risk because the hastily constructed first sarcophagus was crumbling and threatened to release more contamination. Fortunately, before that happened, the <a href=\"https:\/\/en.wikipedia.org\/wiki\/Chernobyl_New_Safe_Confinement\">New Safe Confinement<\/a> structure was installed on top of the whole thing a few years ago. Inside it, work can safely continue to dismantle, decommission, research, without risk to the outside world.<\/p>\n\n<p><img src=\"\/images\/chernobyl-ground-zero-1.jpg\" alt=\"Chernobyl Ground Zero\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-ground-zero-2.jpg\" alt=\"Chernobyl Ground Zero\" \/><\/p>\n\n<p><img src=\"\/images\/chernobyl-ground-zero-3.jpg\" alt=\"Chernobyl Ground Zero\" \/><\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/chernobyl\/\">My visit to Chernobyl<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on April 09, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/modernizing-a-5-year-old-uikit-app\/"}},"id":"https:\/\/jaanus.com\/modernizing-a-5-year-old-uikit-app","published":"2022-01-26T04:09:21+02:00","updated":"2022-01-26T04:09:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I just finished modernizing a 5-year-old UIKit app, bringing it into the SwiftUI world and making other adjustments. It\u2019s a <a href=\"https:\/\/prillikivi.ee\">simple content blocker app for Estonian media<\/a>, and the new version is now <a href=\"https:\/\/itunes.apple.com\/ee\/app\/prillikivi\/id1034777013?mt=8\">available in the App Store.<\/a><\/p>\n\n<p>There\u2019s not that much visible change to the user. There\u2019s a UI refresh, but otherwise, everything behaves pretty much the same. Internally and maintenance-wise, though, it\u2019s a different story. I basically rewrote the whole app. Which is not that big of a deal as it sounds\u2014it\u2019s a very simple app. I always use such opportunities not only to work with the outwardly visible features, but also to test some new ideas and patterns and modern platform API. Following are my notes from this work, both as a reminder to myself, and perhaps useful to someone else too.<\/p>\n\n<h2 id=\"old-to-new-architecture\">Old to new architecture<\/h2>\n\n<p>The starting point was a fairly typical UIKit app from a junior\/mid level iOS developer (that would be myself, in 2015). This was the time way before SwiftUI, so it was all UIKit, with the UI implemented in a mix of storyboards and code. There was the usual assortment of app delegate, view controllers, model-object-like things. There were a few tests for the purchasing and receipt validation, but no tests for most of the app model and logic.<\/p>\n\n<p><a href=\"https:\/\/github.com\/AlDanial\/cloc\">cloc<\/a> reports this for the old state of the app.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>     151 text files.\n     148 unique files.                                          \n      12 files ignored.\n\ngithub.com\/AlDanial\/cloc v 1.90  T=0.12 s (1138.2 files\/s, 376313.8 lines\/s)\n-------------------------------------------------------------------------------\nLanguage                     files          blank        comment           code\n-------------------------------------------------------------------------------\nC\/C++ Header                    85           4706           9716          25965\nXML                             28              0             11           3034\nSwift                           20            562            493           1445\nJSON                             4              1              0            588\nHTML                             2              1              0             71\nMarkdown                         2              7              0             17\n-------------------------------------------------------------------------------\nSUM:                           141           5277          10220          31120\n-------------------------------------------------------------------------------\n<\/code><\/pre><\/div><\/div>\n\n<p>Whoa. 25K lines of C\/C++? What is that?<\/p>\n\n<p>That would be OpenSSL headers. In the old world and old StoreKit, I need to do custom validation of the transaction receipts to ensure their integrity, and one way to do this is to build custom OpenSSL and bundle it with your app, to parse the needed data structures. Ugh. Either that, or use an external library or service. With StoreKit 2, I don\u2019t need to do this\u2014the needed verifications are part of the Apple SDK. I can still do it externally if needed, but in this app, I don\u2019t have any reason to do that.<\/p>\n\n<p>Okay. So that was the old app. How about the new one, after modernizing?<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>      43 text files.\n      43 unique files.                              \n       6 files ignored.\n\ngithub.com\/AlDanial\/cloc v 1.90  T=0.03 s (1328.4 files\/s, 120006.0 lines\/s)\n-------------------------------------------------------------------------------\nLanguage                     files          blank        comment           code\n-------------------------------------------------------------------------------\nXML                             15              0              0           1454\nSwift                           16            289            192            911\nJSON                             3              2              0            472\nHTML                             2              4              0             85\nMarkdown                         2              7              0             17\n-------------------------------------------------------------------------------\nSUM:                            38            302            192           2939\n-------------------------------------------------------------------------------\n<\/code><\/pre><\/div><\/div>\n\n<p>Overall reduction from 31K lines to 2.9K, over 90%. The big percentage is of course cheating since it previously was largely OpenSSL, but still\u2014it was code living in the project that I needed to maintain.<\/p>\n\n<p>XML has been greatly reduced. A big part of XML was storyboards that are now gone. The remaining XML is Xcode project files and configuration that <code class=\"language-plaintext highlighter-rouge\">cloc<\/code> for some reason reads as XML.<\/p>\n\n<p>Swift has gone from 1400 lines to 911, with 114 of those being tests. Previously there were also some tests, but only for the purchasing and receipt validation part that\u2019s now mostly handled by the system, nothing for the app itself.<\/p>\n\n<p>Now, let\u2019s look at the app entry point, which has greatly improved in clarity. I really like how SwiftUI nudges me to be clear about the app architecture and model. Here is the new app entry point in its entirety.<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kd\">import<\/span> <span class=\"kt\">SwiftUI<\/span>\n\n<span class=\"kd\">@main<\/span>\n<span class=\"kd\">struct<\/span> <span class=\"kt\">PrillikiviApp<\/span><span class=\"p\">:<\/span> <span class=\"kt\">App<\/span> <span class=\"p\">{<\/span>\n    \n    <span class=\"kd\">@StateObject<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">buying<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">Buying<\/span><span class=\"p\">()<\/span>\n    <span class=\"kd\">@StateObject<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">filters<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">Filters<\/span><span class=\"p\">()<\/span>\n    <span class=\"kd\">@StateObject<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">preferences<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">Preferences<\/span><span class=\"p\">()<\/span>\n    <span class=\"kd\">@Environment<\/span><span class=\"p\">(\\<\/span><span class=\"o\">.<\/span><span class=\"n\">scenePhase<\/span><span class=\"p\">)<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">scenePhase<\/span>\n    \n    <span class=\"k\">var<\/span> <span class=\"nv\">body<\/span><span class=\"p\">:<\/span> <span class=\"kd\">some<\/span> <span class=\"kt\">Scene<\/span> <span class=\"p\">{<\/span>\n        <span class=\"kt\">WindowGroup<\/span> <span class=\"p\">{<\/span>\n            <span class=\"kt\">ContentView<\/span><span class=\"p\">(<\/span><span class=\"nv\">buying<\/span><span class=\"p\">:<\/span> <span class=\"n\">buying<\/span><span class=\"p\">,<\/span> <span class=\"nv\">filters<\/span><span class=\"p\">:<\/span> <span class=\"n\">filters<\/span><span class=\"p\">,<\/span> <span class=\"nv\">preferences<\/span><span class=\"p\">:<\/span> <span class=\"n\">preferences<\/span><span class=\"p\">)<\/span>\n        <span class=\"p\">}<\/span>\n        <span class=\"o\">.<\/span><span class=\"nf\">onChange<\/span><span class=\"p\">(<\/span><span class=\"nv\">of<\/span><span class=\"p\">:<\/span> <span class=\"n\">scenePhase<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span> <span class=\"n\">scenePhase<\/span> <span class=\"k\">in<\/span>\n            <span class=\"k\">switch<\/span> <span class=\"n\">scenePhase<\/span> <span class=\"p\">{<\/span>\n            <span class=\"k\">case<\/span> <span class=\"o\">.<\/span><span class=\"nv\">active<\/span><span class=\"p\">:<\/span>\n                <span class=\"c1\">\/\/ When app becomes active, trigger loading new info<\/span>\n                <span class=\"n\">filters<\/span><span class=\"o\">.<\/span><span class=\"nf\">loadInfotAtApplicationDidBecomeActive<\/span><span class=\"p\">()<\/span>\n            <span class=\"k\">default<\/span><span class=\"p\">:<\/span>\n                <span class=\"k\">break<\/span>\n            <span class=\"p\">}<\/span>\n        <span class=\"p\">}<\/span>\n    <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>I get a lot of insight in these 20 lines of code. I see that there are three model objects. They are separated and have no dependencies on one another. The view part of the app depends on all of them. The app checks for some kind of new information every time it becomes active.<\/p>\n\n<p>I find this to be way more digestible than a mix of declarative storyboard structure and imperative UIKit code. There is no weird code and connections scattered around in view controllers, app delegate, and who knows where else. Sure, you could have this kind of clarity in the old world if you were disciplined. I freely admit that I\u2019m not. I found it easy to be sloppy. The new tooling nudges me greatly towards discipline.<\/p>\n\n<h2 id=\"making-stateobjects-aware-of-each-others-state\">Making StateObjects aware of each other\u2019s state<\/h2>\n\n<p>In reality, of course, there is a lot more nuance than shown above. I separated the model objects to be clear about their different responsibilities. But they have dependencies. <code class=\"language-plaintext highlighter-rouge\">Filters<\/code> deals with actually loading and applying the content filters that are the heart of my app. <code class=\"language-plaintext highlighter-rouge\">Buying<\/code> deals with everything related to the app purchasing and subscription. <code class=\"language-plaintext highlighter-rouge\">Filters<\/code> obviously needs to know what is the state of the purchase and whether the user has a valid subscription to the app, because the available filters depend on that. How would you model this?<\/p>\n\n<p>In the old world, I\u2019d consider solutions like putting everything into one big model object, or <code class=\"language-plaintext highlighter-rouge\">Buying<\/code> broadcasting notifications and <code class=\"language-plaintext highlighter-rouge\">Filter<\/code> listening to those, or making the models be aware of entire other model objects by making them weakly-held properties on one another, or using the delegate pattern, or many other tools.<\/p>\n\n<p>In this project, I reached out to <code class=\"language-plaintext highlighter-rouge\">Combine<\/code>, which is already implicitly used when you use SwiftUI, and you can further leverage for your own benefit. <a href=\"https:\/\/stackoverflow.com\/questions\/66089669\/data-communication-between-2-observableobjects\">This StackOverflow question<\/a> showed me idea.<\/p>\n\n<blockquote>\n  <p>Using AnyPublisher decouples the idea of having a specific types for either side of the equation, so it would be just as easy to connect ViewModel4 to ViewModel1, etc.<\/p>\n<\/blockquote>\n\n<p>Here is my recipe of making <code class=\"language-plaintext highlighter-rouge\">Filters<\/code> aware of the purchased state of <code class=\"language-plaintext highlighter-rouge\">Buying<\/code>.<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kd\">@MainActor<\/span>\n<span class=\"kd\">class<\/span> <span class=\"kt\">Buying<\/span><span class=\"p\">:<\/span> <span class=\"kt\">ObservableObject<\/span> <span class=\"p\">{<\/span>\n    <span class=\"kd\">@Published<\/span> <span class=\"kd\">private(set)<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">currentPurchaseExpiration<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Date<\/span><span class=\"p\">?<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">@MainActor<\/span>\n<span class=\"kd\">class<\/span> <span class=\"kt\">Filters<\/span><span class=\"p\">:<\/span> <span class=\"kt\">ObservableObject<\/span> <span class=\"p\">{<\/span>\n    <span class=\"kd\">private<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">purchaseCancellable<\/span><span class=\"p\">:<\/span> <span class=\"kt\">AnyCancellable<\/span><span class=\"p\">?<\/span>\n    <span class=\"kd\">func<\/span> <span class=\"nf\">connectToPurchased<\/span><span class=\"p\">(<\/span><span class=\"n\">_<\/span> <span class=\"nv\">publisher<\/span><span class=\"p\">:<\/span> <span class=\"kt\">AnyPublisher<\/span><span class=\"o\">&lt;<\/span><span class=\"kt\">Date<\/span><span class=\"p\">?,<\/span> <span class=\"kt\">Never<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">)<\/span> <span class=\"p\">{<\/span>    \n        <span class=\"n\">purchaseCancellable<\/span> <span class=\"o\">=<\/span> <span class=\"n\">publisher<\/span>\n            <span class=\"o\">.<\/span><span class=\"nf\">removeDuplicates<\/span><span class=\"p\">()<\/span>\n            <span class=\"o\">.<\/span><span class=\"nf\">receive<\/span><span class=\"p\">(<\/span><span class=\"nv\">on<\/span><span class=\"p\">:<\/span> <span class=\"kt\">DispatchQueue<\/span><span class=\"o\">.<\/span><span class=\"n\">main<\/span><span class=\"p\">)<\/span>\n            <span class=\"o\">.<\/span><span class=\"nf\">sink<\/span><span class=\"p\">(<\/span><span class=\"nv\">receiveValue<\/span><span class=\"p\">:<\/span> <span class=\"p\">{<\/span> <span class=\"n\">newDate<\/span> <span class=\"k\">in<\/span>\n                <span class=\"c1\">\/\/ Do something with the received date (note it\u2019s Optional)<\/span>\n            <span class=\"p\">})<\/span>\n    <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n\n<span class=\"kd\">struct<\/span> <span class=\"kt\">ContentView<\/span><span class=\"p\">:<\/span> <span class=\"kt\">View<\/span> <span class=\"p\">{<\/span>\n    <span class=\"k\">var<\/span> <span class=\"nv\">body<\/span><span class=\"p\">:<\/span> <span class=\"kd\">some<\/span> <span class=\"kt\">View<\/span> <span class=\"p\">{<\/span>\n        <span class=\"kt\">WhateverContentView<\/span><span class=\"p\">()<\/span>\n        <span class=\"o\">.<\/span><span class=\"n\">onAppear<\/span> <span class=\"p\">{<\/span>\n            <span class=\"n\">filters<\/span><span class=\"o\">.<\/span><span class=\"nf\">connectToPurchased<\/span><span class=\"p\">(<\/span><span class=\"n\">buying<\/span><span class=\"o\">.<\/span><span class=\"n\">$currentPurchaseExpiration<\/span><span class=\"o\">.<\/span><span class=\"nf\">eraseToAnyPublisher<\/span><span class=\"p\">())<\/span>\n        <span class=\"p\">}<\/span>\n    <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p><code class=\"language-plaintext highlighter-rouge\">Buying<\/code> isn\u2019t aware of any connections. It just exposes a regular <code class=\"language-plaintext highlighter-rouge\">@Published<\/code> property for SwiftUI. But this contains a whole <code class=\"language-plaintext highlighter-rouge\">CurrentValueSubject<\/code> Combine subject inside, which we will use.<\/p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">Filters<\/code> creates a Combine subscriber to the purchased date, but isn\u2019t aware of where exactly it comes from.<\/p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">ContentView<\/code> connects the two sides, by grabbing the published property from <code class=\"language-plaintext highlighter-rouge\">Buying<\/code>, and passing it to <code class=\"language-plaintext highlighter-rouge\">Filters<\/code>. Since the published property contains a <code class=\"language-plaintext highlighter-rouge\">CurrentValueSubject<\/code>, the initial value is also sent immediately upon making the connection. You could argue that it shouldn\u2019t be a view making this connection, but rather another model-like thing or the top-level app structure, and you\u2019d probably be right.<\/p>\n\n<p>This setup affords great testability. So let\u2019s say we want to test some behavior of <code class=\"language-plaintext highlighter-rouge\">Filters<\/code> that depends on some value of the purchased date being received. Here\u2019s how.<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kd\">func<\/span> <span class=\"nf\">testPurchasedFilters<\/span><span class=\"p\">()<\/span> <span class=\"p\">{<\/span>\n    <span class=\"k\">let<\/span> <span class=\"nv\">filters<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">Filters<\/span><span class=\"p\">()<\/span>    \n    <span class=\"n\">filters<\/span><span class=\"o\">.<\/span><span class=\"nf\">connectToPurchased<\/span><span class=\"p\">(<\/span><span class=\"kt\">Just<\/span><span class=\"p\">(<\/span><span class=\"kt\">Date<\/span><span class=\"p\">()<\/span><span class=\"o\">.<\/span><span class=\"nf\">advanced<\/span><span class=\"p\">(<\/span><span class=\"nv\">by<\/span><span class=\"p\">:<\/span> <span class=\"mi\">86400<\/span><span class=\"p\">))<\/span><span class=\"o\">.<\/span><span class=\"nf\">eraseToAnyPublisher<\/span><span class=\"p\">())<\/span>\n    <span class=\"k\">let<\/span> <span class=\"nv\">expectation<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">XCTestExpectation<\/span><span class=\"p\">(<\/span><span class=\"nv\">description<\/span><span class=\"p\">:<\/span> <span class=\"s\">\"Wait for filters connection\"<\/span><span class=\"p\">)<\/span>\n    <span class=\"kt\">Task<\/span> <span class=\"p\">{<\/span>\n        <span class=\"k\">let<\/span> <span class=\"nv\">categories<\/span> <span class=\"o\">=<\/span> <span class=\"n\">filters<\/span><span class=\"o\">.<\/span><span class=\"n\">categories<\/span>\n        <span class=\"k\">let<\/span> <span class=\"nv\">expected<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Set<\/span><span class=\"o\">&lt;<\/span><span class=\"kt\">FilterCategory<\/span><span class=\"o\">&gt;<\/span> <span class=\"o\">=<\/span> <span class=\"err\">\u2026<\/span> <span class=\"kd\">some<\/span> <span class=\"n\">expected<\/span> <span class=\"n\">value<\/span>\n        <span class=\"kt\">XCTAssertEqual<\/span><span class=\"p\">(<\/span><span class=\"n\">categories<\/span><span class=\"p\">,<\/span> <span class=\"n\">expected<\/span><span class=\"p\">)<\/span>\n        <span class=\"n\">expectation<\/span><span class=\"o\">.<\/span><span class=\"nf\">fulfill<\/span><span class=\"p\">()<\/span>\n    <span class=\"p\">}<\/span>\n    <span class=\"nf\">wait<\/span><span class=\"p\">(<\/span><span class=\"nv\">for<\/span><span class=\"p\">:<\/span> <span class=\"p\">[<\/span><span class=\"n\">expectation<\/span><span class=\"p\">],<\/span> <span class=\"nv\">timeout<\/span><span class=\"p\">:<\/span> <span class=\"mf\">1.0<\/span><span class=\"p\">)<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>In a test, we use <code class=\"language-plaintext highlighter-rouge\">Just<\/code> to create an immediate publisher from a simple value, without any <code class=\"language-plaintext highlighter-rouge\">Buying<\/code> object being present. From <code class=\"language-plaintext highlighter-rouge\">Filters<\/code> perspective, everything works all the same, it just receives a value. I am creating a <code class=\"language-plaintext highlighter-rouge\">Task<\/code> for asynchronous execution, since all this value propagation and publishing doesn\u2019t all seem to happen immediately on the same thread.<\/p>\n\n<p>I feel that with this setup, there is \u201cjust enough\u201d amount of connection between the objects. They can get the initial values of specific properties, and be aware of changes to those, without having to know anything else about each other\u2019s internal structure, and without having to create extra protocols or any other glue.<\/p>\n\n<h2 id=\"running-only-one-task-at-a-time\">Running only one task at a time<\/h2>\n\n<p>Another interesting problem I dealt with was, how to run only one task of a given type at a time? In my app, it would be something like downloading filter content from iCloud, which I use to distribute the filters. You see above how some info is loaded every time the app becomes active. The user may repeatedly do this, and I do not want to do this if there already is such work in progress.<\/p>\n\n<p><a href=\"https:\/\/www.swiftbysundell.com\/articles\/swift-actors\/\">Here\u2019s an article by John Sundell<\/a> that covers the basics of how this works in the new Swift concurrency world. Although most of the article is about actors and data isolation, towards the end it also provides a recipe of how to set up the tasks so that only task of a given kind is running at a time. I just took that code, simplified, and ended up with this.<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kd\">@MainActor<\/span>\n<span class=\"kd\">class<\/span> <span class=\"kt\">Filters<\/span><span class=\"p\">:<\/span> <span class=\"kt\">ObservableObject<\/span> <span class=\"p\">{<\/span>\n    <span class=\"kd\">private<\/span> <span class=\"k\">var<\/span> <span class=\"nv\">downloaderTask<\/span><span class=\"p\">:<\/span> <span class=\"kt\">Task<\/span><span class=\"o\">&lt;<\/span><span class=\"kt\">FilterDownloadResult<\/span><span class=\"p\">,<\/span> <span class=\"kt\">Never<\/span><span class=\"o\">&gt;<\/span><span class=\"p\">?<\/span>\n    <span class=\"kd\">private<\/span> <span class=\"kd\">func<\/span> <span class=\"nf\">downloadNewFiltersFromCloudKit<\/span><span class=\"p\">()<\/span> <span class=\"k\">async<\/span> <span class=\"o\">-&gt;<\/span> <span class=\"kt\">FilterDownloadResult<\/span> <span class=\"p\">{<\/span>\n        <span class=\"k\">if<\/span> <span class=\"k\">let<\/span> <span class=\"nv\">existingDownloaderTask<\/span> <span class=\"o\">=<\/span> <span class=\"n\">downloaderTask<\/span> <span class=\"p\">{<\/span>\n            <span class=\"k\">return<\/span> <span class=\"k\">await<\/span> <span class=\"n\">existingDownloaderTask<\/span><span class=\"o\">.<\/span><span class=\"n\">value<\/span>\n        <span class=\"p\">}<\/span>\n        <span class=\"k\">let<\/span> <span class=\"nv\">newDownloaderTask<\/span> <span class=\"o\">=<\/span> <span class=\"kt\">Task<\/span><span class=\"o\">&lt;<\/span><span class=\"kt\">FilterDownloadResult<\/span><span class=\"p\">,<\/span> <span class=\"kt\">Never<\/span><span class=\"o\">&gt;<\/span> <span class=\"p\">{<\/span>\n            <span class=\"k\">guard<\/span> <span class=\"n\">someCheck<\/span> <span class=\"k\">else<\/span> <span class=\"p\">{<\/span>\n                <span class=\"n\">downloaderTask<\/span> <span class=\"o\">=<\/span> <span class=\"kc\">nil<\/span>\n                <span class=\"k\">return<\/span> <span class=\"o\">.<\/span><span class=\"n\">error<\/span>\n            <span class=\"p\">}<\/span>\n            <span class=\"c1\">\/\/ Do work to get the result<\/span>\n            <span class=\"n\">downloaderTask<\/span> <span class=\"o\">=<\/span> <span class=\"kc\">nil<\/span>\n            <span class=\"k\">return<\/span> <span class=\"o\">.<\/span><span class=\"n\">someResult<\/span>\n        <span class=\"p\">}<\/span>   \n        <span class=\"n\">downloaderTask<\/span> <span class=\"o\">=<\/span> <span class=\"n\">newDownloaderTask<\/span>\n        <span class=\"k\">return<\/span> <span class=\"k\">await<\/span> <span class=\"n\">newDownloaderTask<\/span><span class=\"o\">.<\/span><span class=\"n\">value<\/span>\n    <span class=\"p\">}<\/span>\n<span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>I can now call <code class=\"language-plaintext highlighter-rouge\">downloadNewFiltersFromCloudKit<\/code> many times, and there\u2019s only up to one instance of the task ever running.<\/p>\n\n<p>It lets me quite neatly express what I want to do. The one weak point visible here is that at each site of returning a result, I need to remember to nil out the reference to the task. I also haven\u2019t thought through how error handling and throwing works together with tasks. In this task, I handle all the errors inline and just return a different result to indicate an error. But I could also use native Swift error handling that throws the errors, and I haven\u2019t yet examined how that works with tasks.<\/p>\n\n<h2 id=\"summary\">Summary<\/h2>\n\n<p>I took an old project and re-wrote it with some modern technologies (SwiftUI, Combine, modern concurrency, StoreKit 2). Next up: perhaps another modernization in another 5 years\u2019 time.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/modernizing-a-5-year-old-uikit-app\/\">Modernizing a 5-year-old UIKit app<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on January 26, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/a-fairy-tale-about-apple-code-signing\/"}},"id":"https:\/\/jaanus.com\/a-fairy-tale-about-apple-code-signing","published":"2022-01-10T14:09:21+02:00","updated":"2022-01-10T14:09:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>It is the year 2035.<\/p>\n\n<p>We all use Xcode 25 (VR) on our Apple Glasses and iPad to develop new Magic Reality experiences and ship them to the Magic Store for billions of people to download.<\/p>\n\n<p>Everything is smooth and shiny.<\/p>\n\n<p>Except once in a while, when preparing your app, you get the error:<\/p>\n\n<p><code class=\"language-plaintext highlighter-rouge\">Code signing error &gt; Requires provisioning profile<\/code><\/p>\n\n<p>Nobody knows what this means exactly, or why it appears. Nobody remembers the time when \u201ccomputers\u201d and \u201ccommand line\u201d were still a thing. Except a few old men with long beards, called Provisioning Oracles. They live in a cave. The journey there is long and treacherous, yet all Apple platform developers must undertake it once in a while, lest they be forever stuck with this error.<\/p>\n\n<p>The old men still master the long lost art of command line, Apple developer portal navigation and messing around in Keychain Assistant.<\/p>\n\n<p>You sigh and take the journey.<\/p>\n\n<p>\u201cAnother one?\u201d They shake their head. But it\u2019s not with contempt. It is with great compassion and understanding. \u201cCome forward, young one. Let\u2019s look at it together. We have seen many like you.\u201d<\/p>\n\n<p>You sign in to your developer account together. You then step away from the keyboard, and the bearded wise man starts his incantations. You watch with amazement as screenfuls of stuff flash by, as he does things you do not even begin to comprehend.<\/p>\n\n<p>\u201cThere. I fixed your keys and profiles for you. It builds again.\u201d<\/p>\n\n<p>As you prepare to leave and start to offer your thanks and perhaps some payment, and say goodbye, the old bearded man shakes their head.<\/p>\n\n<p>\u201cDo not thank me. Thank Apple in their infinite wisdom to give us this great system that is beyond the comprehension of mortals, yet enables us to build magical things. Your greatest thanks to me is that you go forth and build more magical things.\u201d<\/p>\n\n<p>\u201cNow, leave. The day is ahead of you.\u201d<\/p>\n\n<p>\u201cAnd perhaps this is a goodbye, but not farewell. I know you will be back.\u201d<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/a-fairy-tale-about-apple-code-signing\/\">A fairy tale about Apple code signing<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on January 10, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/toying-with-apple-link-previews\/"}},"id":"https:\/\/jaanus.com\/toying-with-apple-link-previews","published":"2022-01-07T22:09:21+02:00","updated":"2022-01-07T22:09:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I took a closer look at <a href=\"https:\/\/developer.apple.com\/documentation\/linkpresentation\/lplinkmetadata\">LPLinkMetadata<\/a> and <a href=\"https:\/\/developer.apple.com\/documentation\/linkpresentation\/lplinkview\">LPLinkView<\/a>. These are part of Apple\u2019s official SDK on all Apple platforms. They let us fetch web content metadata and use an Apple-provided UI, or draw our own UI.<\/p>\n\n<p>I wanted to understand what kind of metadata is available, and understand the tradeoffs of using Apple\u2019s own view, vs drawing something custom in SwiftUI. To explore all these things, I built a small SwiftUI app, <a href=\"https:\/\/github.com\/jaanus\/LinkPreviewToy\">available in GitHub.<\/a> The app shows you metadata downloaded for a given URL, as well as how it looks with the Apple-provided UI.<\/p>\n\n<p><img src=\"\/images\/linkpreviewtoy-ios.png\" alt=\"LinkPreviewToy on iOS\" \/><\/p>\n\n<p><img src=\"\/images\/linkpreviewtoy-macos.png\" alt=\"LinkPreviewToy on macOS\" \/><\/p>\n\n<h2 id=\"swiftui-views-as-function-of-state\">SwiftUI views as function of state<\/h2>\n\n<p>Before diving into link previews, I\u2019ll point out a SwiftUI pattern that I\u2019ve found useful: view as function of state.<\/p>\n\n<p>\u201cWait\u201d, you say. \u201cThis is not original. This is the main point of SwiftUI. What\u2019s the pattern and your contribution here?\u201d<\/p>\n\n<p>My contribution is that the other day, I started thinking of this. <em>View as function of state.<\/em> What would a pure implementation of this look like? Perhaps literally have a <code class=\"language-plaintext highlighter-rouge\">state<\/code> variable driving the view. Since the states of a view are mutually exlusive\u2014a view can only be in one state at any given time\u2014an enum is a natural data type to model this.<\/p>\n\n<p>Besides the state, views also need data, but the data is often different for each state. What\u2019s the closest that the state and data can be to each other? They can live right in the same data type. Each value of the state enum can have a different set of associated variables, tailored for that particular state. And that can be the only thing that the view cares about: give me the state, and its associated variables.<\/p>\n\n<p>This means that the main control flow of a view can be a <code class=\"language-plaintext highlighter-rouge\">switch<\/code> statement. This is really neat, because it forces you to think through all the possible cases.<\/p>\n\n<p>For regular app use, view model publishes the state as a read-only property. For something like SwiftUI previews or testing, there can be a special initializer for the view model which just takes a state and makes it the current state, without doing any other work. This means that you can very neatly make and see previews of all the possible states of your view. I think it\u2019s quite handy.<\/p>\n\n<p><img src=\"\/images\/view-as-function-of-state.png\" alt=\"View as function of state\" \/><\/p>\n\n<p>Okay. On to the actual link previews.<\/p>\n\n<h2 id=\"drilling-deeper-into-twitter-previews\">Drilling deeper into Twitter previews<\/h2>\n\n<p>There isn\u2019t really much to say. The code works as advertised. <code class=\"language-plaintext highlighter-rouge\">LPLinkMetadata<\/code> gives you a bunch of metadata, which you can use to draw the UI yourself, or use the Apple-provided <code class=\"language-plaintext highlighter-rouge\">LPLinkView<\/code> view, to get a decent UI.<\/p>\n\n<p>Something was off with Twitter previews, though. Take a look at this example.<\/p>\n\n<p><img src=\"\/images\/linkpreviewtoy-twitter.png\" alt=\"Preview of a tweet\" \/><\/p>\n\n<p>The top part contains all the info that we get from <code class=\"language-plaintext highlighter-rouge\">LPLinkMetadata<\/code>. The bottom part is the <code class=\"language-plaintext highlighter-rouge\">LPLinkView<\/code> rendering of the same metadata. Both should, in theory, contain the same info. Yet\u2026 notice how the tweet text is there in the bottom part, and not visible in the top part.<\/p>\n\n<p>This tells me one of two things. Either <code class=\"language-plaintext highlighter-rouge\">LPLinkMetadata<\/code> contains more info than it publicly exposes, or <code class=\"language-plaintext highlighter-rouge\">LPLinkView<\/code> does some extra work to fetch the missing data.<\/p>\n\n<p>The answer is not very far. Turns out it\u2019s the first one, and there\u2019s more info in the metadata object than is exposed publicly. Just examine a variable of this type in the Xcode debugger to see it all.<\/p>\n\n<p><img src=\"\/images\/linkpreviewtoy-more-metadata.png\" alt=\"More metadata properties\" \/><\/p>\n\n<p>Especially the <code class=\"language-plaintext highlighter-rouge\">summary<\/code> field looks what we\u2019re looking for. It\u2019s a shame there isn\u2019t a public property for it. If anyone at Apple is reading, I\u2019ve filed FB9836598 on this.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/toying-with-apple-link-previews\/\">Toying with Apple link previews and SwiftUI<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on January 07, 2022.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/tact-public-beta\/"}},"id":"https:\/\/jaanus.com\/tact-public-beta","published":"2021-12-21T00:00:00+02:00","updated":"2021-12-21T00:00:00+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>My hobby project <a href=\"https:\/\/justtact.com\">Tact<\/a> is now available as public beta.<\/p>\n\n<h2 id=\"tldr\">tl;dr<\/h2>\n\n<ul>\n  <li><a href=\"https:\/\/justtact.com\/beta\">Get Tact for iOS, iPadOS or macOS<\/a><\/li>\n  <li><a href=\"https:\/\/www.justtact.com\/blog\/tact-public-beta\">Read our public beta announcement post<\/a><\/li>\n  <li><a href=\"https:\/\/twitter.com\/justtact\">https:\/\/twitter.com\/justtact<\/a><\/li>\n  <li><a href=\"https:\/\/justtact.com\">justtact.com<\/a><\/li>\n  <li>Public discussions and bug reports: <a href=\"https:\/\/github.com\/tact\/public\">github.com\/tact\/public<\/a><\/li>\n  <li>Connect with us on Tact: <a href=\"https:\/\/go.justtact.com\/1on1\/2ysfDFjDzro67oodMuKAJj?from=Jaanus\">Jaanus<\/a> or <a href=\"https:\/\/go.justtact.com\/1on1\/5WerMvkKNYjfMyMd7MhmY8?from=Priidu\">Priidu<\/a><\/li>\n  <li><a href=\"\/my-hobby-project-tact\/\">Read my thoughts on Tact from earlier this year<\/a><\/li>\n<\/ul>\n\n<p><img src=\"\/images\/2021-12-tact-product.png\" alt=\"Tact on macOS and iOS\" \/><\/p>\n\n<h2 id=\"tell-me-more\">Tell me more<\/h2>\n\n<p>This was all the \u201cofficial\u201d info and links you need to get started with Tact. I\u2019d like to add some color with fresh thoughts, as they have crystallized through this past year of working on Tact.<\/p>\n\n<p>Sometimes it\u2019s easier to say what something isn\u2019t. This reflects the design and focus of Tact, where we intentionally said \u201cno\u201d to a lot of things at the project outset.<\/p>\n\n<h2 id=\"no\">No<\/h2>\n\n<p><strong>No personal data.<\/strong> We feel very strongly about this, and think Tact shines here. We do not have access to your communications, and do not want or ask for any personal data. It\u2019s common for mobile communication tools, even the ones that claim to be \u201cprivate\u201d, \u201cend-to-end encrypted\u201d and all that, to start the relation by asking for your phone number, or siphon in your whole address book to do \u201ccontact matching\u201d or whatever they call it. We\u2019re not saying they all misuse the data, but the most private data access is always no access at all. Tact does not ask for your phone number, e-mail address, address book access, or anything else. The only thing that we ask at the outset is your name. It does not have to be real: use your first name, pseudonym, nickname, or anything else. You can optionally also set a picture (again, no requirements for what it represents), and that\u2019s it.<\/p>\n\n<p><strong>No final form.<\/strong> What you see today in Tact public beta is the first pass. A sketch. A question. A provocation. Does this make sense? Should we continue? You\u2019ll see bugs and rough edges. Priidu and I are our own biggest critics. It pains us to not build everything we imagined, and not build everything to perfection in the first pass, but, \u201cgreat artists ship\u201d.<\/p>\n\n<p><strong>No hyperbole.<\/strong> The world and specifically the technology industry are full of big empty words, a lot of crazy fast change, and just the sense of things rushing by and leaving you behind. We\u2019re tired of this, and make Tact \u201cfor the rest of us\u201d. We don\u2019t claim to \u201cchange the world\u201d. We just make a chat app.<\/p>\n\n<p><strong>No discovery.<\/strong> There is no way to discover other people who use Tact, and connect directly with them. You connect with other people in Tact by directly sharing invitation links. Sure, you can publish it to your website if you choose, but you can also just directly share it with a loved one and no one else. You won\u2019t have any unwanted \u201cconnection requests\u201d.<\/p>\n\n<p><strong>No Android.<\/strong> For many technical, business and philosophical reasons, we built Tact for Apple platforms, and this remains so for the foreseeable future. It\u2019s what Priidu &amp; I care about the most, and where we want to focus.<\/p>\n\n<p><strong>No funding.<\/strong> We took Tact to this point without external funding. Priidu and I put countless hours into it over the past months, and we\u2019ve used our own savings to hire a few great Apple platform engineers to help us build. We\u2019ll need a new plan in the new year, be it shipping a paid product, obtaining external funding, shutting the project down, or any other number of avenues. Time will tell.<\/p>\n\n<p><strong>No calling.<\/strong> No other fancy realtime features either. We chose to limit the scope of this initial version to what we can build and maintain ourselves. Calling certainly fits into the Tact general vision, but we\u2019d need to find our own unique angle. Until then, FaceTime works great, and you can share FaceTime links in Tact for a fairly seamless experience.<\/p>\n\n<p><strong>No ads.<\/strong> We can\u2019t exactly say what the future of Tact looks like, but we can sure as hell say that it will not involve ads as the primary means to fund our business. Ads have their place in the app business, but Tact is not that place.<\/p>\n\n<p>Okay. That was a lot of <em>noes<\/em>. What are the <em>yesses<\/em>? What do we stand for?<\/p>\n\n<h2 id=\"yes\">Yes<\/h2>\n\n<p><strong>Craft and technical excellence.<\/strong> There\u2019s always more work to do, but we\u2019re pretty happy with the current technical state of Tact. It\u2019s small, it has design intention behind it, it starts fast, it\u2019s reliable, it doesn\u2019t use a whole lot of CPU or memory. It\u2019s just a decent iOS and macOS app\u2014fully native, of course, on all platforms where it runs.<\/p>\n\n<p><strong>Children and family.<\/strong> All of us have our lives, and shipping Tact public beta has taken a while because sometimes we\u2019ve needed to live our lives instead of working. I\u2019ve made it a very explicit rule of the project from the beginning, for both myself and everyone else: life comes first, and Tact comes second. What we may lose on a single day because we need to take care of a sick kid, we make up with long-term patience and persistence.<\/p>\n\n<p><strong>Communication.<\/strong> If you were to look at Tact with an inquisitive lens, hunting for bugs and faults, you\u2019d find many. We\u2019re not done yet, and we needed to heavily focus, optimize and cut scope. What we feel good about, though, is looking beyond any single problem, and seeing Tact as a means to actually chat with each other. Tact has been a part of our lives through various small groups for many months now. It\u2019s been with us at home, for team calls, at child daycare, at the gym, on hiking trails and ski slopes, at hospital beds, in grocery stores, on road trips and travels, in pubs and bars, and anywhere else where we\u2019ve lived and worked. We share our daily joy and misery, culture and memes, daily news, silly jokes, family photos, work material, and anything else that forms the digital fabric of our lives. At that, Tact does a pretty fine job.<\/p>\n\n<p><strong>Self-expression.<\/strong> Priidu and I think of Tact as a project of self-expression, almost an art performance, or an expensive hobby, rather than \u201cwork\u201d, \u201csoftware\u201d or \u201cinvestment\u201d. We just like to mess around in Figma and Xcode and put some flesh on the bones of the ideas around communication that we\u2019ve kicked around. We work on Tact because we\u2019re convinced that the world needs it and it will be good business in the end, but we don\u2019t look for a quick return and quick growth at all costs.<\/p>\n\n<p><strong>Desktop app.<\/strong> The sad state of macOS desktop chat apps in today\u2019s mobile-focused world was a big factor in starting Tact in the first place. We design, build and ship Tact\u2019s native macOS desktop app in lockstep with the iOS version. We are creative professionals who spend considerable time at our computers, and macOS will always be a native first-class target for Tact.<\/p>\n\n<p><strong>Kindness.<\/strong> We can\u2019t and won\u2019t police what content you have in your private chats. We can still say, though, that in this age of hyperbole and frenzy, we\u2019d like Tact to stand for kindness, dignity, peace of mind, and a bit nicer messages that we share with one another. That has certainly been the case within the Tact team itself: we look after one another and have a lot of camaraderie, despite some of us having never met.<\/p>\n\n<p><strong>Payment.<\/strong> Tact will be a paid product. We don\u2019t intend to compete on price, because there are many free apps there. We haven\u2018t yet locked the exact pricing and model: if you have a family group chat, it would be silly to force everyone there to pay. We\u2019ll come up with something smart.<\/p>\n\n<p><strong>iCloud.<\/strong> You access Tact with your iCloud account, and all Tact content goes from your device straight into iCloud. That\u2019s why there\u2019s no separate \u201cuser account\u201d or \u201cregistration\u201d in Tact, and why are confident in our privacy claims: we don\u2019t do anything with your chats because we simply don\u2019t have access to them.<\/p>\n\n<p><strong>Safety.<\/strong> We designed Tact to be a safe environment, where you can be free from unwanted intrusion. The Internet can be unwelcoming and hostile. We can\u2019t fix all of it, but we can design our own little corner of it, where you only hear from those who you want to hear from. You don\u2019t get any \u201cconnection requests\u201d from strangers, unless you have chosen to share your personal Tact invitation link with them.<\/p>\n\n<p><strong>Love.<\/strong> We work on Tact with Priidu and the team because we just want to have this app for ourselves and our friends, and we love working on it. We\u2019ll likely continue in some shape or form for quite a while. We wanted to ship the public beta to gauge the reaction of our extended networks and the wider world. So, here we are.<\/p>\n\n<p>So, that\u2019s Tact, as of December 2021.<\/p>\n\n<p>No personal data.<br \/>\nNo final form.<br \/>\nNo hyperbole.<br \/>\nNo discovery.<br \/>\nNo Android.<br \/>\nNo funding.<br \/>\nNo calling.<br \/>\nNo ads.<\/p>\n\n<p>Craft and technical excellence.<br \/>\nChildren and family.<br \/>\nCommunication.<br \/>\nSelf-expression.<br \/>\nDesktop app.<br \/>\nKindness.<br \/>\nPayment.<br \/>\niCloud.<br \/>\nSafety.<br \/>\nLove.<\/p>\n\n<h2 id=\"join-our-journey\">Join our journey<\/h2>\n\n<ul>\n  <li><a href=\"https:\/\/justtact.com\/beta\">Get Tact for iOS, iPadOS or macOS<\/a><\/li>\n  <li><a href=\"https:\/\/www.justtact.com\/blog\/tact-public-beta\">Read our public beta announcement post<\/a><\/li>\n  <li><a href=\"https:\/\/twitter.com\/justtact\">https:\/\/twitter.com\/justtact<\/a><\/li>\n  <li><a href=\"https:\/\/justtact.com\">justtact.com<\/a><\/li>\n  <li>Public discussions and bug reports: <a href=\"https:\/\/github.com\/tact\/public\">github.com\/tact\/public<\/a><\/li>\n  <li>Connect with us on Tact: <a href=\"https:\/\/go.justtact.com\/1on1\/2ysfDFjDzro67oodMuKAJj?from=Jaanus\">Jaanus<\/a> or <a href=\"https:\/\/go.justtact.com\/1on1\/5WerMvkKNYjfMyMd7MhmY8?from=Priidu\">Priidu<\/a>\n)<\/li>\n  <li><a href=\"\/my-hobby-project-tact\/\">Read my thoughts on Tact from earlier this year<\/a><\/li>\n<\/ul>\n\n  <p><a href=\"https:\/\/jaanus.com\/tact-public-beta\/\">My thoughts on Tact public beta<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on December 21, 2021.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/universal-links\/"}},"id":"https:\/\/jaanus.com\/universal-links","published":"2021-08-22T22:48:21+03:00","updated":"2021-08-22T22:48:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I did an investigation of <a href=\"https:\/\/developer.apple.com\/ios\/universal-links\/\">Universal Links.<\/a> They\u2019re supposedly this great technology that allows HTTPS links to be opened automatically in your iOS or macOS app if all the conditions are right, and thus to provide deep links to your content straight in your app.<\/p>\n\n<p>TL;DR: I could not get two key pieces of the technology to work: the <code class=\"language-plaintext highlighter-rouge\">developer<\/code> mode, and <code class=\"language-plaintext highlighter-rouge\">onOpenURL<\/code> when using macOS with SwiftUI. Although Apple keeps telling us that custom URL schemes are deprecated and we should switch to Universal Links, the latter is a dealbreaker with SwiftUI app lifecycle. You can use Universal Links, but be prepared for them not being reliable.<\/p>\n\n<p>Let\u2019s dig in.<\/p>\n\n<h2 id=\"learning-about-universal-links\">Learning about Universal Links<\/h2>\n\n<p>Universal Links have been around for quite a while already. In WWDC19 and WWDC20, there were two sessions with the identical name \u201cWhat\u2019s new in Universal Links\u201d. Go watch these to learn of important updates. Much of both sessions is dedicated to the nuances of handling links and directing which links are handled by your apps and which aren\u2019t.<\/p>\n\n<p>Before I dug into handling different links differently, I wanted to get the basics working. I ran into some trouble with that, and the rest of this post will investigate these troubles.<\/p>\n\n<h2 id=\"apple-app-site-association-file-cdn-and-developer-mode\">apple-app-site-association file, CDN, and developer mode<\/h2>\n\n<p>Universal Links require that you host a file on your web site at the location <code class=\"language-plaintext highlighter-rouge\">.well-known\/apple-app-site-association<\/code> (henceforth I will call it AASA). The simplest content of this file can be like this:<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>{\n    \"applinks\": {\n        \"details\": [\n            {\n                \"appIDs\": [ \"ABCD1234.com.example.YourAppId\" ]\n            }\n        ]\n    }\n}\n<\/code><\/pre><\/div><\/div>\n\n<p>This tells the system that this website authorizes the indicated app ID to handle its links as Universal Links. If you wish, you can have more info in this file to say which links should and shouldn\u2019t be handled by the app. Watch the WWDC sessions for more info about that. But this simple file is sufficient for a demo that causes all of the links to be handled as Universal Links by the app.<\/p>\n\n<p>WWDC20 and the platforms of 2020 brought us an important update: AASA is no longer downloaded by the clients directly from my website, but is instead cached by Apple\u2019s CDN in the production situation. Since their CDN cannot access internal development servers, there is a new \u201cdeveloper\u201d mode that you need to enable both on each client device where you develop, as well as specifying <code class=\"language-plaintext highlighter-rouge\">?mode=developer<\/code> in your Associated Domains applinks entitlement.<\/p>\n\n<p>Just as a reference for myself, you enable the developer mode on macOS with this command: <code class=\"language-plaintext highlighter-rouge\">swcutil developer-mode -e true<\/code> On iOS, there is a setting \u201cAssociated Domains Development\u201d.<\/p>\n\n<p>WWDC20 video claims that you can use \u201cany valid certificate\u201d to secure the HTTPS server that is serving the association file in developer mode, as opposed to \u201cSystem-trusted root certificate\u201c required in production configuration.<\/p>\n\n<p>I tried a bunch of certificates for developer mode: both self-signed, and a certificate issued by a custom CA added to the system trust root store, as I describe in <a href=\"\/ios-13-certificates\/\">this post<\/a>. None of it worked.<\/p>\n\n<p>The method of debugging this is to connect to your iOS device console with Xcode, and filter it for <code class=\"language-plaintext highlighter-rouge\">swcd<\/code>. I saw a line <code class=\"language-plaintext highlighter-rouge\">Trust evaluate failure: [root AnchorTrusted]<\/code> which was present in case of a certificate signed by custom CA trusted in the root store, and was not present when using a truly trusted certificate (e.g public server whose certificate is issued by LetsEncrypt).<\/p>\n\n<p><img src=\"\/images\/universal-links-root-anchortrusted.png\" alt=\"root AnchorTrusted error\" \/><\/p>\n\n<p>In case of a truly self-signed cert, you get different errors: <code class=\"language-plaintext highlighter-rouge\">Trust evaluate failure: [leaf AnchorTrusted SSLHostname ServerAuthEKU]<\/code>, and another message saying <code class=\"language-plaintext highlighter-rouge\">Failed to verify server trust &lt;private&gt; for task AASA-3619F364-FD45-41DE-AB59-4D4F120377AD { domain: 19\u2026.16\u2026.0.10?mode=developer, bytes: 0, route: .wk }: Error Domain=SWCErrorDomain Code=100 \"Disallowed trust result type.\" UserInfo={Line=167, Function=-[SWCSecurityGuard verifyTrust:allowInstalledRootCertificates:error:], NSDebugDescription=Disallowed trust result type., TrustResultType=5}<\/code><\/p>\n\n<p>So, one of the following two statements is true. Either the <code class=\"language-plaintext highlighter-rouge\">developer<\/code> mode is simply not working correctly, or I have misunderstood what \u201cany valid certificate\u201d means in this context. There doesn\u2019t seem to be any more info or documentation available about this.<\/p>\n\n<p>A while ago, I looked quite deeply about HTTPS certificate validation, and how custom root CAs work in modern macOS and iOS: again, I refer you to <a href=\"\/ios-13-certificates\/\">this post<\/a> on the topic. If I have a certificate that works for other Apple Transport Security purposes, but does not work for AASA development mode, I question what\u2019s different and special about this mode and what kind of certificates it requires.<\/p>\n\n<p>Long story short: AASA developer mode works only on public servers whose certificate is issued by trusted root CAs. Custom trusted roots don\u2019t seem to work. Filed Feedback ID for Apple: FB9551780.<\/p>\n\n<p>Okay. So this was not actually a showstopper for me, since I had access to a development server with a trusted certificate where I could play around with my AASA.<\/p>\n\n<h2 id=\"onopenurl-is-not-called-on-macos-swiftui-app-when-opening-universal-links\">onOpenURL is not called on macOS SwiftUI app when opening Universal Links<\/h2>\n\n<p>The other bug I ran into, tested on both Big Sur and Monterey, involves how the app receives Universal Links.<\/p>\n\n<p>In SwiftUI, the way to handle incoming Universal Links is very straightforward. You just place a <code class=\"language-plaintext highlighter-rouge\">onOpenURL<\/code> modifier on any view that you\u2019d like to handle the link, perhaps like this:<\/p>\n\n<div class=\"language-swift highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code><span class=\"kt\">ContentView<\/span><span class=\"p\">()<\/span>\n    <span class=\"o\">.<\/span><span class=\"n\">onOpenURL<\/span> <span class=\"p\">{<\/span> <span class=\"n\">url<\/span> <span class=\"k\">in<\/span>\n        <span class=\"nf\">print<\/span><span class=\"p\">(<\/span><span class=\"s\">\"Got url in content view: <\/span><span class=\"se\">\\(<\/span><span class=\"n\">url<\/span><span class=\"se\">)<\/span><span class=\"s\">\"<\/span><span class=\"p\">)<\/span>\n    <span class=\"p\">}<\/span>\n<\/code><\/pre><\/div><\/div>\n\n<p>Instead of printing the URL, you\u2019d of course want to parse it and do something with it. This is just for the demo.<\/p>\n\n<p>If you figure out the certificate stuff discussed above, then on iOS everything works pretty much as it should, on both simulator and devices. The code above does what it should, and is reliably called when opening Universal Links.<\/p>\n\n<p>On macOS, although the system correctly switches to my app upon opening an Universal Link, <code class=\"language-plaintext highlighter-rouge\">onOpenURL<\/code> is never called for me, no matter what I try. This yields an especially unfortunate situation, where Universal Links seemingly work and switch to my app instead of opening the website, but give my app no indication of the link, and so I cannot provide the correct experience for my user since I have no access to the link they clicked on.<\/p>\n\n<p>I did a test also with AppKit lifecycle, where Universal Links works as expected. For an incoming universal link, I consistently receive the much-longer-named user activity continuation method called in my NSApplicationDelegate class. So it works as expected with AppKit. I\u2019d expect it to work equally well in SwiftUI lifecycle: there\u2019s no sign in documentation that it wouldn\u2019t or shouldn\u2019t. For simpler apps, SwiftUI multiplatform app lifecycle is great. I wish Universal Links worked as well with the SwiftUI lifecycle as they do on iOS.<\/p>\n\n<p>If anyone at Apple is reading this, I\u2019ve filed FB9544271.<\/p>\n\n<h2 id=\"deprecating-custom-app-schemes-for-universal-links\">Deprecating custom app schemes for Universal Links<\/h2>\n\n<p>The WWDC videos about Universal Links from both 2019 and 2020 tell us in no uncertain temrs that custom URL schemes for apps are deprecated, and we should instead switch to Universal Links. I found the above two problems quite disheartening towards that end. Custom schemes have their warts, but not these kinds, they work very reliably on all platforms for my practical purposes. So whatever deep-linking solution I end up with, it will probably involve a combination of Universal Links and custom URL scheme with additional fallbacks for cases like the macOS one, where the Universal Link looks like it works, but really doesn\u2019t, so I must provide additional escape hatches and workarounds if the link is really critical for my app.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/universal-links\/\">The state of Universal Links as of August 2021<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on August 22, 2021.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/reflections-after-wwdc21\/"}},"id":"https:\/\/jaanus.com\/reflections-after-wwdc21","published":"2021-06-13T13:48:21+03:00","updated":"2021-06-13T13:48:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Apple\u2019s annual developer conference <a href=\"https:\/\/developer.apple.com\/wwdc\/\">WWDC<\/a> happened this week. The conference keynote session is aimed at the public. The rest is a developer-oriented event where the Apple developer community learns of Apple software platform changes and updates for the coming year.<\/p>\n\n<p><img src=\"\/images\/wwdc21.png\" alt=\"WWDC21\" \/><\/p>\n\n<p>I don\u2019t have much to say about the content that\u2019s not already been said elsewhere. <a href=\"https:\/\/www.justtact.com\/blog\/outlines-of-wwdc21-keynote-and-platforms-state-of-the-union\">I posted my notes for Keynote and Platforms State of the Union<\/a> on the <a href=\"https:\/\/justtact.com\">Tact<\/a> blog.<\/p>\n\n<p>This WWDC was a fully virtual event for the second time in the row. As I went through the conference experience, it struck me that there is a very curious and diverse mix of channels this year that I use to access the event. Unlike last year where Apple had to scramble to make the event online (COVID happened just a few months before the event), this year they had proper time to prepare. I think the whole mix of channels is interesting to study for other future virtual events, and provides some intriguing clues about Apple\u2019s thinking.<\/p>\n\n<p>Truth be told, I haven\u2019t been to many virtual conferences (ever, or over the past year) so I can\u2019t compare the experience with other similar events. I have been to a few WWDC-s in person, though, and can definitely make a comparison between the in-person and online WWDC flavors.<\/p>\n\n<p>Let\u2019s dive right in and go through the different ways to participate in WWDC.<\/p>\n\n<h2 id=\"sessions\">Sessions<\/h2>\n\n<p>Sessions are the heart of WWDC. They are focused presentations about a specific subject, often complemented by code snippets and example projects. You watch the sessions either on the web, or in the dedicated Developer app which exists for macOS and iOS (and maybe tvOS too? I don\u2019t know about tvOS).<\/p>\n\n<p><img src=\"\/images\/wwdc21-sessions-web.png\" alt=\"WWDC sessions on the web\" \/><\/p>\n\n<p><img src=\"\/images\/wwdc21-sessions-app.png\" alt=\"WWDC sessions in Developer app\" \/><\/p>\n\n<p><img src=\"\/images\/wwdc21-session-app.png\" alt=\"One WWDC session in Developer app\" \/><\/p>\n\n<p>During the in-person conferences, the sessions were presented live on stage (and recorded for video distribution in more recent years). They were divided into a daily schedule of roughly hour-long blocks. A big part of live WWDC was moving around between the different rooms and sessions (and often standing in line to get into the more popular ones, with some of the rooms even being full sometimes, overflow rooms sometimes used etc).<\/p>\n\n<p>The modern video sessions have a high production value, are all released at the same time on a given day, and have varying lengths according to the actual content needs. I join those who find the video experience to be much more usable, as you are not dependent on a strict daily schedule and can watch them at your own pace. You don\u2019t have worries like \u201cthese two things I\u2019d like to see are happening at the same time\u201d, \u201ccan I fit in the room\u201d, \u201cnone of the sessions during this hour apply to me so it\u2019s almost an hour of the conference wasted\u201d.<\/p>\n\n<p>The Developer app is useful for watching the sessions, as you can manage your own playlist across all year\u2019s WWDC-s, and each session includes a transcript and direct links to extra resources.<\/p>\n\n<h2 id=\"digital-lounges\">Digital Lounges<\/h2>\n\n<p>Digital Lounges were a new and exciting thing this year. Essentially, a heavily moderated Slack community with a packed program including trivia quizes, coding exercises, \u201cwatch a session together\u201d events, \u201cmeet the presenter\u201d, and more.<\/p>\n\n<p>Most of the time, you couldn\u2019t speak freely in channels. To ask a question, you submitted it to a form, and it was then posted with an answer in the public channel (or sometimes replied to privately, e.g to direct you to a similar question already answered before). Discussion was open in many threads though.<\/p>\n\n<p>The lounges were open during Californian business hours because those were formally the hours of the conference, and I suppose that\u2019s when the staff manning the channels was working. There was massive staff participation. You could indeed see many presenters or experts answer questions and actively participate in thread discussions.<\/p>\n\n<p>It was curious to note that the profiles of all Apple staff were Memoji. This syncs with the opening of the keynote, where Tim Cook walked into a theater full of emoji audience, which I suppose was all the Apple staff participating in the event. I didn\u2019t check if the emoji in that opening scene were random or actually corresponded to Apple staff, but I wouldn\u2019t be surprised if the latter was the case.<\/p>\n\n<p>It would be great to post a screenshot of the Lounges, but I think the Lounges terms prohibit us from doing that, so I won\u2019t. The information was freely moving though. As one of the staff members said, \u201cThe Digital Lounges are not confidential spaces, and you may share the information you\u2019ve learned with others.\u201d Not much to see on the screenshot though\u2014it looked and worked just like regular Slack.<\/p>\n\n<p>Participants were encouraged to take any notes and screenshots for their own reference, since the lounges would close after the event. Many participants thought the closing was a shame, as there was lots of great knowledge shared there by Apple staff, some of it quite unique, and it would be useful to have this as a searchable resource. On the other hand, I also understand treating it as a real \u201cevent lounge\u201c which is an experience limited to a specific time and place.<\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">It\u2019s curious to see Apple embracing Slack so much. Employees discussing its internal use on Twitter. Some <a href=\"https:\/\/twitter.com\/hashtag\/WWDC21?src=hash&amp;ref_src=twsrc%5Etfw\">#WWDC21<\/a> events in Slack. Xcode Cloud posts to Slack. Slack Slack Slack. I guess they think it is the state of the art and the best on the market in its class?<\/p>&mdash; Jaanus Kase \ud83c\udf3b\ud83d\udc99\ud83d\udc9b (@jaanus) <a href=\"https:\/\/twitter.com\/jaanus\/status\/1402154165409927174?ref_src=twsrc%5Etfw\">June 8, 2021<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<p>I cannot help but note that Apple seems to be endorsing Slack big time. They don\u2019t do frequent integrations with third parties in this fashion. So for example, the fact that Xcode Cloud can natively post notifications to Slack has quite a lot of weight and meaning. I suppose Apple has decided that Slack simply is the state of the art in professional enterprise business chat space. Yet, it\u2019s not so important that they\u2019d want to have it in house (yet?), as they do with their core technologies, at least at this time.<\/p>\n\n<h2 id=\"labs\">Labs<\/h2>\n\n<p>Labs have made a successful transition from physical to virtual space. I\u2019ve participated in both kinds, and the virtual format has worked better for me.<\/p>\n\n<p>For those who haven\u2019t been in the labs \u2013 you book an appointment on a given topic, and you get assigned a call slot of half an hour. At that time, you call in, and have a regular video call, possibly with screen sharing, with Apple engineers who are experts in that area. Myself and many other lab participants can say that these have always been useful, and the all the engineers I have spoken with are knowledgeable, helpful, and kind.<\/p>\n\n<p>A thought struck me about labs, though. Essentially, they\u2019re customer support for developers. Can you think of another product where customer support is available only once a year for one week? I\u2019m exaggerating, of course, as there are many other ways for developers to get support besides the labs.<\/p>\n\n<h2 id=\"developer-forums\">Developer forums<\/h2>\n\n<p><img src=\"\/images\/wwdc21-developer-forums.png\" alt=\"Apple developer forums\" \/><\/p>\n\n<p>The sessions refer to developer forums that are a public platform for discussing Apple technology, with varying level of participation from the staff. All WWDC sessions are numbered and have their own corresponding tag in the forums, with varying levels of activity. Somehow I didn\u2019t feel the same excitement with forums as with other channels, where there seemed to be a larger amount of more consistent participation by the staff.<\/p>\n\n<h2 id=\"swift-forums\">Swift forums<\/h2>\n\n<p><img src=\"\/images\/wwdc21-swift-forums.png\" alt=\"Swift forums\" \/><\/p>\n\n<p>Although not formally a WWDC channel, Swift forums are another valuable source of developer information, related to Swift language and ecosystem. This WWDC brought us a particularly contentious issue of concurrency in Swift. While it was anticipated to be released with Swift 5.5 and announced at WWDC, it was a surprise and disappointment to many developers that it wasn\u2019t backported to previous platforms. As of this writing, Apple has said that it isn\u2019t backported, but they are considering doing it. <a href=\"https:\/\/forums.swift.org\/t\/will-swift-concurrency-deploy-back-to-older-oss\/49370\">This is a highly informative thread on the matter<\/a> that accurately presents all information and viewpoints, and also modes of speaking and behavior.<\/p>\n\n<h2 id=\"employee-twitter\">Employee Twitter<\/h2>\n\n<p>A curious thing has happened over the past year or so. More and more Apple staff is making an appearance on Twitter. The company hasn\u2019t acknowledged this in any of its official channels, but the staff presence on Twitter is surely sanctioned, if not encouraged, by the company.<\/p>\n\n<p>Unlike Digital Lounges where all of the staff used the same style of Memoji as their avatar and the language was somewhat scripted and sugar-coated, the staff Twitter often feature their true photos and authentic selves. Although much of the talk is about work, there\u2019s often personal reflection that would have been unthinkable to publicly see from someone working at Apple just a few years ago.<\/p>\n\n<p>There\u2019s no directory or list of Apple people on Twitter. Well, sure, there are many Twitter lists curated by different people, but there\u2019s no single official or authoritative one. Twitter\u2019s discovery works quite well for me: I follow interesting people in the Apple developer community, and through mentions and Twitter recommendations, I find more.<\/p>\n\n<p>Employee Twitter augmented the WWDC experience really nicely. The staff encouraged audience to join labs, highlighted interesting things from the sessions, and followed up on questions.<\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">The Swift labs are underbooked, so bring some of your questions to us! Got some generic SwiftUI code that has cryptic compiler errors? A view body that takes forever to build? Need help understanding property wrappers or result builders? I\u2019m in Swift open hours on Friday \ud83d\ude42 <a href=\"https:\/\/t.co\/HFKxAOdgEo\">https:\/\/t.co\/HFKxAOdgEo<\/a><\/p>&mdash; Holly Borla (@hollyborla) <a href=\"https:\/\/twitter.com\/hollyborla\/status\/1402862453638144002?ref_src=twsrc%5Etfw\">June 10, 2021<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">I think you will enjoy the talk! \ud83d\ude09 <a href=\"https:\/\/t.co\/ScMRuPkqG6\">https:\/\/t.co\/ScMRuPkqG6<\/a><\/p>&mdash; @numist@xoxo.zone (@numist) <a href=\"https:\/\/twitter.com\/numist\/status\/1403391433755688962?ref_src=twsrc%5Etfw\">June 11, 2021<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n<h2 id=\"social-and-community-events\">Social and community events<\/h2>\n\n<p>Above were all the channels and events tied to Apple company and staff. There is a surrounding universe of community events too numerous to list here. Many Apple educators, journalists and podcasters provide live stream and commentary, and there are social events.<\/p>\n\n<p>The one event not replicated in virtual WWDC is the official Beer Bash, which was a social after-hours event for WWDC members with food, drinks, and music. I wonder what a virtual Beer Bash would look like? Throughout the COVID isolation times, I had quite a few small-scale beer bashes with various circles of friends using various calling tools. Some tools are interesting, like spatial.chat, which lets you sort of recreate a party atmosphere where you move around between groups. I wonder what would that be like for thousands of WWDC participants?<\/p>\n\n<p><a href=\"https:\/\/livenearwwdc.com\">Live near WWDC<\/a> is an institution that I was lucky enough to see live a few times, and that now made the transition to the online world. I had to miss the current one because timezones.<\/p>\n\n<h2 id=\"summary\">Summary<\/h2>\n\n<p>What does all this mean? Where are the Apple community and WWDC going?<\/p>\n\n<p>Two trends stand out to me: openness, and diversity+inclusion (D&amp;I). Which, perhaps, are not too far from each other.<\/p>\n\n<p>It was not too long ago when the whole WWDC was under lock and key. The content was available strictly to developer program members, forums were under a confidentiality agreement, and you could not discuss anything about the beta publicly. Fast forward to today, where all of the content is online and freely distributed, sharing is encouraged, and we have real Apple people on Twitter providing nuance and direct unfiltered thoughts on it all.<\/p>\n\n<p>Perhaps touching both openness and D&amp;I, virtual WWDC is surely available and accessible to more people around the world. The amount of real-event tickets was limited and distributed with a lottery during the more recent years, and the cost of attendance was prohibitive to many. (Do you remember WWDC used to cost $1500+ just for attendance? Not to mention travel, lodging etc.)<\/p>\n\n<p>I love to see how Apple is steadfast committed to D&amp;I. This is pervasive through all aspects of WWDC: the showcased software features, the large share of accessibility sessions, the composition of session presenters, and events like Diversity in Swift Community Meetup. I truly believe they are showing the way to other companies and communities around the world who have not yet decided to fully embrace D&amp;I.<\/p>\n\n<p>What does the future hold? I don\u2019t know, but I\u2019m looking forward to it. It feels fitting to end this with the newest James Dempsey song, first performed at the Live near WWDC event this year.<\/p>\n\n<div class=\"jekyll-twitter-plugin\"><blockquote class=\"twitter-tweet\"><p lang=\"en\" dir=\"ltr\">We debuted a new song at last night\u2019s LIVE near WWDC show.<br \/><br \/>It\u2019s called Futureproof and it holds a lot of meaning for me.<br \/><br \/>For a short break from all the great <a href=\"https:\/\/twitter.com\/hashtag\/WWDC21?src=hash&amp;ref_src=twsrc%5Etfw\">#WWDC21<\/a> sessions\u2014I\u2019d love it if you\u2019d give it a listen.<br \/><br \/>I hope you enjoy it and pass it along.<a href=\"https:\/\/t.co\/OZa2d5tBwP\">https:\/\/t.co\/OZa2d5tBwP<\/a><\/p>&mdash; James Dempsey @jamesdempsey@mastodon.social (@jamesdempsey) <a href=\"https:\/\/twitter.com\/jamesdempsey\/status\/1403025193258291202?ref_src=twsrc%5Etfw\">June 10, 2021<\/a><\/blockquote>\n<script async=\"\" src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div>\n\n  <p><a href=\"https:\/\/jaanus.com\/reflections-after-wwdc21\/\">Reflections after WWDC21<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on June 13, 2021.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/obra-dinn\/"}},"id":"https:\/\/jaanus.com\/obra-dinn","published":"2021-04-22T14:19:21+03:00","updated":"2021-04-22T14:19:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>I recently finished playing <a href=\"https:\/\/obradinn.com\">Return of the Obra Dinn.<\/a><\/p>\n\n<div class=\"embed-video-container\"><iframe src=\"https:\/\/www.youtube.com\/embed\/ILolesm8kFY \"><\/iframe><\/div>\n\n<p>I don\u2019t post about games very often any more. First of all, I don\u2019t get to play them all that much. And even if I do, there\u2019s not much interesting to say about most of them.<\/p>\n\n<p>Obra Dinn is an incredible independent game, designed and developed by just one person, <a href=\"https:\/\/dukope.com\">Lucas Pope<\/a> (with of course help for various aspects of the production, but the concept and design is his alone.) I do think such independent efforts deserve praise and recognition more than multimillion-dollar studio productions. Plus, Obra Dinn just is a very unique and enjoyable game.<\/p>\n\n<p>I wish I could say I finished it without cheating. I didn\u2019t. I cheated. Well, not entirely. I did go through all the content there is to go in the game, and I honestly solved a few fates all by myself. But that was it. Just a few. For going through most of the game, I relied on <a href=\"https:\/\/obradinn.fandom.com\/wiki\/Return_of_the_Obra_Dinn_Wiki\">this great wiki<\/a> that explains (and spoils!) everything about the game.<\/p>\n\n<p>Even though I\u2019m sad that I resorted to cheating, I\u2019m glad I went to that wiki and read all there is to read. I missed tons of subtlety and nuance and lots of the story just by looking at the game. I just didn\u2019t understand what was happening much of the time. Maybe I\u2019ve been too accustomed to high-budget games and their high production values. Or maybe my eyes are aging. Or maybe my brain is aging and I\u2019m getting dumb or lazy. Going through the explainer content on the wiki only made me appreciate the whole game, story and content more than I could gain just from the game experience itself.<\/p>\n\n<p>I try to play games as a form of escapism with great \u201cimmersion factor\u201d - that really place you into a different time, place, and character. Obra Dinn is brilliant at that. The combination of mechanics, 1-pixel graphics, and sounds is just perfect. Even though I didn\u2019t succeed at solving most of the game myself (and didn\u2019t try too hard either), I much enjoyed going through the whole experience just for this immersion aspect.<\/p>\n\n<p>Here\u2019s a more complete video (with some spoilers) that shows and explains the whole premise in more detail.<\/p>\n\n<div class=\"embed-video-container\"><iframe src=\"https:\/\/www.youtube.com\/embed\/V0qxLrFycrc \"><\/iframe><\/div>\n\n  <p><a href=\"https:\/\/jaanus.com\/obra-dinn\/\">Obra Dinn<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on April 22, 2021.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/my-hobby-project-tact\/"}},"id":"https:\/\/jaanus.com\/my-hobby-project-tact","published":"2021-02-04T13:19:21+02:00","updated":"2021-02-04T13:19:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Dear Internet,<\/p>\n\n<p>I would like to introduce you to a hobby project that me and <a href=\"https:\/\/zilmer.com\">Priidu Zilmer<\/a> have been working on for a while, and I invite you along to the journey.<\/p>\n\n<p><a href=\"https:\/\/justtact.com\">Tact<\/a> is a simple chat app for families, friends and small circles, designed for Apple platforms.<\/p>\n\n<p>tl;dr: I\u2019m looking for these kinds of people:<\/p>\n\n<p><strong>Apple platform engineers.<\/strong> Come help me build. <a href=\"https:\/\/justtact.com\/blog\/tact-is-looking-for-apple-platform-engineers\">Details in this post.<\/a><\/p>\n\n<p><strong>Private beta testers.<\/strong> If you\u2019re not afraid of unfinished software, <a href=\"https:\/\/justtact.com\/beta\">consider joining the test.<\/a><\/p>\n\n<p><strong>Investors, advisors, and hustlers.<\/strong> Tact doesn\u2019t yet have external funding. I\u2019m working on Tact because I believe it can be a sound and sustainable business. I haven\u2019t plotted the exact path to get there. I\u2019m interested in your views.<\/p>\n\n<p>I\u2019d be happy to have a call with anybody about these areas. Contact me to set one up.<\/p>\n\n<p>You\u2019ll find a lot of info about Tact on our <a href=\"https:\/\/justtact.com\">placeholder site<\/a>, and I encourage you to go through that. Here are some more personal bits and pieces.<\/p>\n\n<h2 id=\"backstory\">Backstory<\/h2>\n\n<p>For the longest time, Priidu, myself and some other friends have kept in touch since the good old Skype times. We previously used Wire because that\u2019s what we built, but more recently Wire has shifted its focus away from consumers and towards business. Nothing wrong with that. It means, though, that there\u2019s less of a focus on our kind of consumer scenario that I\u2019m interested in.<\/p>\n\n<p>So for quite a while, we had this joke, \u201cwe should make our own chat app\u201d. Of course. That\u2019s all it was, just a joke. But the thought kept nagging me until I did a thought experiment. \u201cWhat if\u2026 it was not a joke?\u201d What would it take? Knowing that I had no time and no money to put into it, what kind of chat app would and could I make? The thought experiment very quickly led me to iCloud that provides two vital services\u2013users and backend.<\/p>\n\n<p>For past many months, we\u2019ve had a functional technical experiment of Tact trying to answer the question, is it possible to build Tact on iCloud like this? To date, I haven\u2019t seen any evidence that it wouldn\u2019t be possible. Seems to be fine. There is lots of work remaining to do, but I haven\u2019t seen any fundamental reason why it wouldn\u2019t work.<\/p>\n\n<p>Tact is informed by developments in the external environment. In the Apple world, SwiftUI was released, letting me build efficiently for two platforms together. (I started out with separate AppKit and UIKit apps already before SwiftUI, but that was no fun.) On the privacy and economics side, we continue to see the struggles of ad-funded platforms. All these signals are feeding into how I think about Tact.<\/p>\n\n<h2 id=\"future\">Future<\/h2>\n\n<p>In 2021, our goal is to build a functional basic enjoyable chat app and make sure it is a solid experience to private beta participants. We\u2019ll then make it available in paid form to validate our hypothesis that there are enough people out there who share our principles and are willing to pay for something like Tact.<\/p>\n\n<p>Beyond that, Tact could go in many directions. This is just a rough outline of ideas that we\u2019ve been kicking around. We may end up building all, some, or none of these, and this list will evolve over time.<\/p>\n\n<p><strong>Realtime features (calling, screen sharing).<\/strong> This fits well into the Tact vision, but is more expensive to build and maintain than we can afford in our current hobby mode. We postponed this whole area until we have a more solid business case.<\/p>\n\n<p><strong>Chat and content experience.<\/strong> What is basic chatting like? Does it always need to have bubbles? (There are no bubbles in Tact.) How do files, photos, links, other media work? Should recent and older content behave differently? We believe the whole messaging field is still nascent and ripe for innovation. We haven\u2019t yet executed many ideas here, and Tact today does not yet break much new ground. We would like to play with these directions.<\/p>\n\n<p><strong>On-device integrations.<\/strong> Apple devices are incredibly powerful machines, loaded with hardware sensors and other apps. How might we involve content flowing freely to and from hardware and other apps? Can on-device integrations act as bots and provide useful services for both personal and business uses?<\/p>\n\n<p><strong>Social group dynamics.<\/strong> What should group dynamics look like in 2021? What are the potential risks of harm and abuse? How can we build the Tact software and network in a way that promotes kind and discourages harmful behavior?<\/p>\n\n<p><strong>Publishing.<\/strong> Tact starts out with closed groups, but doesn\u2019t always need to remain like that. Beyond strictly closed groups, should Tact have some publicly visible outlet, more publicly accessible groups?<\/p>\n\n<p><strong>More client platforms.<\/strong> Tact is currently on iOS and macOS. It\u2019s technically possible to build a web experience for Tact. Would it make sense? What other platforms could Tact live on? What would Tact be on watchOS or tvOS?<\/p>\n\n<h2 id=\"the-path-for-2021\">The path for 2021<\/h2>\n\n<p>Priidu and myself will continue to build Tact in hobby mode and do three things through the year: work on the product, engage with our beta community, and continue consulting with potential investors and advisers. We will not do the latter actively and won\u2019t explicitly look for funding, but will definitely talk with interested people.<\/p>\n\n<p>Through all these actions, I expect to reach one of these outcomes for Tact in 2021.<\/p>\n\n<p><strong>There is no point.<\/strong> We fail to generate sufficient community interest and private beta tester engagement. We have fundamentally got our vision wrong, our product design is poor and unusable, or our build quality is too low. The world just does not have a place for Tact. In this case, we may still continue to operate Tact indefinitely on life support since the ongoing operating expense is low, but there is no business here. It is not the end of the world. I just need to do something else with my life, and Tact won\u2019t be the main thing that I work on.<\/p>\n\n<p><strong>A viable small business.<\/strong> Apple announced their Small Business Program in 2020 and revealed that a \u201cvast majority\u201d of app developers are in \u201cunder 1M of revenue\u201d category. Tact would be just fine in this category. Arriving at a sustainable business model to support ongoing operating costs and a few people\u2019s work seems like a completely reasonable and achievable goal, and is the one I am working towards.<\/p>\n\n<p><strong>Something big.<\/strong> We work on Tact because we believe that our principles and vision have potential to be way bigger than the current feature set. This requires a lot more - of people, investment, and other resources. We are not actively working towards this goal, but it may turn out to be the future anyway, whether in 2021 or a later time.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/my-hobby-project-tact\/\">My hobby project Tact, and how you can come along to the journey<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on February 04, 2021.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/big-sur-remote-notifications\/"}},"id":"https:\/\/jaanus.com\/big-sur-remote-notifications","published":"2020-11-07T09:19:21+02:00","updated":"2020-11-07T09:19:21+02:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p><strong>Updated Nov 8:<\/strong> I did further testing and realized that registering for remote notifications works in production environment on Big Sur, but not in development environment. The original version of this post stated that it doesn\u2019t work at all on Big Sur, which would be a big deal. Not working in development environment is obviously annoying to developers, but has no real user impact. I\u2019ve edited this post to reflect this learning.<\/p>\n\n<p><strong>TL;DR:<\/strong> registering for remote notifications in development environment appears to be broken in Big Sur. <a href=\"https:\/\/github.com\/jaanus\/BigSurRemoteNotifications\">This code<\/a> works for me as expected in Catalina with both development and production configurations. On Big Sur, it works in production context, but not during development. I\u2019ve been looking for an explanation and solution for a while, but no luck so far.<\/p>\n\n<p>macOS Big Sur is about to be released publicly soon. All macOS users will get a major design update with this release. Us developers have been looking at it for a while already, and I quite like working with it. There\u2019s one area where I am having trouble with though, and haven\u2019t found a solution so far. Hence, I\u2019m writing this up publicly, in the hope that someone can point towards what I am doing wrong.<\/p>\n\n<p>Remote notifications are generally a pretty stable part of the Apple SDK. It first shipped on iOS many versions ago, and was later added to macOS. To my knowledge, there weren\u2019t any API and SDK changes in Big Sur in this area. The code I had working in Catalina should just remain working in Big Sur.<\/p>\n\n<p>Alas, that is not the case for me. I have made a <a href=\"https:\/\/github.com\/jaanus\/BigSurRemoteNotifications\">small example app<\/a> that you can just build and run. It first asks the user for authorization to send notifications. If the user grants it, the app then registers to receive remote notifications. It obtains a device token that I can later use to send notifications to the device.<\/p>\n\n<p>Everything works as expected in Catalina. You see these lines in the log.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>2020-11-07 14:19:41.581802+0200 BigSurRemoteNotifications[59054:1699865] [App delegate] Notification authorization ok, registering for remote notifications\n2020-11-07 14:19:44.930732+0200 BigSurRemoteNotifications[59054:1699373] [App delegate] Did register for remote notifications. Token length: 32\n<\/code><\/pre><\/div><\/div>\n\n<p>On Big Sur, it\u2019s a different story. Neither the <code class=\"language-plaintext highlighter-rouge\">didRegisterForRemoteNotificationsWithDeviceToken<\/code> nor <code class=\"language-plaintext highlighter-rouge\">didFailToRegisterForRemoteNotificationsWithError<\/code> callbacks are called. One of them should always be called. Here\u2019s what I see in the log on Big Sur when running in development context, such as building and running straight from Xcode.<\/p>\n\n<div class=\"language-plaintext highlighter-rouge\"><div class=\"highlight\"><pre class=\"highlight\"><code>2020-11-07 10:58:47.851135+0200 BigSurRemoteNotifications[2823:36378] [App delegate] Notification authorization ok, registering for remote notifications\n<\/code><\/pre><\/div><\/div>\n\n<p>The registration just appears to hang forever.<\/p>\n\n<p>I have never seen this work in Big Sur in development environment. It has been broken like this since the first beta. I\u2019ve checked with each subsequent beta release for any behavior changes, but nothing so far. And now we have Big Sur Release Candidate out where this is similarly not working.<\/p>\n\n<p><a href=\"https:\/\/developer.apple.com\/forums\/thread\/660180\">This thread in Apple developer forum<\/a> suggests that it might be due to my network setup. Someone from Apple claims that they had connectivity problems in APNs developer environment at some point. Fair enough. This is also why I use <code class=\"language-plaintext highlighter-rouge\">os_log<\/code> for logging: I can build the app with production configuration and then see the logs in system console.<\/p>\n\n<p>When I build the app on Big Sur and then export a notarized and signed copy of it which is built against production APNS environment, it appears to be working as expected. I stream the app log and can see the callback being called.<\/p>\n\n<p><img src=\"\/images\/big-sur-notification-registration-callback.png\" alt=\"Notification registration callback on Big Sur\" \/><\/p>\n\n<p>To sum it up, it works on Catalina with both development and production configurations, and on Big Sur only with production configuration. I am using exactly the same iMac and network environment with the same code, suggesting to me that it really is something about the operating system.<\/p>\n\n<p>So that\u2019s where I am. Usually in a situation like this, when something is not working as expected, one of these two is true. (Sometimes both. But usually one.)<\/p>\n\n<ol>\n  <li>I am doing something wrong.<\/li>\n  <li>There is something wrong with the underlying system and platform.<\/li>\n<\/ol>\n\n<p>I would happily fix my mistake if I knew what I was doing wrong. I just fail to see what it is, or what and where to look for. The notification registration API and system behavior hasn\u2019t changed. There aren\u2019t any warnings or deprecations in Xcode. The network is fine. It really is just working in Catalina and not working in Big Sur.<\/p>\n\n<p>I have filed FB8731513 to Apple about this a while ago. It doesn\u2019t have any reactions from Apple, but status remains \u201cOpen\u201d.<\/p>\n\n<p>If you happen to be a developer on Big Sur, perhaps you could test this and see if you get similar results? Let me know <a href=\"https:\/\/twitter.com\/jaanus\/status\/1325052157578649601\">on Twitter<\/a> or such. I\u2019ll update this post once I find out more.<\/p>\n\n  <p><a href=\"https:\/\/jaanus.com\/big-sur-remote-notifications\/\">Registering for remote notifications appears broken in Big Sur<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on November 07, 2020.<\/p>"},{"title":{"@attributes":{"type":"html"}},"link":{"@attributes":{"rel":"alternate","type":"text\/html","href":"https:\/\/jaanus.com\/how-design-makes-the-world\/"}},"id":"https:\/\/jaanus.com\/how-design-makes-the-world","published":"2020-05-14T10:19:21+03:00","updated":"2020-05-14T10:19:21+03:00","author":{"name":"Jaanus Kase","uri":"https:\/\/jaanus.com","email":"hello@jaanus.com"},"content":"<p>Today, I\u2018d like to recommend a design book to you\u2014even (especially!) if you don\u2019t identify as a \u201cdesigner.\u201d<\/p>\n\n<p>The book is <a href=\"https:\/\/designmtw.com\">\u201cHow Design Makes The World\u201d<\/a> by <a href=\"https:\/\/scottberkun.com\/\">Scott Berkun.<\/a> And it has a cool trailer.<\/p>\n\n<div class=\"embed-video-container\"><iframe src=\"https:\/\/www.youtube.com\/embed\/BYS4JXW0f5g \"><\/iframe><\/div>\n\n<p>It will give you a new, human-centered lens to look at the world around us, including your own work and daily life. Everything we make and do impacts somebody else, and the book gives you many design-inspired frames to question, critique and improve your own and other people\u2019s decisions.<\/p>\n\n<p>Design has always co-existed with other disciplines and been informed by real-world constraints and tradeoffs. The book does talk a bit about software and the digital world, but only marginally. It shows us how design as an intentional activity has been part of the human domain since forever, talking a lot about physical products and spaces.<\/p>\n\n<p>These days, I work in the niche domain of Anti-Money Laundering and the fun world of financial institutions. The part in the book that touches my work directly is the bit about constraints and tradeoffs. I deal with a different frame and reference system compared to, say, consumer mobile apps. There are many regulations, stakeholders, institutions, decision-making structures and, ultimately, roles and people involved. But ultimately, the design checklist still applies:<\/p>\n\n<ul>\n  <li>What am I trying to improve?<\/li>\n  <li>Who am I trying to improve it for?<\/li>\n  <li>How do I ensure I am successful?<\/li>\n  <li>Who might be hurt by my work, now or in the future?<\/li>\n<\/ul>\n\n<p>The book is a light, entertaining read. There are many sources, but not so much academics and \u201cscience\u201d. It\u2019s mostly real-world stories and history with some light analysis.<\/p>\n\n\n  <p><a href=\"https:\/\/jaanus.com\/how-design-makes-the-world\/\">How Design Makes The World<\/a> was originally published by Jaanus Kase at <a href=\"https:\/\/jaanus.com\">Jaanus<\/a> on May 14, 2020.<\/p>"}]}