[ios] Format all Obj C code via clang-format

Signed-off-by: Konstantin Pastbin <konstantin.pastbin@gmail.com>
This commit is contained in:
Konstantin Pastbin
2025-08-17 16:37:15 +07:00
parent 52e9ddc038
commit aea784ddd7
109 changed files with 5113 additions and 4270 deletions

View File

@@ -3,13 +3,14 @@
@interface MWMSearchCell ()
@property (weak, nonatomic) IBOutlet UILabel * titleLabel;
@property(weak, nonatomic) IBOutlet UILabel * titleLabel;
@end
@implementation MWMSearchCell
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching {
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching
{
NSString * title = result.titleText;
if (title.length == 0)
@@ -17,7 +18,7 @@
self.titleLabel.text = @"";
return;
}
NSDictionary * selectedTitleAttributes = [self selectedTitleAttributes];
NSDictionary * unselectedTitleAttributes = [self unselectedTitleAttributes];
if (!selectedTitleAttributes || !unselectedTitleAttributes)
@@ -25,20 +26,19 @@
self.titleLabel.text = title;
return;
}
NSMutableAttributedString * attributedTitle =
[[NSMutableAttributedString alloc] initWithString:title];
NSMutableAttributedString * attributedTitle = [[NSMutableAttributedString alloc] initWithString:title];
NSDictionary * titleAttributes = isPartialMatching ? unselectedTitleAttributes : selectedTitleAttributes;
NSArray<NSValue *> *highlightRanges = result.highlightRanges;
NSArray<NSValue *> * highlightRanges = result.highlightRanges;
[attributedTitle addAttributes:titleAttributes range:NSMakeRange(0, title.length)];
for (NSValue *rangeValue in highlightRanges) {
for (NSValue * rangeValue in highlightRanges)
{
NSRange range = [rangeValue rangeValue];
if (NSMaxRange(range) <= result.titleText.length) {
if (NSMaxRange(range) <= result.titleText.length)
[attributedTitle addAttributes:selectedTitleAttributes range:range];
} else {
else
NSLog(@"Incorrect range: %@ for string: %@", NSStringFromRange(range), result.titleText);
}
}
self.titleLabel.attributedText = attributedTitle;
[self.titleLabel sizeToFit];

View File

@@ -1,8 +1,8 @@
#import "MWMSearchCommonCell.h"
#import "CLLocation+Mercator.h"
#import "MWMLocationManager.h"
#import "SwiftBridge.h"
#import "SearchResult.h"
#import "SwiftBridge.h"
@interface MWMSearchCommonCell ()
@@ -17,7 +17,8 @@
@implementation MWMSearchCommonCell
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching {
- (void)configureWith:(SearchResult * _Nonnull)result isPartialMatching:(BOOL)isPartialMatching
{
[super configureWith:result isPartialMatching:isPartialMatching];
self.locationLabel.text = result.addressText;
[self.locationLabel sizeToFit];
@@ -29,31 +30,27 @@
self.openLabel.textColor = result.openStatusColor;
[self.openLabel setHidden:result.openStatusText.length == 0];
[self setStyleNameAndApply:@"Background"];
if (result.iconImageName != nil) {
if (result.iconImageName != nil)
self.iconImageView.image = [[UIImage imageNamed:result.iconImageName] imageWithTintColor:UIColor.white];
}
self.iconImageView.backgroundColor = [UIColor colorNamed:@"Base Colors/Blue Color"];
self.separatorInset = UIEdgeInsetsMake(0, kSearchCellSeparatorInset, 0, 0);
}
- (void)layoutSubviews {
- (void)layoutSubviews
{
[super layoutSubviews];
self.iconImageView.image = [self.iconImageView.image imageWithTintColor:UIColor.white];
[self.iconImageView.layer setCornerRadius:self.iconImageView.height / 2];
}
- (NSDictionary *)selectedTitleAttributes {
return @{
NSForegroundColorAttributeName : [UIColor blackPrimaryText],
NSFontAttributeName : [UIFont bold17]
};
- (NSDictionary *)selectedTitleAttributes
{
return @{NSForegroundColorAttributeName: [UIColor blackPrimaryText], NSFontAttributeName: [UIFont bold17]};
}
- (NSDictionary *)unselectedTitleAttributes {
return @{
NSForegroundColorAttributeName : [UIColor blackPrimaryText],
NSFontAttributeName : [UIFont regular17]
};
- (NSDictionary *)unselectedTitleAttributes
{
return @{NSForegroundColorAttributeName: [UIColor blackPrimaryText], NSFontAttributeName: [UIFont regular17]};
}
@end

View File

@@ -2,7 +2,7 @@
@interface MWMSearchSuggestionCell ()
@property (weak, nonatomic) IBOutlet UIImageView * icon;
@property(weak, nonatomic) IBOutlet UIImageView * icon;
@end
@@ -17,12 +17,12 @@
- (NSDictionary *)selectedTitleAttributes
{
return @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.bold16};
return @{NSForegroundColorAttributeName: UIColor.linkBlue, NSFontAttributeName: UIFont.bold16};
}
- (NSDictionary *)unselectedTitleAttributes
{
return @{NSForegroundColorAttributeName : UIColor.linkBlue, NSFontAttributeName : UIFont.regular16};
return @{NSForegroundColorAttributeName: UIColor.linkBlue, NSFontAttributeName: UIFont.regular16};
}
#pragma mark - Properties