| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // RADetailLocationCell.m
- // Apex And Drivers
- //
- // Created by Jack on 2018/6/2.
- // Copyright © 2018年 USAI. All rights reserved.
- //
- #import "RADetailLocationCell.h"
- #import "RADetailLocationModel.h"
- //#import <MapKit/MapKit.h>
- @interface RADetailLocationCell ()
- @property (strong, nonatomic) IBOutlet UILabel *titleLabel;
- @property (strong, nonatomic) IBOutlet UIButton *navigationBtn;
- @property (strong, nonatomic) IBOutlet UITextView *valueLabel;
- @end
- @implementation RADetailLocationCell
- - (void)awakeFromNib {
- [super awakeFromNib];
- // Initialization code
- self.valueLabel.textContainerInset = UIEdgeInsetsMake(0, -5, 0, -5);
- }
- - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
- [super setSelected:selected animated:animated];
- // Configure the view for the selected state
- }
- - (void)prepareForReuse {
- [super prepareForReuse];
-
- self.model = nil;
- self.delegate = nil;
- }
- - (void)setModel:(RADetailLocationModel *)model {
- _model = model;
-
- self.titleLabel.text = _model.title;
- self.valueLabel.text = _model.location;
-
- if (_model.highlight) {
- self.valueLabel.textColor = [UIColor redColor];
- } else{
- self.valueLabel.textColor = [UIColor blackColor];
- }
-
- if (model.detectTel) {
- self.valueLabel.dataDetectorTypes = UIDataDetectorTypePhoneNumber;
- } else {
- self.valueLabel.dataDetectorTypes = UIDataDetectorTypeNone;
- }
- }
- #pragma mark - User Action
- - (IBAction)navigationBtnClick:(UIButton *)sender {
- if (self.delegate && [self.delegate respondsToSelector:@selector(locationCell:didClickNavigation:)]) {
- [self.delegate locationCell:self didClickNavigation:self.model];
- }
- }
- @end
|