Skip to content
This repository has been archived by the owner on Jan 17, 2023. It is now read-only.

Minor changes to support modern Objective-C syntax. #2688

Merged
merged 1 commit into from Jul 24, 2015

Conversation

mattshedlick
Copy link

  1. NSDictionary +dictionaryWithObject:obj forKey:key -> @{key : obj}
  2. NSDictionary -objectForKey:key -> dict[key]
  3. NSArray -objectForKey:0 -> [array firstObject](in AFURLRequestSerialization.m where it makes sense).
    4.NSArray +arrayWithObject[x] -> @[x]

@kcharwood
Copy link
Contributor

We should actually be looking into moving everything to modern syntax... Perhaps this PR could take that on?

@kcharwood kcharwood added this to the 2.6.0 milestone May 6, 2015
@tewha
Copy link
Contributor

tewha commented May 6, 2015

I don't think a third party can help with a pull request, can we? It might be better to land this (assuming it's good, I haven't looked) and ask in another issue. This is something I'd be happy to do if someone doesn't get to it first.

@kcharwood
Copy link
Contributor

@tewha You can add his remote to your local git instance, and branch off his commit and continue. You could then push up a new PR and his commit history will still be included.

@mattshedlick
Copy link
Author

I think I got all the object subscripting changes in this PR.

@kcharwood
Copy link
Contributor

@mattshedlick cool. I havent given it a thorough review, but will do so now knowing you think you got them all. I'll try and do an audit as well.

@kcharwood
Copy link
Contributor

I ran the modern objective-c conversion tool, and ended up with this commit:

ff029cf

Any thoughts on that?

Note I ran it on top of you commit, so your changes won't show up in that diff.

@tewha
Copy link
Contributor

tewha commented May 7, 2015

I noticed an error from the upgrade tool and commented on it; it changed an action to a read only property.

@kcharwood
Copy link
Contributor

I've made those small updates called out on that commit.

It looks like the conversion tool added NS_DESIGNATED_INITIALIZER in the wrong places as well, causing a few compile warnings. I'll clean those up.

@kcharwood
Copy link
Contributor

Alright, 67fb333 now has been squashed down to contain all the changes on top of @mattshedlick's commit.

kcharwood added a commit that referenced this pull request Jul 24, 2015
Minor changes to support modern Objective-C syntax.
@kcharwood kcharwood merged commit ae69790 into AFNetworking:master Jul 24, 2015
@kcharwood
Copy link
Contributor

All tests pass locally.

Thanks for the pr!

🍻

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