添加技能卡引导提示

This commit is contained in:
chenguilong
2022-01-19 16:29:07 +08:00
parent 7d6fe95f65
commit bc5936fdd8
7 changed files with 160 additions and 2 deletions

View File

@@ -137,6 +137,7 @@
9B92A3442797EE6500AD168F /* XPMatchManagePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3432797EE6500AD168F /* XPMatchManagePresenter.m */; };
9B92A3472797EECD00AD168F /* XPMatchManageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3462797EECD00AD168F /* XPMatchManageViewController.m */; };
9B92A34A2797F35E00AD168F /* XPMatchManageTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3492797F35E00AD168F /* XPMatchManageTableViewCell.m */; };
9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */; };
9BAA5FED277A1BBE007453F3 /* XPPrivacyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */; };
9BAA5FF0277A23F4007453F3 /* XPPermissionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BAA5FEF277A23F4007453F3 /* XPPermissionsViewController.m */; };
9BB549592782E6A30090CD26 /* XPNobleCenterPresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 9BB549582782E6A30090CD26 /* XPNobleCenterPresenter.m */; };
@@ -770,6 +771,8 @@
9B92A3462797EECD00AD168F /* XPMatchManageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMatchManageViewController.m; sourceTree = "<group>"; };
9B92A3482797F35E00AD168F /* XPMatchManageTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMatchManageTableViewCell.h; sourceTree = "<group>"; };
9B92A3492797F35E00AD168F /* XPMatchManageTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMatchManageTableViewCell.m; sourceTree = "<group>"; };
9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineSkillTipView.h; sourceTree = "<group>"; };
9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineSkillTipView.m; sourceTree = "<group>"; };
9BAA5FEB277A1BBE007453F3 /* XPPrivacyViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPrivacyViewController.h; sourceTree = "<group>"; };
9BAA5FEC277A1BBE007453F3 /* XPPrivacyViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPPrivacyViewController.m; sourceTree = "<group>"; };
9BAA5FEE277A23F4007453F3 /* XPPermissionsViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPPermissionsViewController.h; sourceTree = "<group>"; };
@@ -4164,6 +4167,8 @@
E824544D26F5BC1A00BE8163 /* XPMineModifPayPwdView.m */,
E824545726F5E65900BE8163 /* XPMineVerifIdentityView.h */,
E824545826F5E65900BE8163 /* XPMineVerifIdentityView.m */,
9B92A3372797BE4500AD168F /* XPMineSkillTipView.h */,
9B92A3382797BE4500AD168F /* XPMineSkillTipView.m */,
);
path = SubViews;
sourceTree = "<group>";
@@ -4558,6 +4563,7 @@
E824544326F58FCE00BE8163 /* XPMinePayPwdInputView.m in Sources */,
1808073027315E8E001FD836 /* NetImageView.m in Sources */,
18486235271EB794005FC5DC /* AgoraRtcImpl.m in Sources */,
9B92A3392797BE4500AD168F /* XPMineSkillTipView.m in Sources */,
E8A1E454276208E500B294CA /* CandyTreeInfoModel.m in Sources */,
E8C1CD7A27D8B29E00376F83 /* RoomFaceInfoModel.m in Sources */,
E81C1B1C27705F6B0020D1E4 /* XPArrangeMicPresenter.m in Sources */,

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "mine_skillCard_guild@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "mine_skillCard_guild@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

View File

