AliSoftware / OHAttributedLabel

UILabel that supports NSAttributedString
https://github.com/AliSoftware/OHAttributedLabel/wiki
1.51k stars 344 forks source link

Add requires ARC - it's best to use ARC, so let's make it use it #163

Closed mattjgalloway closed 10 years ago

mattjgalloway commented 10 years ago

As title. Probably best to make OHAttributedLabel use ARC by default in CocoaPods, because, well, ARC is best :-).

AliSoftware commented 10 years ago

I agree it's better, but that's not true that OHAttributedLabel required ARC as it is still compatible with non-ARC code.

But I agree with the idea about abandonning non-ARC code, so if we add required_arc = true, we probably may remove all the if __has_feature(objc_arc) fuss too in the code (and bump at least the patch version in the podspec, too)

mattjgalloway commented 10 years ago

@AliSoftware true, but all recent (and even not that recent) Xcodes support ARC. So I'd say go for it. It's not building with ARC for everyone using CocoaPods right now, which is a bad thing IMO.

mRs- commented 10 years ago

:+1:

AliSoftware commented 10 years ago

It's not building with ARC for everyone using CocoaPods right now, which is a bad thing IMO

Totally agree.

I didn't set this flag in the podspec because it does not requires ARC stricto sensu, but as not setting this flag in the podspec makes CocoaPods build the lib without ARC, I will definitely add it anyway.

mattjgalloway commented 10 years ago

@AliSoftware yep sure thing. It's a bit of chicken & egg with this stuff sometimes. You try to support both, but things end up falling back to non-ARC like CocoaPods. Although I wonder if they should support a flag like "I can do ARC if you want" and then you could indicate that you want to use ARC by default for all pods that support that. Heck, it might already do that, I don't know. Our good friend @orta would probably know!!

Anyway, I would seriously consider dropping non-ARC support. Up to you though - but I'll be fully behind you if you do!

AliSoftware commented 10 years ago

Damn, pod lib lint can't pass :astonished: failed to find some headers, I'll have to investigate before I can do a clean pod push

AliSoftware commented 10 years ago

Anyway, I would seriously consider dropping non-ARC support. Up to you though - but I'll be fully behind you if you do!

That's exactly what I'm considering :)

AliSoftware commented 10 years ago

Ok there is an issue with pod lib lint (seems to be due to symbolic links to headers that CocoaPods creates when constructing the Pod for linting in /tmp/CocoaPods/Lint… will file an issue to CP about that) but pod spec lint works, so I just pushed 3.5.1 :beers:

AliSoftware commented 10 years ago

@mattjgalloway feel free to file either an issue (or if you feel in the mood even a PR) to remind me of dropping all those #if ! __has_feature(objc_arc) and all the non-ARC code soon too :wink:

mattjgalloway commented 10 years ago

Will do. I'll do that tomorrow.