当前位置: 首页 > 编程日记 > 正文

swift3.0友盟分享

经过(一)的讲解,大家应该可以按照友盟提供的测试账号可以集成友盟分享了,友盟目前集合了18APP27种分享,可以授权的有10App:微信、QQ、新浪微博、腾讯微博、人人网、豆瓣、FacebookTwitterLinkedin领英、Kakao
(二)主要在(一)基础上加了音乐、视频分享,替换了友盟的部分测试账号为自己申请的appKeyappSecret,注意替换时不仅要替换AppDelegate.Swift中的application didFinishLaunchingWithOptions的代码,还要同时替换Info中的URL Types,两者是配套使用的!

作者首先申请了友盟的Appkey 5832b93b99f0c74ef10019c8,在didFinishLaunchingWithOptions的代码中替换,同时对微博微信 QQ这三个主流的Open平台进行了申请

微博

1577306477

b1f0cd8cd2140c407a8c20c319155df8

QQ

1105839186

CKFSBH6Fw21RN5pu

微信

wxd795d58c78ac222b

779c58188ca57046f76353ea1e84412c

代码如下

[objc] view plaincopy
在CODE上查看代码片派生到我的代码片
  1. //
  2. //  AppDelegate.swift
  3. //  umengtest
  4. //
  5. //  Created by targetcloud on 2016/11/21.
  6. //  Copyright © 2016年 targetcloud. All rights reserved.
  7. //
  8. import UIKit
  9. @UIApplicationMain
  10. class AppDelegate: UIResponder, UIApplicationDelegate {
  11. var window: UIWindow?
  12. func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
  13. UMSocialManager.default().openLog(true)
  14. UMSocialManager.default().umSocialAppkey = "57b432afe0f55a9832001a0a"
  15. //        UMSocialManager.default().umSocialAppkey = "5832b93b99f0c74ef10019c8"
  16. print("UMeng social version:\(UMSocialGlobal.umSocialSDKVersion())" );
  17. UMSocialManager.default().setPlaform(UMSocialPlatformType.wechatSession, appKey"wxdc1e388c3822c80b", appSecret"3baf1193c85774b3fd9d18447d76cab0", redirectURL"http://mobile.umeng.com/social")
  18. //        UMSocialManager.default().setPlaform(UMSocialPlatformType.wechatSession, appKey: "wxd795d58c78ac222b", appSecret: "779c58188ca57046f76353ea1e84412c", redirectURL: "http://mobile.umeng.com/social")
  19. UMSocialManager.default().setPlaform(UMSocialPlatformType.QQ, appKey"100424468", appSecret: nil, redirectURL"http://mobile.umeng.com/social")
  20. //        UMSocialManager.default().setPlaform(UMSocialPlatformType.QQ, appKey: "1105839186", appSecret: nil, redirectURL: "http://mobile.umeng.com/social")
  21. UMSocialManager.default().setPlaform(UMSocialPlatformType.alipaySession, appKey"2015111700822536", appSecret: nil, redirectURL"http://mobile.umeng.com/social")
  22. UMSocialManager.default().setPlaform(UMSocialPlatformType.yixinSession, appKey"yx35664bdff4db42c2b7be1e29390c1a06", appSecret: nil, redirectURL"http://mobile.umeng.com/social")
  23. UMSocialManager.default().setPlaform(UMSocialPlatformType.laiWangSession, appKey"8112117817424282305", appSecret"9996ed5039e641658de7b83345fee6c9", redirectURL"http://mobile.umeng.com/social")
  24. UMSocialManager.default().setPlaform(UMSocialPlatformType.sina, appKey"3921700954", appSecret"04b48b094faeb16683c32669824ebdad", redirectURL"http://sns.whalecloud.com/sina2/callback")
  25. //        UMSocialManager.default().setPlaform(UMSocialPlatformType.sina, appKey: "1577306477", appSecret: "b1f0cd8cd2140c407a8c20c319155df8", redirectURL: "http://sns.whalecloud.com/sina2/callback")
  26. UMSocialManager.default().setPlaform(UMSocialPlatformType.linkedin, appKey"81t5eiem37d2sc", appSecret"7dgUXPLH8kA8WHMV", redirectURL"https://api.linkedin.com/v1/people")
  27. UMSocialManager.default().setPlaform(UMSocialPlatformType.twitter, appKey"fB5tvRpna1CKK97xZUslbxiet", appSecret"YcbSvseLIwZ4hZg9YmgJPP5uWzd4zr6BpBKGZhf07zzh3oj62K", redirectURL: nil)
  28. UMSocialManager.default().setPlaform(UMSocialPlatformType.facebook, appKey"506027402887373", appSecret: nil, redirectURL"http://www.umeng.com/social")
  29. UMSocialManager.default().setPlaform(UMSocialPlatformType.pinterest, appKey"4864546872699668063", appSecret: nil, redirectURL: nil)
  30. //        UMSocialManager.default().removePlatformProvider(withPlatformTypes: [UMSocialPlatformType.wechatFavorite,UMSocialPlatformType.yixinTimeLine,UMSocialPlatformType.laiWangTimeLine,UMSocialPlatformType.qzone])
  31. return true
  32. }
  33. func application(_ application: UIApplication, open url: URL, sourceApplication: String?, annotation: Any) -> Bool {
  34. let result = UMSocialManager.default().handleOpen(url)
  35. if !result{
  36. }
  37. return result
  38. }
  39. func application(_ application: UIApplication, handleOpen url: URL) -> Bool {
  40. let result = UMSocialManager.default().handleOpen(url)
  41. if !result{
  42. }
  43. return result
  44. }
  45. }

