SwifterSwift / SwifterSwift

A handy collection of more than 500 native Swift extensions to boost your productivity.
https://swifterswift.com
MIT License
13.96k stars 1.62k forks source link

want more helpers? #879

Closed gurgeous closed 4 years ago

gurgeous commented 4 years ago

Thanks for creating such a great library! SwifterSwift is amazing and helped me get rid of many of our custom extensions. Want a few more? Here are additional helpers that I can add if you want:

UIView

Let me know if any of these are of interest and I'll put together a PR.

(I also have a fair number of NSRegularExpression, NSString and NSMutableAttributedString extensions but I think those are of less interest. Let me know if you'd like to see those too.)

guykogus commented 4 years ago

UIView

(I also have a fair number of NSRegularExpression, NSString and NSMutableAttributedString extensions but I think those are of less interest. Let me know if you'd like to see those too.) - If you have anything here that we don't have already please feel free to share

gurgeous commented 4 years ago

Great! A few more comments:

Here's what I've got for the other classes:

NSRegularExpression

String

NSAttributedString/NSMutableAttributedString/String

The intent here is to make NSAttributedString, NSMutableAttributedString and String all work together to support attributed properties. I don't know how anyone can build attributed text without this stuff. Example usage:

var s = NSMutableAttributedString()
s.append("\(count) ".font(Self.countFont))
s.append(label.font(Self.labelFont))
s.color(.red)
gurgeous commented 4 years ago

Here is a WIP for the first set of additions: https://github.com/SwifterSwift/SwifterSwift/compare/master...gurgeous:more-extensions?expand=1

Feedback is welcome. Let me know if this looks good and I will submit a PR w/ changelog entries. Thanks @guykogus!

LucianoPAlmeida commented 4 years ago

@gurgeous Just one note, make sure to open one PR per extension, this makes easier o discuss a single topic in a PR and also for review :)

gurgeous commented 4 years ago

OK, I will break this up into a few PRs and add changelog entries

LucianoPAlmeida commented 4 years ago

OK, I will break this up into a few PRs and add changelog entries

Thank you! We will take a look at it ASAP :)

gurgeous commented 4 years ago

I'll go ahead and close this. We can explore the additional helpers listed above in separate issues if we want.