2 ms·
I think that at lot of these pollute the global scope unnecessarily or incorrectly, and many of them are semantically incorrect. It's also a massive framework t
by cballard 11y ago
I think that at lot of these pollute the global scope unnecessarily or incorrectly, and many of them are semantically incorrect. It's also a massive framework that doesn't address a specific concern. It would be better packaged as a collection of μframeworks.
Some specific issues:
> Easily access your ViewController on top of your view stack:
let topOfMyViewStack = topMostVC
UIKit supports an arbitrary number of windows, so "your view stack" is not something that is definable.
> Easily access your screen width & height:
print(screenWidth) // 375.0 on iPhone6
print(screenHeight) // 667.0 on iPhone6
Which screen? iOS supports multiple screens - there's a reason that these things are scoped to instance properties of UIScreen.
> Easily run block of code:
let myBlock = {
print("lol")
}
runThisBlock(myBlock)
You can just call it directly with myBlock() - which the implementation presumably does.
> Easily convert between different types:
var myDouble = myInt.toDouble
Double(myInt) isn't really hard, and the "easy" version is more characters.
> Easily access ViewController sizes:
View controllers do not have sizes - views do.
I don't want to rag on the author too much, but I'd also like to add something about the tagline "How Swift standard types and classes were supposed to work". This seems needlessly offensive and incorrect - in all likelihood, Chris Lattner is smarter (or at least more educated on the subject) than you - or me! There's no need to say that he's doing his work incorrectly. Instead, a tagline like "useful extensions for the Swift Standard Library, Foundation, and UIKit" wouldn't imply that the Swift team wasn't doing their job. Save that for complaining about the inability to define a Monad protocol.
- thellimist 11y agoscreenWidth and screenHeight is mainScreen's attributes. iOS devices have only one mainScreen. Maybe you meant the name could be changed as `mainScreenWidth`?
- gok2 11y agoHello, thanks for taking the time to write feedback! I agree on your point of view on some of the matters. >Which screen? The main screen, how can I make that more clearer, I thought it was clear. >Double(myInt) isn't really hard, and the "easy" version is more characters. Correct, but it really is easier to write .toDouble() (Less keystores, more characters) I am going to update some of the stuff you said on the next update, thanks again.