zettajs / ZettaKit

The Zetta iOS Client Library.
MIT License
3 stars 2 forks source link

Updates to ZIKDevice.name to support Swift access #9

Closed benpackard closed 8 years ago

benpackard commented 8 years ago

Two changes to the 'name' property of ZIKDevice to improve Swift interoperability. First, this property is marked as nullable. This tells Swift code that it will contain either an NSString or nil. Second, the 'refresh' method was sometimes setting the device name to [NSNull null] instead of nil. This would occur when the dictionary building the device properties contained "null" for the name key. This causes runtime errors downstream in Swift since the expected type is NSString or nil. The name is now set to nil instead of [NSNull null] when "null' is detected.

Similar changes will likely be necessary for other properties.

mdobson commented 8 years ago

Looks good. I'll get this merged in Monday. I'll also add the nullable stuff to my checklist of updates for next week.

benpackard commented 8 years ago

Thanks, no rush.

Ben

On Jan 16, 2016, 7:53 PM -0500, Matthew Dobsonnotifications@github.com, wrote:

Looks good. I'll get this merged in Monday. I'll also add the nullable stuff to my checklist of updates for next week.

— Reply to this email directly orview it on GitHub(https://github.com/zettajs/ZettaKit/pull/9#issuecomment-172280572).

benpackard commented 8 years ago

Is there a way to merge this into the 0.02 version also? That way I can continue working against 0.02 while issue #11 with 0.03 is looked at.

mdobson commented 8 years ago

I'll take a look on Monday, and get you an answer. I won't be available to handle it today.

-- Matthew Dobson | apigee https://apigee.com/ | m: +1.734.634.5472 | twitter @mdobs http://twitter.com/mdobs @apigee https://twitter.com/apigee | Apigee Community http://community.apigee.com/ for answers, ideas and support!

On Sun, Jan 17, 2016 at 12:32 PM, Ben Packard notifications@github.com wrote:

Is there a way to merge this into the 0.02 version also? That way I can continue working against 0.02 while issue #11 https://github.com/zettajs/ZettaKit/issues/11 is looked at.

— Reply to this email directly or view it on GitHub https://github.com/zettajs/ZettaKit/pull/9#issuecomment-172355650.

benpackard commented 8 years ago

I added another commit which updates the SocketRocket dependency from 0.3.1-beta2 to 0.4. Full details in the commit comment. I now realize I should have branched separately for each commit so that each was in a separate pull request (I think? Not much experience with PRs).

mdobson commented 8 years ago

This is fine. In the future changes this different would be different PRs.

-Matt On Sun, Jan 17, 2016 at 5:33 PM Ben Packard notifications@github.com wrote:

I added another commit which updates the SocketRocket dependency from 0.3.1-beta2 to 0.4. Full details in the commit comment. I now realize I should have branched separately for each commit so that each was in a separate pull request (I think? Not much experience with PRs).

— Reply to this email directly or view it on GitHub https://github.com/zettajs/ZettaKit/pull/9#issuecomment-172391408.