Files
comaps/iphone/Maps/UI/Search/MWMSearchNoResults.m
Konstantin Pastbin e3e4a1985a Organic Maps sources as of 02.04.2025 (fad26bbf22ac3da75e01e62aa01e5c8e11861005)
To expand with full Organic Maps and Maps.ME commits history run:
  git remote add om-historic [om-historic.git repo url]
  git fetch --tags om-historic
  git replace squashed-history historic-commits
2025-05-08 21:10:51 +07:00

38 lines
1.0 KiB
Objective-C

#import "MWMSearchNoResults.h"
static CGFloat const kCompactHeight = 216;
static CGFloat const kExtraCompactHeight = 52;
@interface MWMSearchNoResults ()
@property(weak, nonatomic) IBOutlet UILabel * title;
@property(weak, nonatomic) IBOutlet UILabel * text;
@property(weak, nonatomic) IBOutlet NSLayoutConstraint * textCenterY;
@end
@implementation MWMSearchNoResults
+ (instancetype)viewWithImage:(UIImage *)image title:(NSString *)title text:(NSString *)text {
MWMSearchNoResults * view =
[NSBundle.mainBundle loadNibNamed:[self className] owner:nil options:nil].firstObject;
if (title) {
view.title.text = title;
} else {
[view.title removeFromSuperview];
}
view.text.text = text;
return view;
}
- (void)layoutSubviews {
[super layoutSubviews];
self.frame = self.superview.bounds;
BOOL compact = self.height < kCompactHeight;
self.textCenterY.priority = compact ? UILayoutPriorityDefaultHigh : UILayoutPriorityFittingSizeLevel;
BOOL extraCompact = self.height < kExtraCompactHeight;
self.title.hidden = extraCompact;
}
@end