I can’t explain why, but I just used the phrase ‘put the kibosh on’ for the first time ever, I think. I totally recommend this as a fun phrase to use.
So, I wrote a category on NSPersonNameComponents to implement some custom name-formatting logic, and ran up against an interesting problem. Try as I might, my code in the category just wasn’t visible at all from swift. I wrote code like this:
let components = PersonNameComponents(…)
but whatever I would do, the compiler would complain that PersonNameComponents didn’t have a function myObjCFunction()
But, the ‘generated interface' showed that there was in fact a myObjCFunction(), and if I wrote more code in that .m file, like a category on NSString, I’d be able to use it from swift, so the module was getting imported correctly, and there wasn’t a problem with the header includes. What on earth was wrong?
After spending far too long chasing some rabbit holes, I figured out that PersonNameComponents and NSPersonNameComponents are not the typical pair of swift/ObjC Foundation classes. NSPersonNameComponents is indeed an Objective C class, but PersonNameComponents is a struct (not a class). This mucked with the visibility of the selectors in the category
It turns out this code worked just fine:
let nsComponents = NSPersonNameComponents(…)
And I was happy for about two minutes until the compiler complained about this:
let formatter = PersonNameComponentsFormatter(…)
let nsComponents = NSPersonNameComponents(…
let formattedName = formatter.string(from:nsComponents)
Apparently, PersonNameComponentsFormatter is equivalent to NSPersonNameComponentsFormatter, but it takes a PersonNameComponents struct as an argument here, and can’t take an NSPersonNameComponents.
The solution was easy, once I figured out that the compiler would be happy with
let formattedName = formatter.string(from:nsComponents as PersonNameComponents)
So, tl;dr: sometimes the swift equivalent of an Objective-C class isn’t a swift class, and in that case, writing a category on the Objective-C class isn’t visible to the swift equivalent. In that case, one needs to actually use the objectiveC class in swift with the NS name and everything.
This is the quality punditry @jbrcpod can trusted to deliver.
Shoutout to the engineering team behind NSPersonNameComponentsFormatter
Pair programming in 2020
The talented @athebler contributes some wonderful artwork to the fanzine The Loneliest Girl anemersi.itch.io/the-lonel…
I’ve been thinking a lot the past few months about Maslow’s hierarchy of needs and how it can be an interesting frame for understanding political discussions. Often, there’s a conflict between two sides, and one side is clearly concerned about some need which appears in the hierarchy well below the concern of the other side. For example, a gun control discussion might be “Everyday, I am afraid of getting killed” vs. “I am afraid my rights will be infringed”. “Physical security” appears in the hierarchy far below “sense of freedom”, so as a society, it is clear which need is more urgent. But if one side of the discussion doesn’t think of society as a unit, it can feel free to think of its needs as equally valid and equally urgent as the other side’s needs.
I don’t know how to bridge this gap, but I feel like understanding where different perspectives of a discussion live on the hierarchy of needs is key to understanding how to resolve the divisiveness in 2020 America.
So, if there’s a political discussion going on around you that you don’t understand, try imagining where each side’s concerns live in the hierarchy of needs. It will be illuminating.
Also, this is a great framing for the meaning of the word “privilege”. For example, “it is a privilege to be able to worry about
rather than ” is a statement you can make about anything that lives in the hierarchy of needs above . So, for example, “It is a privilege to be able to worry about my 401k rather than what I’m going to do about this pair of shoes that’s about to have a hole in the bottom of it”
Cracks me up everytime!
Well, it has probably always been interesting, but it seems to be just now that the discussion is far enough along that I can wrap my head around it. I spent some time today reading these three posts that have me excited for the future.
If you are missing async/await in swift, enticed by the prospect of an ‘async let’ or ‘async var’, and/or enjoy a clever headline like ‘go statement considered harmful’, these will be to your liking.
Just submitted an App Store app review giving an app one star because their EULA was completely ridiculous “You agree to … indemnify …
… against any allegations … arising from an alleged breach of your representations or obligations under this agreement. Additionally, you will be primary responsible to pay promptly all .. costs (including attorney’s fees) … in connection with your indemnification obligations above.”
Like, that’s infinite liability for something I have no control over, right?
Shouldn’t Apple have rejected this app for engaging in “manipulative practices within or outside of the app.” (Section 5.6 - Developer Code of Conduct) ???
Wouldn’t it be great if Apple App Store review read the EULAs on every app and rejected the ones which were plainly bonkers? Wouldn’t that be adding value to its ecosystem?
Mile 32. Loop Complete.
22 miles. View of Juanita across the lake.
20 mile IPA is always a good IPA.
18 miles. Almost across the bridge.
15 miles. 520 Bridge View Park.
11.5 miles. First view of Seattle
The DERU Market ‘AM Sandwich’ hit the spot.
It’s a start!
Thinking of taking a little walk next Saturday. Who’s with me?
One of the rewarding parts of working in tech is being part of the Accessibility revolution. Like, it totally rocks when, at Apple’s WWDC, they show off some new tech that makes it easier for a blind person to navigate public spaces, or for a deaf person to participate in public conversations. Each little step towards real inclusivity in tech might be life-changing for some people, and in sum, they are society-transforming. Living and feeling this transformation is nourishing for the soul.
This week I had an experience that put my feelings into perspective. A rather popular tech blogger used the phrase “blind leading the blind” (a phrase which has a long history: from Matthew 15, “And if the blind lead the blind, both will fall into a pit.”), and this phrase really struck a sour chord with me. Not just because of the casual ableism – I manage to not be offended by the everyday idioms that, if I were paying attention, would be constant reminders that the association between disability and inferiority is baked into our language.
No, it struck a sour chord because the traditional meaning of the idiom, that the ignorant are ill-served by getting advice from the ignorant, assumes that change is impossible – that the blind will never be able to navigate public spaces.
Inwardly I shout “No!”
Envision how awesome the blind leading the blind might be – not into the pit of Matthew 15 – but leading like any tour guide leads a group of tourists. Let your guide take you to Pike Place Market and taste the coffee and the piroshky and the crumpets and the nectarines and the chowder. Let your guide take you to the Olympic Sculpture Park, to hear the city and the train tracks and the ferry and the the wind curling around Alexander Calder’s Eagle, and taste the air from the Sound and feel the full force of the sunset. Let your guide take you to Sake Nomi where Johnnie will pour you a flight of Junmai Daiginjoshu and treat you like the Nomidachi regulars.
And who better than the blind to lead the blind? Let your guide help you avoid the dangerous intersections. Let your guide tell you which bus stops are easier to use. Let your guide give you the cues to navigate on your own tomorrow. Let your guide share their hard-won experience about how to enjoy this place you want to visit.
The blind leading the blind is part of the future I want.
Each little step towards real inclusivity might be life-changing. If you imagine a world where “the blind leading the blind” is a sign of a well-functioning, caring, joyful world, you can be part of the transformation of society, and the traditional sense of the phrase “the blind leading the blind” will no longer make sense to you. That’s a glorious world to live in.
1) One may ask, if “blind leading the blind” is a phrase to be avoided, what is a suitable replacement? I’ll suggest trying to make up a new idiom. It’s actually kind of fun, and will make your writing more colorful. How about “Donald Trump teaching Bill Barr about ethics” or “The Kanye West School for Spotlight Avoidance” or “Ellen DeGeneres’ Texas Barbecue Review for Vegan Magazine”.
2) Matthew 15, the reason why the idiom persists (though not, apparently the original source), is actually relevant to the discussion in a more subtle way. In the story, the Pharisees are talking about the Law concerning how to prepare for a meal: Jesus says: “it is not what goes into the mouth that defiles a person, but what comes out of the mouth; this defiles a person.” (which might be updated as “A person’s shit may smell, but it is their words that can stink”.) Jesus goes on the Pharisees obsession with what can go into your mouth isn’t important and calls them “blind guides” and that they should be ignored – their teaching has no value. In the story, Jesus is urging his followers to transform how they think of the old text and of the Commandments, that there is a more caring way to view the Law. As is common with Biblical readings, there are more questions than answers.
3) Thanks to Brent Simmons for encouraging me to write this as a blog post and share it.
4) It is completely coincidental that you can’t spell Pharisee without “see”
5) Thanks to author of, and the anonymous commenter on, this post: thatcrazycrippledchick.blogspot.com/2014/07/t…
Achievement Unlocked: Found a fish on the Burke-Gilman trail
Idea: “Stormtroopers!” - a first-person shooter where no player can actually hit a target, but hitting other things have fun secondary effects
subscribe via RSS