MOAnchorTaskRuleView.m 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. //
  2. // MOAnchorTaskRuleView.m
  3. // MiMoLive
  4. //
  5. // Created by SuperC on 2024/6/3.
  6. //
  7. #import "MOAnchorTaskRuleView.h"
  8. @interface MOAnchorTaskRuleView ()
  9. @property (weak, nonatomic) IBOutlet UILabel *titleLab;
  10. @property (weak, nonatomic) IBOutlet UITextView *contentTev;
  11. @end
  12. @implementation MOAnchorTaskRuleView
  13. + (instancetype)moAnchorTaskRuleView{
  14. return [[[NSBundle mainBundle] loadNibNamed:@"MOAnchorTaskRuleView" owner:self options:nil] firstObject];
  15. }
  16. - (void)awakeFromNib{
  17. [super awakeFromNib];
  18. self.titleLab.text = NSLocalString(@"mimo_anchor_task_rule_title");
  19. self.titleLab.font = [MOTextTools getTheFontWithSize:16.0 AndFontName:kNormalTitleFontStr];
  20. self.layer.cornerRadius = 16.0;
  21. self.layer.masksToBounds = YES;
  22. self.layer.maskedCorners = kCALayerMinXMinYCorner | kCALayerMaxXMinYCorner;
  23. self.contentTev.text = NSLocalString(@"mimo_anchor_task_rule_tip");
  24. self.contentTev.editable = NO;
  25. [self.contentTev setFont:[MOTextTools getTheFontWithSize:14.0 AndFontName:kNormalContentFontStr]];
  26. }
  27. - (IBAction)closeBtnClick:(id)sender {
  28. [self dismissAnchorTaskRuleView];
  29. }
  30. - (void)showAnchorTaskRuleView{
  31. self.frame = CGRectMake(0, 0, SCREENWIDTH, 443.0);
  32. CGRect actionViewRect = self.frame;
  33. actionViewRect.origin.x = SCREENWIDTH;
  34. self.frame = actionViewRect;
  35. WEAKSELF
  36. [UIView animateWithDuration:0.3 animations:^{
  37. CGRect actionViewRect = weakSelf.frame;
  38. actionViewRect.origin.x = 0;
  39. weakSelf.frame = actionViewRect;
  40. }];
  41. }
  42. - (void)dismissAnchorTaskRuleView{
  43. //完成下移动画
  44. WEAKSELF
  45. [UIView animateWithDuration:0.3 animations:^
  46. {
  47. CGRect actionSheetViewRect = weakSelf.frame;
  48. actionSheetViewRect.origin.x = SCREENWIDTH;
  49. weakSelf.frame = actionSheetViewRect;
  50. } completion:^(BOOL finished)
  51. {
  52. [self removeFromSuperview];
  53. }];
  54. }
  55. @end