Core Data and Core Location Part 2

I linked to my previous post on a swift slack channel and got some interesting feedback. I forgot to mention in the last post the option of subclassing NSSortDescriptor to order by location. One of the ideas was one I tried but forgot to mention: subclassing NSSortDescriptor to compare based on distance. I had initially abandoned that approach because of something in this blog post which explains some gotchas involved in that process. I mistakenly thought that ARC made it impossible to override copyWithZone:, which is one of the “requirements” mentioned in that post.

Continue reading

Core Data and Core Location

Core Data by Core Location

I’m building an app that is supposed to track user location and sort a bunch of venues based on where the user is on the latitude/longitude coordinate system relative to those venues. This post is me thinking through how to make Core Location and Core Data work together to sort the venues. I’m using Objective-C for some parts of the app, but my Core Data stack is all Swift 2.2, Xcode 7.3.1 and I’m testing on iOS 9.3.1.

Continue reading

Hacking Pokemon Go

Pokémon Go is finally out in the United States, and as a long time fan of the franchise, I downloaded it as quickly as I could. (I tried the New Zealand App Store this morning, but of course regional stores kept me waiting for a few more hours.)

Continue reading

Generating a PDF from a UIScrollView

A screenshot of an icon on the OS X desktop called UIScrollView.pdf.

PDF Generation of a UICollectionView.

There are plenty of situations where you might want to generate a PDF from a UIScrollView. If you search the internet, you’ll find lots of posts instructing you to change the frame of the scroll view to enclose all of its contents. This won’t work if you’re using AutoLayout. In any case, there’s a better way.

Continue reading

Fixing Plain Style Unsupported in a Navigation Item in Xcode 7

A screenshot of Xcode's errors and warnings pane showing "Plain Style Unsupported in a Navigation Item"

Plain Style Unsupported in a Navigation Item

If you’ve ever seen this Xcode complain about that the “plain style” for UIBarButtonItem is “unsupported in a navigation item” you know that it can be a nuisance to narrow down which button item has the unsupported style, especially in larger projects.

Here’s some good news for you. It’s pretty easy to figure out what button is causing the warning. Here’s how you do it:

Continue reading

Coloring The iOS UIScrollViewIndicators

A UIScrollView with purple indicators

Scroll view w/ purple indicators.

On iOS, UIScrollView (and subclasses UITableView and UICollectionView) come with scroll indicators, which show your user where they are relative to the overall content size of the scroll view.

By default, you can set the scroll view indicators to either be black or white, like so:

Continue reading

Customizing Safari’s Pinned Tabs

A picture showing pinned tabs with generated icons -almost all identical.

Identical Pinned Tabs

Ever pinned a few tabs in Safari and end up with a bunch of identical tabs which all had the same letter as the icon? I did. 

Continue reading

Economics Lessons from Get Famous!

Piles of interest waiting to be collected.

Piles of interest.

What happens when an online trading card simulator goes viral, shuts down, and makes a return under a new name? You have an economics simulation with some very interesting lessons.

Continue reading

Learning Assembly Language Concepts

Assembly language is really cool but it can also be maddening. I took a course on assembly last semester and I’d like to introduce a few of the basic concepts in assembly here. This isn’t a full blown tutorial, but just a bit to whet your appetite.

Continue reading