添加邮件发送的功能
This commit is contained in:
parent
c00a1565f4
commit
2c9a290ae7
@ -15,6 +15,7 @@
|
||||
00D33BF62B99A19900604A44 /* SpatialVideoConvertor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D33BF52B99A19900604A44 /* SpatialVideoConvertor.swift */; };
|
||||
00D33BFA2B9AB21A00604A44 /* ZZHAVExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00D33BF92B9AB21A00604A44 /* ZZHAVExtension.swift */; };
|
||||
00EB2D022BA2D15700924D84 /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 00EB2D012BA2D14700924D84 /* Localizable.strings */; };
|
||||
00EB2D052BA2D59000924D84 /* MessageUI.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EB2D042BA2D59000924D84 /* MessageUI.framework */; };
|
||||
00ED6B342BA04AC200915BDE /* PlayByTransferConvertor.swift in Sources */ = {isa = PBXBuildFile; fileRef = 00ED6B332BA04AC200915BDE /* PlayByTransferConvertor.swift */; };
|
||||
04E1D3F12B68EDFE00743F2F /* CCWebController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 04E1D3F02B68EDFE00743F2F /* CCWebController.swift */; };
|
||||
1E02C9322B8990C600DD3143 /* CCDeviceOperationListView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1E02C9312B8990C600DD3143 /* CCDeviceOperationListView.swift */; };
|
||||
@ -101,6 +102,7 @@
|
||||
00D33BF92B9AB21A00604A44 /* ZZHAVExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ZZHAVExtension.swift; sourceTree = "<group>"; };
|
||||
00EB2D002BA2D14700924D84 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/Localizable.strings; sourceTree = "<group>"; };
|
||||
00EB2D032BA2D16300924D84 /* zh-Hans */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hans"; path = "zh-Hans.lproj/Localizable.strings"; sourceTree = "<group>"; };
|
||||
00EB2D042BA2D59000924D84 /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
|
||||
00ED6B332BA04AC200915BDE /* PlayByTransferConvertor.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PlayByTransferConvertor.swift; sourceTree = "<group>"; };
|
||||
04E1D3F02B68EDFE00743F2F /* CCWebController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCWebController.swift; sourceTree = "<group>"; };
|
||||
1E02C9312B8990C600DD3143 /* CCDeviceOperationListView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CCDeviceOperationListView.swift; sourceTree = "<group>"; };
|
||||
@ -187,6 +189,7 @@
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
AF478B032B577D51005C35A5 /* AVFoundation.framework in Frameworks */,
|
||||
00EB2D052BA2D59000924D84 /* MessageUI.framework in Frameworks */,
|
||||
1E277B76988DF1691E8E5A49 /* Pods_SwiftProject.framework in Frameworks */,
|
||||
AF2120D42B4E99FA00400B7F /* MobileCoreServices.framework in Frameworks */,
|
||||
AF2120D62B4E9A0100400B7F /* Photos.framework in Frameworks */,
|
||||
@ -302,6 +305,7 @@
|
||||
4D8F3A411661D600CD07B39B /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
00EB2D042BA2D59000924D84 /* MessageUI.framework */,
|
||||
AF478B022B577D51005C35A5 /* AVFoundation.framework */,
|
||||
AF2120D52B4E9A0100400B7F /* Photos.framework */,
|
||||
AF2120D32B4E99F900400B7F /* MobileCoreServices.framework */,
|
||||
|
||||
@ -22,9 +22,10 @@ import AVKit
|
||||
import CoreMedia
|
||||
import LLCycleScrollView
|
||||
import TZImagePickerController
|
||||
import MessageUI
|
||||
import SVProgressHUD
|
||||
|
||||
|
||||
class CCHomeController: BaseController, LLCycleScrollViewDelegate {
|
||||
class CCHomeController: BaseController, LLCycleScrollViewDelegate,MFMailComposeViewControllerDelegate {
|
||||
|
||||
|
||||
|
||||
@ -387,6 +388,21 @@ class CCHomeController: BaseController, LLCycleScrollViewDelegate {
|
||||
vc.urlString = sizeUrl
|
||||
self.navigationController?.pushViewController(vc, animated: true)
|
||||
}
|
||||
else if((dic["name"] as! String).elementsEqual("联系我们")) {//联系我们
|
||||
if !MFMailComposeViewController.canSendMail() {
|
||||
SVProgressHUD.showInfo(withStatus: "请先前往系统设置配置发送的邮箱信息")
|
||||
return
|
||||
}
|
||||
|
||||
let mailComposeViewController = MFMailComposeViewController()
|
||||
mailComposeViewController.mailComposeDelegate = self
|
||||
|
||||
mailComposeViewController.setSubject("")
|
||||
mailComposeViewController.setMessageBody("请在此处描述您需要反馈的问题.", isHTML: false)
|
||||
mailComposeViewController.setToRecipients(["fangaoqdi@163.com"])
|
||||
|
||||
self.present(mailComposeViewController, animated: true)
|
||||
}
|
||||
self.deleteMenu()
|
||||
}
|
||||
addAnimation()
|
||||
@ -577,4 +593,26 @@ extension CCHomeController: TZImagePickerControllerDelegate,UINavigationControll
|
||||
// listTableView.reloadData()
|
||||
}
|
||||
|
||||
|
||||
func mailComposeController(_ controller: MFMailComposeViewController, didFinishWith result: MFMailComposeResult, error: Error?) {
|
||||
controller.dismiss(animated: true)
|
||||
|
||||
if let error = error {
|
||||
print(error)
|
||||
} else {
|
||||
switch result {
|
||||
case .cancelled:
|
||||
print("Mail cancelled")
|
||||
case .sent:
|
||||
print("Mail sent")
|
||||
case .failed:
|
||||
print("Mail failed")
|
||||
case .saved:
|
||||
print("Mail saved")
|
||||
default:
|
||||
break
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -87,7 +87,7 @@ class CCMineView: UIView,UITableViewDelegate,UITableViewDataSource{
|
||||
|
||||
let arr = [["img":"Icon_Menu_all_Icon_Connect",
|
||||
"name":"联系我们"],
|
||||
["img":"Icon_Menu_all_Icon_Connect",
|
||||
["img":"Icon_Menu_all_Icon_Privacy",
|
||||
"name":"隐私政策"]]
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user