PQRemindView.swift 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515
  1. // MARK: - 设置页退出登录跟注销账号提示视图
  2. /// 设置页退出登录跟注销账号提示视图
  3. open class PQRemindView: UIView {
  4. public var isBanned: Bool = false // 是否是拉黑用户提示
  5. public var isBlank: Bool = false { // 是否是黑色弹窗
  6. didSet {
  7. if isBlank {
  8. contentView.backgroundColor = UIColor.hexColor(hexadecimal: "#212223")
  9. titleLab.textColor = UIColor.white
  10. contentLab.textColor = UIColor.white
  11. cancelBtn.setTitleColor(UIColor.white, for: .normal)
  12. confirmBtn.setTitleColor(UIColor.white, for: .normal)
  13. } else {
  14. contentView.backgroundColor = UIColor.white
  15. contentLab.textColor = UIColor.hexColor(hexadecimal: "#666666")
  16. titleLab.textColor = UIColor.black
  17. cancelBtn.setTitleColor(UIColor.black, for: .normal)
  18. confirmBtn.setTitleColor(UIColor.black, for: .normal)
  19. }
  20. }
  21. }
  22. public var remindBlock: ((_ sender: UIButton, _ remindData: PQBaseModel?) -> Void)?
  23. lazy public var contentView: UIView = {
  24. let contentView = UIView()
  25. contentView.backgroundColor = UIColor.white
  26. contentView.addCorner(corner: 4)
  27. return contentView
  28. }()
  29. lazy public var titleLab: UILabel = {
  30. let titleLab = UILabel()
  31. titleLab.font = UIFont.systemFont(ofSize: 18, weight: .medium)
  32. titleLab.textAlignment = .center
  33. titleLab.numberOfLines = 0
  34. titleLab.textColor = UIColor.black
  35. return titleLab
  36. }()
  37. lazy public var contentLab: UILabel = {
  38. // let contentLab = TYAttributedLabel.init()
  39. // contentLab.textAlignment = CTTextAlignment.center
  40. // contentLab.verticalAlignment = .center
  41. // contentLab.highlightedLinkBackgroundColor = UIColor.white
  42. // contentLab.numberOfLines = 0
  43. // contentLab.font = UIFont.systemFont(ofSize: 14)
  44. // contentLab.textColor = UIColor.hexColor(hexadecimal: "#666666")
  45. let contentLab = UILabel()
  46. contentLab.font = UIFont.systemFont(ofSize: 16)
  47. contentLab.textAlignment = .center
  48. contentLab.numberOfLines = 0
  49. contentLab.textColor = UIColor.hexColor(hexadecimal: "#666666")
  50. return contentLab
  51. }()
  52. lazy public var cancelBtn: UIButton = {
  53. let cancelBtn = UIButton(type: .custom)
  54. cancelBtn.setTitle("取消", for: .normal)
  55. cancelBtn.setTitleColor(UIColor.black, for: .normal)
  56. cancelBtn.tag = 1
  57. cancelBtn.addTarget(self, action: #selector(btnClck(sender:)), for: .touchUpInside)
  58. cancelBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
  59. return cancelBtn
  60. }()
  61. lazy public var confirmBtn: UIButton = {
  62. let confirmBtn = UIButton(type: .custom)
  63. confirmBtn.setTitle("确定", for: .normal)
  64. confirmBtn.setTitleColor(UIColor.black, for: .normal)
  65. confirmBtn.tag = 2
  66. confirmBtn.addTarget(self, action: #selector(btnClck(sender:)), for: .touchUpInside)
  67. confirmBtn.titleLabel?.font = UIFont.systemFont(ofSize: 16, weight: .medium)
  68. return confirmBtn
  69. }()
  70. lazy public var verticalLine: UIView = {
  71. let verticalLine = UIView()
  72. verticalLine.backgroundColor = UIColor.hexColor(hexadecimal: "#E5E5E5")
  73. return verticalLine
  74. }()
  75. lazy public var horizonLine: UIView = {
  76. let horizonLine = UIView()
  77. horizonLine.backgroundColor = UIColor.hexColor(hexadecimal: "#E5E5E5")
  78. return horizonLine
  79. }()
  80. override public init(frame: CGRect) {
  81. super.init(frame: frame)
  82. addSubview(contentView)
  83. contentView.addSubview(titleLab)
  84. contentView.addSubview(contentLab)
  85. contentView.addSubview(cancelBtn)
  86. contentView.addSubview(confirmBtn)
  87. contentView.addSubview(verticalLine)
  88. contentView.addSubview(horizonLine)
  89. backgroundColor = cShadowColor
  90. }
  91. required public init?(coder _: NSCoder) {
  92. fatalError("init(coder:) has not been implemented")
  93. }
  94. public var remindData: PQBaseModel? {
  95. didSet {
  96. addData()
  97. addLayout()
  98. }
  99. }
  100. open func addData() {
  101. titleLab.text = remindData?.title
  102. contentLab.text = remindData?.summary
  103. cancelBtn.setTitleColor(isBanned ? (isBlank ? UIColor.white : UIColor.black) : (isBlank ? UIColor.white : UIColor.hexColor(hexadecimal: "#666666")), for: .normal)
  104. if isBanned {
  105. titleLab.textAlignment = .center
  106. } else {
  107. titleLab.textAlignment = .left
  108. }
  109. }
  110. open func addLayout() {
  111. var summH: CGFloat = 0
  112. var titleH: CGFloat = 0
  113. if (remindData?.summary?.count ?? 0) > 0 {
  114. summH = sizeWithText(text: remindData?.summary ?? "", font: UIFont.systemFont(ofSize: 16, weight: .medium), size: CGSize(width: cScreenWidth - cDefaultMargin * 12, height: CGFloat.greatestFiniteMagnitude)).height + cDefaultMargin
  115. }
  116. if (remindData?.title?.count ?? 0) > 0 {
  117. titleH = sizeWithText(text: remindData?.title ?? "", font: UIFont.systemFont(ofSize: 18, weight: .medium), size: CGSize(width: cScreenWidth - cDefaultMargin * 12, height: CGFloat.greatestFiniteMagnitude)).height + cDefaultMargin
  118. if titleH < cDefaultMargin * 2 {
  119. titleH = cDefaultMargin * 2
  120. }
  121. }
  122. let contentH: CGFloat = cDefaultMargin * 2 + (titleH > 0 ? titleH + cDefaultMargin : 0) + (summH > 0 ? summH + cDefaultMargin : 0) + cDefaultMargin * 3 + (isBanned ? cDefaultMargin * 2 : 0)
  123. contentView.snp.makeConstraints { make in
  124. make.left.equalTo(self).offset(cDefaultMargin * 4)
  125. make.right.equalTo(self).offset(-cDefaultMargin * 4)
  126. make.height.equalTo(contentH)
  127. make.center.equalTo(self)
  128. }
  129. titleLab.snp.makeConstraints { make in
  130. make.left.equalTo(contentView).offset(cDefaultMargin * 2)
  131. make.right.equalTo(contentView).offset(-cDefaultMargin * 2)
  132. make.height.equalTo(titleH)
  133. make.top.equalTo(contentView).offset(cDefaultMargin * 2)
  134. }
  135. contentLab.snp.makeConstraints { make in
  136. make.top.equalTo(titleLab.snp_bottom).offset(summH > 0 ? cDefaultMargin : 0)
  137. make.left.right.equalTo(titleLab)
  138. make.height.equalTo(summH)
  139. }
  140. if isBanned {
  141. let btnW: CGFloat = (cScreenWidth - 1 - cDefaultMargin * 8) / 2
  142. verticalLine.snp.makeConstraints { make in
  143. make.top.equalTo(contentLab.snp_bottom).offset(cDefaultMargin)
  144. make.height.equalTo(1)
  145. make.left.width.equalToSuperview()
  146. }
  147. cancelBtn.snp.makeConstraints { make in
  148. make.left.equalToSuperview()
  149. make.top.equalTo(verticalLine.snp_bottom)
  150. make.width.equalTo(btnW)
  151. make.bottom.equalTo(contentView)
  152. }
  153. horizonLine.snp.makeConstraints { make in
  154. make.left.equalTo(cancelBtn.snp_right)
  155. make.height.top.equalTo(cancelBtn)
  156. make.width.equalTo(1)
  157. }
  158. confirmBtn.snp.makeConstraints { make in
  159. make.right.equalToSuperview()
  160. make.height.width.bottom.equalTo(cancelBtn)
  161. }
  162. } else {
  163. confirmBtn.snp.makeConstraints { make in
  164. make.right.equalTo(titleLab)
  165. make.height.equalTo(cDefaultMargin * 4)
  166. make.width.equalTo(cDefaultMargin * 6)
  167. make.bottom.equalTo(contentView).offset(-cDefaultMargin)
  168. }
  169. cancelBtn.snp.makeConstraints { make in
  170. make.right.equalTo(confirmBtn.snp_left).offset(-cDefaultMargin)
  171. make.height.equalTo(cDefaultMargin * 4)
  172. make.width.equalTo(cDefaultMargin * 6)
  173. make.bottom.equalTo(confirmBtn)
  174. }
  175. }
  176. }
  177. @objc open func btnClck(sender: UIButton) {
  178. removeFromSuperview()
  179. if remindBlock != nil {
  180. remindBlock!(sender, remindData!)
  181. }
  182. }
  183. }
  184. // MARK: 空白提示页
  185. /// 空白提示页
  186. open class PQEmptyRemindView: UIView {
  187. // 回调
  188. public var fullRefreshBloc: ((_ isNetConnected: Bool, _ emptyData: PQEmptyModel?) -> Void)?
  189. lazy public var imageView: UIImageView = {
  190. let imageView = UIImageView()
  191. imageView.backgroundColor = UIColor.clear
  192. imageView.contentMode = .scaleAspectFit
  193. return imageView
  194. }()
  195. lazy public var remindLab: UILabel = {
  196. let remindLab = UILabel()
  197. remindLab.font = UIFont.systemFont(ofSize: 16)
  198. remindLab.numberOfLines = 1
  199. remindLab.textAlignment = NSTextAlignment.center
  200. remindLab.textColor = UIColor.white
  201. return remindLab
  202. }()
  203. // lazy public var shimmeringView: FBShimmeringView = {
  204. // let shimmeringView = FBShimmeringView()
  205. // shimmeringView.isShimmering = false
  206. // shimmeringView.shimmeringBeginFadeDuration = 0.3
  207. // shimmeringView.shimmeringEndFadeDuration = 0.1
  208. // shimmeringView.shimmeringOpacity = 0.2
  209. // shimmeringView.shimmeringSpeed = 300
  210. // shimmeringView.contentView = remindLab
  211. // return shimmeringView
  212. // }()
  213. lazy public var remindSubLab: UILabel = {
  214. let remindSubLab = UILabel()
  215. remindSubLab.font = UIFont.systemFont(ofSize: 14)
  216. remindSubLab.numberOfLines = 1
  217. remindSubLab.textAlignment = NSTextAlignment.center
  218. remindSubLab.textColor = UIColor.hexColor(hexadecimal: "#999999")
  219. return remindSubLab
  220. }()
  221. lazy public var refreshBtn: UIButton = {
  222. let refreshBtn = UIButton(type: .custom)
  223. refreshBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#EE0051")
  224. refreshBtn.titleLabel?.font = UIFont.systemFont(ofSize: 15)
  225. refreshBtn.setTitleColor(UIColor.white, for: .normal)
  226. refreshBtn.setTitle("刷新", for: .normal)
  227. refreshBtn.setTitle("重新连接网络", for: .selected)
  228. refreshBtn.addCorner(corner: cDefaultMargin * 2)
  229. refreshBtn.isHidden = true
  230. refreshBtn.addTarget(self, action: #selector(fullRefresh), for: .touchUpInside)
  231. return refreshBtn
  232. }()
  233. override public init(frame: CGRect) {
  234. super.init(frame: frame)
  235. addSubview(imageView)
  236. // addSubview(shimmeringView)
  237. addSubview(remindSubLab)
  238. addSubview(refreshBtn)
  239. let ges = UITapGestureRecognizer(target: self, action: #selector(fullRefresh))
  240. addGestureRecognizer(ges)
  241. backgroundColor = PQBFConfig.shared.styleBackGroundColor
  242. }
  243. required public init?(coder _: NSCoder) {
  244. fatalError("init(coder:) has not been implemented")
  245. }
  246. @objc public var emptyData: PQEmptyModel? {
  247. didSet {
  248. addData()
  249. addLayout()
  250. }
  251. }
  252. }
  253. extension PQEmptyRemindView {
  254. public func addData() {
  255. if !isNetConnected() {
  256. remindLab.text = "网络连接失败,请检查网络后重试"
  257. remindSubLab.isHidden = true
  258. refreshBtn.isHidden = false
  259. refreshBtn.backgroundColor = UIColor.hexColor(hexadecimal: "#EE0051")
  260. refreshBtn.setTitleColor(UIColor.white, for: .normal)
  261. refreshBtn.setTitle("刷新", for: .normal)
  262. imageView.image = UIImage.init().BF_Image(named: "pic_network")
  263. } else {
  264. if emptyData?.emptyImage != nil, emptyData?.emptyImage?.count ?? 0 > 0 {
  265. imageView.image = UIImage.init().BF_Image(named: emptyData?.emptyImage ?? "")
  266. } else {
  267. imageView.image = nil
  268. }
  269. remindLab.text = emptyData?.title
  270. remindSubLab.text = emptyData?.summary
  271. refreshBtn.isHidden = emptyData?.isRefreshHidden ?? true
  272. if emptyData?.refreshImage != nil, (emptyData?.refreshImage?.count ?? 0) > 0 {
  273. refreshBtn.setImage(UIImage.init().BF_Image(named: emptyData?.refreshImage ?? ""), for: .normal)
  274. } else {
  275. refreshBtn.setImage(nil, for: .normal)
  276. }
  277. refreshBtn.setAttributedTitle(emptyData?.refreshTitle, for: .normal)
  278. if emptyData?.refreshBgColor != nil {
  279. refreshBtn.backgroundColor = emptyData?.refreshBgColor
  280. }
  281. }
  282. }
  283. override public var isHidden: Bool {
  284. didSet {
  285. addData()
  286. addLayout()
  287. }
  288. }
  289. public func addLayout() {
  290. var imageH: CGFloat = cDefaultMargin * 7
  291. var contentH: CGFloat = 0
  292. if (emptyData?.emptyImage != nil && emptyData?.emptyImage?.count ?? 0 > 0) || !isNetConnected() {
  293. contentH = contentH + imageH + cDefaultMargin
  294. } else {
  295. imageH = 0
  296. }
  297. if emptyData?.title != nil, emptyData?.title?.count ?? 0 > 0 {
  298. contentH = contentH + cDefaultMargin * 2 + cDefaultMargin
  299. }
  300. if emptyData?.summary != nil, emptyData?.summary?.count ?? 0 > 0 {
  301. contentH = contentH + cDefaultMargin * 2 + cDefaultMargin
  302. }
  303. if !refreshBtn.isHidden {
  304. contentH = contentH + cDefaultMargin + cDefaultMargin * 4
  305. }
  306. let topY = (frame.height - contentH) / 2
  307. imageView.snp.remakeConstraints { make in
  308. make.top.equalTo(topY)
  309. make.centerX.equalTo(self)
  310. make.height.equalTo(imageH)
  311. }
  312. // shimmeringView.snp.makeConstraints { make in
  313. // make.left.right.equalTo(self)
  314. // make.top.equalTo(imageView.snp_bottom).offset(cDefaultMargin)
  315. // }
  316. remindLab.snp.remakeConstraints { make in
  317. make.size.equalToSuperview()
  318. }
  319. remindSubLab.snp.makeConstraints { make in
  320. make.left.right.equalTo(self)
  321. make.top.equalTo(remindLab.snp_bottom).offset(cDefaultMargin)
  322. }
  323. refreshBtn.snp.makeConstraints { make in
  324. make.width.equalTo(cDefaultMargin * 13)
  325. make.height.equalTo(cDefaultMargin * 4)
  326. make.top.equalTo(remindSubLab.snp_bottom).offset(cDefaultMargin)
  327. make.centerX.equalToSuperview()
  328. }
  329. }
  330. @objc func fullRefresh() {
  331. let isConnected: Bool = isNetConnected()
  332. if !isConnected {
  333. cShowHUB(superView: nil, msg: "网络不给力")
  334. }
  335. if fullRefreshBloc != nil {
  336. fullRefreshBloc!(isConnected, emptyData)
  337. }
  338. }
  339. func addShimmeringView() {}
  340. func removeShimmeringView() {}
  341. }
  342. // MARK: - 上传提示框
  343. /// 上传提示框
  344. public class PQUploadRemindView: PQRemindView {
  345. public var canMoreOpration: Bool = false // 是否还有更多操作
  346. public var confirmTitle: String = "我知道了"
  347. public var cancelTitle: String = "取消"
  348. public var cacelColor: UIColor = UIColor.hexColor(hexadecimal: "#666666")
  349. public var attributedTitle: NSAttributedString?
  350. override public func addData() {
  351. titleLab.textAlignment = .center
  352. if attributedTitle != nil {
  353. titleLab.attributedText = attributedTitle
  354. } else {
  355. titleLab.text = remindData?.title
  356. }
  357. if remindData?.attributedTitle != nil {
  358. contentLab.attributedText = remindData?.attributedTitle
  359. } else {
  360. contentLab.text = remindData?.summary
  361. }
  362. cancelBtn.setTitleColor(cacelColor, for: .normal)
  363. confirmBtn.setTitleColor(UIColor.hexColor(hexadecimal: "#EE0051"), for: .normal)
  364. confirmBtn.setTitle(confirmTitle, for: .normal)
  365. cancelBtn.setTitle(cancelTitle, for: .normal)
  366. let ges = UITapGestureRecognizer(target: self, action: #selector(removeView))
  367. addGestureRecognizer(ges)
  368. }
  369. override public func addLayout() {
  370. let titleH: CGFloat = ((remindData?.title != nil && (remindData?.title?.count ?? 0) > 0) || attributedTitle != nil) ? cDefaultMargin * 2 : 0
  371. let summH: CGFloat = sizeTextFits(attributedText: remindData?.attributedTitle != nil ? remindData?.attributedTitle : NSMutableAttributedString(string: remindData?.summary ?? ""), text: nil, numberOfLines: 0, font: UIFont.systemFont(ofSize: 14), maxSize: CGSize(width: cScreenWidth - cDefaultMargin * 12, height: CGFloat.greatestFiniteMagnitude)).height + cDefaultMargin
  372. let contentH: CGFloat = (titleH == 0 ? 0 : cDefaultMargin * 3) + cDefaultMargin * 2 + summH + cDefaultMargin + cDefaultMargin * 5
  373. contentView.snp.makeConstraints { make in
  374. make.left.equalTo(self).offset(cDefaultMargin * 3)
  375. make.right.equalTo(self).offset(-cDefaultMargin * 3)
  376. make.height.equalTo(contentH)
  377. make.center.equalTo(self)
  378. }
  379. titleLab.snp.makeConstraints { make in
  380. make.left.equalTo(contentView).offset(cDefaultMargin * 2)
  381. make.right.equalTo(contentView).offset(-cDefaultMargin * 2)
  382. make.height.equalTo(titleH)
  383. make.top.equalTo(contentView).offset(titleH == 0 ? 0 : cDefaultMargin * 2)
  384. }
  385. contentLab.snp.makeConstraints { make in
  386. make.top.equalTo(titleLab.snp_bottom).offset(cDefaultMargin)
  387. make.left.right.equalTo(titleLab)
  388. make.height.equalTo(summH)
  389. }
  390. if canMoreOpration {
  391. let btnW: CGFloat = (cScreenWidth - 1 - cDefaultMargin * 8) / 2
  392. verticalLine.snp.makeConstraints { make in
  393. make.top.equalTo(contentLab.snp_bottom).offset(cDefaultMargin)
  394. make.height.equalTo(1)
  395. make.left.width.equalToSuperview()
  396. }
  397. cancelBtn.snp.makeConstraints { make in
  398. make.left.equalToSuperview()
  399. make.top.equalTo(verticalLine.snp_bottom)
  400. make.width.equalTo(btnW)
  401. make.bottom.equalTo(contentView)
  402. }
  403. horizonLine.snp.makeConstraints { make in
  404. make.left.equalTo(cancelBtn.snp_right)
  405. make.height.top.equalTo(cancelBtn)
  406. make.width.equalTo(1)
  407. }
  408. confirmBtn.snp.makeConstraints { make in
  409. make.right.equalToSuperview()
  410. make.height.width.bottom.equalTo(cancelBtn)
  411. }
  412. } else {
  413. verticalLine.snp.makeConstraints { make in
  414. make.top.equalTo(contentLab.snp_bottom).offset(cDefaultMargin)
  415. make.height.equalTo(1)
  416. make.left.width.equalToSuperview()
  417. }
  418. confirmBtn.snp.makeConstraints { make in
  419. make.right.left.equalTo(titleLab)
  420. make.top.equalTo(verticalLine.snp_bottom)
  421. make.bottom.equalTo(contentView)
  422. }
  423. }
  424. }
  425. @objc func removeView() {
  426. removeFromSuperview()
  427. }
  428. @objc public override func btnClck(sender: UIButton) {
  429. removeFromSuperview()
  430. if remindBlock != nil {
  431. remindBlock!(sender, remindData!)
  432. }
  433. }
  434. /// 快速生成
  435. /// - Parameters:
  436. /// - title: <#title description#>
  437. /// - summary: <#summary description#>
  438. /// - confirmTitle: <#confirmTitle description#>
  439. /// - remindHandle: <#remindHandle description#>
  440. /// - Returns: <#description#>
  441. class public func showUploadRemindView(title: String?, attributedTitle: NSAttributedString? = nil, summary: String, canMoreOpration: Bool = false, confirmTitle: String?, cancelTitle: String? = nil, cancelColor: UIColor? = nil, remindHandle: @escaping (_ sender: UIButton, _ baseModel: PQBaseModel?) -> Void) {
  442. if UIApplication.shared.keyWindow?.viewWithTag(cUploadViewRemindTag) != nil {
  443. UIApplication.shared.keyWindow?.viewWithTag(cUploadViewRemindTag)?.removeFromSuperview()
  444. }
  445. let remindData = PQBaseModel()
  446. let paragraphStyle = NSMutableParagraphStyle()
  447. paragraphStyle.lineSpacing = 3.0
  448. paragraphStyle.alignment = .center
  449. remindData.title = title
  450. remindData.attributedTitle = NSMutableAttributedString(string: summary, attributes: [NSAttributedString.Key.font: UIFont.systemFont(ofSize: 14), NSAttributedString.Key.foregroundColor: UIColor.hexColor(hexadecimal: "#666666"), NSAttributedString.Key.paragraphStyle: paragraphStyle])
  451. let remindView = PQUploadRemindView(frame: CGRect(x: 0, y: 0, width: cScreenWidth, height: cScreenHeigth))
  452. remindView.canMoreOpration = canMoreOpration
  453. if confirmTitle != nil {
  454. remindView.confirmTitle = confirmTitle!
  455. }
  456. if cancelTitle != nil {
  457. remindView.cancelTitle = cancelTitle!
  458. }
  459. if cancelColor != nil {
  460. remindView.cacelColor = cancelColor!
  461. }
  462. if attributedTitle != nil {
  463. remindView.attributedTitle = attributedTitle
  464. }
  465. remindView.remindBlock = { sender, baseModel in
  466. remindHandle(sender, baseModel)
  467. }
  468. remindView.tag = cUploadViewRemindTag
  469. UIApplication.shared.keyWindow?.addSubview(remindView)
  470. remindView.remindData = remindData
  471. }
  472. }