@@ -0,0 +1,19 @@
//
// XPMineSkillTipView.h
// xplan-ios
//
// Created by GreenLand on 2022/1/19.
//
#import <UIKit/UIKit.h>
static NSString * const kYinyouSkillCardTipKey = @"kYinyouSkillCardTipKey";
NS_ASSUME_NONNULL_BEGIN
@interface XPMineSkillTipView : UIView
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,85 @@
//
// XPMineSkillTipView.m
// xplan-ios
//
// Created by GreenLand on 2022/1/19.
//
#import "XPMineSkillTipView.h"
///Third
#import <Masonry/Masonry.h>
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
@interface XPMineSkillTipView()
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIImageView *tipImageView;
@end
@implementation XPMineSkillTipView
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
}
return self;
}
#pragma mark - Response
- (void)onTapSkillTip:(UITapGestureRecognizer *)ges {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:@"isShow" forKey:kYinyouSkillCardTipKey];
[defaults synchronize];
[self removeFromSuperview];
}
#pragma mark - Private Method
- (void)initSubViews {
[self addSubview:self.bgView];
[self addSubview:self.tipImageView];
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onTapSkillTip:)];
[self.tipImageView addGestureRecognizer:tap];
}
- (void)initSubViewConstraints {
CGFloat nobleH = (KScreenWidth - 30.0)/ 345.0 * 44;
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(0);
}];
CGFloat margin = ((KScreenWidth - 30) / 3 - 40) * 0.5 * 0.5;
CGFloat mutiple = 405/292.0;
[self.tipImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(123 + nobleH + kSafeAreaTopHeight + kStatusBarHeight);
make.centerX.mas_equalTo(self);
// make.width.mas_equalTo(292);
// make.height.mas_equalTo(405);
make.height.mas_equalTo(self.tipImageView.mas_width).multipliedBy(mutiple);
make.right.mas_equalTo(-15 - margin);
}];
}
- (UIView *)bgView {
if (!_bgView) {
_bgView = [[UIView alloc] init];
_bgView.backgroundColor = [ThemeColor tabbarNormalColor];
}
return _bgView;
}
- (UIImageView *)tipImageView {
if (!_tipImageView) {
_tipImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_skillCard_guild"]];
_tipImageView.contentMode = UIViewContentModeScaleAspectFit;
_tipImageView.userInteractionEnabled = YES;
}
return _tipImageView;
}
@end

View File

@@ -24,6 +24,7 @@
#import "XPMineMenuTableViewCell.h"
#import "XPMineHeadItemTableViewCell.h"
#import "XPMineHeadView.h"
#import "XPMineSkillTipView.h"
///VC
#import "XPMineSettingViewController.h"
#import "XPMineTeenagerViewController.h"
@@ -55,6 +56,8 @@
///
@property (nonatomic,strong) UserInfoModel *userInfo;
@property (nonatomic, strong) XPMineSkillTipView *skillTipView;
@end
@implementation XPMineViewController
@@ -71,6 +74,7 @@
[super viewDidLoad];
[self initSubViews];
[self initSubViewConstraints];
[self showSkillCardTipView];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -93,6 +97,9 @@
self.tableView.tableHeaderView = self.headView;
[self.presenter getNormalItems];
[self.presenter getCardItems];
if (@available(iOS 15.0, *)) {//iOS1522
self.tableView.sectionHeaderTopPadding = 0;
}
}
- (void)initSubViewConstraints {
@@ -111,6 +118,17 @@
}];
}
///
- (void)showSkillCardTipView {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *skillCardTip = [defaults objectForKey:kYinyouSkillCardTipKey];
if (!skillCardTip) {
UIWindow *window = [UIApplication sharedApplication].delegate.window;
[window addSubview:self.skillTipView];
[window bringSubviewToFront:self.skillTipView];
}
}
- (void)pushViewControllerWithType:(XPMineItemType)type {
switch (type) {
case XPMineItemType_Match_Manage: {
@@ -250,9 +268,9 @@
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 1) {
return 0;
return 13;
}
return 0;
return 16;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
@@ -307,6 +325,7 @@
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.userInfo = userInfo;
self.headView.userInfo = userInfo;
[self.tableView reloadData];
}
#pragma mark - XPMineHeadItemTableViewCellDelegate
@@ -357,4 +376,11 @@
return _bgImageView;
}
- (XPMineSkillTipView *)skillTipView {
if (!_skillTipView) {
_skillTipView = [[XPMineSkillTipView alloc] initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
}
return _skillTipView;
}
@end