[objc] view plaincopy
在CODE上查看代码片派生到我的代码片
  1. //
  2. //  ViewController.swift
  3. //  umengtest
  4. //
  5. //  Created by targetcloud on 2016/11/21.
  6. //  Copyright © 2016年 targetcloud. All rights reserved.
  7. //
  8. import UIKit
  9. class ViewController: UIViewController {
  10. override func viewDidLoad() {
  11. super.viewDidLoad()
  12. let shareButton:UIButton = UIButton(frame: CGRect(x: 50, y50, width200, height50))
  13. //        shareButton.center = CGPoint(x: self.view.frame.size.width / 2, y: self.view.frame.size.height / 2)
  14. shareButton.setTitle("Swift图文分享", for: UIControlState())
  15. shareButton.addTarget(self, action: #selector(shareAction_pic), for: UIControlEvents.touchUpInside)
  16. shareButton.setTitleColor(UIColor.blue, for: UIControlState())
  17. shareButton.backgroundColor = UIColor.clear
  18. let sharewww : UIButton = UIButton(frame: CGRect(x: 50, y100, width200, height50))
  19. sharewww.setTitle("Swift网页分享", for: UIControlState())
  20. sharewww.addTarget(self, action: #selector(shareAction_www), for: UIControlEvents.touchUpInside)
  21. sharewww.setTitleColor(UIColor.blue, for: UIControlState())
  22. sharewww.backgroundColor = UIColor.clear
  23. let sharetxt : UIButton = UIButton(frame: CGRect(x: 50, y150, width200, height50))
  24. sharetxt.setTitle("Swift文字分享", for: UIControlState())
  25. sharetxt.addTarget(self, action: #selector(shareAction_txt), for: UIControlEvents.touchUpInside)
  26. sharetxt.setTitleColor(UIColor.blue, for: UIControlState())
  27. sharetxt.backgroundColor = UIColor.clear
  28. let shareMusic : UIButton = UIButton(frame: CGRect(x: 50, y200, width200, height50))
  29. shareMusic.setTitle("Swift音乐分享", for: UIControlState())
  30. shareMusic.addTarget(self, action: #selector(shareAction_music), for: UIControlEvents.touchUpInside)
  31. shareMusic.setTitleColor(UIColor.blue, for: UIControlState())
  32. shareMusic.backgroundColor = UIColor.clear
  33. let shareVideo : UIButton = UIButton(frame: CGRect(x: 50, y250, width200, height50))
  34. shareVideo.setTitle("Swift视频分享", for: UIControlState())
  35. shareVideo.addTarget(self, action: #selector(shareAction_video), for: UIControlEvents.touchUpInside)
  36. shareVideo.setTitleColor(UIColor.blue, for: UIControlState())
  37. shareVideo.backgroundColor = UIColor.clear
  38. self.view.addSubview(shareButton)
  39. self.view.addSubview(sharewww)
  40. self.view.addSubview(sharetxt)
  41. self.view.addSubview(shareMusic)
  42. self.view.addSubview(shareVideo)
  43. }
  44. func shareAction_pic (){
  45. UMSocialUIManager.showShareMenuViewInWindow {[weak self] (shreMenuView, platformType) in
  46. let messageObject:UMSocialMessageObject = UMSocialMessageObject.init()
  47. messageObject.text = "友盟分享测试(图片),swift3.0 Xcode8.1 umeng6.0.3 作者:targetcloud"
  48. let shareObject:UMShareImageObject = UMShareImageObject.init()
  49. shareObject.title = "图片分享"
  50. shareObject.descr = "这里是图片分享测试,作者:targetcloud"
  51. shareObject.thumbImage = UIImage.init(named: "icon")
  52. shareObject.shareImage = "http://dev.umeng.com/images/tab2_1.png"
  53. messageObject.shareObject = shareObject;
  54. UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewControllerself, completion: { (shareResponse, error) in
  55. if error != nil {
  56. print("Share Fail with error :%@", error)
  57. }else{
  58. self?.getUserInfoForPlatform(platformType: platformType)
  59. print("Share succeed")
  60. }
  61. })
  62. }
  63. }
  64. func shareAction_www (){
  65. UMSocialUIManager.showShareMenuViewInWindow {[weak self] (shreMenuView, platformType) in
  66. let messageObject:UMSocialMessageObject = UMSocialMessageObject.init()
  67. messageObject.text = "友盟分享测试(网页),swift3.0 Xcode8.1 umeng6.0.3 作者:targetcloud"
  68. let shareObject:UMShareWebpageObject = UMShareWebpageObject.init()
  69. shareObject.title = "网页分享"
  70. shareObject.descr = "这里是网页分享测试,作者:targetcloud"
  71. shareObject.thumbImage = UIImage.init(named: "icon")
  72. shareObject.webpageUrl = "http://video.sina.com.cn/p/sports/cba/v/2013-10-22/144463050817.html"
  73. messageObject.shareObject = shareObject;
  74. UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewControllerself, completion: { (shareResponse, error) in
  75. if error != nil {
  76. print("Share Fail with error :%@", error)
  77. }else{
  78. self?.getUserInfoForPlatform(platformType: platformType)
  79. print("Share succeed")
  80. }
  81. })
  82. }
  83. }
  84. func shareAction_txt (){
  85. UMSocialUIManager.showShareMenuViewInWindow {[weak self] (shareSelectionView:UMShareMenuSelectionView?, platformType:UMSocialPlatformType) in
  86. let messageObject : UMSocialMessageObject = UMSocialMessageObject.init()
  87. messageObject.text = "友盟分享测试(文本),swift3.0 Xcode8.1 umeng6.0.3 作者:targetcloud"
  88. UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewControllerself, completion: { (data:Any?, error:Error?) in
  89. if error != nil {
  90. print("************Share fail with error *********",error)
  91. }else{
  92. UMSocialManager.default().getUserInfo(with: platformType, currentViewControllerself, completion: { (result:Any?, error:Error?) in
  93. if let userinfo  = result as? UMSocialUserInfoResponse{
  94. let message = " name: \(userinfo.name)\n icon: \(userinfo.iconurl)\n gender: \(userinfo.gender)\n"
  95. print(message)
  96. }
  97. })
  98. if let resp:UMSocialShareResponse = data as? UMSocialShareResponse  {
  99. print("response message is ",resp.message ?? "")
  100. print("response originalResponse data is ",resp.originalResponse ?? "")
  101. }
  102. print("response data is ",data)
  103. }
  104. self?.alertWithError(error: error)
  105. })
  106. }
  107. }
  108. func shareAction_music (){
  109. UMSocialUIManager.showShareMenuViewInWindow {[weak self] (shareSelectionView:UMShareMenuSelectionView?, platformType:UMSocialPlatformType) in
  110. let messageObject : UMSocialMessageObject = UMSocialMessageObject.init()
  111. messageObject.text = "友盟分享测试(音乐),swift3.0 Xcode8.1 umeng6.0.3 作者:targetcloud"
  112. let shareObject:UMShareMusicObject = UMShareMusicObject.init()
  113. shareObject.title = "音乐分享"
  114. shareObject.descr = "这里是音乐分享测试,作者:targetcloud"
  115. shareObject.thumbImage = UIImage.init(named: "icon")
  116. shareObject.musicUrl = "http://c.y.qq.com/v8/playsong.html?songid=108782194&source=yqq#wechat_redirect"
  117. messageObject.shareObject = shareObject;
  118. UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewControllerself, completion: { (data:Any?, error:Error?) in
  119. if error != nil {
  120. print("************Share fail with error *********",error)
  121. }else{
  122. if let resp:UMSocialShareResponse = data as? UMSocialShareResponse  {
  123. print("response message is ",resp.message ?? "")
  124. print("response originalResponse data is ",resp.originalResponse ?? "")
  125. }
  126. print("response data is ",data)
  127. }
  128. self?.alertWithError(error: error)
  129. })
  130. }
  131. }
  132. func shareAction_video (){
  133. UMSocialUIManager.showShareMenuViewInWindow {[weak self] (shareSelectionView:UMShareMenuSelectionView?, platformType:UMSocialPlatformType) in
  134. let messageObject : UMSocialMessageObject = UMSocialMessageObject.init()
  135. messageObject.text = "友盟分享测试(视频),swift3.0 Xcode8.1 umeng6.0.3 作者:targetcloud"
  136. let shareObject:UMShareVideoObject = UMShareVideoObject.init()
  137. shareObject.title = "视频分享"
  138. shareObject.descr = "这里是视频分享测试,作者:targetcloud"
  139. shareObject.thumbImage = UIImage.init(named: "icon")
  140. shareObject.videoUrl = "http://v.youku.com/v_show/id_XMTgyMjI1MjQxNg==.html?f=18252872#paction"
  141. messageObject.shareObject = shareObject;
  142. UMSocialManager.default().share(to: platformType, messageObject: messageObject, currentViewControllerself, completion: { (data:Any?, error:Error?) in
  143. if error != nil {
  144. print("************Share fail with error *********",error)
  145. }else{
  146. if let resp:UMSocialShareResponse = data as? UMSocialShareResponse  {
  147. print("response message is ",resp.message ?? "")
  148. print("response originalResponse data is ",resp.originalResponse ?? "")
  149. }
  150. print("response data is ",data)
  151. }
  152. self?.alertWithError(error: error)
  153. })
  154. }
  155. }
  156. func alertWithError(error:Error?){
  157. var result = ""
  158. if (error == nil) {
  159. result = "恭喜你,分享成功!邀请好友一起玩吧!"
  160. }else{
  161. if(error != nil){
  162. result = "分享失败,此功能正在努力开通中..."
  163. }else{
  164. result = "额,分享失败了!"
  165. }
  166. }
  167. let alert = UIAlertView.init(title: "越分享,越快乐!", message: result, delegate: nil, cancelButtonTitle: NSLocalizedString("确定", comment"确定"))
  168. alert.show()
  169. }
  170. func getUserInfoForPlatform(platformType:UMSocialPlatformType){
  171. UMSocialManager.default().getUserInfo(with: platformType, currentViewControllerself, completion: { (result:Any?, error:Error?) in
  172. if let userinfo  = result as? UMSocialUserInfoResponse {
  173. let message = " name: \(userinfo.name)\n icon: \(userinfo.iconurl)\n gender: \(userinfo.gender)\n"
  174. print(message)
  175. let alert = UIAlertView.init(title: "UserInfo", message: message, delegate: nil, cancelButtonTitle: NSLocalizedString("确定", comment"确定"))
  176. alert.show()
  177. }
  178. })
  179. }
  180. }




集成步骤不再重复,请按照(一)是肯定可以成功集成的

运行效果如下,图片(共20张):先是按友盟的账号进行微信聊天(1234微信朋友圈(567)收藏(89)三个功能测试的,

接着测试了QQ101112 QQ 空间(1314),接着换为自己的账号进行微博测试(1516),微信(171819)、微信朋友圈(20




















相关文章:

C++11中std::future的使用

C11中的std::future是一个模板类。std::future提供了一种用于访问异步操作结果的机制。std::future所引用的共享状态不能与任何其它异步返回的对象共享(与std::shared_future相反)( std::future references shared state that is not shared with any other asynchronous retur…

给算法工程师和研究员的「霸王餐」| 附招聘信息

现在的算法工程师真的是太难了!要让AI会看人眼都分辨不清的医疗影像!数据又不够,还得用前沿技术!好不容易学会看片,还要让AI会分析病理!然后模型搞出来了,还要把几十种模型,做N次计算…

swift3.0三种反向传值

一 :通知 1.通知传值所用方法 // MARK: - private methods(内部接口) let NotifMycation NSNotification.Name(rawValue:"MyNSNotification") func tempbuttonAction() { //这个方法可以传一个值 NotificationCenter.default.post(name: NotifMycation, object: &q…

C++11中std::shared_future的使用

C11中的std::shared_future是个模板类。与std::future类似,std::shared_future提供了一种访问异步操作结果的机制;不同于std::future,std::shared_future允许多个线程等待同一个共享状态;不同于std::future仅支持移动操作&#xf…

聊聊抖音、奈飞、Twitch、大疆、快手、B站的多媒体关键技术

随着5G牌照发放,5G终端正在迎来集中上市潮,对于5G带来的变革一触即发。目前互联网上超过七成的流量来自多媒体,未来这个比例将超过八成。音视频就像空气和水一样普及,深度到每个人的生活和工作中。同时,深度学习技术则…

Linux安全事件应急响应排查方法总结

Linux安全事件应急响应排查方法总结 Linux是服务器操作系统中最常用的操作系统,因为其拥有高性能、高扩展性、高安全性,受到了越来越多的运维人员追捧。但是针对Linux服务器操作系统的安全事件也非常多的。攻击方式主要是弱口令攻击、远程溢出攻击及其他…

C++11中std::packaged_task的使用

C11中的std::packaged_task是个模板类。std::packaged_task包装任何可调用目标(函数、lambda表达式、bind表达式、函数对象)以便它可以被异步调用。它的返回值或抛出的异常被存储于能通过std::future对象访问的共享状态中。 std::packaged_task类似于std::function&#xff0c…

Swift3.0和OC桥接方法

1.直接在工程中commandn,出现如图,点击Header File创建桥接文件Bridging-Header.h,如图: 2.点击next,出现如图画面,一定要记得勾选第一项,再点击create创建完成。 3.配置桥接文件,点击target - …

量子算命,在线掷筊:一个IBM量子云计算机的应用实践,代码都有了

整理 | Jane 出品| AI科技大本营(ID:rgznai100) “算命”,古今中外,亘古不衰的一门学问,哪怕到了今天,大家对算命占卜都抱着一些”敬畏“的信任心理,西方流行塔罗牌,国…

rails应用ajax之二:使用rails自身支持

考虑另一种情况: 1. 页面上半部分显示当前的所有用户,页面下半部分是输入新用户的界面; 2. 每当输入新用户时,页面上半部分会动态更新新加用户的内容; 我们还是用ajax实现,不过这次用rails内部对ajax的支持…

C++11中std::async的使用

C11中的std::async是个模板函数。std::async异步调用函数,在某个时候以Args作为参数(可变长参数)调用Fn,无需等待Fn执行完成就可返回,返回结果是个std::future对象。Fn返回的值可通过std::future对象的get成员函数获取。一旦完成Fn的执行&…

BAT数据披露:缺人!110万AI人才缺口,两者矛盾,凉凉了!

人工智能到底有多火?近日国内首份《BAT人工智能领域人才发展报告》新鲜出炉,此次报告是针对国内人工智能领域的人才争夺情况进行了梳理。并把研究对象锁定在BAT三大巨头的身上。来源:《BAT人工智能领域人才发展报告》其中得出最为核心的结论&…

swift3.0最新拨打电话方法

let alertVC : UIAlertController UIAlertController.init(title: "是否拨打报警电话:10086", message: "", preferredStyle: .alert) let falseAA : UIAlertAction UIAlertAction.init(title: "取消", style: .cancel, handler: nil) let tr…

关于手机已处理里重复单据的处理办法

更新视图 VWFE_TASK去掉 union TWFE_TASK_BAK 的部分,原因是因为后面做了流程预演导致的问题转载于:https://blog.51cto.com/iderun/1602828

swiftswift3.0自己封装的快速构建页面的方法

//#param mark 控件 func creatLabel(frame:CGRect,text:String,textColor:UIColor,textFont:CGFloat,textAlignment:NSTextAlignment) -> UILabel { let label UILabel.init(frame: frame) label.text text label.textColor textColor label.font UIFont.systemFont(of…

Google是如何做Code Review的?| CSDN原力计划

作者 | 帅昕 xindoo 编辑 | 屠敏出品 | CSDN 博客我和几个小伙伴一起翻译了Google前一段时间放出来的Google’s Engineering Practices documentation(https://github.com/google/eng-practices),翻译后的GitHub仓库:https://gith…

从FFmpeg 4. 2源码中提取dshow mjpeg code步骤

之前在https://blog.csdn.net/fengbingchun/article/details/103735560 中介绍过在Windows上通过vs2017编译FFmpeg源码进行单步调试的步骤,为了进一步熟悉FFmpeg这里以提取FFmpeg dshow mjpeg源码为例介绍其实现过程及注意事项: FFmpeg是用C实现的&…

ControlButton按钮事件

#ifndef __HControlButton_H__#define __HControlButton_H__#include "cocos2d.h"#include "cocos-ext.h"USING_NS_CC;USING_NS_CC_EXT; //用于标识当前按钮的状态typedef enum{ touch_begin, touch_down, touch_up,}tagForTouch;class HControlB…

swift3.0UIAlertController使用方法

let alertVC : UIAlertController UIAlertController.init(title: "添加照片", message: "", preferredStyle: .actionSheet) let cleanAction UIAlertAction(title: "取消", style: UIAlertActionStyle.cancel,handler:nil) let photoActi…

Doxygen使用介绍

Doxygen的主页为http://doxygen.nl/,它的license为GPL,最新发布版本为1.8.17,源代码存放在https://github.com/doxygen/doxygen,它支持的语言包括C、C、Objective-C、C#、Java、Python等,它支持的系统平台包括Winodws、…

云计算软件生态圈:摸到一把大牌

作者 | 老姜编辑 | 阿秃出品 | CSDN云计算(ID:CSDNcloud)“我觉得我摸着了一把大牌。”软件领域的新锐企业——有赞公司创始人兼CEO白鸦在转向SaaS领域的一个细分市场时,曾对天使投资人这样说。而老牌软件企业金蝶创始人徐少春在2…

iOS封装HTTPS双向和单向验证

1.HttpsUtil (1) 对双向和单向验证的封装 #import <Foundation/Foundation.h> #import "AFNetworking.h" interface HttpsUtil : NSObject // 双向认证 (void)configHTTPSessionManager:(AFHTTPSessionManager *)manager serverCers:(NSArray *) serverCerNam…

开源库BearSSL介绍及使用

BearSSL是用C语言实现的SSL/TLS协议&#xff0c;它的源码可直接通过git clone https://www.bearssl.org/git/BearSSL 下载&#xff0c;它的license是MIT&#xff0c;最新版本为0.6。 BearSSL的主要特性是&#xff1a; (1). 正确且安全&#xff1a;对不安全的协议版本和算法选…

个推CTO安森:我所理解的数据中台

作者 | 个推CTO安森来源 | 个推技术学院&#xff08;ID:ID: getuitech&#xff09;引言在前面两篇文章&#xff08;《数据智能时代来临&#xff1a;本质及技术体系要求》和《多维度分析系统的选型方法》&#xff09;之中&#xff0c;我们概括性地阐述了对于数据智能的理解&…

玩弹珠手游-杂想

前言 为什么会写这个杂想呢&#xff1f; 因为最近这一个月来&#xff0c;我有点太沉迷怪物弹珠这个游戏了&#xff0c;每天下班回来的时间和上下班路途都在玩这个游戏&#xff0c;占据了我大部分的业余时间&#xff0c;也该是时候放一放玩游戏了。 为什么会玩这个游戏呢&#x…

OC封装时间选择器

#import <UIKit/UIKit.h> protocol TimeDatePickerViewDelegate <NSObject> //必须实现的两个协议 required - (void)changeTime : (NSDate *)date;//当时改变时出发 - (void)daterMine : (NSDate *)date;//更确定时间 end interface TimeDatePickerView :UIView /…

银行卡大小的充电宝,买就送耳机!

每个人的朋友圈和微博上似乎都有那么几个活得让人羡慕的朋友他们的生活看起来不仅精致&#xff0c;还很丰富多彩从早上第一刻就开始了↓出门旅游新一天的穿搭逆天朋友团咖啡馆到书店逼格十足的日料夜景太迷人忍不住发个小视频最后一定不要错过傍晚的夕阳&#xff0c;真的好上镜…

C++中插件使用举例

插件并不是在构建时链接的&#xff0c;而是在运行时发现并加载的。因此&#xff0c;用户可以利用你定义好的插件API来编写自己的插件。这样他们就能以指定方式扩展API的功能。插件库是一个动态库&#xff0c;它可以独立于核心API编译&#xff0c;在运行时根据需要显示加载。不过…

C和C++安全编码笔记:指针诡计

指针诡计(pointer subterfuge)是通过修改指针值来利用程序漏洞的方法的统称。 可以通过覆盖函数指针将程序的控制权转移到攻击者提供的外壳代码(shellcode)。当程序通过函数指针执行一个函数调用时&#xff0c;攻击者提供的代码将会取代原本希望执行的代码而得到执行。 对象指…