├── Cartfile ├── .travis.yml ├── Cartfile.resolved ├── ZGMailbox ├── Assets.xcassets │ ├── Contents.json │ ├── Mail │ │ ├── Contents.json │ │ ├── btn_add.imageset │ │ │ ├── btn_add@2x.png │ │ │ └── Contents.json │ │ ├── icon_star.imageset │ │ │ ├── icon_star@2x.png │ │ │ ├── icon_star@3x.png │ │ │ └── Contents.json │ │ ├── mail_sent.imageset │ │ │ ├── mail_sent@2x.png │ │ │ ├── mail_sent@3x.png │ │ │ └── Contents.json │ │ ├── searchhelp.imageset │ │ │ ├── searchhelp.png │ │ │ └── Contents.json │ │ ├── attach_add.imageset │ │ │ ├── attach_add@2x.png │ │ │ └── Contents.json │ │ ├── icon_reply.imageset │ │ │ ├── icon_reply@2x.png │ │ │ └── Contents.json │ │ ├── mail_draft.imageset │ │ │ ├── mail_draft@2x.png │ │ │ ├── mail_draft@3x.png │ │ │ └── Contents.json │ │ ├── mail_inbox.imageset │ │ │ ├── mail_inbox@2x.png │ │ │ ├── mail_inbox@3x.png │ │ │ └── Contents.json │ │ ├── attach_mask.imageset │ │ │ ├── attach_mask@2x.png │ │ │ └── Contents.json │ │ ├── btn_dot_stop.imageset │ │ │ ├── btn_dot_stop@2x.png │ │ │ └── Contents.json │ │ ├── btn_nav_next.imageset │ │ │ ├── btn_nav_next@2x.png │ │ │ ├── btn_nav_next@3x.png │ │ │ └── Contents.json │ │ ├── btn_nav_prev.imageset │ │ │ ├── btn_nav_prev@2x.png │ │ │ ├── btn_nav_prev@3x.png │ │ │ └── Contents.json │ │ ├── mail_deleted.imageset │ │ │ ├── mail_deleted@2x.png │ │ │ ├── mail_deleted@3x.png │ │ │ └── Contents.json │ │ ├── mail_flagged.imageset │ │ │ ├── mail_flagged@2x.png │ │ │ ├── mail_flagged@3x.png │ │ │ └── Contents.json │ │ ├── mail_sending.imageset │ │ │ ├── mail_sending@3x.png │ │ │ └── Contents.json │ │ ├── wmAttachment.imageset │ │ │ ├── wmAttachment@2x.png │ │ │ └── Contents.json │ │ ├── attach_delete.imageset │ │ │ ├── attach_delete@2x.png │ │ │ └── Contents.json │ │ ├── attachment_bg.imageset │ │ │ ├── attachment_bg@2x.png │ │ │ └── Contents.json │ │ ├── defultHeadBig.imageset │ │ │ ├── defultHeadBig@2x.png │ │ │ └── Contents.json │ │ ├── icon_moveMail.imageset │ │ │ ├── icon_moveMail@2x.png │ │ │ ├── icon_moveMail@3x.png │ │ │ └── Contents.json │ │ ├── contactWriteMail.imageset │ │ │ ├── contactWriteMail@2x.png │ │ │ └── Contents.json │ │ ├── filetype_pdf_51h.imageset │ │ │ ├── filetype_pdf_51h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_ppt_51h.imageset │ │ │ ├── filetype_ppt_51h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_txt_51h.imageset │ │ │ ├── filetype_txt_51h@2x.png │ │ │ └── Contents.json │ │ ├── icon_status_star.imageset │ │ │ ├── icon_status_star@2x.png │ │ │ └── Contents.json │ │ ├── filetype_pdf_105h.imageset │ │ │ ├── filetype_pdf_105h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_ppt_105h.imageset │ │ │ ├── filetype_ppt_105h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_txt_105h.imageset │ │ │ ├── filetype_txt_105h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_word_51h.imageset │ │ │ ├── filetype_word_51h@2x.png │ │ │ └── Contents.json │ │ ├── icon_status_reply.imageset │ │ │ ├── icon_status_reply@2x.png │ │ │ ├── icon_status_reply@3x.png │ │ │ └── Contents.json │ │ ├── btn_add_highlighted.imageset │ │ │ ├── btn_add_highlighted@2x.png │ │ │ └── Contents.json │ │ ├── btn_dot_large_pause.imageset │ │ │ ├── btn_dot_large_pause@2x.png │ │ │ └── Contents.json │ │ ├── checkmark_selected.imageset │ │ │ ├── checkmark_selected@2x.png │ │ │ ├── checkmark_selected@3x.png │ │ │ └── Contents.json │ │ ├── filetype_excel_105h.imageset │ │ │ ├── filetype_excel_105h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_excel_51h.imageset │ │ │ ├── filetype_excel_51h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_image_105h.imageset │ │ │ ├── filetype_image_105h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_image_51h.imageset │ │ │ ├── filetype_image_51h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_others_51h.imageset │ │ │ ├── filetype_others_51h@2x.png │ │ │ └── Contents.json │ │ ├── filetype_word_105h.imageset │ │ │ ├── filetype_word_105h@2x.png │ │ │ └── Contents.json │ │ ├── icon_nav_arrow_down.imageset │ │ │ ├── icon_nav_arrow_down@2x.png │ │ │ ├── icon_nav_arrow_down@3x.png │ │ │ └── Contents.json │ │ ├── icon_status_attach.imageset │ │ │ ├── icon_status_attach@2x.png │ │ │ ├── icon_status_attach@3x.png │ │ │ └── Contents.json │ │ ├── icon_status_forward.imageset │ │ │ ├── icon_status_forward@2x.png │ │ │ ├── icon_status_forward@3x.png │ │ │ └── Contents.json │ │ ├── icon_status_unread.imageset │ │ │ ├── icon_status_unread@2x.png │ │ │ └── Contents.json │ │ ├── addressSelectCorrect.imageset │ │ │ ├── addressSelectCorrect@2x.png │ │ │ └── Contents.json │ │ ├── checkmark_unselected.imageset │ │ │ ├── checkmark_unselected@2x.png │ │ │ ├── checkmark_unselected@3x.png │ │ │ └── Contents.json │ │ ├── filetype_others_105h.imageset │ │ │ ├── filetype_others_105h@2x.png │ │ │ └── Contents.json │ │ ├── attach_delete_presses.imageset │ │ │ ├── attach_delete_presses@2x.png │ │ │ └── Contents.json │ │ ├── attachment_bg_pressed.imageset │ │ │ ├── attachment_bg_pressed@2x.png │ │ │ └── Contents.json │ │ ├── icon_statusbar_failed.imageset │ │ │ ├── icon_statusbar_failed@2x.png │ │ │ ├── icon_statusbar_failed@3x.png │ │ │ └── Contents.json │ │ ├── mail_sent_highlighted.imageset │ │ │ ├── mail_sent_highlighted@2x.png │ │ │ ├── mail_sent_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── btn_dot_large_download.imageset │ │ │ ├── btn_dot_large_download@2x.png │ │ │ └── Contents.json │ │ ├── icon_statusbar_sending.imageset │ │ │ ├── icon_statusbar_sending@2x.png │ │ │ ├── icon_statusbar_sending@3x.png │ │ │ └── Contents.json │ │ ├── mail_draft_highlighted.imageset │ │ │ ├── mail_draft_highlighted@2x.png │ │ │ ├── mail_draft_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── mail_inbox_highlighted.imageset │ │ │ ├── mail_inbox_highlighted@2x.png │ │ │ ├── mail_inbox_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── mail_deleted_highlighted.imageset │ │ │ ├── mail_deleted_highlighted@2x.png │ │ │ ├── mail_deleted_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── mail_flagged_highlighted.imageset │ │ │ ├── mail_flagged_highlighted@2x.png │ │ │ ├── mail_flagged_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── mail_roundcornerBgNormal.imageset │ │ │ ├── mail_roundcornerBgNormal@2x.png │ │ │ └── Contents.json │ │ ├── mail_sending_highlighted.imageset │ │ │ ├── mail_sending_highlighted@2x.png │ │ │ ├── mail_sending_highlighted@3x.png │ │ │ └── Contents.json │ │ ├── icon_statusbar_successful.imageset │ │ │ ├── icon_statusbar_successful@2x.png │ │ │ ├── icon_statusbar_successful@3x.png │ │ │ └── Contents.json │ │ └── mail_roundcornerBgHighlight.imageset │ │ │ ├── mail_roundcornerBgHighlight@2x.png │ │ │ └── Contents.json │ └── AppIcon.appiconset │ │ └── Contents.json ├── Other │ ├── Tool │ │ ├── MWPhotoBrowser │ │ │ ├── Assets │ │ │ │ ├── ImageError.png │ │ │ │ ├── ImageError@2x.png │ │ │ │ ├── ImageError@3x.png │ │ │ │ ├── VideoOverlay.png │ │ │ │ ├── ImageSelectedOff.png │ │ │ │ ├── ImageSelectedOn.png │ │ │ │ ├── VideoOverlay@2x.png │ │ │ │ ├── VideoOverlay@3x.png │ │ │ │ ├── ImageSelectedOff@2x.png │ │ │ │ ├── ImageSelectedOff@3x.png │ │ │ │ ├── ImageSelectedOn@2x.png │ │ │ │ ├── ImageSelectedOn@3x.png │ │ │ │ ├── UIBarButtonItemGrid.png │ │ │ │ ├── ImageSelectedSmallOff.png │ │ │ │ ├── ImageSelectedSmallOn.png │ │ │ │ ├── ImageSelectedSmallOff@2x.png │ │ │ │ ├── ImageSelectedSmallOff@3x.png │ │ │ │ ├── ImageSelectedSmallOn@2x.png │ │ │ │ ├── ImageSelectedSmallOn@3x.png │ │ │ │ ├── PlayButtonOverlayLarge.png │ │ │ │ ├── UIBarButtonItemArrowLeft.png │ │ │ │ ├── UIBarButtonItemGrid@2x.png │ │ │ │ ├── UIBarButtonItemGrid@3x.png │ │ │ │ ├── PlayButtonOverlayLarge@2x.png │ │ │ │ ├── PlayButtonOverlayLarge@3x.png │ │ │ │ ├── PlayButtonOverlayLargeTap.png │ │ │ │ ├── UIBarButtonItemArrowRight.png │ │ │ │ ├── PlayButtonOverlayLargeTap@2x.png │ │ │ │ ├── PlayButtonOverlayLargeTap@3x.png │ │ │ │ ├── UIBarButtonItemArrowLeft@2x.png │ │ │ │ ├── UIBarButtonItemArrowLeft@3x.png │ │ │ │ ├── UIBarButtonItemArrowRight@2x.png │ │ │ │ └── UIBarButtonItemArrowRight@3x.png │ │ │ └── Classes │ │ │ │ ├── UIImage+MWPhotoBrowser.h │ │ │ │ ├── MWGridViewController.h │ │ │ │ ├── MWGridCell.h │ │ │ │ ├── MWTapDetectingView.h │ │ │ │ ├── UIImage+MWPhotoBrowser.m │ │ │ │ ├── MWTapDetectingImageView.h │ │ │ │ ├── MWCommon.h │ │ │ │ ├── MWZoomingScrollView.h │ │ │ │ ├── MWCaptionView.h │ │ │ │ ├── MWPhoto.h │ │ │ │ ├── MWTapDetectingView.m │ │ │ │ ├── MWTapDetectingImageView.m │ │ │ │ ├── MWCaptionView.m │ │ │ │ ├── MWPhotoProtocol.h │ │ │ │ └── MWPhotoBrowser.h │ │ ├── RSA │ │ │ └── RSA.h │ │ ├── HPGrowingTextView │ │ │ └── HPTextViewInternal.h │ │ └── Reachability │ │ │ └── TMReachability.h │ ├── Category │ │ ├── NSDate │ │ │ └── NSDate+DDAddition.h │ │ ├── String │ │ │ ├── NSString+Mail.h │ │ │ └── NSString+Mail.m │ │ ├── Colors │ │ │ ├── UIColor+colorWIthHex.h │ │ │ └── UIColor+colorWIthHex.m │ │ ├── ViewController │ │ │ └── UIViewController+HUD.h │ │ └── UIView │ │ │ └── UIView+Addition.h │ └── Common │ │ ├── PrefixHeader.pch │ │ ├── Header.h │ │ ├── ZGConst.h │ │ ├── ZGConst.m │ │ └── Macros.h ├── Module │ ├── MailSearch-邮件搜索 │ │ ├── Views │ │ │ ├── ZGRoundSearchBar.h │ │ │ └── ZGRoundSearchBar.m │ │ └── Controllers │ │ │ └── ZGMailMessageSearchViewController.h │ ├── NewMail-新邮件 │ │ ├── Views │ │ │ ├── HeaderView │ │ │ │ ├── ZGSenderButton.h │ │ │ │ ├── ZGMailAddressButton.h │ │ │ │ ├── ZGMailAddressTextField.h │ │ │ │ ├── ZGSubjectEditView.h │ │ │ │ ├── ZGSenderButton.m │ │ │ │ ├── ZGComposeHeaderView.h │ │ │ │ ├── ZGMailAddressButton.m │ │ │ │ ├── ZGMailAddressTextField.m │ │ │ │ └── ZGMailAddressFlowEditView.h │ │ │ ├── AttachmentView │ │ │ │ ├── ZGAddAttachmentCollectionViewCell.h │ │ │ │ ├── ZGWriteMailFileAttachmentCollectionViewCell.h │ │ │ │ ├── ZGWriteMailImageAttachmentCollectionViewCell.h │ │ │ │ ├── ZGAddAttachmentCollectionViewCell.m │ │ │ │ └── ZGWriteMailAttachmentView.h │ │ │ └── ZGSendMailTopIndicator.h │ │ ├── Models │ │ │ └── ZGMailAttachmetPhoto.h │ │ └── Controllers │ │ │ └── ZGNewMailViewController.h │ ├── MailList-邮件列表 │ │ ├── Controllers │ │ │ ├── ZGMailListViewController.h │ │ │ └── ZGSendingMailListViewController.h │ │ ├── Views │ │ │ ├── ZGMailListCellPortraitView.h │ │ │ ├── ZGMailListTitleView.h │ │ │ ├── ZGMailListBottomToolBar.h │ │ │ ├── ZGMailListTableViewCell.h │ │ │ ├── ZGMailListCellPortraitView.m │ │ │ └── ZGMailListTitleView.m │ │ └── Models │ │ │ ├── ZGMailMessage.h │ │ │ ├── ZGMailRecord.h │ │ │ └── ZGMailMessage.m │ ├── MailDetail-邮件详情 │ │ ├── Views │ │ │ ├── ZGAddressShadowButton.h │ │ │ ├── ZGAttachmentTableViewCell.h │ │ │ ├── ZGMessageHeaderDetailTimeTableViewCell.h │ │ │ ├── ZGMessageAttachmentView.h │ │ │ ├── ZGMessageHeaderDetailAttachmentTableViewCell.h │ │ │ ├── ZGMessageHeaderDetailAddressTableViewCell.h │ │ │ ├── ZGMailMessageHeaderDetailView.h │ │ │ ├── ZGMailMessageHeaderView.h │ │ │ ├── MCOMessageView.h │ │ │ ├── ZGAddressShadowButton.m │ │ │ ├── ZGMessageHeaderDetailTimeTableViewCell.m │ │ │ ├── ZGMessageAttachmentView.m │ │ │ ├── ZGMessageHeaderDetailAttachmentTableViewCell.m │ │ │ └── ZGAttachmentTableViewCell.m │ │ ├── Manager │ │ │ └── MCOCIDURLProtocol.h │ │ └── Controllers │ │ │ └── ZGMailMessageDetailViewController.h │ ├── MailContactsDetail-邮件联系人详细 │ │ └── Controllers │ │ │ └── ZGMailContactsDetailViewController.h │ └── MailAttachment-邮件附件 │ │ ├── Views │ │ ├── ZGAttachmentDownloadView.h │ │ └── ZGAttachmentDownloadView.m │ │ └── Controllers │ │ └── ZGMessageAttachmentViewController.h ├── LoginViewController.h ├── AppDelegate.h ├── main.m ├── Info.plist ├── Base.lproj │ ├── Main.storyboard │ └── LaunchScreen.storyboard └── AppDelegate.m ├── README.md ├── ZGMailbox.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── ZGMailbox.xcworkspace ├── contents.xcworkspacedata └── xcshareddata │ └── IDEWorkspaceChecks.plist ├── ZGMailboxTests ├── Info.plist └── ZGMailboxTests.m ├── ZGMailboxUITests ├── Info.plist └── ZGMailboxUITests.m ├── Podfile ├── Podfile.lock └── .gitignore /Cartfile: -------------------------------------------------------------------------------- 1 | github "MailCore/mailcore2" "master" 2 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | osx_image: xcode10 3 | -------------------------------------------------------------------------------- /Cartfile.resolved: -------------------------------------------------------------------------------- 1 | github "MailCore/mailcore2" "bd9874f36e7bcf6edcaaf38c7e06c2dbd06ad136" 2 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageError@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_add.imageset/btn_add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_add.imageset/btn_add@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/VideoOverlay@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_star.imageset/icon_star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_star.imageset/icon_star@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_star.imageset/icon_star@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_star.imageset/icon_star@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent.imageset/mail_sent@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sent.imageset/mail_sent@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent.imageset/mail_sent@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sent.imageset/mail_sent@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/searchhelp.imageset/searchhelp.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/searchhelp.imageset/searchhelp.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOff@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedOn@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_add.imageset/attach_add@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attach_add.imageset/attach_add@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_reply.imageset/icon_reply@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_reply.imageset/icon_reply@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft.imageset/mail_draft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_draft.imageset/mail_draft@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft.imageset/mail_draft@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_draft.imageset/mail_draft@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox.imageset/mail_inbox@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_inbox.imageset/mail_inbox@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox.imageset/mail_inbox@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_inbox.imageset/mail_inbox@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_mask.imageset/attach_mask@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attach_mask.imageset/attach_mask@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOff@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/ImageSelectedSmallOn@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemGrid@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_stop.imageset/btn_dot_stop@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_dot_stop.imageset/btn_dot_stop@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_next.imageset/btn_nav_next@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_nav_next.imageset/btn_nav_next@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_next.imageset/btn_nav_next@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_nav_next.imageset/btn_nav_next@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_prev.imageset/btn_nav_prev@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_nav_prev.imageset/btn_nav_prev@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_prev.imageset/btn_nav_prev@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_nav_prev.imageset/btn_nav_prev@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted.imageset/mail_deleted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_deleted.imageset/mail_deleted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted.imageset/mail_deleted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_deleted.imageset/mail_deleted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged.imageset/mail_flagged@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_flagged.imageset/mail_flagged@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged.imageset/mail_flagged@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_flagged.imageset/mail_flagged@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sending.imageset/mail_sending@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sending.imageset/mail_sending@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/wmAttachment.imageset/wmAttachment@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/wmAttachment.imageset/wmAttachment@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLarge@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_delete.imageset/attach_delete@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attach_delete.imageset/attach_delete@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attachment_bg.imageset/attachment_bg@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attachment_bg.imageset/attachment_bg@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/defultHeadBig.imageset/defultHeadBig@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/defultHeadBig.imageset/defultHeadBig@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_moveMail.imageset/icon_moveMail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_moveMail.imageset/icon_moveMail@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_moveMail.imageset/icon_moveMail@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_moveMail.imageset/icon_moveMail@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/PlayButtonOverlayLargeTap@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowLeft@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Other/Tool/MWPhotoBrowser/Assets/UIBarButtonItemArrowRight@3x.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ZGMailbox 2 | 基于[MailCore 2](https://github.com/MailCore/mailcore2)库实现的支持IMAP和SMTP协议的邮件客户端。 3 | 4 | 目前实现了: 5 | * 邮件列表 6 | * 邮件详情页(仿QQ邮箱效果) 7 | * 邮件编辑:添加星标、移除星标、标为已读、标为未读、删除邮件 8 | 9 | 10 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/contactWriteMail.imageset/contactWriteMail@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/contactWriteMail.imageset/contactWriteMail@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_pdf_51h.imageset/filetype_pdf_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_pdf_51h.imageset/filetype_pdf_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_ppt_51h.imageset/filetype_ppt_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_ppt_51h.imageset/filetype_ppt_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_txt_51h.imageset/filetype_txt_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_txt_51h.imageset/filetype_txt_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_star.imageset/icon_status_star@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_star.imageset/icon_status_star@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_pdf_105h.imageset/filetype_pdf_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_pdf_105h.imageset/filetype_pdf_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_ppt_105h.imageset/filetype_ppt_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_ppt_105h.imageset/filetype_ppt_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_txt_105h.imageset/filetype_txt_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_txt_105h.imageset/filetype_txt_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_word_51h.imageset/filetype_word_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_word_51h.imageset/filetype_word_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_reply.imageset/icon_status_reply@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_reply.imageset/icon_status_reply@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_reply.imageset/icon_status_reply@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_reply.imageset/icon_status_reply@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_add_highlighted.imageset/btn_add_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_add_highlighted.imageset/btn_add_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_large_pause.imageset/btn_dot_large_pause@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_dot_large_pause.imageset/btn_dot_large_pause@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_selected.imageset/checkmark_selected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/checkmark_selected.imageset/checkmark_selected@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_selected.imageset/checkmark_selected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/checkmark_selected.imageset/checkmark_selected@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_excel_105h.imageset/filetype_excel_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_excel_105h.imageset/filetype_excel_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_excel_51h.imageset/filetype_excel_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_excel_51h.imageset/filetype_excel_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_image_105h.imageset/filetype_image_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_image_105h.imageset/filetype_image_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_image_51h.imageset/filetype_image_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_image_51h.imageset/filetype_image_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_others_51h.imageset/filetype_others_51h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_others_51h.imageset/filetype_others_51h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_word_105h.imageset/filetype_word_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_word_105h.imageset/filetype_word_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_nav_arrow_down.imageset/icon_nav_arrow_down@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_nav_arrow_down.imageset/icon_nav_arrow_down@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_nav_arrow_down.imageset/icon_nav_arrow_down@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_nav_arrow_down.imageset/icon_nav_arrow_down@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_attach.imageset/icon_status_attach@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_attach.imageset/icon_status_attach@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_attach.imageset/icon_status_attach@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_attach.imageset/icon_status_attach@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_forward.imageset/icon_status_forward@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_forward.imageset/icon_status_forward@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_forward.imageset/icon_status_forward@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_forward.imageset/icon_status_forward@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_unread.imageset/icon_status_unread@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_status_unread.imageset/icon_status_unread@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/addressSelectCorrect.imageset/addressSelectCorrect@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/addressSelectCorrect.imageset/addressSelectCorrect@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_unselected.imageset/checkmark_unselected@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/checkmark_unselected.imageset/checkmark_unselected@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_unselected.imageset/checkmark_unselected@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/checkmark_unselected.imageset/checkmark_unselected@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_others_105h.imageset/filetype_others_105h@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/filetype_others_105h.imageset/filetype_others_105h@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_delete_presses.imageset/attach_delete_presses@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attach_delete_presses.imageset/attach_delete_presses@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attachment_bg_pressed.imageset/attachment_bg_pressed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/attachment_bg_pressed.imageset/attachment_bg_pressed@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_failed.imageset/icon_statusbar_failed@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_failed.imageset/icon_statusbar_failed@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_failed.imageset/icon_statusbar_failed@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_failed.imageset/icon_statusbar_failed@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent_highlighted.imageset/mail_sent_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sent_highlighted.imageset/mail_sent_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent_highlighted.imageset/mail_sent_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sent_highlighted.imageset/mail_sent_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_large_download.imageset/btn_dot_large_download@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/btn_dot_large_download.imageset/btn_dot_large_download@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_sending.imageset/icon_statusbar_sending@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_sending.imageset/icon_statusbar_sending@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_sending.imageset/icon_statusbar_sending@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_sending.imageset/icon_statusbar_sending@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft_highlighted.imageset/mail_draft_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_draft_highlighted.imageset/mail_draft_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft_highlighted.imageset/mail_draft_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_draft_highlighted.imageset/mail_draft_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox_highlighted.imageset/mail_inbox_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_inbox_highlighted.imageset/mail_inbox_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox_highlighted.imageset/mail_inbox_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_inbox_highlighted.imageset/mail_inbox_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted_highlighted.imageset/mail_deleted_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_deleted_highlighted.imageset/mail_deleted_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted_highlighted.imageset/mail_deleted_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_deleted_highlighted.imageset/mail_deleted_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged_highlighted.imageset/mail_flagged_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_flagged_highlighted.imageset/mail_flagged_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged_highlighted.imageset/mail_flagged_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_flagged_highlighted.imageset/mail_flagged_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgNormal.imageset/mail_roundcornerBgNormal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgNormal.imageset/mail_roundcornerBgNormal@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sending_highlighted.imageset/mail_sending_highlighted@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sending_highlighted.imageset/mail_sending_highlighted@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sending_highlighted.imageset/mail_sending_highlighted@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_sending_highlighted.imageset/mail_sending_highlighted@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_successful.imageset/icon_statusbar_successful@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_successful.imageset/icon_statusbar_successful@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_successful.imageset/icon_statusbar_successful@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/icon_statusbar_successful.imageset/icon_statusbar_successful@3x.png -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgHighlight.imageset/mail_roundcornerBgHighlight@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Vincentzzg/ZGMailbox/HEAD/ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgHighlight.imageset/mail_roundcornerBgHighlight@2x.png -------------------------------------------------------------------------------- /ZGMailbox/Module/MailSearch-邮件搜索/Views/ZGRoundSearchBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGRoundSearchBar.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/6/6. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGRoundSearchBar : UISearchBar 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZGMailbox.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ZGMailbox.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZGMailbox/LoginViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // LoginViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/15. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | ///登录页面 12 | @interface LoginViewController : UIViewController 13 | 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGSenderButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGSenderButton.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/19. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 抄送/密送按钮 13 | */ 14 | @interface ZGSenderButton : UIButton 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/24. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailSearch-邮件搜索/Controllers/ZGMailMessageSearchViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessageSearchViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/18. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGMailMessageSearchViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/NSDate/NSDate+DDAddition.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDate+DDAddition.h 3 | // IOSDuoduo 4 | // 5 | // Created by 独嘉 on 14-6-5. 6 | // Copyright (c) 2014年 dujia. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDate (DDAddition) 12 | 13 | - (NSString *)transformToFuzzyDate; 14 | - (NSString *)promptDateString; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Controllers/ZGMailListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/20. 6 | // Copyright © 2017年 ZZG. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 邮件列表页面:收件箱列表、草稿箱列表、发件箱、已发送 13 | */ 14 | @interface ZGMailListViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/24. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Controllers/ZGSendingMailListViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGSendingMailListViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/22. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 发件箱列表(用于点击右上角发送中的视图时展示发送中的邮件列表) 13 | */ 14 | @interface ZGSendingMailListViewController : UIViewController 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGAddressShadowButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAddressShadowButton.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/6. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGAddressShadowButton : UIButton 12 | 13 | @property (nonatomic, copy) NSString *shortName; 14 | @property (nonatomic, copy) NSString *mailbox; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGAttachmentTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAttachmentTableViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPPart; 12 | 13 | @interface ZGAttachmentTableViewCell : UITableViewCell 14 | 15 | @property (nonatomic, strong) MCOIMAPPart *part; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageHeaderDetailTimeTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageHeaderDetailTimeTableViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGMessageHeaderDetailTimeTableViewCell : UITableViewCell 12 | 13 | @property (nonatomic, strong) NSDate *date; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListCellPortraitView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListCellPortraitView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/23. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGMailListCellPortraitView : UIView 12 | 13 | @property (nonatomic, strong) UILabel *myLabel; 14 | @property (nonatomic, strong) UIImageView *imageView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_add@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/searchhelp.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "searchhelp.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/AttachmentView/ZGAddAttachmentCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAddAttachmentCollectionViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/26. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGAddAttachmentCollectionViewCell : UICollectionViewCell 12 | 13 | @property (nonatomic, strong) UIImageView *backgroudImageView; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_add.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attach_add@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_mask.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attach_mask@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_reply.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_reply@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/String/NSString+Mail.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Mail.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/15. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (Mail) 12 | 13 | /** 14 | * 格式化size的展示字符(带两位小数) 15 | * 16 | * @param size 大小 17 | * 18 | * @return 格式化的字符串 19 | */ 20 | + (NSString *)formatStringOfSize:(float)size; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/UIImage+MWPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MWPhotoBrowser.h 3 | // Pods 4 | // 5 | // Created by Michael Waterfall on 05/07/2015. 6 | // 7 | // 8 | 9 | #import 10 | 11 | @interface UIImage (MWPhotoBrowser) 12 | 13 | + (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle; 14 | + (UIImage *)clearImageWithSize:(CGSize)size; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_delete.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attach_delete@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attachment_bg.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attachment_bg@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_stop.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_dot_stop@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/defultHeadBig.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "defultHeadBig@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sending.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "mail_sending@3x.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/wmAttachment.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "wmAttachment@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/contactWriteMail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "contactWriteMail@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_pdf_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_pdf_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_ppt_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_ppt_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_txt_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_txt_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_star.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_status_star@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_add_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_add_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_large_pause.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_dot_large_pause@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_excel_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_excel_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_excel_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_excel_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_image_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_image_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_image_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_image_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_others_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_others_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_pdf_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_pdf_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_ppt_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_ppt_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_txt_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_txt_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_word_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_word_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_word_51h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_word_51h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_unread.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_status_unread@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/addressSelectCorrect.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "addressSelectCorrect@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attach_delete_presses.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attach_delete_presses@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/attachment_bg_pressed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "attachment_bg_pressed@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/filetype_others_105h.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "filetype_others_105h@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_dot_large_download.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_dot_large_download@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgNormal.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_roundcornerBgNormal@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_roundcornerBgHighlight.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_roundcornerBgHighlight@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_star.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_star@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_star@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_sent@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_sent@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_draft@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_draft@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_inbox@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_inbox@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_next.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_nav_next@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "btn_nav_next@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/btn_nav_prev.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "btn_nav_prev@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "btn_nav_prev@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_deleted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_deleted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_flagged@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_flagged@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_moveMail.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_moveMail@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_moveMail@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_reply.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_status_reply@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_status_reply@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_selected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "checkmark_selected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "checkmark_selected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_nav_arrow_down.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_nav_arrow_down@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_nav_arrow_down@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_attach.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_status_attach@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_status_attach@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_status_forward.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_status_forward@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_status_forward@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/checkmark_unselected.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "checkmark_unselected@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "checkmark_unselected@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_failed.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_statusbar_failed@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_statusbar_failed@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sent_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_sent_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_sent_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Module/MailContactsDetail-邮件联系人详细/Controllers/ZGMailContactsDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailContactsDetailViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/2. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 邮件联系人详情页面 13 | */ 14 | @interface ZGMailContactsDetailViewController : UIViewController 15 | 16 | @property (nonatomic, copy) NSString *nameStr; 17 | @property (nonatomic, copy) NSString *mailAddressStr; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_sending.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_statusbar_sending@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_statusbar_sending@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_draft_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_draft_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_draft_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_inbox_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_inbox_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_inbox_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_deleted_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_deleted_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_deleted_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_flagged_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_flagged_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_flagged_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/mail_sending_highlighted.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "mail_sending_highlighted@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "mail_sending_highlighted@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/Mail/icon_statusbar_successful.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "icon_statusbar_successful@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "filename" : "icon_statusbar_successful@3x.png", 15 | "scale" : "3x" 16 | } 17 | ], 18 | "info" : { 19 | "version" : 1, 20 | "author" : "xcode" 21 | } 22 | } -------------------------------------------------------------------------------- /ZGMailbox/Other/Common/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/16. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | // Include any system framework and library headers here that should be included in all compilation units. 13 | // You will also need to set the Prefix Header build setting of one or more of your targets to reference this file. 14 | 15 | #import "Header.h" 16 | 17 | #endif /* PrefixHeader_pch */ 18 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Common/Header.h: -------------------------------------------------------------------------------- 1 | // 2 | // Header.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/16. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #ifndef Header_h 10 | #define Header_h 11 | 12 | /***** 包含头文件 */ 13 | #import "ZGConst.h" 14 | #import "Macros.h" 15 | 16 | /***** 开源库 */ 17 | #import 18 | #import 19 | 20 | /** 分类 */ 21 | #import "UIColor+colorWIthHex.h" 22 | #import "UIView+Addition.h" 23 | #import "UIViewController+HUD.h" 24 | 25 | #endif /* Header_h */ 26 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWGridViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWGridViewController.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 08/10/2013. 6 | // 7 | // 8 | 9 | #import 10 | #import "MWPhotoBrowser.h" 11 | 12 | @interface MWGridViewController : UICollectionViewController {} 13 | 14 | @property (nonatomic, assign) MWPhotoBrowser *browser; 15 | @property (nonatomic) BOOL selectionMode; 16 | @property (nonatomic) CGPoint initialContentOffset; 17 | 18 | - (void)adjustOffsetsAsRequired; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/Colors/UIColor+colorWIthHex.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+colorWIthHex.h 3 | // CBExchange 4 | // 5 | // Created by 周中广 on 15/10/21. 6 | // Copyright © 2015年 周中广. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * color生成器 13 | */ 14 | @interface UIColor (colorWIthHex) 15 | 16 | /** 17 | * 创建一个颜色 18 | * 19 | * @param color color的16进制字符串值 20 | * @param alpha 透明度 21 | * 22 | * @return 根据color的16进制值创建的颜色 23 | */ 24 | + (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailAttachment-邮件附件/Views/ZGAttachmentDownloadView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAttachmentDownloadView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGAttachmentDownloadView : UIView 12 | 13 | @property (nonatomic, strong) UIProgressView *progressView; 14 | @property (nonatomic, strong) UILabel *progressLabel; 15 | @property (nonatomic, strong) UILabel *fileNameLabel; 16 | @property (nonatomic, copy) NSString *mimeType; 17 | @property (nonatomic, copy) NSString *filename; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWGridCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWGridCell.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 08/10/2013. 6 | // 7 | // 8 | 9 | #import 10 | #import "MWPhoto.h" 11 | #import "MWGridViewController.h" 12 | 13 | @interface MWGridCell : UICollectionViewCell {} 14 | 15 | @property (nonatomic, weak) MWGridViewController *gridController; 16 | @property (nonatomic) NSUInteger index; 17 | @property (nonatomic) id photo; 18 | @property (nonatomic) BOOL selectionMode; 19 | @property (nonatomic) BOOL isSelected; 20 | 21 | - (void)displayImage; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGMailAddressButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAddressButton.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOAddress; 12 | 13 | /** 14 | * 邮件地址按钮 15 | */ 16 | @interface ZGMailAddressButton : UIButton 17 | 18 | @property (nonatomic, strong) MCOAddress *address; 19 | 20 | @property (nonatomic, strong) UILabel *commaLabel; 21 | 22 | /** 23 | * 显示顿号 24 | */ 25 | - (void)showCommaLabel; 26 | 27 | /** 28 | * 隐藏顿号 29 | */ 30 | - (void)hideCommaLabel; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Common/ZGConst.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGConst.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/16. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGConst : NSObject 12 | 13 | //收到新邮件 14 | extern NSString *const ZGNotificationReceivedNewMail; 15 | 16 | //邮件目录 17 | extern NSString *const MailFolderTypeINBOX; 18 | extern NSString *const MailFolderTypeDraft; 19 | extern NSString *const MailFolderTypeSending; 20 | extern NSString *const MailFolderTypeSent; 21 | extern NSString *const MailFolderTypeTrash; 22 | extern NSString *const MailFolderTypeOther; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListTitleView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListTitleView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/23. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGMailListTitleViewDelegate; 12 | 13 | @interface ZGMailListTitleView : UIView 14 | 15 | @property (nonatomic, strong) UILabel *titleLabel; 16 | @property (nonatomic, weak) id delegate; 17 | @property (nonatomic, assign) BOOL isArrowDown; 18 | 19 | @end 20 | 21 | @protocol ZGMailListTitleViewDelegate 22 | 23 | - (void)mailListTitleViewPrssed:(ZGMailListTitleView *)titleView; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Common/ZGConst.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGConst.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/16. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGConst.h" 10 | 11 | @implementation ZGConst 12 | 13 | //收到新邮件 14 | NSString *const ZGNotificationReceivedNewMail = @"NotificationReceivedNewMail"; 15 | 16 | //邮件目录 17 | NSString *const MailFolderTypeINBOX = @"INBOX"; 18 | NSString *const MailFolderTypeDraft = @"Draft"; 19 | NSString *const MailFolderTypeSent = @"Sent"; 20 | NSString *const MailFolderTypeSending = @"Sending"; 21 | NSString *const MailFolderTypeTrash = @"Trash"; 22 | NSString *const MailFolderTypeOther = @"Other"; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/ZGSendMailTopIndicator.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGSendMailTopIndicator.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGSendMailTopIndicator : UIWindow 12 | 13 | /** 14 | * 展示 15 | */ 16 | - (void)show; 17 | 18 | /** 19 | * 是否正在展示 20 | */ 21 | - (BOOL)isPresenting; 22 | 23 | /** 24 | * 隐藏 25 | */ 26 | - (void)hide; 27 | 28 | - (void)setProgress:(float)progress; 29 | 30 | - (void)setProgressLabel:(NSString *)str; 31 | 32 | - (void)showSuccessView; 33 | 34 | - (void)showSuccessViewWithTotalCount:(NSUInteger)count; 35 | 36 | - (void)showFailureView; 37 | 38 | @end 39 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWTapDetectingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewTap.h 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol MWTapDetectingViewDelegate; 12 | 13 | @interface MWTapDetectingView : UIView {} 14 | 15 | @property (nonatomic, weak) id tapDelegate; 16 | 17 | @end 18 | 19 | @protocol MWTapDetectingViewDelegate 20 | 21 | @optional 22 | 23 | - (void)view:(UIView *)view singleTapDetected:(UITouch *)touch; 24 | - (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch; 25 | - (void)view:(UIView *)view tripleTapDetected:(UITouch *)touch; 26 | 27 | @end -------------------------------------------------------------------------------- /ZGMailbox/Module/MailAttachment-邮件附件/Controllers/ZGMessageAttachmentViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageAttachmentViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPPart; 12 | //@class MCOAttachment; 13 | @class MCOIMAPSession; 14 | @class MCOIMAPMessage; 15 | 16 | @interface ZGMessageAttachmentViewController : UIViewController 17 | 18 | @property (nonatomic, strong) MCOIMAPPart *part; 19 | //@property (nonatomic, strong) MCOAttachment *attachment; 20 | @property (nonatomic, copy) NSString *folder; 21 | @property (nonatomic, strong) MCOIMAPSession *session; 22 | @property (nonatomic, strong) MCOIMAPMessage *message; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/UIImage+MWPhotoBrowser.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImage+MWPhotoBrowser.m 3 | // Pods 4 | // 5 | // Created by Michael Waterfall on 05/07/2015. 6 | // 7 | // 8 | 9 | #import "UIImage+MWPhotoBrowser.h" 10 | 11 | @implementation UIImage (MWPhotoBrowser) 12 | 13 | + (UIImage *)imageForResourcePath:(NSString *)path ofType:(NSString *)type inBundle:(NSBundle *)bundle { 14 | return [UIImage imageWithContentsOfFile:[bundle pathForResource:path ofType:type]]; 15 | } 16 | 17 | + (UIImage *)clearImageWithSize:(CGSize)size { 18 | UIGraphicsBeginImageContextWithOptions(size, NO, [UIScreen mainScreen].scale); 19 | UIImage *blank = UIGraphicsGetImageFromCurrentImageContext(); 20 | UIGraphicsEndImageContext(); 21 | return blank; 22 | } 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZGMailboxTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZGMailboxUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWTapDetectingImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageViewTap.h 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol MWTapDetectingImageViewDelegate; 12 | 13 | @interface MWTapDetectingImageView : UIImageView {} 14 | 15 | @property (nonatomic, weak) id tapDelegate; 16 | 17 | @end 18 | 19 | @protocol MWTapDetectingImageViewDelegate 20 | 21 | @optional 22 | 23 | - (void)imageView:(UIImageView *)imageView singleTapDetected:(UITouch *)touch; 24 | - (void)imageView:(UIImageView *)imageView doubleTapDetected:(UITouch *)touch; 25 | - (void)imageView:(UIImageView *)imageView tripleTapDetected:(UITouch *)touch; 26 | 27 | @end -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageAttachmentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageAttachmentView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPPart; 12 | @protocol ZGMessageAttachmentViewDelegate; 13 | 14 | /** 15 | * 插件视图 16 | */ 17 | @interface ZGMessageAttachmentView : UIView 18 | 19 | @property (nonatomic, strong) UITableView *myTableView; 20 | @property (nonatomic, copy) NSArray *attachments; 21 | @property (nonatomic, weak) id delegate; 22 | 23 | - (float)heightOfAttachmentView; 24 | 25 | - (void)reloadTableView; 26 | 27 | @end 28 | 29 | @protocol ZGMessageAttachmentViewDelegate 30 | 31 | - (void)messageAttachmentView:(ZGMessageAttachmentView *)attachmentView selectAttachment:(MCOIMAPPart *)part; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageHeaderDetailAttachmentTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageHeaderDetailAttachmentTableViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZGAddressShadowButton; 12 | @protocol ZGMessageHeaderDetailAttachmentTableViewCellDelegate; 13 | 14 | @interface ZGMessageHeaderDetailAttachmentTableViewCell : UITableViewCell 15 | 16 | @property (nonatomic, weak) id delegate; 17 | @property (nonatomic, copy) NSArray *attachments; 18 | 19 | @end 20 | 21 | @protocol ZGMessageHeaderDetailAttachmentTableViewCellDelegate 22 | 23 | - (void)headerDetailAttachmentCell:(ZGMessageHeaderDetailAttachmentTableViewCell *)cell attacmentButtonPressed:(ZGAddressShadowButton *)button; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/String/NSString+Mail.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+Mail.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/15. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import "NSString+Mail.h" 10 | 11 | @implementation NSString (Mail) 12 | 13 | /** 14 | * 格式化size的展示字符 15 | * 16 | * @param size 17 | * 18 | * @return 19 | */ 20 | + (NSString *)formatStringOfSize:(float)size { 21 | NSString *strOfNetworkFlow = @""; 22 | NSString *strOfUnit = @""; 23 | 24 | if (size / 1024 >= 1000) {//M 25 | strOfNetworkFlow = [NSString stringWithFormat:@"%.2f", size / (1024.0 * 1024.0)]; 26 | strOfUnit = @"M"; 27 | } else {//K 28 | strOfNetworkFlow = [NSString stringWithFormat:@"%.2f", size / 1024.0f]; 29 | strOfUnit = @"K"; 30 | } 31 | 32 | return [strOfNetworkFlow stringByAppendingString:strOfUnit]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWCommon.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWPreprocessor.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 01/10/2013. 6 | // 7 | 8 | #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedSame) 9 | #define SYSTEM_VERSION_GREATER_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedDescending) 10 | #define SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedAscending) 11 | #define SYSTEM_VERSION_LESS_THAN(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] == NSOrderedAscending) 12 | #define SYSTEM_VERSION_LESS_THAN_OR_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] compare:v options:NSNumericSearch] != NSOrderedDescending) 13 | -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | # platform :ios, '8.0' 3 | 4 | source 'https://github.com/CocoaPods/Specs.git' 5 | platform :ios, '9.0' 6 | 7 | target 'ZGMailbox' do 8 | # Uncomment the next line if you're using Swift or would like to use dynamic frameworks 9 | # use_frameworks! 10 | 11 | # Pods for ZGMailbox 12 | pod 'Masonry'#布局 13 | pod 'MJRefresh'#下拉刷新 14 | pod 'MyLayout' #流式布局 15 | # pod 'mailcore2-ios'#邮件协议 16 | pod 'TTTAttributedLabel'#富文本 17 | pod 'pop'#动画库 18 | pod 'TZImagePickerController'#图片选择器 19 | pod 'SDWebImage'#图片加载 20 | pod 'DACircularProgress'#已停止更新 21 | pod 'MBProgressHUD'#加载视图 22 | pod 'DZNEmptyDataSet' #页面空数据视图 23 | 24 | target 'ZGMailboxTests' do 25 | inherit! :search_paths 26 | # Pods for testing 27 | end 28 | 29 | target 'ZGMailboxUITests' do 30 | inherit! :search_paths 31 | # Pods for testing 32 | end 33 | 34 | end 35 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Manager/MCOCIDURLProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCTCIDURLProtocol.h 3 | // testUI 4 | // 5 | // Created by DINH Viêt Hoà on 1/22/13. 6 | // Copyright (c) 2013 MailCore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #include 12 | 13 | @interface MCOCIDURLProtocol : NSURLProtocol 14 | 15 | + (void) registerProtocol; 16 | 17 | + (BOOL) isCID:(NSURL *)url; 18 | + (BOOL) isXMailcoreImage:(NSURL *)url; 19 | 20 | #ifdef __cplusplus 21 | + (void) startLoadingWithMessage:(MCOAbstractMessage *)message 22 | partUniqueID:(NSString *)partUniqueID 23 | data:(NSData *)data 24 | request:(NSMutableURLRequest *)request; 25 | 26 | + (void) partDownloadedMessage:(MCOAbstractMessage *)message 27 | partUniqueID:(NSString *)partUniqueID 28 | data:(NSData *)data; 29 | #endif 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageHeaderDetailAddressTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageHeaderDetailAddressTableViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZGAddressShadowButton; 12 | @class MCOAddress; 13 | @protocol ZGMessageHeaderDetailAddressTableViewCellDelegate; 14 | 15 | @interface ZGMessageHeaderDetailAddressTableViewCell : UITableViewCell 16 | 17 | @property (nonatomic, weak) id delegate; 18 | @property (nonatomic, strong) MCOAddress *address; 19 | 20 | @property (nonatomic, strong) UILabel *titleLabel; 21 | 22 | @end 23 | 24 | @protocol ZGMessageHeaderDetailAddressTableViewCellDelegate 25 | 26 | - (void)headerDetailAddressCell:(ZGMessageHeaderDetailAddressTableViewCell *)tableViewCell addressButtonPressed:(ZGAddressShadowButton *)button; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGMailAddressTextField.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAddressTextField.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGMailAddressTextFieldDelegate; 12 | 13 | /** 14 | * 邮件地址输入textField,可以隐藏光标,但不放弃第一响应 15 | */ 16 | @interface ZGMailAddressTextField : UITextField 17 | 18 | @property (nonatomic, weak) id addressTextFieldDelegate; 19 | 20 | /** 21 | * 展示光标(同时移除遮罩) 22 | */ 23 | - (void)showCursor; 24 | 25 | /** 26 | * 隐藏光标(同时添加遮罩),并没有放弃第一响应 27 | */ 28 | - (void)hideCuresor; 29 | 30 | @end 31 | 32 | @protocol ZGMailAddressTextFieldDelegate 33 | 34 | /** 35 | * 键盘删除按钮点击 36 | */ 37 | - (void)textFieldDidDelete; 38 | 39 | /** 40 | * 单击手势 41 | */ 42 | - (void)mailAddressTextField:(ZGMailAddressTextField *)textField didRecognizeTapGesture:(UITapGestureRecognizer *)gesture; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/AttachmentView/ZGWriteMailFileAttachmentCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGWriteMailFileAttachmentCollectionViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/8. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPPart; 12 | @protocol ZGWriteMailFileAttachmentCollectionViewCellDelegate; 13 | 14 | /** 15 | * 写邮件文件附件cell 16 | */ 17 | @interface ZGWriteMailFileAttachmentCollectionViewCell : UICollectionViewCell 18 | 19 | @property (nonatomic, strong) UIImageView *backgroudImageView; 20 | 21 | @property (nonatomic, strong) MCOIMAPPart *part; 22 | @property (nonatomic, weak) id delegate; 23 | 24 | @end 25 | 26 | @protocol ZGWriteMailFileAttachmentCollectionViewCellDelegate 27 | 28 | - (void)writeMailFileAttachmentCollectionViewCell:(ZGWriteMailFileAttachmentCollectionViewCell *)attachmentViewCell deleteButtonPressed:(UIButton *)button; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Models/ZGMailAttachmetPhoto.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAttachmetPhoto.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/22. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //图片浏览 12 | #import "MWPhoto.h" 13 | #import "MWPhotoProtocol.h" 14 | 15 | @class MCOIMAPPart; 16 | @class MCOIMAPMessage; 17 | 18 | //自定义邮件消息图片附件浏览photo类 19 | @interface ZGMailAttachmetPhoto : NSObject 20 | 21 | @property (nonatomic, strong) NSString *caption; 22 | @property (nonatomic, readonly) UIImage *image; 23 | @property (nonatomic, readonly) MCOIMAPPart *imagePart; 24 | 25 | @property (nonatomic, strong) NSString *folder; 26 | @property (nonatomic, strong) MCOIMAPMessage *message; 27 | 28 | 29 | + (ZGMailAttachmetPhoto *)photoWithImagePart:(MCOIMAPPart *)imagePart folder:(NSString *)folder message:(MCOIMAPMessage *)message; 30 | 31 | - (id)initWithImagePart:(MCOIMAPPart *)imagePart folder:(NSString *)folder message:(MCOIMAPMessage *)message; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Controllers/ZGMailMessageDetailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessageDetailViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/27. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPSession; 12 | @class MCOIMAPMessage; 13 | @protocol ZGMailMessageDetailViewControllerDelegate; 14 | 15 | ///邮件详情页面 16 | @interface ZGMailMessageDetailViewController : UIViewController 17 | 18 | @property (nonatomic, weak) id delegate; 19 | 20 | @property (nonatomic, copy) NSString *folder; 21 | @property (nonatomic, strong) MCOIMAPSession *session; 22 | @property (nonatomic, strong) MCOIMAPMessage *imapMessage; 23 | @property (nonatomic, strong) NSIndexPath *indexPath; 24 | 25 | @end 26 | 27 | @protocol ZGMailMessageDetailViewControllerDelegate 28 | 29 | - (void)messageDetailVC:(ZGMailMessageDetailViewController *)messageDetailVC deleteMessageAtIndexPath:(NSIndexPath *)indexPath; 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/RSA/RSA.h: -------------------------------------------------------------------------------- 1 | /* 2 | @author: ideawu 3 | @link: https://github.com/ideawu/Objective-C-RSA 4 | */ 5 | 6 | #import 7 | 8 | @interface RSA : NSObject 9 | 10 | // return base64 encoded string 11 | + (NSString *)encryptString:(NSString *)str publicKey:(NSString *)pubKey; 12 | // return raw data 13 | + (NSData *)encryptData:(NSData *)data publicKey:(NSString *)pubKey; 14 | // return base64 encoded string 15 | // enc with private key NOT working YET! 16 | //+ (NSString *)encryptString:(NSString *)str privateKey:(NSString *)privKey; 17 | // return raw data 18 | //+ (NSData *)encryptData:(NSData *)data privateKey:(NSString *)privKey; 19 | 20 | // decrypt base64 encoded string, convert result to string(not base64 encoded) 21 | + (NSString *)decryptString:(NSString *)str publicKey:(NSString *)pubKey; 22 | + (NSData *)decryptData:(NSData *)data publicKey:(NSString *)pubKey; 23 | + (NSString *)decryptString:(NSString *)str privateKey:(NSString *)privKey; 24 | + (NSData *)decryptData:(NSData *)data privateKey:(NSString *)privKey; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /ZGMailboxTests/ZGMailboxTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailboxTests.m 3 | // ZGMailboxTests 4 | // 5 | // Created by zzg on 2018/1/24. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGMailboxTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZGMailboxTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMailMessageHeaderDetailView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessageHeaderDetailView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/6. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOMessageHeader; 12 | @class MCOIMAPMessage; 13 | @class ZGAddressShadowButton; 14 | @protocol ZGMailMessageHeaderDetailViewDelegate; 15 | 16 | /** 17 | * 邮件消息页面顶部详情视图 18 | */ 19 | @interface ZGMailMessageHeaderDetailView : UIView 20 | 21 | @property (nonatomic, strong) MCOIMAPMessage *message; 22 | @property (nonatomic, weak) id delegate; 23 | 24 | - (void)reloadTableView; 25 | 26 | - (float)heightOfMailDetailView; 27 | 28 | @end 29 | 30 | @protocol ZGMailMessageHeaderDetailViewDelegate 31 | 32 | - (void)headerDetailView:(ZGMailMessageHeaderDetailView *)headerDetailView addressButtonPressed:(ZGAddressShadowButton *)button; 33 | - (void)headerDetailView:(ZGMailMessageHeaderDetailView *)headerDetailView attachmentButtonPressed:(ZGAddressShadowButton *)button; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWZoomingScrollView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZoomingScrollView.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 14/10/2010. 6 | // Copyright 2010 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MWPhotoProtocol.h" 11 | #import "MWTapDetectingImageView.h" 12 | #import "MWTapDetectingView.h" 13 | 14 | @class MWPhotoBrowser, MWPhoto, MWCaptionView; 15 | 16 | @interface MWZoomingScrollView : UIScrollView { 17 | 18 | } 19 | 20 | @property () NSUInteger index; 21 | @property (nonatomic) id photo; 22 | @property (nonatomic, weak) MWCaptionView *captionView; 23 | @property (nonatomic, weak) UIButton *selectedButton; 24 | @property (nonatomic, weak) UIButton *playButton; 25 | 26 | - (id)initWithPhotoBrowser:(MWPhotoBrowser *)browser; 27 | - (void)displayImage; 28 | - (void)displayImageFailure; 29 | - (void)setMaxMinZoomScalesForCurrentBounds; 30 | - (void)prepareForReuse; 31 | - (BOOL)displayingVideo; 32 | - (void)setImageHidden:(BOOL)hidden; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Controllers/ZGNewMailViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGNewMailViewController.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/28. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOAddress; 12 | @class MCOIMAPMessage; 13 | @class MCOIMAPSession; 14 | @class MCOMessageParser; 15 | @class ZGMailMessage; 16 | 17 | typedef NS_ENUM(NSUInteger, NewMailType) { 18 | NewMailTypeDefault,//新邮件 19 | NewMailTypeReply,//回复 20 | NewMailTypeReplyAll,//回复全部 21 | NewMailTypeForward,//转发 22 | NewMailTypeDraft,//草稿 23 | NewMailTypeSending,//发件箱邮件 24 | }; 25 | 26 | 27 | @interface ZGNewMailViewController : UIViewController 28 | 29 | @property (nonatomic, strong) MCOAddress *recipientAddress; 30 | @property (nonatomic, assign) NewMailType newMailType; 31 | 32 | //回复、转发邮件,加载原始邮件使用 33 | @property (nonatomic, strong) MCOIMAPMessage *originImapMessage; 34 | @property (nonatomic, strong) MCOIMAPSession *session; 35 | @property (nonatomic, copy) NSString *originMessageFolder; 36 | 37 | 38 | //草稿、发件箱邮件数据源 39 | @property (nonatomic, strong) ZGMailMessage *mailMessage; 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/AttachmentView/ZGWriteMailImageAttachmentCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGWriteMailImageAttachmentCollectionViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/26. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGWriteMailImageAttachmentCollectionViewCellDelegate; 12 | 13 | /** 14 | * 写邮件图片附件cell 15 | */ 16 | @interface ZGWriteMailImageAttachmentCollectionViewCell : UICollectionViewCell 17 | 18 | @property (nonatomic, weak) id delegate; 19 | 20 | //@property (nonatomic, strong) NSIndexPath *indexPath; 21 | @property (nonatomic, strong) UIImageView *attachmentPreviewImageView; 22 | 23 | @property (nonatomic, strong) NSData *imageData; 24 | @property (nonatomic, copy) NSString *imageName; 25 | @property (nonatomic, strong) NSIndexPath *indexPath; 26 | 27 | @end 28 | 29 | @protocol ZGWriteMailImageAttachmentCollectionViewCellDelegate 30 | 31 | - (void)writeMailImageAttachmentCollectionViewCell:(ZGWriteMailImageAttachmentCollectionViewCell *)attachmentViewCell deleteButtonPressed:(UIButton *)button; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Models/ZGMailMessage.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessage.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/11. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 消息的状态 13 | */ 14 | typedef NS_ENUM(NSInteger, MailMessageStatus) { 15 | MailMessageStatus_Wait, 16 | MailMessageStatus_Sending, 17 | MailMessageStatus_Draft, 18 | MailMessageStatus_Failure, 19 | }; 20 | 21 | @class MCOIMAPMessage; 22 | @class MCOMessageHeader; 23 | 24 | @interface ZGMailMessage : NSObject 25 | 26 | @property (nonatomic, assign) MailMessageStatus messageStatus; 27 | @property (nonatomic, copy) NSString *failureString;//邮件发送失败原因 28 | 29 | 30 | @property (nonatomic, strong) MCOMessageHeader *header; 31 | @property (nonatomic, copy) NSString *bodyText; 32 | @property (nonatomic, strong) NSArray *attachmentsFilenameArray;//附件文件名数组 33 | 34 | //原始邮件的数据 35 | @property (nonatomic, strong) MCOIMAPMessage *originImapMessage; 36 | @property (nonatomic, copy) NSString *originMessageFolder;//原始邮件的文件夹 37 | @property (nonatomic, strong) NSArray *originMessageParts;//原始邮件附件数据(MCOIMAPPart),用于附件展示、编辑 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWCaptionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWCaptionView.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 30/12/2011. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MWPhotoProtocol.h" 11 | 12 | @interface MWCaptionView : UIToolbar 13 | 14 | // Init 15 | - (id)initWithPhoto:(id)photo; 16 | 17 | // To create your own custom caption view, subclass this view 18 | // and override the following two methods (as well as any other 19 | // UIView methods that you see fit): 20 | 21 | // Override -setupCaption so setup your subviews and customise the appearance 22 | // of your custom caption 23 | // You can access the photo's data by accessing the _photo ivar 24 | // If you need more data per photo then simply subclass MWPhoto and return your 25 | // subclass to the photo browsers -photoBrowser:photoAtIndex: delegate method 26 | - (void)setupCaption; 27 | 28 | // Override -sizeThatFits: and return a CGSize specifying the height of your 29 | // custom caption view. With width property is ignored and the caption is displayed 30 | // the full width of the screen 31 | - (CGSize)sizeThatFits:(CGSize)size; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListBottomToolBar.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListBottomToolBar.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/15. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGMailListBottomToolBarDelegate; 12 | 13 | /** 14 | * 修改标记按钮类型 15 | */ 16 | typedef NS_ENUM(NSInteger, FlaButtonType) { 17 | FlaButtonType_Delete,//只有删除按钮 18 | FlaButtonType_FlagAndDelete,//标记+删除 19 | FlaButtonType_AllFlagSeenAndDelete//全部已读+删除 20 | }; 21 | 22 | ///邮件列表底部工具条 23 | @interface ZGMailListBottomToolBar : UIView 24 | 25 | @property (nonatomic, weak) id toolBarDelegate; 26 | 27 | - (void)setDeleteButtonEnable:(BOOL)enable; 28 | 29 | - (void)setFlagButtonType:(FlaButtonType)type; 30 | 31 | @end 32 | 33 | @protocol ZGMailListBottomToolBarDelegate 34 | 35 | ///全部标记按钮点击 36 | - (void)mailListBottomToolBarAllFlagButtonPressed:(ZGMailListBottomToolBar *)bottomToolBar; 37 | 38 | ///标记按钮点击 39 | - (void)mailListBottomToolBarFlagButtonPressed:(ZGMailListBottomToolBar *)bottomToolBar; 40 | 41 | ///删除按钮点击 42 | - (void)mailListBottomToolBarDeleteButtonPressed:(ZGMailListBottomToolBar *)bottomToolBar; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWPhoto.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWPhoto.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 17/10/2010. 6 | // Copyright 2010 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | #import "MWPhotoProtocol.h" 12 | 13 | // This class models a photo/image and it's caption 14 | // If you want to handle photos, caching, decompression 15 | // yourself then you can simply ensure your custom data model 16 | // conforms to MWPhotoProtocol 17 | @interface MWPhoto : NSObject 18 | 19 | @property (nonatomic, strong) NSString *caption; 20 | @property (nonatomic, strong) NSURL *videoURL; 21 | @property (nonatomic) BOOL emptyImage; 22 | @property (nonatomic) BOOL isVideo; 23 | 24 | + (MWPhoto *)photoWithImage:(UIImage *)image; 25 | + (MWPhoto *)photoWithURL:(NSURL *)url; 26 | + (MWPhoto *)photoWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize; 27 | + (MWPhoto *)videoWithURL:(NSURL *)url; // Initialise video with no poster image 28 | 29 | - (id)init; 30 | - (id)initWithImage:(UIImage *)image; 31 | - (id)initWithURL:(NSURL *)url; 32 | - (id)initWithAsset:(PHAsset *)asset targetSize:(CGSize)targetSize; 33 | - (id)initWithVideoURL:(NSURL *)url; 34 | 35 | @end 36 | 37 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGSubjectEditView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGSubjectEditView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/24. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGSubjectEditViewDelegate; 12 | 13 | /** 14 | * 邮件主题编辑视图 15 | */ 16 | @interface ZGSubjectEditView : UIView 17 | 18 | @property (nonatomic, weak) id delegate; 19 | 20 | /** 21 | * 获取邮件主题 22 | * 23 | * @return 邮件主题 24 | */ 25 | - (NSString *)mailSubject; 26 | 27 | /** 28 | * 设置附件个数 29 | * 30 | * @param attachmentNumber 附件个数 31 | */ 32 | - (void)setAttachmentNumber:(NSInteger)attachmentNumber; 33 | 34 | /** 35 | * 设置主题 36 | * 37 | * @param subjectStr 邮件主题 38 | */ 39 | - (void)setSubject:(NSString *)subjectStr; 40 | 41 | @end 42 | 43 | @protocol ZGSubjectEditViewDelegate 44 | 45 | - (void)subjectEditViewBeginEditing:(ZGSubjectEditView *)subjectEditView; 46 | - (void)subjectEditViewEndEditing:(ZGSubjectEditView *)subjectEditView; 47 | 48 | /** 49 | * 附件按钮点击 50 | * 51 | * @param subjectEditView <#subjectEditView description#> 52 | * @param button <#button description#> 53 | */ 54 | - (void)subjectEditView:(ZGSubjectEditView *)subjectEditView attachmentButtonPressed:(UIButton *)button; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Models/ZGMailRecord.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailRecord.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPMessage; 12 | @class ZGMailMessage; 13 | 14 | @interface ZGMailRecord : NSObject 15 | 16 | @property (nonatomic, copy) NSString *messageID; 17 | 18 | @property (nonatomic, copy) NSString *sender;//发件人 19 | @property (nonatomic, copy) NSString *senderPortrait;//发件人头像 20 | 21 | @property (nonatomic, copy) NSString *receiver;//收件人 22 | @property (nonatomic, copy) NSString *receiverPortrait;//收件人头像(如果有多个只取第一个) 23 | 24 | @property (nonatomic, copy) NSString *subject;//主题 25 | @property (nonatomic, copy) NSDate *date;//时间 26 | 27 | @property (nonatomic, assign) BOOL isUnread;//未读 28 | @property (nonatomic, assign) BOOL isReply;//回复(回复别人的邮件、别人回复了你的邮件) 29 | @property (nonatomic, assign) BOOL isForwarded;//转发(转发了邮件) 30 | @property (nonatomic, assign) BOOL isStarred;//星标 31 | @property (nonatomic, assign) BOOL isHaveAttachment;//附件 32 | 33 | - (instancetype)initWithImapMessage:(MCOIMAPMessage *)message; 34 | 35 | /** 36 | * 草稿箱、发件箱数据 37 | * 38 | * @param message 自定义消息对象 39 | * 40 | * @return 返回 41 | */ 42 | - (instancetype)initWithMailMessage:(ZGMailMessage *)message; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Common/Macros.h: -------------------------------------------------------------------------------- 1 | // 2 | // Macros.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/16. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #ifndef Macros_h 10 | #define Macros_h 11 | 12 | /** 13 | * 判断一个字符串是否是空的 14 | */ 15 | #define IsEmptyString(str) (![str isKindOfClass:[NSString class]] || (!str || [[str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] isEqualToString:@""])) 16 | 17 | //屏幕分辨率 18 | #define ScreenSize [[UIScreen mainScreen] currentMode].size 19 | //设备尺寸 20 | #define ScreenHeight [[UIScreen mainScreen] bounds].size.height 21 | #define ScreenWidth [[UIScreen mainScreen] bounds].size.width 22 | 23 | /** 24 | * 邮件发件箱列表刷新通知 25 | * 26 | */ 27 | #define MailSendingFolderReloadNotification @"MailSendingFolderReloadNotification" 28 | 29 | /** 30 | * 收件箱未读消息个数 31 | */ 32 | #define Mailaddress_KEY @"Mailaddress" 33 | #define Password_KEY @"Password" 34 | #define InboxUnseenMailNumber_KEY @"InboxUnseenMailNumber" 35 | #define InboxUidNext_KEY @"InboxUidNext" 36 | 37 | /***** NSNotificationCenter通知名称 *****/ 38 | /** 39 | * 展示邮件列表页 40 | */ 41 | #define ShowMailListControllerNotification @"ShowMailListControllerNotification" 42 | 43 | #endif /* Macros_h */ 44 | -------------------------------------------------------------------------------- /ZGMailboxUITests/ZGMailboxUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailboxUITests.m 3 | // ZGMailboxUITests 4 | // 5 | // Created by zzg on 2018/1/24. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZGMailboxUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZGMailboxUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMailMessageHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessageHeaderView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/5. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class MCOIMAPMessage; 12 | @protocol ZGMailMessageHeaderViewDelegate; 13 | @class ZGAddressShadowButton; 14 | 15 | /** 16 | * 邮件消息顶部视图 17 | */ 18 | @interface ZGMailMessageHeaderView : UIView 19 | 20 | @property (nonatomic, strong) MCOIMAPMessage *message; 21 | @property (nonatomic, weak) id delegate; 22 | 23 | - (float)heightOfMessageHeaderView; 24 | - (float)heightOfSummaryMessageHeaderView; 25 | 26 | - (void)hideMailDetailView; 27 | 28 | - (void)showStarImageView; 29 | 30 | - (void)hideStarImageView; 31 | 32 | - (void)showUnseenImageView; 33 | 34 | - (void)hideUnseenImageView; 35 | 36 | @end 37 | 38 | @protocol ZGMailMessageHeaderViewDelegate 39 | 40 | - (void)headerView:(ZGMailMessageHeaderView *)headerView detailButtonPressed:(id)sender; 41 | 42 | - (void)headerView:(ZGMailMessageHeaderView *)headerView hideButtonPressed:(id)sender; 43 | 44 | - (void)headerView:(ZGMailMessageHeaderView *)headerView addressButtonPressed:(ZGAddressShadowButton *)button; 45 | 46 | - (void)headerView:(ZGMailMessageHeaderView *)headerView attachmentButtonPressed:(ZGAddressShadowButton *)button; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListTableViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListTableViewCell.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZGMailRecord; 12 | @class MCOIMAPMessageRenderingOperation; 13 | @protocol ZGMailListTableViewCellDelegate; 14 | 15 | @interface ZGMailListTableViewCell : UITableViewCell 16 | 17 | @property (nonatomic, strong) NSString *folderType;//文件夹 18 | @property (nonatomic, strong) ZGMailRecord *mailRecord; 19 | @property (nonatomic, strong) UIImageView *multipleSelectImageView;//多选图片 20 | @property (nonatomic, strong) UILabel *contentLabel;//内容 21 | @property (nonatomic, strong) UILabel *failureLabel; 22 | 23 | @property (nonatomic, strong) UIProgressView *progressView; 24 | 25 | @property (nonatomic, strong) NSIndexPath *indexPath; 26 | @property (nonatomic, weak) id delegate; 27 | 28 | @property (nonatomic, strong) MCOIMAPMessageRenderingOperation * messageRenderingOperation; 29 | 30 | - (void)showStar:(BOOL)isShow; 31 | 32 | - (void)showUnseen:(BOOL)isShow; 33 | 34 | - (void)showProgressView; 35 | 36 | //- (void)showContentLabel; 37 | 38 | @end 39 | 40 | @protocol ZGMailListTableViewCellDelegate 41 | 42 | - (void)mailListTableViewCell:(ZGMailListTableViewCell *)cell cancelButtonPressed:(UIButton *)sender; 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailSearch-邮件搜索/Views/ZGRoundSearchBar.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGRoundSearchBar.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/6/6. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGRoundSearchBar.h" 10 | 11 | @implementation ZGRoundSearchBar 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame { 14 | self = [super initWithFrame:frame]; 15 | if (self) { 16 | self.backgroundImage = [UIImage new]; 17 | self.searchTextPositionAdjustment = UIOffsetMake(4, 0); 18 | 19 | UIImage *image = [UIImage imageNamed:@"searchBarBg"]; 20 | image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(6, 6, 6, 6) resizingMode:UIImageResizingModeStretch]; 21 | [self setSearchFieldBackgroundImage:image forState:UIControlStateNormal]; 22 | 23 | UITextField *searchField = [self valueForKey:@"searchField"]; 24 | if (searchField) { 25 | searchField.tintColor = [UIColor colorWithHexString:@"C4261D" alpha:1.0f]; 26 | searchField.clearButtonMode = UITextFieldViewModeNever; 27 | searchField.font = [UIFont systemFontOfSize:15]; 28 | } 29 | } 30 | return self; 31 | } 32 | 33 | /* 34 | // Only override drawRect: if you perform custom drawing. 35 | // An empty implementation adversely affects performance during animation. 36 | - (void)drawRect:(CGRect)rect { 37 | // Drawing code 38 | } 39 | */ 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /ZGMailbox/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGSenderButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGSenderButton.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/19. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGSenderButton.h" 10 | 11 | @interface ZGSenderButton () 12 | 13 | @property (nonatomic, strong) UIView *separatorView; 14 | 15 | @end 16 | 17 | @implementation ZGSenderButton 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | [self addSubview:self.separatorView]; 23 | 24 | //设置设备上显示1个像素的线 25 | float floatsortaPixel = 1.0 / [UIScreen mainScreen].scale; 26 | [self.separatorView mas_makeConstraints:^(MASConstraintMaker *make) { 27 | make.bottom.mas_equalTo(self.mas_bottom).offset(-floatsortaPixel); 28 | make.height.mas_equalTo(floatsortaPixel); 29 | make.leading.mas_equalTo(self.mas_leading).offset(15); 30 | make.trailing.mas_equalTo(self); 31 | }]; 32 | } 33 | 34 | return self; 35 | } 36 | 37 | - (CGRect)titleRectForContentRect:(CGRect)contentRect { 38 | contentRect.origin.x = 15; 39 | 40 | return contentRect; 41 | } 42 | 43 | #pragma mark - setter and getter 44 | 45 | - (UIView *)separatorView { 46 | if (_separatorView == nil) { 47 | _separatorView = [[UIView alloc] init]; 48 | _separatorView.backgroundColor = [UIColor colorWithHexString:@"c8c8c8" alpha:1.0f]; 49 | } 50 | 51 | return _separatorView; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/MCOMessageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // MCOMessageView.h 3 | // testUI 4 | // 5 | // Created by DINH Viêt Hoà on 1/19/13. 6 | // Copyright (c) 2013 MailCore. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import 12 | 13 | @class MCOIMAPSession; 14 | 15 | typedef NS_ENUM(NSUInteger, MessageType) { 16 | MessageTypeNormal,//常规邮件 17 | MessageTypeOriginal,//原始邮件 18 | }; 19 | 20 | @protocol MCOMessageViewDelegate; 21 | 22 | @interface MCOMessageView : UIView 23 | 24 | @property (nonatomic, strong) UIScrollView *webScrollView; 25 | 26 | @property (nonatomic, strong) MCOIMAPSession *session; 27 | @property (nonatomic, copy) NSString *folder; 28 | @property (nonatomic, strong) MCOIMAPMessage *imapMessage; 29 | @property (nonatomic, assign) MessageType messageType; 30 | 31 | @property (nonatomic, assign) id delegate; 32 | 33 | @property (nonatomic, assign) BOOL prefetchIMAPImagesEnabled; 34 | @property (nonatomic, assign) BOOL prefetchIMAPAttachmentsEnabled; 35 | 36 | @property (nonatomic, copy) NSString *messageHtmlString; 37 | 38 | - (BOOL)isLoading; 39 | 40 | @end 41 | 42 | @protocol MCOMessageViewDelegate 43 | 44 | @optional 45 | 46 | - (BOOL)MCOMessageView:(MCOMessageView *)view webViewShouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType; 47 | 48 | - (void)MCOMessageView:(MCOMessageView *)view webViewDidFinishLoad:(UIWebView *)webView; 49 | - (void)MCOMessageView:(MCOMessageView *)view webViewDidFailLoad:(UIWebView *)webView; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/HPGrowingTextView/HPTextViewInternal.h: -------------------------------------------------------------------------------- 1 | // 2 | // HPTextViewInternal.h 3 | // 4 | // Created by Hans Pinckaers on 29-06-10. 5 | // 6 | // MIT License 7 | // 8 | // Copyright (c) 2011 Hans Pinckaers 9 | // 10 | // Permission is hereby granted, free of charge, to any person obtaining a copy 11 | // of this software and associated documentation files (the "Software"), to deal 12 | // in the Software without restriction, including without limitation the rights 13 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | // copies of the Software, and to permit persons to whom the Software is 15 | // furnished to do so, subject to the following conditions: 16 | // 17 | // The above copyright notice and this permission notice shall be included in 18 | // all copies or substantial portions of the Software. 19 | // 20 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 26 | // THE SOFTWARE. 27 | 28 | #import 29 | 30 | 31 | @interface HPTextViewInternal : UITextView 32 | 33 | @property (nonatomic, strong) NSString *placeholder; 34 | @property (nonatomic, strong) UIColor *placeholderColor; 35 | @property (nonatomic) BOOL displayPlaceHolder; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListCellPortraitView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListCellPortraitView.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/23. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMailListCellPortraitView.h" 10 | 11 | @interface ZGMailListCellPortraitView () 12 | 13 | @end 14 | 15 | @implementation ZGMailListCellPortraitView 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame { 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | [self addSubview:self.myLabel]; 21 | [self addSubview:self.imageView]; 22 | 23 | [self layoutViewSubViews]; 24 | } 25 | 26 | return self; 27 | } 28 | 29 | #pragma mark - private method 30 | 31 | - (void)layoutViewSubViews { 32 | [self.myLabel mas_makeConstraints:^(MASConstraintMaker *make) { 33 | make.center.mas_equalTo(self); 34 | make.size.mas_equalTo(self); 35 | }]; 36 | 37 | [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) { 38 | make.size.mas_equalTo(self); 39 | make.center.mas_equalTo(self); 40 | }]; 41 | } 42 | 43 | #pragma mark - setter and getter 44 | 45 | - (UILabel *)myLabel { 46 | if (_myLabel == nil) { 47 | _myLabel = [[UILabel alloc] init]; 48 | _myLabel.font = [UIFont systemFontOfSize:22.0f]; 49 | _myLabel.textAlignment = NSTextAlignmentCenter; 50 | } 51 | 52 | return _myLabel; 53 | } 54 | 55 | - (UIImageView *)imageView { 56 | if (_imageView == nil) { 57 | _imageView = [[UIImageView alloc] init]; 58 | } 59 | return _imageView; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DACircularProgress (2.3.1) 3 | - DZNEmptyDataSet (1.8.1) 4 | - Masonry (1.1.0) 5 | - MBProgressHUD (1.0.0) 6 | - MJRefresh (3.1.15) 7 | - MyLayout (1.5.0) 8 | - pop (1.0.10) 9 | - SDWebImage (4.2.1): 10 | - SDWebImage/Core (= 4.2.1) 11 | - SDWebImage/Core (4.2.1) 12 | - TTTAttributedLabel (2.0.0) 13 | - TZImagePickerController (1.9.3) 14 | 15 | DEPENDENCIES: 16 | - DACircularProgress 17 | - DZNEmptyDataSet 18 | - Masonry 19 | - MBProgressHUD 20 | - MJRefresh 21 | - MyLayout 22 | - pop 23 | - SDWebImage 24 | - TTTAttributedLabel 25 | - TZImagePickerController 26 | 27 | SPEC REPOS: 28 | https://github.com/CocoaPods/Specs.git: 29 | - DACircularProgress 30 | - DZNEmptyDataSet 31 | - Masonry 32 | - MBProgressHUD 33 | - MJRefresh 34 | - MyLayout 35 | - pop 36 | - SDWebImage 37 | - TTTAttributedLabel 38 | - TZImagePickerController 39 | 40 | SPEC CHECKSUMS: 41 | DACircularProgress: 4dd437c0fc3da5161cb289e07ac449493d41db71 42 | DZNEmptyDataSet: 9525833b9e68ac21c30253e1d3d7076cc828eaa7 43 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 44 | MBProgressHUD: 4890f671c94e8a0f3cf959aa731e9de2f036d71a 45 | MJRefresh: 9af70f5f9327a2cf87f0fb5929f35fcc2fa638ea 46 | MyLayout: a80c782879ab1d689b737f7f3373fbf66407941d 47 | pop: 82ca6b068ce9278fd350fd9dd09482a0ce9492e6 48 | SDWebImage: 1fa4c9edf525b744f002db89f3f5a38b3cd4c541 49 | TTTAttributedLabel: 8cffe8e127e4e82ff3af1e5386d4cd0ad000b656 50 | TZImagePickerController: 079ab986018c22793462e531045a75e366b18252 51 | 52 | PODFILE CHECKSUM: 98ab81f80f0d0e7ed473ef222ba33042981b4b2a 53 | 54 | COCOAPODS: 1.9.3 55 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWTapDetectingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewTap.m 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import "MWTapDetectingView.h" 10 | 11 | @implementation MWTapDetectingView 12 | 13 | - (id)init { 14 | if ((self = [super init])) { 15 | self.userInteractionEnabled = YES; 16 | } 17 | return self; 18 | } 19 | 20 | - (id)initWithFrame:(CGRect)frame { 21 | if ((self = [super initWithFrame:frame])) { 22 | self.userInteractionEnabled = YES; 23 | } 24 | return self; 25 | } 26 | 27 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 28 | UITouch *touch = [touches anyObject]; 29 | NSUInteger tapCount = touch.tapCount; 30 | switch (tapCount) { 31 | case 1: 32 | [self handleSingleTap:touch]; 33 | break; 34 | case 2: 35 | [self handleDoubleTap:touch]; 36 | break; 37 | case 3: 38 | [self handleTripleTap:touch]; 39 | break; 40 | default: 41 | break; 42 | } 43 | [[self nextResponder] touchesEnded:touches withEvent:event]; 44 | } 45 | 46 | - (void)handleSingleTap:(UITouch *)touch { 47 | if ([_tapDelegate respondsToSelector:@selector(view:singleTapDetected:)]) 48 | [_tapDelegate view:self singleTapDetected:touch]; 49 | } 50 | 51 | - (void)handleDoubleTap:(UITouch *)touch { 52 | if ([_tapDelegate respondsToSelector:@selector(view:doubleTapDetected:)]) 53 | [_tapDelegate view:self doubleTapDetected:touch]; 54 | } 55 | 56 | - (void)handleTripleTap:(UITouch *)touch { 57 | if ([_tapDelegate respondsToSelector:@selector(view:tripleTapDetected:)]) 58 | [_tapDelegate view:self tripleTapDetected:touch]; 59 | } 60 | 61 | @end 62 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | *.xcuserstate 25 | *.DS_Store 26 | 27 | ## Obj-C/Swift specific 28 | *.hmap 29 | *.ipa 30 | *.dSYM.zip 31 | *.dSYM 32 | 33 | # CocoaPods 34 | # 35 | # We recommend against adding the Pods directory to your .gitignore. However 36 | # you should judge for yourself, the pros and cons are mentioned at: 37 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 38 | # 39 | Pods/ 40 | 41 | # Carthage 42 | # 43 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 44 | Carthage/Checkouts 45 | 46 | Carthage/Build 47 | 48 | # fastlane 49 | # 50 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 51 | # screenshots whenever they are needed. 52 | # For more information about the recommended setup visit: 53 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 54 | 55 | fastlane/report.xml 56 | fastlane/Preview.html 57 | fastlane/screenshots 58 | fastlane/test_output 59 | 60 | # Code Injection 61 | # 62 | # After new code Injection tools there's a generated folder /iOSInjectionProject 63 | # https://github.com/johnno1962/injectionforxcode 64 | 65 | iOSInjectionProject/ 66 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/ViewController/UIViewController+HUD.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+HUD.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 16/8/16. 6 | // Copyright © 2016年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIViewController (HUD) 12 | 13 | ////////////////////**********loading**********////////////////////// 14 | 15 | /** 16 | * 展示没有文字的loading视图 17 | * 18 | * @param cover 是否要覆盖navbar 19 | */ 20 | - (void)showHUDCoverNavbar:(BOOL)cover; 21 | 22 | /** 23 | * 展示有文字的loading视图 24 | * 25 | * @param cover 是否要覆盖navbar 26 | * @param loadingText 文字 27 | */ 28 | - (void)showHUDCoverNavbar:(BOOL)cover loadingText:(NSString *)loadingText; 29 | 30 | ////////////////////**********提示文字**********////////////////////// 31 | 32 | /** 33 | * 展示提示文字 34 | * 35 | * @param tipText 提示文字 36 | */ 37 | - (void)showTipText:(NSString *)tipText; 38 | 39 | /** 40 | * 展示提示文字 41 | * 42 | * @param tipText 提示文字 43 | * @param completion 隐藏之后需要执行的block 44 | */ 45 | - (void)showTipText:(NSString *)tipText completion:(void (^)(void))completion; 46 | 47 | 48 | ////////////////////**********成功提示**********////////////////////// 49 | 50 | /** 51 | * 带成功图标的提示 52 | * 53 | * @param successTipText 提示文字 54 | */ 55 | - (void)showSuccessTipText:(NSString *)successTipText; 56 | 57 | /** 58 | * 带成功图标的提示 59 | * 60 | * @param successTipText 提示文字 61 | * @param completion 隐藏之后需要执行的block 62 | */ 63 | - (void)showSuccessTipText:(NSString *)successTipText completion:(void (^)(void))completion; 64 | 65 | 66 | ////////////////////**********隐藏**********////////////////////// 67 | 68 | /** 69 | * 隐藏loading视图 70 | * 71 | */ 72 | - (void)hideHUD; 73 | 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /ZGMailbox/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Models/ZGMailMessage.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailMessage.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/5/11. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMailMessage.h" 10 | 11 | @implementation ZGMailMessage 12 | 13 | #pragma mark - NSCoding 14 | 15 | - (id)initWithCoder:(NSCoder *)decoder { 16 | self = [super init]; 17 | if (!self) { 18 | return nil; 19 | } 20 | 21 | self.messageStatus = [decoder decodeIntegerForKey:@"messageStatus"]; 22 | self.failureString = [decoder decodeObjectForKey:@"failureString"]; 23 | 24 | self.header = [decoder decodeObjectForKey:@"header"]; 25 | self.bodyText = [decoder decodeObjectForKey:@"bodyText"]; 26 | 27 | self.attachmentsFilenameArray = [decoder decodeObjectForKey:@"attachmentsFilenameArray"]; 28 | 29 | self.originImapMessage = [decoder decodeObjectForKey:@"originImapMessage"]; 30 | self.originMessageFolder = [decoder decodeObjectForKey:@"originMessageFolder"]; 31 | self.originMessageParts = [decoder decodeObjectForKey:@"originMessageParts"]; 32 | 33 | return self; 34 | } 35 | 36 | - (void)encodeWithCoder:(NSCoder *)encoder { 37 | [encoder encodeInteger:self.messageStatus forKey:@"messageStatus"]; 38 | [encoder encodeObject:self.failureString forKey:@"failureString"]; 39 | 40 | [encoder encodeObject:self.header forKey:@"header"]; 41 | [encoder encodeObject:self.bodyText forKey:@"bodyText"]; 42 | 43 | [encoder encodeObject:self.attachmentsFilenameArray forKey:@"attachmentsFilenameArray"]; 44 | 45 | [encoder encodeObject:self.originImapMessage forKey:@"originImapMessage"]; 46 | [encoder encodeObject:self.originMessageParts forKey:@"originMessageParts"]; 47 | [encoder encodeObject:self.originMessageFolder forKey:@"originMessageFolder"]; 48 | } 49 | @end 50 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/Colors/UIColor+colorWIthHex.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+colorWIthHex.m 3 | // CBExchange 4 | // 5 | // Created by 周中广 on 15/10/21. 6 | // Copyright © 2015年 周中广. All rights reserved. 7 | // 8 | 9 | #import "UIColor+colorWIthHex.h" 10 | 11 | @implementation UIColor (colorWIthHex) 12 | 13 | + (UIColor *)colorWithHexString:(NSString *)color alpha:(CGFloat)alpha 14 | { 15 | //删除字符串中的空格 16 | NSString *cString = [[color stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString]; 17 | // String should be 6 or 8 characters 18 | if ([cString length] < 6) 19 | { 20 | return [UIColor clearColor]; 21 | } 22 | // strip 0X if it appears 23 | //如果是0x开头的,那么截取字符串,字符串从索引为2的位置开始,一直到末尾 24 | if ([cString hasPrefix:@"0X"]) 25 | { 26 | cString = [cString substringFromIndex:2]; 27 | } 28 | //如果是#开头的,那么截取字符串,字符串从索引为1的位置开始,一直到末尾 29 | if ([cString hasPrefix:@"#"]) 30 | { 31 | cString = [cString substringFromIndex:1]; 32 | } 33 | if ([cString length] != 6) 34 | { 35 | return [UIColor clearColor]; 36 | } 37 | 38 | // Separate into r, g, b substrings 39 | NSRange range; 40 | range.location = 0; 41 | range.length = 2; 42 | //r 43 | NSString *rString = [cString substringWithRange:range]; 44 | //g 45 | range.location = 2; 46 | NSString *gString = [cString substringWithRange:range]; 47 | //b 48 | range.location = 4; 49 | NSString *bString = [cString substringWithRange:range]; 50 | 51 | // Scan values 52 | unsigned int r, g, b; 53 | [[NSScanner scannerWithString:rString] scanHexInt:&r]; 54 | [[NSScanner scannerWithString:gString] scanHexInt:&g]; 55 | [[NSScanner scannerWithString:bString] scanHexInt:&b]; 56 | return [UIColor colorWithRed:((float)r / 255.0f) green:((float)g / 255.0f) blue:((float)b / 255.0f) alpha:alpha]; 57 | } 58 | 59 | @end 60 | -------------------------------------------------------------------------------- /ZGMailbox/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/AttachmentView/ZGAddAttachmentCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAddAttachmentCollectionViewCell.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/26. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGAddAttachmentCollectionViewCell.h" 10 | 11 | @interface ZGAddAttachmentCollectionViewCell () 12 | 13 | @property (nonatomic, strong) UIImageView *addImageView; 14 | 15 | @end 16 | 17 | @implementation ZGAddAttachmentCollectionViewCell 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | [self.contentView addSubview:self.backgroudImageView]; 23 | [self.contentView addSubview:self.addImageView]; 24 | 25 | [self layoutViewSubviews]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | #pragma mark - private method 32 | 33 | - (void)layoutViewSubviews { 34 | [self.backgroudImageView mas_makeConstraints:^(MASConstraintMaker *make) { 35 | make.size.mas_equalTo(self.contentView); 36 | make.center.mas_equalTo(self.contentView); 37 | }]; 38 | 39 | [self.addImageView mas_makeConstraints:^(MASConstraintMaker *make) { 40 | make.center.mas_equalTo(self.contentView); 41 | }]; 42 | } 43 | 44 | #pragma mark - setter and getter 45 | 46 | - (UIImageView *)backgroudImageView { 47 | if (_backgroudImageView == nil) { 48 | _backgroudImageView = [[UIImageView alloc] init]; 49 | UIImage *image = [UIImage imageNamed:@"attachment_bg"]; 50 | image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(4, 4, 4, 4)]; 51 | [_backgroudImageView setImage:image]; 52 | } 53 | 54 | return _backgroudImageView; 55 | } 56 | 57 | - (UIImageView *)addImageView { 58 | if (_addImageView == nil) { 59 | _addImageView = [[UIImageView alloc] init]; 60 | _addImageView.image = [UIImage imageNamed:@"attach_add"]; 61 | } 62 | 63 | return _addImageView; 64 | } 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWTapDetectingImageView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageViewTap.m 3 | // Momento 4 | // 5 | // Created by Michael Waterfall on 04/11/2009. 6 | // Copyright 2009 d3i. All rights reserved. 7 | // 8 | 9 | #import "MWTapDetectingImageView.h" 10 | 11 | @implementation MWTapDetectingImageView 12 | 13 | - (id)initWithFrame:(CGRect)frame { 14 | if ((self = [super initWithFrame:frame])) { 15 | self.userInteractionEnabled = YES; 16 | } 17 | return self; 18 | } 19 | 20 | - (id)initWithImage:(UIImage *)image { 21 | if ((self = [super initWithImage:image])) { 22 | self.userInteractionEnabled = YES; 23 | } 24 | return self; 25 | } 26 | 27 | - (id)initWithImage:(UIImage *)image highlightedImage:(UIImage *)highlightedImage { 28 | if ((self = [super initWithImage:image highlightedImage:highlightedImage])) { 29 | self.userInteractionEnabled = YES; 30 | } 31 | return self; 32 | } 33 | 34 | - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event { 35 | UITouch *touch = [touches anyObject]; 36 | NSUInteger tapCount = touch.tapCount; 37 | switch (tapCount) { 38 | case 1: 39 | [self handleSingleTap:touch]; 40 | break; 41 | case 2: 42 | [self handleDoubleTap:touch]; 43 | break; 44 | case 3: 45 | [self handleTripleTap:touch]; 46 | break; 47 | default: 48 | break; 49 | } 50 | [[self nextResponder] touchesEnded:touches withEvent:event]; 51 | } 52 | 53 | - (void)handleSingleTap:(UITouch *)touch { 54 | if ([_tapDelegate respondsToSelector:@selector(imageView:singleTapDetected:)]) 55 | [_tapDelegate imageView:self singleTapDetected:touch]; 56 | } 57 | 58 | - (void)handleDoubleTap:(UITouch *)touch { 59 | if ([_tapDelegate respondsToSelector:@selector(imageView:doubleTapDetected:)]) 60 | [_tapDelegate imageView:self doubleTapDetected:touch]; 61 | } 62 | 63 | - (void)handleTripleTap:(UITouch *)touch { 64 | if ([_tapDelegate respondsToSelector:@selector(imageView:tripleTapDetected:)]) 65 | [_tapDelegate imageView:self tripleTapDetected:touch]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /ZGMailbox/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGAddressShadowButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAddressShadowButton.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/6. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGAddressShadowButton.h" 10 | 11 | @interface ZGAddressShadowButton () 12 | 13 | @end 14 | 15 | @implementation ZGAddressShadowButton 16 | 17 | - (instancetype)initWithFrame:(CGRect)frame { 18 | self = [super initWithFrame:frame]; 19 | if (self) { 20 | self.titleLabel.numberOfLines = 2; 21 | self.titleLabel.textAlignment = NSTextAlignmentLeft; 22 | self.titleLabel.lineBreakMode = NSLineBreakByWordWrapping; 23 | 24 | UIImage *image = [UIImage imageNamed:@"mail_roundcornerBgHighlight"]; 25 | image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(2, 2, 2, 2)]; 26 | [self setBackgroundImage:image forState:UIControlStateHighlighted]; 27 | [self setBackgroundImage:image forState:UIControlStateSelected]; 28 | 29 | UIImage *normalImage = [UIImage imageNamed:@"mail_roundcornerBgNormal"]; 30 | normalImage = [normalImage resizableImageWithCapInsets:UIEdgeInsetsMake(2, 2, 2, 2)]; 31 | [self setBackgroundImage:normalImage forState:UIControlStateNormal]; 32 | 33 | self.contentEdgeInsets = UIEdgeInsetsMake(4, 4, 4, 4); 34 | } 35 | 36 | return self; 37 | } 38 | 39 | - (NSString *)shortName { 40 | if (IsEmptyString(self.mailbox)) { 41 | NSString *attTitle = [[self currentAttributedTitle] string]; 42 | if (IsEmptyString(attTitle)) {//发件人只有发件人名字的情况 43 | NSString *title = [self currentTitle]; 44 | 45 | return title; 46 | } else {//两行地址的情况 47 | return [[attTitle componentsSeparatedByString:@"\n"] firstObject]; 48 | } 49 | } else { 50 | NSArray *array = [self.mailbox componentsSeparatedByString:@"@"]; 51 | 52 | return [array firstObject]; 53 | } 54 | } 55 | 56 | - (void)pressesBegan:(NSSet *)presses withEvent:(UIPressesEvent *)event { 57 | self.highlighted = YES; 58 | } 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Category/UIView/UIView+Addition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Addition.h 3 | // IOSDuoduo 4 | // 5 | // Created by 独嘉 on 14-5-26. 6 | // Copyright (c) 2014年 dujia. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 增加了一些好用的基本属性 13 | */ 14 | 15 | @interface UIView (Addition) 16 | 17 | /** 18 | * Shortcut for frame.origin.x. 19 | * 20 | * Sets frame.origin.x = left 21 | */ 22 | @property (nonatomic) CGFloat left; 23 | 24 | /** 25 | * Shortcut for frame.origin.y 26 | * 27 | * Sets frame.origin.y = top 28 | */ 29 | @property (nonatomic) CGFloat top; 30 | 31 | /** 32 | * Shortcut for frame.origin.x + frame.size.width 33 | * 34 | * Sets frame.origin.x = right - frame.size.width 35 | */ 36 | @property (nonatomic) CGFloat right; 37 | 38 | /** 39 | * Shortcut for frame.origin.y + frame.size.height 40 | * 41 | * Sets frame.origin.y = bottom - frame.size.height 42 | */ 43 | @property (nonatomic) CGFloat bottom; 44 | 45 | /** 46 | * Shortcut for frame.size.width 47 | * 48 | * Sets frame.size.width = width 49 | */ 50 | @property (nonatomic) CGFloat width; 51 | 52 | /** 53 | * Shortcut for frame.size.height 54 | * 55 | * Sets frame.size.height = height 56 | */ 57 | @property (nonatomic) CGFloat height; 58 | 59 | /** 60 | * Shortcut for frame.origin 61 | */ 62 | @property (nonatomic) CGPoint origin; 63 | 64 | /** 65 | * Shortcut for frame.size 66 | */ 67 | @property (nonatomic) CGSize size; 68 | 69 | @property (nonatomic) CGFloat centerX; 70 | @property (nonatomic) CGFloat centerY; 71 | 72 | 73 | /** 74 | * Finds the first descendant view (including this view) that is a member of a particular class. 75 | */ 76 | - (UIView*)descendantOrSelfWithClass:(Class)cls; 77 | 78 | /** 79 | * Finds the first ancestor view (including this view) that is a member of a particular class. 80 | */ 81 | - (UIView*)ancestorOrSelfWithClass:(Class)cls; 82 | 83 | /** 84 | * Removes all subviews. 85 | */ 86 | - (void)removeAllSubviews; 87 | 88 | /** 89 | * The view controller whose view contains this view. 90 | */ 91 | - (UIViewController*)viewController; 92 | 93 | /** 94 | 给View加上圆角和边框 95 | */ 96 | - (UIView *)roundedCornerAndBorderView; 97 | 98 | - (id)subviewWithTag:(NSInteger)tag; 99 | @end 100 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/AttachmentView/ZGWriteMailAttachmentView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGWriteMailAttachmentView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/26. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class ZGAddAttachmentCollectionViewCell; 12 | @protocol ZGWriteMailAttachmentViewDelegate; 13 | 14 | 15 | /** 16 | * 写邮件附件视图:如果是邮件转发,会在前面展示原始邮件的附件 17 | */ 18 | @interface ZGWriteMailAttachmentView : UIView 19 | 20 | @property (nonatomic, weak) id delegate; 21 | 22 | @property (nonatomic, strong) NSMutableArray *originMessageAttachments;//原始邮件附件数据(MCOIMAPPart) 23 | 24 | //@property (nonatomic, strong) NSMutableArray *attachmentsPhotosArray;//图片数据 25 | //@property (nonatomic, strong) NSMutableArray *attachmentsDataArray;//Data数据,用来计算大小 26 | @property (nonatomic, copy) NSString *messageID; 27 | @property (nonatomic, strong) NSMutableArray *attachmentsFilenameArray; 28 | 29 | - (void)reloadAttachmentView; 30 | - (float)calculateHeightOfAttachmentViewWithAttachmentCount:(NSInteger)count; 31 | 32 | @end 33 | 34 | @protocol ZGWriteMailAttachmentViewDelegate 35 | 36 | /** 37 | * 附件点击 38 | * 39 | * @param attachmentView 附件视图 40 | * @param index 附件下标 41 | */ 42 | - (void)writeMailAttachmentView:(ZGWriteMailAttachmentView *)attachmentView didSelectItemAtIndex:(NSInteger)index; 43 | 44 | /** 45 | * 原始邮件附件点击 46 | * 47 | * @param attachmentView 附件视图 48 | * @param index 附件下标 49 | */ 50 | - (void)writeMailAttachmentView:(ZGWriteMailAttachmentView *)attachmentView didSelectOriginMessageItemAtIndex:(NSInteger)index; 51 | 52 | /** 53 | * 原始邮件附件删除 54 | * 55 | * @param attachmentView 附件视图 56 | * @param index 附件下标 57 | */ 58 | - (void)writeMailAttachmentView:(ZGWriteMailAttachmentView *)attachmentView originMessageDeleteButtonPressed:(NSInteger)index; 59 | 60 | /** 61 | * 附件删除 62 | * 63 | * @param attachmentView 附件视图 64 | * @param index 附件下标 65 | */ 66 | - (void)writeMailAttachmentView:(ZGWriteMailAttachmentView *)attachmentView deleteButtonPressed:(NSInteger)index; 67 | 68 | /** 69 | * 添加附件cell点击 70 | * 71 | * @param attachmentView 附件视图 72 | */ 73 | - (void)addAttachmentCollectionViewCellPressed:(ZGWriteMailAttachmentView *)attachmentView; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGComposeHeaderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGComposeHeaderView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/19. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "ZGMailAddressFlowEditView.h" 11 | 12 | @protocol ZGComposeHeaderViewDelegate; 13 | @class ZGMailAddressButton; 14 | @class MCOMessageHeader; 15 | 16 | /** 17 | * 写邮件头部视图 18 | */ 19 | @interface ZGComposeHeaderView : UIView 20 | 21 | @property (nonatomic, weak) id delegate; 22 | @property (nonatomic, strong) MCOMessageHeader *header; 23 | @property (nonatomic, assign) MailAddressFlowEditViewType editViewType; 24 | 25 | - (void)headerViewBecomeFirstResponder; 26 | 27 | - (void)headerViewResignFirstResponder; 28 | 29 | //- (BOOL)isHeaderViewFirstResponder; 30 | 31 | /** 32 | * 添加地址数组 33 | * 34 | * @param array 地址数组 35 | */ 36 | - (void)addAddressArrayToAddressEditView:(NSArray *)array; 37 | 38 | /** 39 | * 设置附件个数 40 | * 41 | * @param attachmentNumber 附件个数 42 | */ 43 | - (void)setAttachmentNumber:(NSInteger)attachmentNumber; 44 | 45 | /** 46 | * 设置主题 47 | * 48 | * @param subjectStr 邮件主题 49 | */ 50 | - (void)setSubject:(NSString *)subjectStr; 51 | 52 | @end 53 | 54 | @protocol ZGComposeHeaderViewDelegate 55 | 56 | /** 57 | * 添加联系人按钮点击 58 | * 59 | * @param composeHeaderView headerView 60 | * @param button 邮件地址按钮 61 | */ 62 | - (void)composeHeaderView:(ZGComposeHeaderView *)composeHeaderView addContactsButtonPressed:(ZGMailAddressButton *)button; 63 | 64 | /** 65 | * 删除收件人地址按钮 66 | * 67 | * @param composeHeaderView headerView 68 | * @param button 删除收件人地址按钮 69 | */ 70 | - (void)composeHeaderView:(ZGComposeHeaderView *)composeHeaderView deleteAddressButton:(ZGMailAddressButton *)button; 71 | 72 | /** 73 | * 地址编辑 74 | * 75 | * @param composeHeaderView headerView 76 | * @param tobeEmpty 编辑之后是否为空 77 | */ 78 | - (void)composeHeaderView:(ZGComposeHeaderView *)composeHeaderView isAddressTextFieldTobeEmpty:(BOOL)tobeEmpty; 79 | 80 | /** 81 | * 附件按钮点击 82 | * 83 | * @param composeHeaderView headerView 84 | * @param button 附件按钮 85 | */ 86 | - (void)composeHeaderView:(ZGComposeHeaderView *)composeHeaderView attachmentButtonPressed:(UIButton *)button; 87 | 88 | @end 89 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGMailAddressButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAddressButton.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMailAddressButton.h" 10 | 11 | //地址 12 | #import 13 | 14 | @interface ZGMailAddressButton () 15 | 16 | 17 | @end 18 | 19 | @implementation ZGMailAddressButton 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | self.titleLabel.font = [UIFont systemFontOfSize:17.0f]; 25 | [self setTitleColor:[UIColor colorWithHexString:@"2A83f2" alpha:1.0f] forState:UIControlStateNormal]; 26 | [self setTitleColor:[UIColor whiteColor] forState:UIControlStateSelected]; 27 | 28 | UIImage *image = [UIImage imageNamed:@"addressSelectCorrect"]; 29 | image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(2, 2, 2, 2)]; 30 | [self setBackgroundImage:image forState:UIControlStateSelected]; 31 | 32 | [self addSubview:self.commaLabel]; 33 | [self.commaLabel mas_makeConstraints:^(MASConstraintMaker *make) { 34 | make.height.mas_equalTo(self.titleLabel); 35 | make.centerY.mas_equalTo(self.titleLabel); 36 | make.leading.mas_equalTo(self.titleLabel.mas_trailing); 37 | }]; 38 | UIEdgeInsets insets = self.contentEdgeInsets; 39 | insets.top = 0; 40 | insets.bottom = 0; 41 | insets.left = 2; 42 | insets.right = 2; 43 | // self.contentEdgeInsets = insets; 44 | } 45 | 46 | return self; 47 | } 48 | 49 | - (void)setSelected:(BOOL)selected { 50 | [super setSelected:selected]; 51 | 52 | // self.commaLabel.hidden = selected; 53 | } 54 | 55 | - (void)layoutSubviews { 56 | [super layoutSubviews]; 57 | 58 | // [self setTitle:self.record.commonName forState:UIControlStateNormal]; 59 | } 60 | 61 | #pragma mark - public method 62 | 63 | - (void)showCommaLabel { 64 | self.commaLabel.hidden = NO; 65 | } 66 | 67 | - (void)hideCommaLabel { 68 | self.commaLabel.hidden = YES; 69 | } 70 | 71 | #pragma mark - setter and getter 72 | 73 | - (UILabel *)commaLabel { 74 | if (_commaLabel == nil) { 75 | _commaLabel = [[UILabel alloc] init]; 76 | _commaLabel.textColor = [UIColor colorWithHexString:@"2A83f2" alpha:1.0f]; 77 | _commaLabel.font = [UIFont systemFontOfSize:17.0f]; 78 | _commaLabel.text = @"、"; 79 | } 80 | 81 | return _commaLabel; 82 | } 83 | 84 | @end 85 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGMailAddressTextField.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAddressTextField.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMailAddressTextField.h" 10 | 11 | @interface ZGMailAddressTextField () 12 | 13 | @property (nonatomic, strong) UIView *addressTextFieldMaskView; 14 | @property (nonatomic, strong) UITapGestureRecognizer *tapGesture; 15 | 16 | @end 17 | 18 | @implementation ZGMailAddressTextField 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | self.tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didRecognizeTapGesture:)]; 24 | self.tapGesture.numberOfTapsRequired = 1; 25 | [self.addressTextFieldMaskView addGestureRecognizer:self.tapGesture]; 26 | } 27 | 28 | return self; 29 | } 30 | 31 | - (void)deleteBackward { 32 | if ([self.addressTextFieldDelegate respondsToSelector:@selector(textFieldDidDelete)]){ 33 | [self.addressTextFieldDelegate textFieldDidDelete]; 34 | } 35 | [super deleteBackward]; 36 | } 37 | 38 | - (void)dealloc { 39 | [self.addressTextFieldMaskView removeGestureRecognizer:self.tapGesture]; 40 | } 41 | 42 | #pragma mark - IBAction 43 | 44 | /** 45 | * textField遮罩视图点击事件 46 | */ 47 | - (void)didRecognizeTapGesture:(UITapGestureRecognizer *)gesture { 48 | if (self.addressTextFieldDelegate && [self.addressTextFieldDelegate respondsToSelector:@selector(mailAddressTextField:didRecognizeTapGesture:)]) { 49 | [self.addressTextFieldDelegate mailAddressTextField:self didRecognizeTapGesture:gesture]; 50 | } 51 | } 52 | 53 | #pragma mark - public method 54 | 55 | - (void)showCursor { 56 | //显示光标 57 | self.tintColor = [UIColor colorWithHexString:@"007AFF" alpha:1.0f]; 58 | if ([self.addressTextFieldMaskView isDescendantOfView:self]) { 59 | //移除遮罩视图 60 | [self.addressTextFieldMaskView removeFromSuperview]; 61 | } 62 | } 63 | 64 | - (void)hideCuresor { 65 | //隐藏光标 66 | self.tintColor = [UIColor clearColor]; 67 | [self addSubview:self.addressTextFieldMaskView]; 68 | [self.addressTextFieldMaskView mas_remakeConstraints:^(MASConstraintMaker *make) { 69 | make.size.mas_equalTo(self); 70 | make.center.mas_equalTo(self); 71 | }]; 72 | } 73 | 74 | #pragma mark - setter and getter 75 | 76 | - (UIView *)addressTextFieldMaskView { 77 | if (_addressTextFieldMaskView == nil) { 78 | _addressTextFieldMaskView = [[UIView alloc] init]; 79 | _addressTextFieldMaskView.backgroundColor = [UIColor clearColor]; 80 | } 81 | 82 | return _addressTextFieldMaskView; 83 | } 84 | 85 | @end 86 | -------------------------------------------------------------------------------- /ZGMailbox/Module/NewMail-新邮件/Views/HeaderView/ZGMailAddressFlowEditView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailAddressFlowEditView.h 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/21. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @protocol ZGMailAddressFlowEditViewDelegate; 12 | @class ZGMailAddressButton; 13 | 14 | typedef NS_ENUM(NSUInteger, MailAddressFlowEditViewType) { 15 | MailAddressFlowEditViewTypeNone, 16 | MailAddressFlowEditViewTypeRecipient,//收件人 17 | MailAddressFlowEditViewTypeCC,//抄送 18 | MailAddressFlowEditViewTypeBCC//密送 19 | }; 20 | 21 | /** 22 | * 邮件地址流式布局编辑视图 23 | */ 24 | @interface ZGMailAddressFlowEditView : UIView 25 | 26 | @property (nonatomic, strong) NSString *title; 27 | @property (nonatomic, assign) MailAddressFlowEditViewType type; 28 | @property (nonatomic, assign) BOOL isShowWholeEditView; 29 | 30 | @property (nonatomic, weak) id delegate; 31 | 32 | //添加地址数组 33 | - (void)addAddressArray:(NSArray *)addressArray; 34 | 35 | /** 36 | * 返回地址编辑视图的高度 37 | */ 38 | - (float)heightOfAddressFlowEditView; 39 | 40 | /** 41 | * 判断地址编辑视图是否为空 42 | */ 43 | - (BOOL)isAddressFlowEditViewEmpty; 44 | 45 | /** 46 | * 隐藏完整的地址编辑视图,展示联系人label 47 | */ 48 | - (void)hideWholeAddressFlowEditView; 49 | 50 | /** 51 | * 展示截断的联系人信息 52 | */ 53 | - (void)showTruncateContactsViewWithArray:(NSArray *)array; 54 | 55 | /** 56 | * 展示完整的地址编辑视图 57 | */ 58 | - (void)showWholeAddressFlowEditView; 59 | 60 | @end 61 | 62 | @protocol ZGMailAddressFlowEditViewDelegate 63 | 64 | /** 65 | * 地址编辑视图开始编辑 66 | */ 67 | - (void)addressFlowEditViewBeginEditing:(ZGMailAddressFlowEditView *)addressFlowEditView; 68 | 69 | /** 70 | * 地址编辑视图结束编辑 71 | */ 72 | - (void)addressFlowEditViewEndEditing:(ZGMailAddressFlowEditView *)addressFlowEditView; 73 | 74 | /** 75 | * 地址输入框输入 76 | */ 77 | - (void)addressFlowEditView:(ZGMailAddressFlowEditView *)addressFlowEditView textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; 78 | 79 | /** 80 | * 键盘“下一项”点击 81 | */ 82 | - (void)addressFlowEditView:(ZGMailAddressFlowEditView *)addressFlowEditView textFieldNextButtonPressed:(NSString *)text; 83 | 84 | /** 85 | * 地址编辑视图高度即将变化 86 | */ 87 | - (void)addressFlowEditView:(ZGMailAddressFlowEditView *)addressFlowEditView heightWillChange:(float)height; 88 | 89 | /** 90 | * 联系人编辑视图,添加联系人按钮点击 91 | */ 92 | - (void)addressFlowEditView:(ZGMailAddressFlowEditView *)addressFlowEditView addContactsButtonPressed:(ZGMailAddressButton *)button; 93 | 94 | /** 95 | * 联系人编辑视图,添加联系人按钮点击 96 | */ 97 | - (void)addressFlowEditView:(ZGMailAddressFlowEditView *)addressFlowEditView deleteAddressButton:(ZGMailAddressButton *)button; 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWCaptionView.m: -------------------------------------------------------------------------------- 1 | // 2 | // MWCaptionView.m 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 30/12/2011. 6 | // Copyright (c) 2011 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import "MWCommon.h" 10 | #import "MWCaptionView.h" 11 | #import "MWPhoto.h" 12 | 13 | static const CGFloat labelPadding = 10; 14 | 15 | // Private 16 | @interface MWCaptionView () { 17 | id _photo; 18 | UILabel *_label; 19 | } 20 | @end 21 | 22 | @implementation MWCaptionView 23 | 24 | - (id)initWithPhoto:(id)photo { 25 | self = [super initWithFrame:CGRectMake(0, 0, 320, 44)]; // Random initial frame 26 | if (self) { 27 | self.userInteractionEnabled = NO; 28 | _photo = photo; 29 | self.barStyle = UIBarStyleBlackTranslucent; 30 | self.tintColor = nil; 31 | self.barTintColor = nil; 32 | self.barStyle = UIBarStyleBlackTranslucent; 33 | [self setBackgroundImage:nil forToolbarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault]; 34 | self.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleTopMargin|UIViewAutoresizingFlexibleLeftMargin|UIViewAutoresizingFlexibleRightMargin; 35 | [self setupCaption]; 36 | } 37 | return self; 38 | } 39 | 40 | - (CGSize)sizeThatFits:(CGSize)size { 41 | CGFloat maxHeight = 9999; 42 | if (_label.numberOfLines > 0) maxHeight = _label.font.leading*_label.numberOfLines; 43 | CGSize textSize = [_label.text boundingRectWithSize:CGSizeMake(size.width - labelPadding*2, maxHeight) 44 | options:NSStringDrawingUsesLineFragmentOrigin 45 | attributes:@{NSFontAttributeName:_label.font} 46 | context:nil].size; 47 | return CGSizeMake(size.width, textSize.height + labelPadding * 2); 48 | } 49 | 50 | - (void)setupCaption { 51 | _label = [[UILabel alloc] initWithFrame:CGRectIntegral(CGRectMake(labelPadding, 0, 52 | self.bounds.size.width-labelPadding*2, 53 | self.bounds.size.height))]; 54 | _label.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight; 55 | _label.opaque = NO; 56 | _label.backgroundColor = [UIColor clearColor]; 57 | _label.textAlignment = NSTextAlignmentCenter; 58 | _label.lineBreakMode = NSLineBreakByWordWrapping; 59 | 60 | _label.numberOfLines = 0; 61 | _label.textColor = [UIColor whiteColor]; 62 | _label.font = [UIFont systemFontOfSize:17]; 63 | if ([_photo respondsToSelector:@selector(caption)]) { 64 | _label.text = [_photo caption] ? [_photo caption] : @" "; 65 | } 66 | [self addSubview:_label]; 67 | } 68 | 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageHeaderDetailTimeTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageHeaderDetailTimeTableViewCell.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMessageHeaderDetailTimeTableViewCell.h" 10 | 11 | @interface ZGMessageHeaderDetailTimeTableViewCell () 12 | 13 | @property (nonatomic, strong) UILabel *titleLabel; 14 | @property (nonatomic, strong) UILabel *timeLablel; 15 | 16 | @end 17 | 18 | @implementation ZGMessageHeaderDetailTimeTableViewCell 19 | 20 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier { 21 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 22 | if (self) { 23 | [self.contentView addSubview:self.titleLabel]; 24 | [self.contentView addSubview:self.timeLablel]; 25 | 26 | [self layoutCellSubviews]; 27 | } 28 | 29 | return self; 30 | } 31 | 32 | - (void)awakeFromNib { 33 | [super awakeFromNib]; 34 | // Initialization code 35 | } 36 | 37 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 38 | [super setSelected:selected animated:animated]; 39 | 40 | // Configure the view for the selected state 41 | } 42 | 43 | - (void)layoutSubviews { 44 | [super layoutSubviews]; 45 | 46 | //创建一个时间格式化对象 47 | NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; 48 | //按照什么样的格式来格式化时间 49 | formatter.dateFormat = @"yyyy年M月d日 HH:mm"; 50 | NSString *date = [formatter stringFromDate:self.date]; 51 | self.timeLablel.text = date; 52 | } 53 | 54 | #pragma mark - private method 55 | 56 | - (void)layoutCellSubviews { 57 | [self.timeLablel mas_makeConstraints:^(MASConstraintMaker *make) { 58 | make.leading.mas_equalTo(self.contentView.mas_leading).offset(65); 59 | make.centerY.mas_equalTo(self.contentView); 60 | }]; 61 | 62 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { 63 | make.trailing.mas_equalTo(self.timeLablel.mas_leading).offset(-3); 64 | make.centerY.mas_equalTo(self.timeLablel); 65 | }]; 66 | } 67 | 68 | #pragma mark - setter and getter 69 | 70 | - (UILabel *)titleLabel { 71 | if (_titleLabel == nil) { 72 | _titleLabel = [[UILabel alloc] init]; 73 | _titleLabel.font = [UIFont systemFontOfSize:12.0f]; 74 | _titleLabel.textColor = [UIColor colorWithHexString:@"999999" alpha:1.0f]; 75 | _titleLabel.text = @"时间:"; 76 | } 77 | 78 | return _titleLabel; 79 | } 80 | 81 | - (UILabel *)timeLablel { 82 | if (_timeLablel == nil) { 83 | _timeLablel = [[UILabel alloc] init]; 84 | _timeLablel.font = [UIFont systemFontOfSize:12.0f]; 85 | _timeLablel.textColor = [UIColor colorWithHexString:@"999999" alpha:1.0f]; 86 | } 87 | 88 | return _timeLablel; 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWPhotoProtocol.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWPhotoProtocol.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 02/01/2012. 6 | // Copyright (c) 2012 __MyCompanyName__. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | // Notifications 12 | #define MWPHOTO_LOADING_DID_END_NOTIFICATION @"MWPHOTO_LOADING_DID_END_NOTIFICATION" 13 | #define MWPHOTO_PROGRESS_NOTIFICATION @"MWPHOTO_PROGRESS_NOTIFICATION" 14 | 15 | // If you wish to use your own data models for photo then they must conform 16 | // to this protocol. See instructions for details on each method. 17 | // Otherwise you can use the MWPhoto object or subclass it yourself to 18 | // store more information per photo. 19 | // 20 | // You can see the MWPhoto class for an example implementation of this protocol 21 | // 22 | @protocol MWPhoto 23 | 24 | @required 25 | 26 | // Return underlying UIImage to be displayed 27 | // Return nil if the image is not immediately available (loaded into memory, preferably 28 | // already decompressed) and needs to be loaded from a source (cache, file, web, etc) 29 | // IMPORTANT: You should *NOT* use this method to initiate 30 | // fetching of images from any external of source. That should be handled 31 | // in -loadUnderlyingImageAndNotify: which may be called by the photo browser if this 32 | // methods returns nil. 33 | @property (nonatomic, strong) UIImage *underlyingImage; 34 | 35 | // Called when the browser has determined the underlying images is not 36 | // already loaded into memory but needs it. 37 | - (void)loadUnderlyingImageAndNotify; 38 | 39 | // Fetch the image data from a source and notify when complete. 40 | // You must load the image asyncronously (and decompress it for better performance). 41 | // It is recommended that you use SDWebImageDecoder to perform the decompression. 42 | // See MWPhoto object for an example implementation. 43 | // When the underlying UIImage is loaded (or failed to load) you should post the following 44 | // notification: 45 | // [[NSNotificationCenter defaultCenter] postNotificationName:MWPHOTO_LOADING_DID_END_NOTIFICATION 46 | // object:self]; 47 | - (void)performLoadUnderlyingImageAndNotify; 48 | 49 | // This is called when the photo browser has determined the photo data 50 | // is no longer needed or there are low memory conditions 51 | // You should release any underlying (possibly large and decompressed) image data 52 | // as long as the image can be re-loaded (from cache, file, or URL) 53 | - (void)unloadUnderlyingImage; 54 | 55 | @optional 56 | 57 | // If photo is empty, in which case, don't show loading error icons 58 | @property (nonatomic) BOOL emptyImage; 59 | 60 | // Video 61 | @property (nonatomic) BOOL isVideo; 62 | - (void)getVideoURL:(void (^)(NSURL *url))completion; 63 | 64 | // Return a caption string to be displayed over the image 65 | // Return nil to display no caption 66 | - (NSString *)caption; 67 | 68 | // Cancel any background loading of image data 69 | - (void)cancelAnyLoading; 70 | 71 | @end -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/MWPhotoBrowser/Classes/MWPhotoBrowser.h: -------------------------------------------------------------------------------- 1 | // 2 | // MWPhotoBrowser.h 3 | // MWPhotoBrowser 4 | // 5 | // Created by Michael Waterfall on 14/10/2010. 6 | // Copyright 2010 d3i. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "MWPhoto.h" 11 | #import "MWPhotoProtocol.h" 12 | #import "MWCaptionView.h" 13 | 14 | // Debug Logging 15 | #if 0 // Set to 1 to enable debug logging 16 | #define MWLog(x, ...) NSLog(x, ## __VA_ARGS__); 17 | #else 18 | #define MWLog(x, ...) 19 | #endif 20 | 21 | @class MWPhotoBrowser; 22 | 23 | @protocol MWPhotoBrowserDelegate 24 | 25 | - (NSUInteger)numberOfPhotosInPhotoBrowser:(MWPhotoBrowser *)photoBrowser; 26 | - (id )photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index; 27 | 28 | @optional 29 | 30 | - (id )photoBrowser:(MWPhotoBrowser *)photoBrowser thumbPhotoAtIndex:(NSUInteger)index; 31 | - (MWCaptionView *)photoBrowser:(MWPhotoBrowser *)photoBrowser captionViewForPhotoAtIndex:(NSUInteger)index; 32 | - (NSString *)photoBrowser:(MWPhotoBrowser *)photoBrowser titleForPhotoAtIndex:(NSUInteger)index; 33 | - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser didDisplayPhotoAtIndex:(NSUInteger)index; 34 | - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser actionButtonPressedForPhotoAtIndex:(NSUInteger)index; 35 | - (BOOL)photoBrowser:(MWPhotoBrowser *)photoBrowser isPhotoSelectedAtIndex:(NSUInteger)index; 36 | - (void)photoBrowser:(MWPhotoBrowser *)photoBrowser photoAtIndex:(NSUInteger)index selectedChanged:(BOOL)selected; 37 | - (void)photoBrowserDidFinishModalPresentation:(MWPhotoBrowser *)photoBrowser; 38 | 39 | @end 40 | 41 | @interface MWPhotoBrowser : UIViewController 42 | 43 | @property (nonatomic, weak) IBOutlet id delegate; 44 | @property (nonatomic) BOOL zoomPhotosToFill; 45 | @property (nonatomic) BOOL displayNavArrows; 46 | @property (nonatomic) BOOL displayActionButton; 47 | @property (nonatomic) BOOL displaySelectionButtons; 48 | @property (nonatomic) BOOL alwaysShowControls; 49 | @property (nonatomic) BOOL enableGrid; 50 | @property (nonatomic) BOOL enableSwipeToDismiss; 51 | @property (nonatomic) BOOL startOnGrid; 52 | @property (nonatomic) BOOL autoPlayOnAppear; 53 | @property (nonatomic) NSUInteger delayToHideElements; 54 | @property (nonatomic, readonly) NSUInteger currentIndex; 55 | 56 | // Customise image selection icons as they are the only icons with a colour tint 57 | // Icon should be located in the app's main bundle 58 | @property (nonatomic, strong) NSString *customImageSelectedIconName; 59 | @property (nonatomic, strong) NSString *customImageSelectedSmallIconName; 60 | 61 | // Init 62 | - (id)initWithPhotos:(NSArray *)photosArray; 63 | - (id)initWithDelegate:(id )delegate; 64 | 65 | // Reloads the photo browser and refetches data 66 | - (void)reloadData; 67 | 68 | // Set page that photo browser starts on 69 | - (void)setCurrentPhotoIndex:(NSUInteger)index; 70 | 71 | // Navigation 72 | - (void)showNextPhotoAnimated:(BOOL)animated; 73 | - (void)showPreviousPhotoAnimated:(BOOL)animated; 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailAttachment-邮件附件/Views/ZGAttachmentDownloadView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAttachmentDownloadView.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGAttachmentDownloadView.h" 10 | 11 | #import "ZGMailModule.h" 12 | 13 | @interface ZGAttachmentDownloadView () 14 | 15 | @property (nonatomic, strong) UIImageView *fileIconImageView; 16 | 17 | @end 18 | 19 | @implementation ZGAttachmentDownloadView 20 | 21 | - (instancetype)initWithFrame:(CGRect)frame { 22 | self = [super initWithFrame:frame]; 23 | if (self) { 24 | [self addSubview:self.fileIconImageView]; 25 | [self addSubview:self.fileNameLabel]; 26 | [self addSubview:self.progressView]; 27 | [self addSubview:self.progressLabel]; 28 | 29 | [self layoutViewSubview]; 30 | } 31 | 32 | return self; 33 | } 34 | 35 | - (void)layoutSubviews { 36 | [super layoutSubviews]; 37 | 38 | NSString *imageName = [[ZGMailModule sharedInstance] imageNameWithFileName:self.filename imageSizeType:ImageSizeTypeLarge]; 39 | self.fileIconImageView.image = [UIImage imageNamed:imageName]; 40 | } 41 | 42 | #pragma mark - private method 43 | 44 | - (void)layoutViewSubview { 45 | [self.fileIconImageView mas_makeConstraints:^(MASConstraintMaker *make) { 46 | make.centerX.mas_equalTo(self); 47 | make.bottom.mas_equalTo(self.fileNameLabel.mas_top).offset(-20); 48 | }]; 49 | 50 | [self.fileNameLabel mas_makeConstraints:^(MASConstraintMaker *make) { 51 | make.centerX.mas_equalTo(self); 52 | make.bottom.mas_equalTo(self.mas_centerY).offset(-10); 53 | }]; 54 | 55 | [self.progressView mas_makeConstraints:^(MASConstraintMaker *make) { 56 | make.centerX.mas_equalTo(self); 57 | make.top.mas_equalTo(self.mas_centerY).offset(25); 58 | make.width.mas_equalTo(self.mas_width).offset(-130); 59 | }]; 60 | 61 | [self.progressLabel mas_makeConstraints:^(MASConstraintMaker *make) { 62 | make.centerX.mas_equalTo(self); 63 | make.top.mas_equalTo(self.progressView.mas_bottom).offset(10); 64 | }]; 65 | } 66 | 67 | #pragma mark - setter and getter 68 | 69 | - (UIImageView *)fileIconImageView { 70 | if (_fileIconImageView == nil) { 71 | _fileIconImageView = [[UIImageView alloc] init]; 72 | } 73 | 74 | return _fileIconImageView; 75 | } 76 | 77 | - (UILabel *)fileNameLabel { 78 | if (_fileNameLabel == nil) { 79 | _fileNameLabel = [[UILabel alloc] init]; 80 | _fileNameLabel.font = [UIFont boldSystemFontOfSize:15.0f]; 81 | _fileNameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; 82 | } 83 | 84 | return _fileNameLabel; 85 | } 86 | 87 | - (UIProgressView *)progressView { 88 | if (_progressView == nil) { 89 | _progressView = [[UIProgressView alloc] init]; 90 | _progressView.progressTintColor = [UIColor colorWithRed:196/255.0f green:38/255.0f blue:29/255.0f alpha:0.8f]; 91 | _progressView.trackTintColor = [UIColor colorWithHexString:@"CAC9CE" alpha:1.0f]; 92 | // _progressView.progressImage = [UIImage imageNamed:@"searchBarBg"]; 93 | } 94 | 95 | return _progressView; 96 | } 97 | 98 | - (UILabel *)progressLabel { 99 | if (_progressLabel == nil) { 100 | _progressLabel = [[UILabel alloc] init]; 101 | _progressLabel.font = [UIFont systemFontOfSize:14.0f]; 102 | // _progressLabel.textColor = [UIColor colorWithHexString:@"666666" alpha:1.0f]; 103 | } 104 | 105 | return _progressLabel; 106 | } 107 | 108 | @end 109 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageAttachmentView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageAttachmentView.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMessageAttachmentView.h" 10 | 11 | //cell 12 | #import "ZGAttachmentTableViewCell.h" 13 | 14 | #import 15 | 16 | //常量 17 | static NSString *const AttachmentTableViewCellIdentifier = @"AttachmentTableViewCellIdentifier"; 18 | 19 | @interface ZGMessageAttachmentView () 20 | 21 | @end 22 | 23 | @implementation ZGMessageAttachmentView 24 | 25 | - (instancetype)initWithFrame:(CGRect)frame { 26 | self = [super initWithFrame:frame]; 27 | if (self) { 28 | self.backgroundColor = [UIColor whiteColor]; 29 | [self addSubview:self.myTableView]; 30 | [self layoutViewSubviews]; 31 | } 32 | 33 | return self; 34 | } 35 | 36 | #pragma mark - UITableViewDelegate 37 | 38 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 39 | if (self.delegate && [self.delegate respondsToSelector:@selector(messageAttachmentView:selectAttachment:)]) { 40 | [self.delegate messageAttachmentView:self selectAttachment:[self.attachments objectAtIndex:indexPath.row]]; 41 | } 42 | 43 | [tableView deselectRowAtIndexPath:indexPath animated:YES]; 44 | } 45 | 46 | - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { 47 | return 0.01; 48 | } 49 | 50 | - (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section { 51 | return 0.01; 52 | } 53 | 54 | #pragma mark - UITableViewDataSource 55 | 56 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 57 | return [self.attachments count]; 58 | } 59 | 60 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 61 | ZGAttachmentTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:AttachmentTableViewCellIdentifier]; 62 | cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; 63 | cell.part = [self.attachments objectAtIndex:indexPath.row]; 64 | 65 | return cell; 66 | } 67 | 68 | #pragma mark - public method 69 | 70 | - (float)heightOfAttachmentView { 71 | return [self.attachments count] * 62 + 20; 72 | } 73 | 74 | - (void)reloadTableView { 75 | [self.myTableView reloadData]; 76 | } 77 | 78 | #pragma mark - private method 79 | 80 | - (void)layoutViewSubviews { 81 | [self.myTableView mas_makeConstraints:^(MASConstraintMaker *make) { 82 | make.size.mas_equalTo(self); 83 | make.center.mas_equalTo(self); 84 | }]; 85 | } 86 | 87 | #pragma mark - setter and getter 88 | 89 | - (UITableView *)myTableView { 90 | if (_myTableView == nil) { 91 | _myTableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped]; 92 | _myTableView.backgroundColor = [UIColor whiteColor]; 93 | _myTableView.contentOffset = CGPointZero; 94 | _myTableView.layoutMargins = UIEdgeInsetsZero; 95 | _myTableView.separatorInset = UIEdgeInsetsMake(0, 10, 0, 0); 96 | _myTableView.delegate = self; 97 | _myTableView.dataSource = self; 98 | _myTableView.rowHeight = 62; 99 | _myTableView.tableHeaderView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, CGFLOAT_MIN)]; 100 | 101 | [_myTableView registerClass:[ZGAttachmentTableViewCell class] forCellReuseIdentifier:AttachmentTableViewCellIdentifier]; 102 | } 103 | 104 | return _myTableView; 105 | } 106 | 107 | @end 108 | -------------------------------------------------------------------------------- /ZGMailbox/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2018/1/24. 6 | // Copyright © 2018年 zzg. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | #import "LoginViewController.h" 12 | #import "ZGMailListViewController.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | // Override point for customization after application launch. 23 | 24 | //展示邮件列表页 25 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(showMailListViewController:) name:ShowMailListControllerNotification object:nil]; 26 | 27 | //设置根控制器 28 | LoginViewController *vc = [[LoginViewController alloc] init]; 29 | self.window.backgroundColor = [UIColor colorWithHexString:@"F2F2F2" alpha:1.0f]; 30 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 31 | self.window.rootViewController = vc; 32 | [self.window makeKeyAndVisible]; 33 | 34 | return YES; 35 | } 36 | 37 | 38 | - (void)applicationWillResignActive:(UIApplication *)application { 39 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 40 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 41 | } 42 | 43 | 44 | - (void)applicationDidEnterBackground:(UIApplication *)application { 45 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 47 | } 48 | 49 | 50 | - (void)applicationWillEnterForeground:(UIApplication *)application { 51 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 52 | } 53 | 54 | 55 | - (void)applicationDidBecomeActive:(UIApplication *)application { 56 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 57 | } 58 | 59 | 60 | - (void)applicationWillTerminate:(UIApplication *)application { 61 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 62 | } 63 | 64 | #pragma mark - private method 65 | 66 | /** 67 | * 展示邮件列表页 68 | */ 69 | - (void)showMailListViewController:(NSNotification *)notify { 70 | dispatch_async(dispatch_get_main_queue(), ^{ 71 | self.window.rootViewController = nil; 72 | 73 | // options是动画选项 74 | [UIView transitionWithView:[UIApplication sharedApplication].keyWindow duration:0.5f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{ 75 | BOOL oldState = [UIView areAnimationsEnabled]; 76 | [UIView setAnimationsEnabled:NO]; 77 | 78 | ZGMailListViewController *mailListVC = [[ZGMailListViewController alloc] init]; 79 | UINavigationController *navVC = [[UINavigationController alloc] initWithRootViewController:mailListVC]; 80 | self.window.rootViewController = navVC; 81 | [self.window makeKeyAndVisible]; 82 | 83 | [UIView setAnimationsEnabled:oldState]; 84 | } completion:^(BOOL finished) { 85 | 86 | }]; 87 | }); 88 | } 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGMessageHeaderDetailAttachmentTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMessageHeaderDetailAttachmentTableViewCell.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/10. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMessageHeaderDetailAttachmentTableViewCell.h" 10 | 11 | #import "ZGAddressShadowButton.h" 12 | 13 | #import 14 | #import 15 | 16 | @interface ZGMessageHeaderDetailAttachmentTableViewCell () 17 | 18 | @property (nonatomic, strong) UILabel *titleLabel; 19 | @property (nonatomic, strong) ZGAddressShadowButton *addressButton; 20 | 21 | @end 22 | 23 | @implementation ZGMessageHeaderDetailAttachmentTableViewCell 24 | 25 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier { 26 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 27 | if (self) { 28 | [self.contentView addSubview:self.titleLabel]; 29 | [self.contentView addSubview:self.addressButton]; 30 | 31 | [self layoutCellSubviews]; 32 | } 33 | 34 | return self; 35 | } 36 | 37 | - (void)awakeFromNib { 38 | [super awakeFromNib]; 39 | // Initialization code 40 | } 41 | 42 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 43 | [super setSelected:selected animated:animated]; 44 | 45 | // Configure the view for the selected state 46 | } 47 | 48 | - (void)layoutSubviews { 49 | [super layoutSubviews]; 50 | if ([self.attachments count] > 1) { 51 | [self.addressButton setTitle:[NSString stringWithFormat:@"%lu", (unsigned long)self.attachments.count] forState:UIControlStateNormal]; 52 | } else { 53 | MCOIMAPPart *part = [self.attachments firstObject]; 54 | [self.addressButton setTitle:part.filename forState:UIControlStateNormal]; 55 | } 56 | } 57 | 58 | #pragma mark - IBAction 59 | 60 | - (IBAction)addressButtonPressed:(id)sender { 61 | if (self.delegate && [self.delegate respondsToSelector:@selector(headerDetailAttachmentCell:attacmentButtonPressed:)]) { 62 | [self.delegate headerDetailAttachmentCell:self attacmentButtonPressed:sender]; 63 | } 64 | } 65 | 66 | #pragma mark - private method 67 | 68 | - (void)layoutCellSubviews { 69 | [self.addressButton mas_makeConstraints:^(MASConstraintMaker *make) { 70 | make.leading.mas_equalTo(self.contentView.mas_leading).offset(62); 71 | make.centerY.mas_equalTo(self.contentView); 72 | }]; 73 | 74 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { 75 | make.trailing.mas_equalTo(self.addressButton.mas_leading); 76 | make.centerY.mas_equalTo(self.addressButton); 77 | }]; 78 | } 79 | 80 | #pragma mark - setter and getter 81 | 82 | - (UILabel *)titleLabel { 83 | if (_titleLabel == nil) { 84 | _titleLabel = [[UILabel alloc] init]; 85 | _titleLabel.font = [UIFont systemFontOfSize:12.0f]; 86 | _titleLabel.textColor = [UIColor colorWithHexString:@"999999" alpha:1.0f]; 87 | _titleLabel.text = @"附件:"; 88 | } 89 | 90 | return _titleLabel; 91 | } 92 | 93 | - (ZGAddressShadowButton *)addressButton { 94 | if (_addressButton == nil) { 95 | _addressButton = [ZGAddressShadowButton buttonWithType:UIButtonTypeCustom]; 96 | [_addressButton setTitleColor:[UIColor colorWithHexString:@"999999" alpha:1.0f] forState:UIControlStateNormal]; 97 | _addressButton.titleLabel.font = [UIFont systemFontOfSize:12.0f]; 98 | [_addressButton addTarget:self action:@selector(addressButtonPressed:) forControlEvents:UIControlEventTouchUpInside]; 99 | [_addressButton setImage:[UIImage imageNamed:@"icon_status_attach"] forState:UIControlStateNormal]; 100 | } 101 | 102 | return _addressButton; 103 | } 104 | 105 | @end 106 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailDetail-邮件详情/Views/ZGAttachmentTableViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGAttachmentTableViewCell.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/4/13. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGAttachmentTableViewCell.h" 10 | 11 | #import 12 | 13 | #import "ZGMailModule.h" 14 | 15 | //分类 16 | #import "NSString+Mail.h" 17 | 18 | @interface ZGAttachmentTableViewCell () 19 | 20 | @property (nonatomic, strong) UIImageView *fileIconImageView; 21 | @property (nonatomic, strong) UILabel *filenameLabel; 22 | @property (nonatomic, strong) UILabel *sizeLabel; 23 | 24 | @end 25 | 26 | @implementation ZGAttachmentTableViewCell 27 | 28 | - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(nullable NSString *)reuseIdentifier { 29 | self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; 30 | if (self) { 31 | [self.contentView addSubview:self.fileIconImageView]; 32 | [self.contentView addSubview:self.filenameLabel]; 33 | [self.contentView addSubview:self.sizeLabel]; 34 | 35 | [self layoutCellSubviews]; 36 | } 37 | 38 | return self; 39 | } 40 | 41 | - (void)awakeFromNib { 42 | [super awakeFromNib]; 43 | // Initialization code 44 | } 45 | 46 | - (void)setSelected:(BOOL)selected animated:(BOOL)animated { 47 | [super setSelected:selected animated:animated]; 48 | 49 | // Configure the view for the selected state 50 | } 51 | 52 | - (void)layoutSubviews { 53 | [super layoutSubviews]; 54 | 55 | NSString *filename = [self.part filename]; 56 | self.filenameLabel.text = filename; 57 | self.sizeLabel.text = [NSString formatStringOfSize:self.part.size]; 58 | 59 | NSString *imageName = [[ZGMailModule sharedInstance] imageNameWithFileName:filename imageSizeType:ImageSizeTypeSmall]; 60 | self.fileIconImageView.image = [UIImage imageNamed:imageName]; 61 | } 62 | 63 | #pragma mark - private method 64 | 65 | - (void)layoutCellSubviews { 66 | [self.fileIconImageView mas_makeConstraints:^(MASConstraintMaker *make) { 67 | make.leading.mas_equalTo(self.contentView.mas_leading).offset(10); 68 | make.centerY.mas_equalTo(self.contentView); 69 | make.size.mas_equalTo(CGSizeMake(51, 51)); 70 | }]; 71 | 72 | [self.filenameLabel mas_makeConstraints:^(MASConstraintMaker *make) { 73 | make.leading.mas_equalTo(self.fileIconImageView.mas_trailing).offset(14); 74 | make.trailing.mas_equalTo(self.contentView.mas_trailing); 75 | make.top.mas_equalTo(self.contentView.mas_top).offset(14); 76 | }]; 77 | 78 | [self.sizeLabel mas_makeConstraints:^(MASConstraintMaker *make) { 79 | make.leading.mas_equalTo(self.fileIconImageView.mas_trailing).offset(14); 80 | make.top.mas_equalTo(self.filenameLabel.mas_bottom).offset(4); 81 | }]; 82 | } 83 | 84 | #pragma mark - setter and getter 85 | 86 | - (UIImageView *)fileIconImageView { 87 | if (_fileIconImageView == nil) { 88 | _fileIconImageView = [[UIImageView alloc] init]; 89 | // _fileIconImageView.image = [UIImage imageNamed:@"filetype_pdf_51h"]; 90 | } 91 | 92 | return _fileIconImageView; 93 | } 94 | 95 | - (UILabel *)filenameLabel { 96 | if (_filenameLabel == nil) { 97 | _filenameLabel = [[UILabel alloc] init]; 98 | _filenameLabel.font = [UIFont boldSystemFontOfSize:15.0f]; 99 | _filenameLabel.lineBreakMode = NSLineBreakByTruncatingMiddle; 100 | } 101 | 102 | return _filenameLabel; 103 | } 104 | 105 | - (UILabel *)sizeLabel { 106 | if (_sizeLabel == nil) { 107 | _sizeLabel = [[UILabel alloc] init]; 108 | _sizeLabel.textColor = [UIColor colorWithHexString:@"666666" alpha:1.0f]; 109 | _sizeLabel.font = [UIFont systemFontOfSize:10.0f]; 110 | } 111 | 112 | return _sizeLabel; 113 | } 114 | 115 | @end 116 | -------------------------------------------------------------------------------- /ZGMailbox/Other/Tool/Reachability/TMReachability.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2011, Tony Million. 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 11 | 2. Redistributions in binary form must reproduce the above copyright notice, 12 | this list of conditions and the following disclaimer in the documentation 13 | and/or other materials provided with the distribution. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 16 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 17 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 18 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 19 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 | POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #import 29 | #import 30 | 31 | //! Project version number for MacOSReachability. 32 | FOUNDATION_EXPORT double ReachabilityVersionNumber; 33 | 34 | //! Project version string for MacOSReachability. 35 | FOUNDATION_EXPORT const unsigned char ReachabilityVersionString[]; 36 | 37 | /** 38 | * Create NS_ENUM macro if it does not exist on the targeted version of iOS or OS X. 39 | * 40 | * @see http://nshipster.com/ns_enum-ns_options/ 41 | **/ 42 | #ifndef NS_ENUM 43 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 44 | #endif 45 | 46 | extern NSString *const kReachabilityChangedNotification; 47 | 48 | typedef NS_ENUM(NSInteger, NetworkStatus) { 49 | // Apple NetworkStatus Compatible Names. 50 | NotReachable = 0, 51 | ReachableViaWiFi = 2, 52 | ReachableViaWWAN = 1 53 | }; 54 | 55 | @class TMReachability; 56 | 57 | typedef void (^NetworkReachable)(TMReachability * reachability); 58 | typedef void (^NetworkUnreachable)(TMReachability * reachability); 59 | typedef void (^NetworkReachability)(TMReachability * reachability, SCNetworkConnectionFlags flags); 60 | 61 | 62 | @interface TMReachability : NSObject 63 | 64 | @property (nonatomic, copy) NetworkReachable reachableBlock; 65 | @property (nonatomic, copy) NetworkUnreachable unreachableBlock; 66 | @property (nonatomic, copy) NetworkReachability reachabilityBlock; 67 | 68 | @property (nonatomic, assign) BOOL reachableOnWWAN; 69 | 70 | 71 | +(instancetype)reachabilityWithHostname:(NSString*)hostname; 72 | // This is identical to the function above, but is here to maintain 73 | //compatibility with Apples original code. (see .m) 74 | +(instancetype)reachabilityWithHostName:(NSString*)hostname; 75 | +(instancetype)reachabilityForInternetConnection; 76 | +(instancetype)reachabilityWithAddress:(void *)hostAddress; 77 | +(instancetype)reachabilityForLocalWiFi; 78 | 79 | -(instancetype)initWithReachabilityRef:(SCNetworkReachabilityRef)ref; 80 | 81 | -(BOOL)startNotifier; 82 | -(void)stopNotifier; 83 | 84 | -(BOOL)isReachable; 85 | -(BOOL)isReachableViaWWAN; 86 | -(BOOL)isReachableViaWiFi; 87 | 88 | // WWAN may be available, but not active until a connection has been established. 89 | // WiFi may require a connection for VPN on Demand. 90 | -(BOOL)isConnectionRequired; // Identical DDG variant. 91 | -(BOOL)connectionRequired; // Apple's routine. 92 | // Dynamic, on demand connection? 93 | -(BOOL)isConnectionOnDemand; 94 | // Is user intervention required? 95 | -(BOOL)isInterventionRequired; 96 | 97 | -(NetworkStatus)currentReachabilityStatus; 98 | -(SCNetworkReachabilityFlags)reachabilityFlags; 99 | -(NSString*)currentReachabilityString; 100 | -(NSString*)currentReachabilityFlags; 101 | 102 | @end 103 | -------------------------------------------------------------------------------- /ZGMailbox/Module/MailList-邮件列表/Views/ZGMailListTitleView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZGMailListTitleView.m 3 | // ZGMailbox 4 | // 5 | // Created by zzg on 2017/3/23. 6 | // Copyright © 2017年 zzg. All rights reserved. 7 | // 8 | 9 | #import "ZGMailListTitleView.h" 10 | 11 | @interface ZGMailListTitleView () 12 | 13 | @property (nonatomic, strong) UIButton *myButton; 14 | @property (nonatomic, strong) UIImageView *arrowImageView; 15 | 16 | @end 17 | 18 | @implementation ZGMailListTitleView 19 | 20 | - (instancetype)initWithFrame:(CGRect)frame { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | [self addSubview:self.titleLabel]; 24 | [self addSubview:self.arrowImageView]; 25 | [self addSubview:self.myButton]; 26 | self.isArrowDown = NO; 27 | 28 | [self layoutViewSubviews]; 29 | } 30 | 31 | return self; 32 | } 33 | 34 | #pragma mark - IBAction 35 | 36 | - (IBAction)buttonPressed:(id)sender { 37 | if (self.delegate && [self.delegate respondsToSelector:@selector(mailListTitleViewPrssed:)]) { 38 | [self.delegate mailListTitleViewPrssed:self]; 39 | self.isArrowDown = !self.isArrowDown; 40 | 41 | // if (self.isArrowDown) { 42 | // [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 43 | // self.arrowImageView.transform = CGAffineTransformMakeRotation(0 * (M_PI / 180.0f)); 44 | // } completion:^(BOOL finished) { 45 | // self.isArrowDown = NO; 46 | // }]; 47 | // } else { 48 | // [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 49 | // self.arrowImageView.transform = CGAffineTransformMakeRotation(180 * (M_PI / 180.0f)); 50 | // } completion:^(BOOL finished) { 51 | // self.isArrowDown = YES; 52 | // }]; 53 | // } 54 | } 55 | } 56 | 57 | #pragma mark - private method 58 | 59 | - (void)layoutViewSubviews { 60 | [self.myButton mas_makeConstraints:^(MASConstraintMaker *make) { 61 | make.size.mas_equalTo(self); 62 | make.center.mas_equalTo(self); 63 | }]; 64 | 65 | [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { 66 | make.center.mas_equalTo(self); 67 | }]; 68 | 69 | [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) { 70 | make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(0); 71 | make.centerX.mas_equalTo(self); 72 | }]; 73 | } 74 | 75 | #pragma mark - setter and getter 76 | 77 | - (void)setIsArrowDown:(BOOL)isArrowDown { 78 | if (!isArrowDown) { 79 | [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 80 | self.arrowImageView.transform = CGAffineTransformMakeRotation(0 * (M_PI / 180.0f)); 81 | } completion:^(BOOL finished) { 82 | }]; 83 | } else { 84 | [UIView animateWithDuration:0.25 delay:0 options:UIViewAnimationOptionCurveLinear animations:^{ 85 | self.arrowImageView.transform = CGAffineTransformMakeRotation(180 * (M_PI / 180.0f)); 86 | } completion:^(BOOL finished) { 87 | }]; 88 | } 89 | 90 | _isArrowDown = isArrowDown; 91 | } 92 | 93 | - (UIButton *)myButton { 94 | if (_myButton == nil) { 95 | _myButton = [UIButton buttonWithType:UIButtonTypeCustom]; 96 | [_myButton addTarget:self action:@selector(buttonPressed:) forControlEvents:UIControlEventTouchUpInside]; 97 | } 98 | 99 | return _myButton; 100 | } 101 | 102 | - (UILabel *)titleLabel { 103 | if (_titleLabel == nil) { 104 | _titleLabel = [[UILabel alloc] init]; 105 | _titleLabel.textColor = [UIColor blackColor]; 106 | _titleLabel.font = [UIFont boldSystemFontOfSize:18.0f]; 107 | } 108 | 109 | return _titleLabel; 110 | } 111 | 112 | - (UIImageView *)arrowImageView { 113 | if (_arrowImageView == nil) { 114 | _arrowImageView = [[UIImageView alloc] init]; 115 | _arrowImageView.image = [UIImage imageNamed:@"icon_nav_arrow_down"]; 116 | _arrowImageView.tintColor = [UIColor whiteColor]; 117 | } 118 | 119 | return _arrowImageView; 120 | } 121 | 122 | @end 123 | --------------------------------------------------------------------------------