Not sure if Swift 1.2 fixed this but
@IBInspectable var title_align_center: Bool?
Works in Interface Builder but the app crashes without warning. IBInspectable cannot be optional.
Original videos, music, and software.
Not sure if Swift 1.2 fixed this but
@IBInspectable var title_align_center: Bool?
Works in Interface Builder but the app crashes without warning. IBInspectable cannot be optional.
Recently I've been working on some code wrote in 2013 by some dude, and I kind of feel it's funny due to the quality of the code. Yes there are some more advanced topic about how to write good code but you don't really see example of bad code everyday, for example:
And I'm about to change the order of the tabs.
Nice variable name.
It's hard for us to totally avoid duplicated code (especially for those 2-line codes), but copy/paste the whole login code/xib into 2 places is just... not very common.
It used be everywhere but not anymore, so hi old buddy! Actually you don't need to use things like UIScreen.main_width, self.view.w should be fair enough (+main_width and -w are from LCategory) in most cases.
if (selectedScope == 0) {
distanceToFilterResults = filterDistance500M;
[[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance500M];
}else if (selectedScope == 1) {
distanceToFilterResults = filterDistance5KM;
[[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance5KM];
}else if (selectedScope == 2) {
distanceToFilterResults = filterDistance50KM;
[[QCDTaskMaster sharedInstance]setFilterDistance:filterDistance50KM];
}else if (selectedScope == 3) {
distanceToFilterResults = filterDistanceALL;
[[QCDTaskMaster sharedInstance]setFilterDistance:filterDistanceALL];
}
I totally don't understand why someone would write code like this. There are more than 5 ways to make the code cleaner.
...
There are a shit load of stuff like this, and guess who's not cool? It's me 'cause I'm making fun of other people, which is totally not cool. Don't do it kids.