Skip to main content

Dev Log

Developer Log

NSAppearanceNameVibrantDark vs Custom Drawing

By Dev Log

The built-in cocoa controls are great for most things. However, every developer reaches a point where they need to do some custom drawing.

The drawing is easy enough, but you may run into the same issue that we recently did. Our custom drawing code worked fine with when in a parent view with standard NSAppearanceNameAqua appearance, but when the parent view used NSAppearanceNameVibrantDark drawing behaved in unexpected ways.

The easiest solution that we found to address this issue was to set NSAppearanceNameAqua on the views where we were doing the custom drawing.

Weird Blending Artifacts

Fixed Goodness

Twitter Cards missing Image

By Dev Log

“Facebook allows images to be on a different server. Twitter does not.”

The Rest of the Story

Twitter Cards are a great way to share links on Twitter. In addition to the link, they include a summary and an image.

We also use Facebook Sharing to do essentially the same thing. As chance would have it, we set up Facebook first. Facebook complained that the images sometimes didn’t load fast enough. We placed the shared images on our AWS server so they would load faster. This was fine. For Facebook.

After setting up some Twitter Cards we noticed that the image wasn’t loading properly.

We found a lot of suggestions on how to fix this, but none of them worked.

Finally, one site suggested that it might be because of robots.txt configured to disallow indexing of wordpress images.

User-agent: Twitterbot
Disallow: *
Allow: /wp-content/uploads/*

This was NOT the problem that we had, but it suggested that Twitter might be requiring that the image be located on the same server as the shared page. This in fact is what the problem turned out to be.

Once we hosted the images on our server the Twitter Card images showed up properly.