Conversation
57133e0 to
aa793b2
Compare
b2c4280 to
9a5be34
Compare
kambala-decapitator
left a comment
There was a problem hiding this comment.
although subclassing UILabel isn't really needed when you can do just
@implementation UILabel (NoFound)
- (instancetype)initAsNoFoundWithFrame:(CGRect)frame {
self = [self initWithFrame:frame];
}
// or even instead of the initializer:
- (void)configureAsNoFound {
...
}
@end|
|
||
| @import UIKit; | ||
|
|
||
| @interface NoFoundLabel : UILabel; |
There was a problem hiding this comment.
| @interface NoFoundLabel : UILabel; | |
| @interface NoFoundLabel : UILabel |
|
|
||
| @interface NoFoundLabel : UILabel; | ||
|
|
||
| - (id)initWithFrame:(CGRect)frame; |
There was a problem hiding this comment.
| - (id)initWithFrame:(CGRect)frame; | |
| - (instancetype)initWithFrame:(CGRect)frame; |
|
|
||
| @implementation NoFoundLabel | ||
|
|
||
| - (id)initWithFrame:(CGRect)frame { |
There was a problem hiding this comment.
| - (id)initWithFrame:(CGRect)frame { | |
| - (instancetype)initWithFrame:(CGRect)frame { |
|
please also fix conflicts |
Wouldn't this require to define this again several times, for controller it is used in? I thought of either subclassing (as I did now) or adding an extension (also 2 new files). You have different solution in mind? |
38a7372 to
8eea564
Compare
|
I gave you an example of extension :) without the interface declaration (which is trivial to create) to type less |
Yes, I recognized this 😉 My question is about where to place such extension? If I need to declare this separately for each controller, there's still code duplication. |
|
no, of course no duplication. Simply place it in separate files just like you did with the other extensions. btw you can also include all extensions in PCH to have them accessible everywhere. |
8eea564 to
9ac90d6
Compare
|
FInally, I went for a standard, full-blown extension. Will use the same pattern for future extensions. I have several extension to come with next PRs. |
kambala-decapitator
left a comment
There was a problem hiding this comment.
FYI you're not limited to a single extension for a given class, you can have as many as you want.
|
You're ok with the solution? In this case I would make this ready for merge. |
This avoids calls of reloadData for simple connection status updates.
Allows to remove a variable.
Avoids code duplication and ensures consistent look.
9ac90d6 to
362a198
Compare
Description
This PR applies two main changes:
Introduce
updateServerCellStatusThe new method
updateServerCellStatusupdates the server list cell's connection status icon only. This allows to reduce the amount ofreleadDatacalls, which was before used to do this.Introduce
noFoundLabelThe UILabel
noFoundLabelis used to signal an empty server list. It is faded in/out depending on the state of the list. This allows to remove the former solution which based on a dummy cell.Other smaller changer were related to coding styles and minor refactoring.
Summary for release notes
Improvement: Using UILabel to signal "No saved hosts found" instead of creating a dummy cell
Improvement: Avoid calling reloadData by only updating connection status icon when needed
Maintenance: Coding styles and minor refactoring