当前位置: 首页 > news >正文

app网站开发河 又杭州网站

app网站开发河 又,杭州网站,商业网站网站建设,上海搬家公司哪家口碑最好本章介绍如何使用ios开发出滑动拼图验证码,分别OC代码和swift代码调用 1.导入项目model文件OC代码(下载完整Demo) 2.放入你需要显示的图片 一:OC调用 #import "ViewController.h" #import "CodeView.h"…

本章介绍如何使用ios开发出滑动拼图验证码,分别OC代码和swift代码调用

1.导入项目model文件OC代码(下载完整Demo)
在这里插入图片描述

2.放入你需要显示的图片
在这里插入图片描述

一:OC调用

#import "ViewController.h"
#import "CodeView.h"@interface ViewController () <CodeViewDelegate>
@property (nonatomic, strong) CodeView * codeView;
@end@implementation ViewController- (void)viewDidLoad {[super viewDidLoad];// Do any additional setup after loading the view, typically from a nib._codeView = [[CodeView alloc]initWithFrame:self.view.frame];[self.view addSubview:_codeView];_codeView.delegate = self;_codeView.passDistance = 2;self.view.backgroundColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.8];
}- (void)codeViewAuthenticationResult:(BOOL)result
{NSLog(@"验证%@通过", result ? @"" : @"不");
}- (void)viewWillAppear:(BOOL)animated
{[super viewWillAppear:animated];[_codeView setCodeImage:[UIImage imageNamed:@"testB.jpg"]];
}- (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];// Dispose of any resources that can be recreated.
}@end

二:swift调用

import UIKitclass MeViewController: BaseViewController,CodeViewDelegate{private var codeView = CodeView()private let meView = MeView()override func initData() {// 显示自定义视图弹窗showCustomPopup()}// 显示自定义视图弹窗func showCustomPopup() {// 实例化自定义视图codeView = CodeView(frame: CGRect(x: 0, y: 0, width: ALERTVIEW_WIDTH - 150, height: ALERTVIEW_HEIGHT))// 设置自定义视图的样式和内容// 添加到当前视图控制器的视图上//let customView = CodeView(frame: self.view.frame)
//            self.view.addSubview(codeView)codeView.delegate = selfcodeView.passDistance = 2// 设置自定义视图的布局约束,可以根据需要进行调整codeView.center = self.view.centercodeView.setCodeImage(UIImage(named: "testA.jpg"))meView.addSubview(codeView)// 添加点击背景关闭弹窗的逻辑(可选)let tapGesture = UITapGestureRecognizer(target: self, action: #selector(dismissCustomPopup))codeView.addGestureRecognizer(tapGesture)}// 点击背景关闭弹窗的逻辑(可选)@objc func dismissCustomPopup() {// 移除自定义视图self.view.subviews.forEach { subview inif subview is CodeView {subview.removeFromSuperview()}}}func codeViewAuthenticationResult(_ result: Bool) {print("code%@ == ",result)}
}
http://www.hkea.cn/news/667120/

相关文章:

  • wordpress门户建站html网页完整代码作业
  • 子域名 做单独的网站广州seo外包公司
  • 凡科建设网站的步骤永久免费无代码开发平台网站
  • 建设一个百度百科类网站网站排名优化的技巧
  • 自己做网站可以吗淄博做网站的公司
  • 个人做健康网站好吗宁波网站制作与推广价格
  • 长沙有哪些做网站的连云港seo优化公司
  • 青羊区定制网站建设报价搜索引擎营销方案
  • 淘宝优惠券查询网站怎么做域名备案官网
  • wordpress自定义url优化教程网下载
  • 模板网站和定制网站百度搜索引擎的网址
  • 企业建设网站公司哪家好app拉新推广接单平台
  • 老虎淘客系统可以做网站吗江西省水文监测中心
  • 高港区企业网站建设快速建站教程
  • 怎样写企业网站建设方案北京网站seo招聘
  • 做蛋糕视频的网站软文广告范文
  • h5自适应网站模板下载网站换友链平台
  • 政府网站建设及管理规范各大搜索引擎入口
  • poedit pro wordpress免费网站推广优化
  • 市场营销产品推广策划方案seo合作代理
  • 东莞专业网站建设推广搜索引擎网络排名
  • 服务器做网站用什么环境好销售营销方案100例
  • 如何做DJ网站英文seo外链
  • 网站统计源码下载百度推广的步骤
  • 本地网站建设seo推广的方法
  • 东莞好的网站建设效果seo和sem分别是什么
  • 最新版wordpress背景手机网络优化软件
  • 丛台企业做网站推广免费建一级域名网站
  • 集宁网站建设免费网站推广网站破解版
  • 网站建设域名的购买有域名和服务器怎么建网站