Skip to content
This repository has been archived by the owner on Apr 16, 2024. It is now read-only.

iOS Versions Support? #2

Closed
johnnyshankman opened this issue Jan 8, 2016 · 6 comments
Closed

iOS Versions Support? #2

johnnyshankman opened this issue Jan 8, 2016 · 6 comments

Comments

@johnnyshankman
Copy link

Any chance you've touched this code in the last three years to double check if it still works with iOS 7, 8, and 9?

I'd love to use this.

@cknadler
Copy link
Owner

cknadler commented Jan 8, 2016

I haven't at all. Sorry! Under the hood it should be the same, but it would take a bit of work to get it to play nice with modern objective-c. Pull requests definitely welcome if you're interested in fixing it up. ^_^

@johnnyshankman
Copy link
Author

I'll definitely take a stab at making this support iOS8 and iOS9 in a few weeks.

Right now it definitely doesn't play nice with startMonitoringForRegion: (https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/index.html#//apple_ref/occ/instm/CLLocationManager/startMonitoringForRegion:).

It cannot be used as a drop-in replacement for CLCircularRegion because it isn't actually a subclass of CLRegion, which is now required by that method call.

@johnnyshankman
Copy link
Author

If we could manage to make this extend CLRegion on this line (https://github.com/cknadler/CKSquareRegion/blob/master/CKSquareRegion.h#L29) and then make the necessary updates to method names etc. to get that working we'd be A-OK.

@cknadler
Copy link
Owner

That sounds good to me. I'd definitely accept a pull request with that change. Thanks! 👍

@johnnyshankman
Copy link
Author

Oof, this is a lot harder than I had hoped. There's a ton that needs to be done in order for this to not return an error when monitoring the region on iOS 8 and 9.

We have to conform to NSCopying and NSSecureCoding.

Even with that I can't get the damn thing to set anything besides its identifier when I instantiate a new square region. There should no longer be a radius so that's okay to be null, but the center should be printing out the center I am setting and it is not.

Totally confused.

@johnnyshankman
Copy link
Author

It's like I'm setting center, but not the version of it that CLRegion prints out in the description? Which is enough for the manager to return an error when attempting to monitor it?

If I give the class its own description method then I can successfully see the center point I had set previously. Problem is it seems not be the same center CLRegion checks out. When I do get it to plausibly set the right region, it shits the bed because the center is read only.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants