Closed gurgeous closed 4 years ago
UIView
CGRect
, no needboundsWidth
instead of bounds.width
, for example(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
Great! A few more comments:
Here's what I've got for the other classes:
applying
. Probably we should just make applying
public and support the singular case as well.color
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)
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!
@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 :)
OK, I will break this up into a few PRs and add changelog entries
OK, I will break this up into a few PRs and add changelog entries
Thank you! We will take a look at it ASAP :)
I'll go ahead and close this. We can explore the additional helpers listed above in separate issues if we want.
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.)