美文网首页
将制作的二维码添加到沙河路径并展示

将制作的二维码添加到沙河路径并展示

作者: 小緈福 | 来源:发表于2018-05-26 11:37 被阅读0次

一.

1.导入制作二维码的第三方libqrencode

2.在viewController中导入头文件

#import "QRCodeGenerator.h"

3.在xib中拖入控件并关联

4. 在制作二维码按钮

self.IMG.image = [QRCodeGenerator qrImageForString:self.contentTF.text imageSize:self.IMG.frame.size.width];

//保存二维码并给与二维码图片名称

    NSString * qq = [NSString stringWithFormat:@"%@/123.png",NSHomeDirectory()];

    [UIImagePNGRepresentation(self.IMG.image) writeToFile:qq atomically:YES];

5.在显示按钮中跳转

[self.navigationController pushViewController:[oneViewController new] animated:YES];

二.

1.在第二个界面创建xib并拖入控件并关联

2.在第二个界面中实现

NSString * qq = [NSString stringWithFormat:@"%@/123.png",NSHomeDirectory()];

    self.IMG1.image  = [UIImage imageWithContentsOfFile:qq]

3.添加系统方法

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    [self.navigationController popViewControllerAnimated:YES];
}

三.

1.导入友盟推送SDK

2.添加依赖库

CoreTelephony.framework

libz.tbd

libsqlite3.tbd

SystemConfiguration.framework

3.在AppDelegate.m导入头文件

#import <UMPush/UMessage.h>

4.Push组件基本功能配置

    UMessageRegisterEntity * entity = [[UMessageRegisterEntity alloc] init];

    //type是对推送的几个参数的选择,可以选择一个或者多个。默认是三个全部打开,即:声音,弹窗,角标

    entity.types = UMessageAuthorizationOptionBadge|UMessageAuthorizationOptionSound|UMessageAuthorizationOptionAlert;

    [UNUserNotificationCenter currentNotificationCenter].delegate=self;

    [UMessage registerForRemoteNotificationsWithLaunchOptions:launchOptions Entity:entity    completionHandler:^(BOOL granted, NSError * _Nullable error) {

        if (granted) {

            UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"推送" message:@"推送授权成功" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

            [alertV show];

        }else{

            UIAlertView *alertV = [[UIAlertView alloc]initWithTitle:@"推送" message:@"推送授权失败" delegate:self cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];

            [alertV show];

        }

    }];

相关文章

  • 将制作的二维码添加到沙河路径并展示

    一. 1.导入制作二维码的第三方libqrencode 2.在viewController中导入头文件 #impo...

  • MenuItem 常用方法

    将场景中GameObject路径添加到剪切板 将prefab路径添加到剪切板

  • pymol module 添加到 python 的 import

    先查看 pymol module 的路径 将 pymol module 的路径添加到 python import ...

  • path全局修改

    vim /etc/paths 将路径添加到 paths文件中 ,一行一个路径

  • Leaflet+D3: 路径

    开发环境 根据d3创建svg,并添加到map地图的overlayPane下 根据点位坐标 生成线 创建路径 将经纬...

  • 动态加载

    替换整个应用的classloader,或将动态路径添加到现有classloader路径中,这种路径必须指向一个压缩...

  • IOS绘图之绘制直线

    使用两种方法绘制直线。绘图的一般步骤: 获取上下文 创建路径并设置路径 将属性添加到上下文 设置上下文属性 绘制路...

  • Core Graphics绘图框架

    一般在控件的draw方法中执行 绘图步骤 1、获取绘图上下文2、创建并设置路径3、将路径添加到上下文4、设置上下文...

  • javaScript之数组常规用法

    1.unshift:将参数添加到原数组开头,并返回数组的长度。 2.push:将参数添加到原数组末尾,并返回数组的...

  • 将已知工具路径添加到系统路径

    在Mac中安装了calibre后,想使用里边的某些功能命令又要找到命令文件的所在路径,很麻烦哎... 执行完以上的...

网友评论

      本文标题:将制作的二维码添加到沙河路径并展示

      本文链接:https://www.haomeiwen.com/subject/zdqmjftx.html