Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some file names should drop NS Prefix #285

Closed
furuyan opened this issue Oct 31, 2016 · 12 comments
Closed

Some file names should drop NS Prefix #285

furuyan opened this issue Oct 31, 2016 · 12 comments

Comments

@furuyan
Copy link
Contributor

furuyan commented Oct 31, 2016

Some file names and implementations isn't match.
e.g.

NSDateExtensions.swift
extension Date {

So i think we should rename some files.

Target is below.

  • NSBundleExtensions.swift
  • NSDateExtensions.swift
  • NSUserDefaultsExtension.swift
  • NSTimerExtensions.swift
  • NSURLExtensions.swift
  • each test file
@lfarah
Copy link
Collaborator

lfarah commented Oct 31, 2016

Thanks for pointing that out! I always saw that but never remembered to open an issue.
@goktugyil: we need to come up with a way that doesn't break everybody's projects

@piv199
Copy link
Collaborator

piv199 commented Oct 31, 2016

@lfarah we just can rename files and it will not break projects at least which uses cocoapods/carthage.

P.S. the same. I always see, but always forget :)

@lfarah
Copy link
Collaborator

lfarah commented Oct 31, 2016

@piv199 but we still need to rename the classes and that will definitely break a looot of things

@piv199
Copy link
Collaborator

piv199 commented Oct 31, 2016

@lfarah What classes are you gonna rename that will break compatibility?

@lfarah
Copy link
Collaborator

lfarah commented Oct 31, 2016

@piv199 it's not compatibility, but if people were using... hmmm thinking about it, it really doesn't matter because in Xcode 8 the compiler won't let you use, for example, NSTimer. Even if we currently have NSTimerExtensions, they already work on the Timer class.
Summarizing my thoughts: true, it won't break anything

@Esqarrouth
Copy link
Owner

So the compiler will think we're extending NSTimer whether we extend NSTimer or Timer?

@Khalian
Copy link
Collaborator

Khalian commented Nov 2, 2016

IIRC the NS namespace is a legacy and is no hurry to be replaced.

In my opinion the since files are not exposed to the consumer it does not make any difference to the end user.

e.g no one would use import NSBundleExtensions

Moreover if the underlying data type retains the NS prefix, it will end up confusing contributors on what exactly is being extended.

@lfarah
Copy link
Collaborator

lfarah commented Nov 2, 2016

@goktugyil do you wanna open a PR since it involves file changing?

@Esqarrouth
Copy link
Owner

Sure

@Esqarrouth
Copy link
Owner

Forgot to open a branch, oh well.

f489f13
fe49760
5452805
cece3c1
4ec595a
c568ede

@Esqarrouth
Copy link
Owner

Thanks @furuyan

@Esqarrouth
Copy link
Owner

We can possibly change nsurls in url file to no prefix urls, not sure if those would break anything or not.

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

No branches or pull requests

5 participants