├── .DS_Store ├── LICENSE ├── README.md ├── TTPopupView.podspec ├── TTPopupView ├── TTButton.h ├── TTButton.m ├── TTPopupView.bundle │ ├── bgImage_HL@2x.png │ └── cellLine@2x.png ├── TTPopupView.h └── TTPopupView.m ├── TTPopupViewDemo.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ └── xcuserdata │ │ └── haitao.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ └── haitao.xcuserdatad │ └── xcschemes │ ├── TTPopupViewDemo.xcscheme │ └── xcschememanagement.plist ├── TTPopupViewDemo ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── Icons │ ├── funs │ │ ├── alert_72px.png │ │ └── traffic_sign_forbidden_72px.png │ ├── share │ │ ├── acorn_72px.png │ │ ├── badge_google_72px.png │ │ ├── badge_twitter_72px.png │ │ ├── chrome_72px.png │ │ ├── copy_72px.png │ │ ├── cuevana_storm_72px.png │ │ ├── cutthe_rope_72px.png │ │ ├── dropbox_72px.png │ │ ├── evernote_72px.png │ │ ├── facebook_72px.png │ │ ├── google_picasa_72px.png │ │ ├── myspace_72px.png │ │ ├── qq.png │ │ ├── qzone_72px.png │ │ ├── tencent_72px.png │ │ ├── tencent_weixin_72px.png │ │ ├── wechat_72px.png │ │ ├── weibo_72px.png │ │ ├── yahoo_72px.png │ │ ├── youtube_72px.png │ │ └── zhihu_72px.png │ └── share128 │ │ ├── airdroid_128px.png │ │ ├── angrybirds_128px.png │ │ ├── chrome_128px.png │ │ ├── cnn_128px.png │ │ ├── drupal_128px.png │ │ ├── earth_128px.png │ │ ├── evernote_128px.png │ │ ├── google_picasa_128px.png │ │ ├── last_fm_128px.png │ │ ├── pinterest_128px.png │ │ ├── qq_128px.png │ │ ├── stumbleupon_128px.png │ │ ├── twitter_128px.png │ │ ├── vimeo_128px.png │ │ ├── wechat_128px.png │ │ ├── weibo_128px.png │ │ └── youtube_128px.png ├── Info.plist ├── TTPopupViewDemo.xcdatamodeld │ ├── .xccurrentversion │ └── TTPopupViewDemo.xcdatamodel │ │ └── contents ├── TableViewController.h ├── TableViewController.m └── main.m ├── TTPopupViewDemoTests ├── Info.plist └── TTPopupViewDemoTests.m ├── TTPopupViewDemoUITests ├── Info.plist └── TTPopupViewDemoUITests.m ├── screenshot01.png ├── screenshot02.png ├── screenshot03.png ├── screenshot04.png └── screenshot05.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/.DS_Store -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | <<<<<<< HEAD 2 | Apache License 3 | Version 2.0, January 2004 4 | http://www.apache.org/licenses/ 5 | 6 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 7 | 8 | 1. Definitions. 9 | 10 | "License" shall mean the terms and conditions for use, reproduction, 11 | and distribution as defined by Sections 1 through 9 of this document. 12 | 13 | "Licensor" shall mean the copyright owner or entity authorized by 14 | the copyright owner that is granting the License. 15 | 16 | "Legal Entity" shall mean the union of the acting entity and all 17 | other entities that control, are controlled by, or are under common 18 | control with that entity. For the purposes of this definition, 19 | "control" means (i) the power, direct or indirect, to cause the 20 | direction or management of such entity, whether by contract or 21 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 22 | outstanding shares, or (iii) beneficial ownership of such entity. 23 | 24 | "You" (or "Your") shall mean an individual or Legal Entity 25 | exercising permissions granted by this License. 26 | 27 | "Source" form shall mean the preferred form for making modifications, 28 | including but not limited to software source code, documentation 29 | source, and configuration files. 30 | 31 | "Object" form shall mean any form resulting from mechanical 32 | transformation or translation of a Source form, including but 33 | not limited to compiled object code, generated documentation, 34 | and conversions to other media types. 35 | 36 | "Work" shall mean the work of authorship, whether in Source or 37 | Object form, made available under the License, as indicated by a 38 | copyright notice that is included in or attached to the work 39 | (an example is provided in the Appendix below). 40 | 41 | "Derivative Works" shall mean any work, whether in Source or Object 42 | form, that is based on (or derived from) the Work and for which the 43 | editorial revisions, annotations, elaborations, or other modifications 44 | represent, as a whole, an original work of authorship. For the purposes 45 | of this License, Derivative Works shall not include works that remain 46 | separable from, or merely link (or bind by name) to the interfaces of, 47 | the Work and Derivative Works thereof. 48 | 49 | "Contribution" shall mean any work of authorship, including 50 | the original version of the Work and any modifications or additions 51 | to that Work or Derivative Works thereof, that is intentionally 52 | submitted to Licensor for inclusion in the Work by the copyright owner 53 | or by an individual or Legal Entity authorized to submit on behalf of 54 | the copyright owner. For the purposes of this definition, "submitted" 55 | means any form of electronic, verbal, or written communication sent 56 | to the Licensor or its representatives, including but not limited to 57 | communication on electronic mailing lists, source code control systems, 58 | and issue tracking systems that are managed by, or on behalf of, the 59 | Licensor for the purpose of discussing and improving the Work, but 60 | excluding communication that is conspicuously marked or otherwise 61 | designated in writing by the copyright owner as "Not a Contribution." 62 | 63 | "Contributor" shall mean Licensor and any individual or Legal Entity 64 | on behalf of whom a Contribution has been received by Licensor and 65 | subsequently incorporated within the Work. 66 | 67 | 2. Grant of Copyright License. Subject to the terms and conditions of 68 | this License, each Contributor hereby grants to You a perpetual, 69 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 70 | copyright license to reproduce, prepare Derivative Works of, 71 | publicly display, publicly perform, sublicense, and distribute the 72 | Work and such Derivative Works in Source or Object form. 73 | 74 | 3. Grant of Patent License. Subject to the terms and conditions of 75 | this License, each Contributor hereby grants to You a perpetual, 76 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 77 | (except as stated in this section) patent license to make, have made, 78 | use, offer to sell, sell, import, and otherwise transfer the Work, 79 | where such license applies only to those patent claims licensable 80 | by such Contributor that are necessarily infringed by their 81 | Contribution(s) alone or by combination of their Contribution(s) 82 | with the Work to which such Contribution(s) was submitted. If You 83 | institute patent litigation against any entity (including a 84 | cross-claim or counterclaim in a lawsuit) alleging that the Work 85 | or a Contribution incorporated within the Work constitutes direct 86 | or contributory patent infringement, then any patent licenses 87 | granted to You under this License for that Work shall terminate 88 | as of the date such litigation is filed. 89 | 90 | 4. Redistribution. You may reproduce and distribute copies of the 91 | Work or Derivative Works thereof in any medium, with or without 92 | modifications, and in Source or Object form, provided that You 93 | meet the following conditions: 94 | 95 | (a) You must give any other recipients of the Work or 96 | Derivative Works a copy of this License; and 97 | 98 | (b) You must cause any modified files to carry prominent notices 99 | stating that You changed the files; and 100 | 101 | (c) You must retain, in the Source form of any Derivative Works 102 | that You distribute, all copyright, patent, trademark, and 103 | attribution notices from the Source form of the Work, 104 | excluding those notices that do not pertain to any part of 105 | the Derivative Works; and 106 | 107 | (d) If the Work includes a "NOTICE" text file as part of its 108 | distribution, then any Derivative Works that You distribute must 109 | include a readable copy of the attribution notices contained 110 | within such NOTICE file, excluding those notices that do not 111 | pertain to any part of the Derivative Works, in at least one 112 | of the following places: within a NOTICE text file distributed 113 | as part of the Derivative Works; within the Source form or 114 | documentation, if provided along with the Derivative Works; or, 115 | within a display generated by the Derivative Works, if and 116 | wherever such third-party notices normally appear. The contents 117 | of the NOTICE file are for informational purposes only and 118 | do not modify the License. You may add Your own attribution 119 | notices within Derivative Works that You distribute, alongside 120 | or as an addendum to the NOTICE text from the Work, provided 121 | that such additional attribution notices cannot be construed 122 | as modifying the License. 123 | 124 | You may add Your own copyright statement to Your modifications and 125 | may provide additional or different license terms and conditions 126 | for use, reproduction, or distribution of Your modifications, or 127 | for any such Derivative Works as a whole, provided Your use, 128 | reproduction, and distribution of the Work otherwise complies with 129 | the conditions stated in this License. 130 | 131 | 5. Submission of Contributions. Unless You explicitly state otherwise, 132 | any Contribution intentionally submitted for inclusion in the Work 133 | by You to the Licensor shall be under the terms and conditions of 134 | this License, without any additional terms or conditions. 135 | Notwithstanding the above, nothing herein shall supersede or modify 136 | the terms of any separate license agreement you may have executed 137 | with Licensor regarding such Contributions. 138 | 139 | 6. Trademarks. This License does not grant permission to use the trade 140 | names, trademarks, service marks, or product names of the Licensor, 141 | except as required for reasonable and customary use in describing the 142 | origin of the Work and reproducing the content of the NOTICE file. 143 | 144 | 7. Disclaimer of Warranty. Unless required by applicable law or 145 | agreed to in writing, Licensor provides the Work (and each 146 | Contributor provides its Contributions) on an "AS IS" BASIS, 147 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 148 | implied, including, without limitation, any warranties or conditions 149 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 150 | PARTICULAR PURPOSE. You are solely responsible for determining the 151 | appropriateness of using or redistributing the Work and assume any 152 | risks associated with Your exercise of permissions under this License. 153 | 154 | 8. Limitation of Liability. In no event and under no legal theory, 155 | whether in tort (including negligence), contract, or otherwise, 156 | unless required by applicable law (such as deliberate and grossly 157 | negligent acts) or agreed to in writing, shall any Contributor be 158 | liable to You for damages, including any direct, indirect, special, 159 | incidental, or consequential damages of any character arising as a 160 | result of this License or out of the use or inability to use the 161 | Work (including but not limited to damages for loss of goodwill, 162 | work stoppage, computer failure or malfunction, or any and all 163 | other commercial damages or losses), even if such Contributor 164 | has been advised of the possibility of such damages. 165 | 166 | 9. Accepting Warranty or Additional Liability. While redistributing 167 | the Work or Derivative Works thereof, You may choose to offer, 168 | and charge a fee for, acceptance of support, warranty, indemnity, 169 | or other liability obligations and/or rights consistent with this 170 | License. However, in accepting such obligations, You may act only 171 | on Your own behalf and on Your sole responsibility, not on behalf 172 | of any other Contributor, and only if You agree to indemnify, 173 | defend, and hold each Contributor harmless for any liability 174 | incurred by, or claims asserted against, such Contributor by reason 175 | of your accepting any such warranty or additional liability. 176 | 177 | END OF TERMS AND CONDITIONS 178 | 179 | APPENDIX: How to apply the Apache License to your work. 180 | 181 | To apply the Apache License to your work, attach the following 182 | boilerplate notice, with the fields enclosed by brackets "{}" 183 | replaced with your own identifying information. (Don't include 184 | the brackets!) The text should be enclosed in the appropriate 185 | comment syntax for the file format. We also recommend that a 186 | file or class name and description of purpose be included on the 187 | same "printed page" as the copyright notice for easier 188 | identification within third-party archives. 189 | 190 | Copyright {yyyy} {name of copyright owner} 191 | 192 | Licensed under the Apache License, Version 2.0 (the "License"); 193 | you may not use this file except in compliance with the License. 194 | You may obtain a copy of the License at 195 | 196 | http://www.apache.org/licenses/LICENSE-2.0 197 | 198 | Unless required by applicable law or agreed to in writing, software 199 | distributed under the License is distributed on an "AS IS" BASIS, 200 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 201 | See the License for the specific language governing permissions and 202 | limitations under the License. 203 | ======= 204 | MIT License 205 | 206 | Copyright (c) 2016 Robin Wong 207 | 208 | Permission is hereby granted, free of charge, to any person obtaining a copy 209 | of this software and associated documentation files (the "Software"), to deal 210 | in the Software without restriction, including without limitation the rights 211 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 212 | copies of the Software, and to permit persons to whom the Software is 213 | furnished to do so, subject to the following conditions: 214 | 215 | The above copyright notice and this permission notice shall be included in all 216 | copies or substantial portions of the Software. 217 | 218 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 219 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 220 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 221 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 222 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 223 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 224 | SOFTWARE. 225 | >>>>>>> 0262d849bc18a7447feed4fdd194e7f501651e17 226 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TTPopupView 2 | [![LICENSE](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://raw.githubusercontent.com/whtacm/TTPopupView/master/LICENSE)  3 | [![SUPPORT](https://img.shields.io/badge/support-iOS%207%2B%20-blue.svg?style=flat)](https://en.wikipedia.org/wiki/IOS_7)  4 | 5 | 6 |
7 | 自下而上的弹出菜单框,可实现仿微信弹出菜单列表、QQ、知乎等不同样式分享弹出框。 8 | 9 |
10 | ## 样式截图Screenshots 11 |
12 | ### 列表类型 13 | 14 | ![screenshot01.png](screenshot01.png) 15 |
16 | ### 无分页无圆角类型 17 | ![screenshot02.png](screenshot02.png) 18 |
19 | ### 圆角/无分页类型 20 | ![screenshot03.png](screenshot03.png) 21 |
22 | ### 分页/无圆角类型 23 | ![screenshot04.png](screenshot04.png) 24 |
25 | ### 分页/圆角类型 26 | ![screenshot05.png](screenshot05.png) 27 | 28 |
29 | ## 安装&使用 30 | ### 安装 31 | 32 | #### 手动安装 33 | 34 | 你可以手动地把项目下的 `TTPopupView` 的文件拷贝到你的项目中使用 35 | 36 | #### Cocoapods 37 | 38 | pod 'TTPopupView','~> 0.0.1' 39 | 40 |
41 | ### 使用 42 | 43 | #### 类微信弹出列表样式的初始化 44 | 如果要实现一个类似微信弹出列表样式的功能,你可以调用下面的方法: 45 | 46 | 47 | 48 | NSArray *titles = [[NSArray alloc]initWithObjects:@"拍照",@"从手机相册选择",@"保存图片", nil]; 49 | 50 | popup = [[TTPopupView alloc]initWithPopupTitle:nil funsTitles:titles click:^(NSInteger buttonIndex) { 51 | //处理点击事件 52 | }]; 53 | 54 | 55 | 或者 56 | 57 | popup = [[TTPopupView alloc]initWithPopupTitle:nil funsTitles:titles delegate:self]; 58 | 59 | 来初始化 `TTPopupView` 对象,第二个方式,还需要实现 **TTPopupViewDelegate** 中的方法 60 | 61 | #pragma mark - TTPopupViewDelegate 62 | 63 | -(void)popupView:(TTPopupView *)popup onClick:(NSInteger)index{ 64 | //处理点击事件 65 | } 66 | 67 | #### 其他样式的初始化 68 | 69 | 其他四个样式,是类似QQ、知乎一类应用的分享弹出框,样式可以选择在初始化时通过参数来确定。点击处理的部分和上面一样,可以通过实现 **TTPopupViewDelegate** 中的方法 或者 **block** 来实现 70 | 71 | NSArray *shareIcons = @[@"evernote_128px",@"qq_128px",@"wechat_128px",@"weibo_128px",@"google_picasa_128px", 72 | @"youtube_128px",@"chrome_128px",@"cnn_128px",@"angrybirds_128px"]; 73 | NSArray *shareTitles = @[@"印象笔记",@"QQ",@"微信",@"微博",@"Picasa",@"Youtube",@"Chrome",@"CNN",@"AngryBirds"]; 74 | NSArray *funsIcons = @[@"zhihu_72px",@"qq",@"qzone_72px",@"traffic_sign_forbidden_72px",@"alert_72px"]; 75 | NSArray *funsTitles = @[@"复制链接",@"刷新",@"调整字体",@"投诉",@"查看信息"]; 76 | 77 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewNormal popupTitle:nil share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles click:^(NSInteger buttonIndex) { 78 | //处理点击事件 79 | }]; 80 | 81 | 或者 82 | 83 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewNormal popupTitle:nil share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles delegate:self]; 84 | 85 | #### 弹出框样式参数: 86 | /** 87 | * 类似分享弹出框,不带pagecontrol控件,无圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 88 | */ 89 | TTPopupViewNormal, 90 | 91 | /** 92 | * 类似分享弹出框,带pagecontrol控件,无圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 93 | */ 94 | TTPopupViewWithPageControl, 95 | 96 | /** 97 | * 类似分享弹出框,不带pagecontrol控件,有圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 98 | */ 99 | TTPopupViewNormalWithCircle, 100 | 101 | /** 102 | * 类似分享弹出框,带pagecontrol控件,有圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 103 | */ 104 | TTPopupViewWithPageControlWithCircle 105 | 106 | #### 其他属性设置 107 | 你可以设置弹出框的一些参数,包括标题、分享app、功能标题、取消按钮文字和字体大小及颜色,阴影部分的颜色和透明度,圆角样式下圆角的大小等,这些都要在调用 **show()**方法之前完成。 108 | 109 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 110 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 111 | [popup setContentTextFont:[UIFont systemFontOfSize:12]]; 112 | [popup setContentTextColor:[UIColor grayColor]]; 113 | [popup setCancelTextColor:[UIColor blackColor]]; 114 | [popup setRadius:8]; 115 | 116 | [popup show]; 117 | #### 问题&反馈 118 | - QQ :364432355 119 | - E-mail : whtacm@gmail.com 120 | -------------------------------------------------------------------------------- /TTPopupView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "TTPopupView" 4 | s.version = "0.0.1" 5 | s.summary = "自下而上的弹出菜单框,可实现仿微信弹出菜单列表、QQ、知乎等不同样式分享弹出框。" 6 | s.homepage = "https://github.com/whtacm/TTPopupView" 7 | s.license = "MIT" 8 | s.author = { "whtacm" => "whtacm@gmail.com" } 9 | s.platform = :ios, "7.0" 10 | s.source = { :git => "https://github.com/whtacm/TTPopupView.git", :tag => s.version } 11 | s.source_files = "TTPopupView/**/*.{h,m}" 12 | s.resource = "TTPopupView/TTPopupView.bundle" 13 | s.requires_arc = true 14 | 15 | end -------------------------------------------------------------------------------- /TTPopupView/TTButton.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTButton.h 3 | // nari.mip.console 4 | // 5 | // Created by Haitao-Wong on 8/9/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import 10 | typedef enum{ 11 | TTAlignmentStyleTop,// 图标在上,文本在下 12 | TTAlignmentStyleBottom, // 图标在下,文本在上 13 | }TTAlignmentStyle; 14 | 15 | @interface TTButton : UIButton 16 | /** 17 | * 创建不同类型的按钮 18 | */ 19 | @property (nonatomic,assign)TTAlignmentStyle style; 20 | 21 | + (instancetype)tt_Button; 22 | 23 | - (instancetype)initWithAlignmentStyle:(TTAlignmentStyle)style withFrame:(CGRect)frame; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /TTPopupView/TTButton.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTButton.m 3 | // nari.mip.console 4 | // 5 | // Created by Haitao-Wong on 8/9/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import "TTButton.h" 10 | 11 | // 12 | #define tt_label_img_margin 4 13 | 14 | @implementation TTButton 15 | 16 | +(instancetype)tt_Button{ 17 | return [[self alloc]init]; 18 | } 19 | 20 | -(instancetype)initWithAlignmentStyle:(TTAlignmentStyle)style withFrame:(CGRect)frame{ 21 | TTButton *btn = [[TTButton alloc]init]; 22 | btn.frame = frame; 23 | btn.style = style; 24 | return btn; 25 | } 26 | 27 | -(void)layoutSubviews{ 28 | [super layoutSubviews]; 29 | 30 | if (self.style == TTAlignmentStyleBottom) { 31 | [self alignmentBottom]; 32 | }else if(self.style == TTAlignmentStyleTop){ 33 | [self alignmentTop]; 34 | } 35 | } 36 | 37 | /** 38 | * 39 | */ 40 | - (void)alignmentBottom{ 41 | // 计算文本的的宽度 42 | NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; 43 | dictM[NSFontAttributeName] = self.titleLabel.font; 44 | CGRect frame = [self.titleLabel.text boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dictM context:nil]; 45 | 46 | CGFloat btnW = self.frame.size.width; 47 | CGFloat btnH = self.frame.size.height; 48 | 49 | CGFloat titleLabelH = frame.size.height; 50 | CGFloat imageViewH = btnH - titleLabelH - tt_label_img_margin * 3; 51 | CGFloat margin = (btnW - imageViewH) / 2; 52 | 53 | self.titleLabel.frame = CGRectMake(0 , tt_label_img_margin, btnW, btnH - imageViewH - tt_label_img_margin * 3); 54 | self.titleLabel.textAlignment = NSTextAlignmentCenter; 55 | self.imageView.frame = CGRectMake(margin, self.titleLabel.frame.size.height + tt_label_img_margin * 2, imageViewH, imageViewH); 56 | } 57 | 58 | /** 59 | * 60 | */ 61 | - (void)alignmentTop{ 62 | // 计算文本的的宽度 63 | NSMutableDictionary *dictM = [NSMutableDictionary dictionary]; 64 | dictM[NSFontAttributeName] = self.titleLabel.font; 65 | CGRect frame = [self.titleLabel.text boundingRectWithSize:CGSizeMake(MAXFLOAT, MAXFLOAT) options:NSStringDrawingUsesLineFragmentOrigin attributes:dictM context:nil]; 66 | 67 | CGFloat btnW = self.frame.size.width; 68 | CGFloat btnH = self.frame.size.height; 69 | 70 | CGFloat titleLabelH = frame.size.height; 71 | CGFloat imageViewH = btnH - titleLabelH - tt_label_img_margin * 3; 72 | CGFloat margin = (btnW - imageViewH) / 2; 73 | 74 | self.imageView.frame = CGRectMake(margin, tt_label_img_margin, imageViewH, imageViewH); 75 | self.titleLabel.frame = CGRectMake(0 , imageViewH + tt_label_img_margin * 2,btnW, btnH - imageViewH - tt_label_img_margin * 3); 76 | self.titleLabel.textAlignment = NSTextAlignmentCenter; 77 | } 78 | 79 | 80 | @end 81 | -------------------------------------------------------------------------------- /TTPopupView/TTPopupView.bundle/bgImage_HL@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupView/TTPopupView.bundle/bgImage_HL@2x.png -------------------------------------------------------------------------------- /TTPopupView/TTPopupView.bundle/cellLine@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupView/TTPopupView.bundle/cellLine@2x.png -------------------------------------------------------------------------------- /TTPopupView/TTPopupView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TTPopupView.h 3 | // 4 | // 5 | // Created by Haitao-Wong on 7/6/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | 10 | // 按钮高度 11 | #define TT_BUTTON_H 44.0f 12 | 13 | // 分享和功能区域按钮高度(按钮宽高一样) 14 | #define TT_ICON_H 72.0f 15 | 16 | // 屏幕尺寸 17 | #define SCREEN_SIZE [UIScreen mainScreen].bounds.size 18 | 19 | // 颜色 20 | #define TTColor(r, g, b) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:1.0f] 21 | 22 | // 默认弹出框标题字体大小 23 | #define TT_DEFAULT_POPUP_TITLE_TEXT_FONT [UIFont systemFontOfSize:14.0f] 24 | 25 | // 默认分享和功能区域字体大小 26 | #define TT_DEFAULT_CONTENT_TEXT_FONT [UIFont systemFontOfSize:15.0f] 27 | 28 | // 默认取消按钮字体大小 29 | #define TT_DEFAULT_CANCEL_TEXT_FONT [UIFont systemFontOfSize:16.0f] 30 | 31 | // 动画时长 32 | #define TT_DEFAULT_ANIMATION_DURATION 0.3f 33 | 34 | // 透明度 35 | #define TT_DEFAULT_BACKGROUND_OPACITY 0.3f 36 | 37 | 38 | #import 39 | #import "TTButton.h" 40 | 41 | @class TTPopupView; 42 | 43 | #pragma 44 | /** 45 | * 弹出框类型 46 | */ 47 | typedef NS_ENUM(NSInteger,TTPopupViewStyle) { 48 | /** 49 | * 类似微信弹出框,包含标题(可选)、功能列、取消按钮 50 | */ 51 | TTPopupViewActionSheet, 52 | 53 | /** 54 | * 类似分享弹出框,不带pagecontrol控件,无圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 55 | */ 56 | TTPopupViewNormal, 57 | 58 | /** 59 | * 类似分享弹出框,带pagecontrol控件,无圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 60 | */ 61 | TTPopupViewWithPageControl, 62 | 63 | /** 64 | * 类似分享弹出框,不带pagecontrol控件,有圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 65 | */ 66 | TTPopupViewNormalWithCircle, 67 | 68 | /** 69 | * 类似分享弹出框,带pagecontrol控件,有圆角,包含标题(可选)、可分享的第三方平台按钮区(可选,两行四列)、APP自身的功能按钮区(可选,一行)、取消按钮 70 | */ 71 | TTPopupViewWithPageControlWithCircle 72 | 73 | }; 74 | 75 | /** 76 | * 点击弹出框按钮调用的block,可分享的第三方平台APP的按钮tag值为(1000 + index),功能按钮tag值为(2000 + index) 77 | * 78 | * @param buttonIndex 按钮的tag属性值 79 | */ 80 | typedef void(^TTClickBlock)(NSInteger buttonIndex); 81 | 82 | #pragma mark - Delegate 83 | /** 84 | * 弹出框的委托 85 | */ 86 | @protocol TTPopupViewDelegate 87 | 88 | @optional 89 | /** 90 | * 91 | * 点击弹出框按钮调用的方法 92 | * 93 | * @param index 按钮的tag属性值,可分享的第三方平台APP的按钮tag值为(1000 + index),功能按钮tag值为(2000 + index) 94 | */ 95 | -(void)popupView:(TTPopupView*)popup onClick:(NSInteger)index; 96 | 97 | @end 98 | 99 | #pragma mark - TTPopupView 100 | @interface TTPopupView: UIView 101 | 102 | /** 103 | * 弹出框类型 104 | */ 105 | @property (nonatomic) TTPopupViewStyle style; 106 | 107 | /** 108 | * 弹出框的标题 109 | */ 110 | @property (nonatomic, copy) NSString *popupTitle; 111 | 112 | /** 113 | * 第三方平台APP的图标 114 | */ 115 | @property (nonatomic, copy) NSArray *share2Icons; 116 | 117 | /** 118 | *第三方平台APP的标题 119 | */ 120 | @property (nonatomic, copy) NSArray *share2Titles; 121 | 122 | /** 123 | * 自身功能的按钮图标 124 | */ 125 | @property (nonatomic, copy) NSArray *funsIcons; 126 | 127 | /** 128 | * 自身功能的标题 129 | */ 130 | @property (nonatomic, copy) NSArray *funsTitles; 131 | 132 | /** 133 | * 取消按钮标题 134 | */ 135 | @property (nonatomic, strong) NSString *cancelTitle; 136 | 137 | /** 138 | * 弹出框的窗口 139 | */ 140 | @property (nonatomic,strong) UIWindow *rootWindow; 141 | 142 | /** 143 | * 弹出框阴影部分视图 144 | */ 145 | @property (nonatomic, strong) UIView *shadowView; 146 | 147 | /** 148 | * 弹出框的全部内容部分,标题、分享和功能按钮区域、取消按钮 149 | */ 150 | @property (nonatomic, strong) UIView *contentView; 151 | 152 | /** 153 | * 弹出框除去取消按钮的内容部分 154 | */ 155 | @property (nonatomic, strong) UIView *topContentView; 156 | 157 | /** 158 | * 取消按钮控件 159 | */ 160 | @property (nonatomic, strong) UIButton *cancelBtn; 161 | 162 | /** 163 | * 弹出框标题 164 | */ 165 | @property (nonatomic, strong) UILabel *txtTitle; 166 | 167 | /** 168 | * 分享第三方APP部分视图 169 | */ 170 | @property (nonatomic, strong) UIScrollView *share2ScrollView; 171 | 172 | /** 173 | * 功能部分视图 174 | */ 175 | @property (nonatomic, strong) UIScrollView *funsScrollView; 176 | 177 | /** 178 | *分页控件 179 | */ 180 | @property (nonatomic, strong) UIPageControl *pageControl; 181 | 182 | /** 183 | * 弹出框标题字体,默认14 184 | */ 185 | @property (nonatomic, strong) UIFont *popupTitleTextFont; 186 | 187 | /** 188 | * 弹出框标题颜色,默认黑色 189 | */ 190 | @property (nonatomic, strong) UIColor *popupTitleTextColor; 191 | 192 | /** 193 | * 分享和功能区域字体大小,默认15 194 | */ 195 | @property (nonatomic, strong) UIFont *contentTextFont; 196 | 197 | /** 198 | * 分享和功能区域字的颜色,默认黑色 199 | */ 200 | @property (nonatomic, strong) UIColor *contentTextColor; 201 | 202 | /** 203 | * 取消按钮字体大小,默认16 204 | */ 205 | @property (nonatomic, strong) UIFont *cancelTextFont; 206 | 207 | /** 208 | * 取消按钮字的颜色,默认黑色 209 | */ 210 | @property (nonatomic, strong) UIColor *cancelTextColor; 211 | 212 | /** 213 | * 弹出、退出动画时长,默认0.3s 214 | */ 215 | @property (nonatomic, assign) CGFloat animationDuration; 216 | 217 | /** 218 | * 阴影部分透明度,默认0.3f 219 | */ 220 | @property (nonatomic, assign) CGFloat backgroundOpacity; 221 | 222 | /** 223 | * 圆角大小,默认是contentView.frame.size.width / 16 224 | */ 225 | @property (nonatomic, assign) CGFloat radius; 226 | 227 | /** 228 | * 代理属性 229 | */ 230 | @property (nonatomic, weak) id delegate; 231 | 232 | /** 233 | * 点击block 234 | */ 235 | @property (nonatomic, copy) TTClickBlock clickBlock; 236 | 237 | /** 238 | * 创建弹出框(仿微信的列表类型) 239 | * 240 | * @param popupTitle 弹出框标题 241 | * @param funsTitles 功能标题 242 | * @param delegate 委托 243 | * 244 | * @return 245 | */ 246 | -(instancetype)initWithPopupTitle:(NSString*)popupTitle funsTitles:(NSArray*)funsTitles delegate:(id)delegate ; 247 | 248 | /** 249 | * 创建弹出框(仿微信的列表类型) 250 | * 251 | * @param popupTitle 弹出框标题 252 | * @param funsTitles 功能标题 253 | * @param click 点击block 254 | * 255 | * @return 256 | */ 257 | -(instancetype)initWithPopupTitle:(NSString*)popupTitle funsTitles:(NSArray*)funsTitles click:(TTClickBlock)click; 258 | 259 | 260 | /** 261 | *创建弹出框 262 | * 263 | * @param style 样式 264 | * @param share2Icons 第三方分享APP的图标 265 | * @param share2Titles 第三方分享APP的标题 266 | * @param funsIcons 功能图标 267 | * @param funsTitles 功能标题 268 | * @param delegate 委托 269 | * 270 | * @return 271 | */ 272 | -(instancetype)initWithStyle:(TTPopupViewStyle)style popupTitle:(NSString*)popupTitle share2Icons:(NSArray*)share2Icons 273 | share2Titles:(NSArray*)share2Titles funsIcons:(NSArray*)funsIcons funsTitles:(NSArray*)funsTitles delegate:(id)delegate ; 274 | 275 | /** 276 | *创建弹出框 277 | * 278 | * @param style 样式 279 | * @param share2Icons 第三方分享APP的图标 280 | * @param share2Titles 第三方分享APP的标题 281 | * @param funsIcons 功能图标 282 | * @param funsTitles 功能标题 283 | * @param click 点击block 284 | * 285 | * @return 286 | */ 287 | -(instancetype)initWithStyle:(TTPopupViewStyle)style popupTitle:(NSString*)popupTitle share2Icons:(NSArray*)share2Icons 288 | share2Titles:(NSArray*)share2Titles funsIcons:(NSArray*)funsIcons funsTitles:(NSArray*)funsTitles click:(TTClickBlock)click; 289 | 290 | /** 291 | * 弹出框展示,完成创建动作、设置属性后,最后调用该方法。 292 | */ 293 | -(void)show; 294 | 295 | @end 296 | -------------------------------------------------------------------------------- /TTPopupView/TTPopupView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTPopupView.m 3 | // 4 | // 5 | // Created by Haitao-Wong on 7/6/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import "TTPopupView.h" 10 | 11 | @implementation TTPopupView 12 | 13 | //-(NSString *)popupTitle{ 14 | // if (!self.popupTitle) { 15 | // self.popupTitle = @"分享"; 16 | // } 17 | // return self.popupTitle; 18 | //} 19 | 20 | 21 | -(NSString *)cancelTitle{ 22 | if (!_cancelTitle) { 23 | _cancelTitle = @"取消"; 24 | } 25 | return _cancelTitle; 26 | } 27 | 28 | -(UIFont *)popupTitleTextFont{ 29 | if (!_popupTitleTextFont) { 30 | _popupTitleTextFont =TT_DEFAULT_POPUP_TITLE_TEXT_FONT; 31 | } 32 | return _popupTitleTextFont; 33 | } 34 | 35 | -(UIColor *)popupTitleTextColor{ 36 | if (!_popupTitleTextColor) { 37 | _popupTitleTextColor = [UIColor blackColor]; 38 | } 39 | return _popupTitleTextColor; 40 | } 41 | 42 | -(UIFont *)contentTextFont{ 43 | if (!_contentTextFont) { 44 | _contentTextFont =TT_DEFAULT_CONTENT_TEXT_FONT; 45 | } 46 | return _contentTextFont; 47 | } 48 | 49 | -(UIColor *)contentTextColor{ 50 | if (!_contentTextColor) { 51 | _contentTextColor = [UIColor grayColor]; 52 | } 53 | return _contentTextColor; 54 | } 55 | 56 | -(UIFont *)cancelTextFont{ 57 | if (!_cancelTextFont) { 58 | _cancelTextFont = TT_DEFAULT_CANCEL_TEXT_FONT; 59 | } 60 | return _cancelTextFont; 61 | } 62 | 63 | -(UIColor *)cancelTextColor{ 64 | if (!_cancelTextColor) { 65 | _cancelTextColor = TTColor(255, 0, 30); 66 | } 67 | return _cancelTextColor; 68 | } 69 | 70 | 71 | - (CGFloat)animationDuration { 72 | if (!_animationDuration) { 73 | _animationDuration = TT_DEFAULT_ANIMATION_DURATION; 74 | } 75 | 76 | return _animationDuration; 77 | } 78 | 79 | - (CGFloat)backgroundOpacity { 80 | if (!_backgroundOpacity) { 81 | _backgroundOpacity = TT_DEFAULT_BACKGROUND_OPACITY; 82 | } 83 | 84 | return _backgroundOpacity; 85 | } 86 | 87 | -(UIWindow *)rootWindow{ 88 | if (_rootWindow==nil) { 89 | _rootWindow = [[UIWindow alloc]initWithFrame:[UIScreen mainScreen].bounds]; 90 | _rootWindow.windowLevel = UIWindowLevelStatusBar; 91 | _rootWindow.backgroundColor = [UIColor clearColor]; 92 | _rootWindow.hidden = NO; 93 | } 94 | return _rootWindow; 95 | } 96 | 97 | -(instancetype)initWithPopupTitle:(NSString *)popupTitle funsTitles:(NSArray *)funsTitles delegate:(id)delegate{ 98 | return [self initWithStyle:TTPopupViewActionSheet popupTitle:popupTitle share2Icons:nil share2Titles:nil funsIcons:nil funsTitles:funsTitles delegate:delegate]; 99 | } 100 | 101 | -(instancetype)initWithPopupTitle:(NSString *)popupTitle funsTitles:(NSArray *)funsTitles click:(TTClickBlock)click{ 102 | return [self initWithStyle:TTPopupViewActionSheet popupTitle:popupTitle share2Icons:nil share2Titles:nil funsIcons:nil funsTitles:funsTitles click:click]; 103 | } 104 | 105 | -(instancetype)initWithStyle:(TTPopupViewStyle)style popupTitle:(NSString*)popupTitle share2Icons:(NSArray *)share2Icons share2Titles:(NSArray *)share2Titles funsIcons:(NSArray *)funsIcons funsTitles:(NSArray *)funsTitles delegate:(id)delegate{ 106 | 107 | if (self = [super init]) { 108 | self.style = style; 109 | self.popupTitle = popupTitle; 110 | self.share2Icons = share2Icons; 111 | self.share2Titles = share2Titles; 112 | self.funsIcons = funsIcons; 113 | self.funsTitles = funsTitles; 114 | self.delegate = delegate; 115 | } 116 | 117 | return self; 118 | } 119 | 120 | -(instancetype)initWithStyle:(TTPopupViewStyle)style popupTitle:(NSString *)popupTitle share2Icons:(NSArray *)share2Icons share2Titles:(NSArray *)share2Titles funsIcons:(NSArray *)funsIcons funsTitles:(NSArray *)funsTitles click:(TTClickBlock)click{ 121 | if (self = [super init]) { 122 | self.style = style; 123 | self.popupTitle = popupTitle; 124 | self.share2Icons = share2Icons; 125 | self.share2Titles = share2Titles; 126 | self.funsIcons = funsIcons; 127 | self.funsTitles = funsTitles; 128 | self.clickBlock = click; 129 | } 130 | 131 | return self; 132 | 133 | } 134 | 135 | -(void)show{ 136 | [self setupView]; 137 | self.rootWindow.hidden = NO; 138 | 139 | //把弹出框view添加上来,此时弹出框view在屏幕底部的外面,还没显示出来 140 | [self addSubview:self.contentView]; 141 | 142 | [self.rootWindow addSubview:self]; 143 | 144 | [UIView animateWithDuration:self.animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 145 | UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(dismiss:)]; 146 | 147 | [self.shadowView setAlpha:self.backgroundOpacity]; 148 | [self.shadowView setUserInteractionEnabled:YES]; 149 | [self.shadowView addGestureRecognizer:singleTap]; 150 | [self.contentView setBackgroundColor:[UIColor clearColor]]; 151 | 152 | CGRect frame = self.contentView.frame; 153 | frame.origin.y -= frame.size.height; 154 | [self.contentView setFrame:frame]; 155 | 156 | } completion:nil]; 157 | 158 | } 159 | 160 | /** 161 | * 设置所有View和布局 162 | */ 163 | -(void)setupView{ 164 | 165 | // 阴影部分的view 166 | UIView *shadowView = [[UIView alloc] init]; 167 | [shadowView setAlpha:0]; 168 | [shadowView setUserInteractionEnabled:NO]; 169 | [shadowView setFrame:(CGRect){0, 0, SCREEN_SIZE}]; 170 | [shadowView setBackgroundColor:TTColor(46, 49, 50)]; 171 | //[shadowView addGestureRecognizer:singleTap]; 172 | [self addSubview:shadowView]; 173 | self.shadowView = shadowView; 174 | 175 | NSString *bundlePath = [[NSBundle bundleForClass:self.class] pathForResource:@"TTPopupView" ofType:@"bundle"]; 176 | 177 | // 弹出框部分的view,所有的APP图标、功能图标和取消按钮都在这里添加 178 | UIView *contentView = [[UIView alloc] init]; 179 | [contentView setBackgroundColor:TTColor(192, 192, 193)]; 180 | self.contentView = contentView; 181 | 182 | //弹出框除去取消按钮的部分 183 | UIView *topView = [[UIView alloc] init]; 184 | [topView setBackgroundColor:TTColor(192, 192, 193)]; 185 | self.topContentView = topView; 186 | 187 | // 设置弹出框标题 188 | if (self.popupTitle) { 189 | CGFloat vSpace = 0; 190 | CGSize titleSize = [self.popupTitle sizeWithAttributes:@{NSFontAttributeName : self.popupTitleTextFont}]; 191 | if (titleSize.width > SCREEN_SIZE.width - 30.0f) { 192 | vSpace = 15.0f; 193 | } 194 | 195 | UIView *titleBgView = [[UIView alloc] init]; 196 | titleBgView.backgroundColor = [UIColor whiteColor]; 197 | titleBgView.frame = CGRectMake(0, -vSpace, (self.style == TTPopupViewWithPageControlWithCircle || self.style == TTPopupViewNormalWithCircle) ? SCREEN_SIZE.width * .9 : SCREEN_SIZE.width, TT_BUTTON_H + vSpace); 198 | [self.topContentView addSubview:titleBgView]; 199 | 200 | // 标题 201 | UILabel *label = [[UILabel alloc] init]; 202 | [label setText:self.popupTitle]; 203 | [label setNumberOfLines:2.0f]; 204 | [label setTextColor:TTColor(34, 34, 34)]; 205 | [label setTextAlignment:NSTextAlignmentCenter]; 206 | [label setFont:self.popupTitleTextFont]; 207 | [label setBackgroundColor:[UIColor whiteColor]]; 208 | [label setFrame:CGRectMake(15.0f, 0, (self.style == TTPopupViewWithPageControlWithCircle || self.style == TTPopupViewNormalWithCircle) ? SCREEN_SIZE.width * .9 - 30 : SCREEN_SIZE.width - 30 , titleBgView.frame.size.height)]; 209 | [titleBgView addSubview:label]; 210 | } 211 | 212 | // 对分享和功能按钮区布局 213 | switch (self.style) { 214 | case TTPopupViewActionSheet: 215 | //仿微信列表类型的弹出框 216 | [self doActionSheetStyle]; 217 | break; 218 | 219 | case TTPopupViewNormal: 220 | //带分享和功能按钮的弹出框,无分页,无圆角 221 | [self doPageControlStyle:NO andCircleStyle:NO]; 222 | break; 223 | 224 | case TTPopupViewWithPageControl: 225 | //带分享和功能按钮的弹出框,有分页(),无圆角 226 | if(self.share2Icons && self.share2Icons.count < 8){ 227 | [self doPageControlStyle:NO andCircleStyle:NO]; 228 | }else{ 229 | [self doPageControlStyle:YES andCircleStyle:NO]; 230 | } 231 | break; 232 | case TTPopupViewWithPageControlWithCircle: 233 | if(self.share2Icons && self.share2Icons.count < 8){ 234 | [self doPageControlStyle:NO andCircleStyle:YES]; 235 | }else{ 236 | [self doPageControlStyle:YES andCircleStyle:YES]; 237 | } 238 | break; 239 | default: 240 | [self doPageControlStyle:NO andCircleStyle:YES]; 241 | break; 242 | } 243 | 244 | // 对内容区域的frame进行设置 245 | CGRect topFrame = self.topContentView.frame; 246 | [self.contentView setFrame:CGRectMake((self.style == TTPopupViewNormalWithCircle || self.style == TTPopupViewWithPageControlWithCircle) ? SCREEN_SIZE.width * .05 : 0, SCREEN_SIZE.height, topFrame.size.width, topFrame.size.height + TT_BUTTON_H + ((self.style == TTPopupViewNormalWithCircle || self.style == TTPopupViewWithPageControlWithCircle) ? 15.0f : 6))]; 247 | CGRect contentFrame = self.contentView.frame; 248 | [self.contentView addSubview:self.topContentView]; 249 | 250 | // 取消按钮的背景 251 | NSString *linePath = [bundlePath stringByAppendingPathComponent:@"bgImage_HL@2x.png"]; 252 | UIImage *bgImage = [UIImage imageWithContentsOfFile:linePath]; 253 | 254 | // 取消按钮 255 | self.cancelBtn = [[UIButton alloc]initWithFrame:CGRectMake(0 , contentFrame.size.height - TT_BUTTON_H - ((self.style == TTPopupViewNormalWithCircle || self.style == TTPopupViewWithPageControlWithCircle) ? 9.0f : 0), contentFrame.size.width,TT_BUTTON_H )]; 256 | [self.cancelBtn setTag:-100]; 257 | [self.cancelBtn setTitle:self.cancelTitle forState:UIControlStateNormal]; 258 | [self.cancelBtn setTitleColor:self.cancelTextColor forState:UIControlStateNormal]; 259 | [self.cancelBtn setBackgroundColor:[UIColor whiteColor]]; 260 | [self.cancelBtn setBackgroundImage:bgImage forState:UIControlStateHighlighted]; 261 | [self.cancelBtn addTarget:self action:@selector(didClick:) forControlEvents:UIControlEventTouchUpInside]; 262 | [[self.cancelBtn titleLabel] setFont:self.cancelTextFont]; 263 | 264 | [self.contentView addSubview: self.cancelBtn]; 265 | 266 | // 根据是否是圆角类型,进行圆角处理 267 | if(self.style == TTPopupViewWithPageControlWithCircle || self.style == TTPopupViewNormalWithCircle){ 268 | if (!self.radius || self.radius <= 0) { 269 | self.radius = contentFrame.size.width/16; 270 | } 271 | self.cancelBtn.layer.cornerRadius = self.radius; 272 | self.cancelBtn.layer.masksToBounds = YES; 273 | 274 | self.topContentView.layer.cornerRadius = self.radius; 275 | self.topContentView.layer.masksToBounds = YES; 276 | } 277 | 278 | [self setFrame:(CGRect){0, 0, SCREEN_SIZE}]; 279 | } 280 | 281 | /** 282 | * 仿微信弹出框列表类型的处理 283 | */ 284 | -(void)doActionSheetStyle{ 285 | 286 | NSString *bundlePath = [[NSBundle bundleForClass:self.class] pathForResource:@"TTPopupView" ofType:@"bundle"]; 287 | if (self.funsTitles.count) { 288 | for (int i = 0; i < self.funsTitles.count; i++) { 289 | // 功能按钮 290 | UIButton *btn = [[UIButton alloc] init]; 291 | [btn setTag:i]; 292 | [btn setBackgroundColor:[UIColor whiteColor]]; 293 | [btn setTitle:self.funsTitles[i] forState:UIControlStateNormal]; 294 | [[btn titleLabel] setFont:self.contentTextFont]; 295 | [btn setTitleColor:self.contentTextColor forState:UIControlStateNormal]; 296 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateHighlighted]; 297 | 298 | 299 | NSString *linePath = [bundlePath stringByAppendingPathComponent:@"bgImage_HL@2x.png"]; 300 | UIImage *bgImage = [UIImage imageWithContentsOfFile:linePath]; 301 | 302 | [btn setBackgroundImage:bgImage forState:UIControlStateHighlighted]; 303 | [btn addTarget:self action:@selector(didClick:) forControlEvents:UIControlEventTouchUpInside]; 304 | 305 | CGFloat y = TT_BUTTON_H * (i + (self.popupTitle ? 1 : 0)); 306 | [btn setFrame:CGRectMake(0, y, SCREEN_SIZE.width, TT_BUTTON_H)]; 307 | [self.topContentView addSubview:btn]; 308 | } 309 | 310 | for (int i = 0; i < self.funsTitles.count; i++) { 311 | NSString *linePath = [bundlePath stringByAppendingPathComponent:@"cellLine@2x.png"]; 312 | UIImage *lineImage = [UIImage imageWithContentsOfFile:linePath]; 313 | 314 | // 功能按钮的分割线条 315 | UIImageView *line = [[UIImageView alloc] init]; 316 | [line setImage:lineImage]; 317 | [line setContentMode:UIViewContentModeTop]; 318 | CGFloat y = (i + (self.popupTitle ? 1 : 0)) * TT_BUTTON_H; 319 | [line setFrame:CGRectMake(0, y, SCREEN_SIZE.width, 1.0f)]; 320 | [self.topContentView addSubview:line]; 321 | } 322 | } 323 | 324 | // 内容top部分frame的设置 325 | CGFloat bottomH = (self.popupTitle ? TT_BUTTON_H : 0) + TT_BUTTON_H * self.funsTitles.count; 326 | [self.topContentView setFrame:CGRectMake(0, 0, SCREEN_SIZE.width, bottomH)]; 327 | } 328 | 329 | /** 330 | * 非微信列表类型弹出框的布局处理 331 | */ 332 | -(void)doPageControlStyle:(BOOL)pageControlStyle andCircleStyle:(BOOL)circleStyle{ 333 | NSString *bundlePath = [[NSBundle bundleForClass:self.class] pathForResource:@"TTPopupView" ofType:@"bundle"]; 334 | NSString *linePath = [bundlePath stringByAppendingPathComponent:@"cellLine@2x.png"]; 335 | UIImage *lineImage = [UIImage imageWithContentsOfFile:linePath]; 336 | 337 | // 第三方分享APP的布局处理,如果传入的第三方分享APP的图标列表是nil或者count ==0,则不添加分享按钮区。 338 | if (self.share2Icons && self.share2Icons.count>0) { 339 | // 根据有无弹出框标题、分页控件、圆角情况,分别设置分享部分视图的frame大小 340 | self.share2ScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, self.popupTitle ? TT_BUTTON_H : 0, circleStyle ? SCREEN_SIZE.width * .9 : SCREEN_SIZE.width, TT_ICON_H * 2 + 10 + (self.popupTitle ? 5 : 10) + (pageControlStyle ? 5 : 10))]; 341 | [self.topContentView addSubview:self.share2ScrollView]; 342 | [self.share2ScrollView setBackgroundColor:[UIColor whiteColor]]; 343 | 344 | // 计算分享部分视图的contentsize 和属性设置 345 | CGSize size = self.share2ScrollView.frame.size; 346 | CGFloat shareSVWidth = size.width; 347 | CGFloat margin = (size.width - TT_ICON_H * 4) /5; 348 | size.width *= (self.share2Icons.count/8 + 1); 349 | self.share2ScrollView.contentSize = size; 350 | self.share2ScrollView.showsHorizontalScrollIndicator = NO; 351 | self.share2ScrollView.pagingEnabled = YES; 352 | 353 | // 添加第三方分享APP按钮 354 | for (int i = 0; i0) { 405 | // 计算功能部分视图的frame大小 406 | self.funsScrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, (self.popupTitle ? TT_BUTTON_H : 0) + (self.share2ScrollView ? self.share2ScrollView.frame.size.height + (pageControlStyle ? 20 : 0) : 0), circleStyle ? SCREEN_SIZE.width * .9 : SCREEN_SIZE.width, TT_ICON_H + 20)]; 407 | [self.topContentView addSubview:self.funsScrollView]; 408 | [self.funsScrollView setBackgroundColor:[UIColor whiteColor]]; 409 | 410 | // 计算功能部分视图的contentsize大小 和属性设置 411 | CGSize size = self.funsScrollView.frame.size; 412 | CGFloat funsSVWidth = size.width; 413 | CGFloat margin = (size.width - TT_ICON_H * 4) /5; 414 | size.width = (self.funsIcons.count + 1) * margin + TT_ICON_H * self.funsIcons.count; 415 | self.funsScrollView.contentSize = size; 416 | self.funsScrollView.showsHorizontalScrollIndicator = NO; 417 | 418 | // 添加功能按钮 419 | for (int i = 0; i>dismiss",self); 485 | [UIView animateWithDuration:self.animationDuration delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{ 486 | [self.shadowView setAlpha:0]; 487 | [self.shadowView setUserInteractionEnabled:NO]; 488 | 489 | CGRect frame = self.contentView.frame; 490 | frame.origin.y += frame.size.height; 491 | [self.contentView setFrame:frame]; 492 | 493 | } completion:^(BOOL finished){ 494 | [self removeFromSuperview]; 495 | self.rootWindow.hidden = YES; 496 | }]; 497 | } 498 | 499 | /** 500 | * 点击处理 501 | * 502 | * @param btn 503 | */ 504 | -(void)didClick:(UIButton*)btn { 505 | [self dismiss:nil]; 506 | 507 | if (btn && btn.tag == -100) { 508 | return; 509 | } 510 | 511 | if (self.delegate) { 512 | if ([self.delegate respondsToSelector:@selector(popupView:onClick:)]) { 513 | [self.delegate popupView:self onClick:btn.tag]; 514 | } 515 | } 516 | 517 | 518 | if (self.clickBlock) { 519 | self.clickBlock(btn.tag); 520 | } 521 | 522 | 523 | } 524 | @end 525 | -------------------------------------------------------------------------------- /TTPopupViewDemo.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | B2CC69961D6540E000E76E38 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69951D6540E000E76E38 /* main.m */; }; 11 | B2CC69991D6540E000E76E38 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69981D6540E000E76E38 /* AppDelegate.m */; }; 12 | B2CC699F1D6540E000E76E38 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2CC699D1D6540E000E76E38 /* Main.storyboard */; }; 13 | B2CC69A21D6540E000E76E38 /* TTPopupViewDemo.xcdatamodeld in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69A01D6540E000E76E38 /* TTPopupViewDemo.xcdatamodeld */; }; 14 | B2CC69A41D6540E000E76E38 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69A31D6540E000E76E38 /* Assets.xcassets */; }; 15 | B2CC69A71D6540E000E76E38 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69A51D6540E000E76E38 /* LaunchScreen.storyboard */; }; 16 | B2CC69B21D6540E000E76E38 /* TTPopupViewDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69B11D6540E000E76E38 /* TTPopupViewDemoTests.m */; }; 17 | B2CC69BD1D6540E000E76E38 /* TTPopupViewDemoUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69BC1D6540E000E76E38 /* TTPopupViewDemoUITests.m */; }; 18 | B2CC69D01D65410300E76E38 /* TTButton.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69CC1D65410300E76E38 /* TTButton.m */; }; 19 | B2CC69D11D65410300E76E38 /* TTPopupView.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69CD1D65410300E76E38 /* TTPopupView.bundle */; }; 20 | B2CC69D21D65410300E76E38 /* TTPopupView.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC69CF1D65410300E76E38 /* TTPopupView.m */; }; 21 | B2CC6A011D65412700E76E38 /* alert_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69D51D65412700E76E38 /* alert_72px.png */; }; 22 | B2CC6A021D65412700E76E38 /* traffic_sign_forbidden_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69D61D65412700E76E38 /* traffic_sign_forbidden_72px.png */; }; 23 | B2CC6A031D65412700E76E38 /* acorn_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69D81D65412700E76E38 /* acorn_72px.png */; }; 24 | B2CC6A041D65412700E76E38 /* badge_google_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69D91D65412700E76E38 /* badge_google_72px.png */; }; 25 | B2CC6A051D65412700E76E38 /* badge_twitter_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DA1D65412700E76E38 /* badge_twitter_72px.png */; }; 26 | B2CC6A061D65412700E76E38 /* chrome_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DB1D65412700E76E38 /* chrome_72px.png */; }; 27 | B2CC6A071D65412700E76E38 /* copy_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DC1D65412700E76E38 /* copy_72px.png */; }; 28 | B2CC6A081D65412700E76E38 /* cuevana_storm_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DD1D65412700E76E38 /* cuevana_storm_72px.png */; }; 29 | B2CC6A091D65412700E76E38 /* cutthe_rope_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DE1D65412700E76E38 /* cutthe_rope_72px.png */; }; 30 | B2CC6A0A1D65412700E76E38 /* dropbox_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69DF1D65412700E76E38 /* dropbox_72px.png */; }; 31 | B2CC6A0B1D65412700E76E38 /* evernote_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E01D65412700E76E38 /* evernote_72px.png */; }; 32 | B2CC6A0C1D65412700E76E38 /* facebook_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E11D65412700E76E38 /* facebook_72px.png */; }; 33 | B2CC6A0D1D65412700E76E38 /* google_picasa_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E21D65412700E76E38 /* google_picasa_72px.png */; }; 34 | B2CC6A0E1D65412700E76E38 /* myspace_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E31D65412700E76E38 /* myspace_72px.png */; }; 35 | B2CC6A0F1D65412700E76E38 /* qq.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E41D65412700E76E38 /* qq.png */; }; 36 | B2CC6A101D65412700E76E38 /* qzone_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E51D65412700E76E38 /* qzone_72px.png */; }; 37 | B2CC6A111D65412700E76E38 /* tencent_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E61D65412700E76E38 /* tencent_72px.png */; }; 38 | B2CC6A121D65412700E76E38 /* tencent_weixin_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E71D65412700E76E38 /* tencent_weixin_72px.png */; }; 39 | B2CC6A131D65412700E76E38 /* wechat_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E81D65412700E76E38 /* wechat_72px.png */; }; 40 | B2CC6A141D65412700E76E38 /* weibo_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69E91D65412700E76E38 /* weibo_72px.png */; }; 41 | B2CC6A151D65412700E76E38 /* yahoo_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69EA1D65412700E76E38 /* yahoo_72px.png */; }; 42 | B2CC6A161D65412700E76E38 /* youtube_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69EB1D65412700E76E38 /* youtube_72px.png */; }; 43 | B2CC6A171D65412700E76E38 /* zhihu_72px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69EC1D65412700E76E38 /* zhihu_72px.png */; }; 44 | B2CC6A181D65412700E76E38 /* airdroid_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69EE1D65412700E76E38 /* airdroid_128px.png */; }; 45 | B2CC6A191D65412700E76E38 /* angrybirds_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69EF1D65412700E76E38 /* angrybirds_128px.png */; }; 46 | B2CC6A1A1D65412700E76E38 /* chrome_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F01D65412700E76E38 /* chrome_128px.png */; }; 47 | B2CC6A1B1D65412700E76E38 /* cnn_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F11D65412700E76E38 /* cnn_128px.png */; }; 48 | B2CC6A1C1D65412700E76E38 /* drupal_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F21D65412700E76E38 /* drupal_128px.png */; }; 49 | B2CC6A1D1D65412700E76E38 /* earth_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F31D65412700E76E38 /* earth_128px.png */; }; 50 | B2CC6A1E1D65412700E76E38 /* evernote_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F41D65412700E76E38 /* evernote_128px.png */; }; 51 | B2CC6A1F1D65412700E76E38 /* google_picasa_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F51D65412700E76E38 /* google_picasa_128px.png */; }; 52 | B2CC6A201D65412700E76E38 /* last_fm_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F61D65412700E76E38 /* last_fm_128px.png */; }; 53 | B2CC6A211D65412700E76E38 /* pinterest_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F71D65412700E76E38 /* pinterest_128px.png */; }; 54 | B2CC6A221D65412700E76E38 /* qq_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F81D65412700E76E38 /* qq_128px.png */; }; 55 | B2CC6A231D65412700E76E38 /* stumbleupon_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69F91D65412700E76E38 /* stumbleupon_128px.png */; }; 56 | B2CC6A241D65412700E76E38 /* twitter_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69FA1D65412700E76E38 /* twitter_128px.png */; }; 57 | B2CC6A251D65412700E76E38 /* vimeo_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69FB1D65412700E76E38 /* vimeo_128px.png */; }; 58 | B2CC6A261D65412700E76E38 /* wechat_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69FC1D65412700E76E38 /* wechat_128px.png */; }; 59 | B2CC6A271D65412700E76E38 /* weibo_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69FD1D65412700E76E38 /* weibo_128px.png */; }; 60 | B2CC6A281D65412700E76E38 /* youtube_128px.png in Resources */ = {isa = PBXBuildFile; fileRef = B2CC69FE1D65412700E76E38 /* youtube_128px.png */; }; 61 | B2CC6A291D65412700E76E38 /* TableViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B2CC6A001D65412700E76E38 /* TableViewController.m */; }; 62 | /* End PBXBuildFile section */ 63 | 64 | /* Begin PBXContainerItemProxy section */ 65 | B2CC69AE1D6540E000E76E38 /* PBXContainerItemProxy */ = { 66 | isa = PBXContainerItemProxy; 67 | containerPortal = B2CC69891D6540E000E76E38 /* Project object */; 68 | proxyType = 1; 69 | remoteGlobalIDString = B2CC69901D6540E000E76E38; 70 | remoteInfo = TTPopupViewDemo; 71 | }; 72 | B2CC69B91D6540E000E76E38 /* PBXContainerItemProxy */ = { 73 | isa = PBXContainerItemProxy; 74 | containerPortal = B2CC69891D6540E000E76E38 /* Project object */; 75 | proxyType = 1; 76 | remoteGlobalIDString = B2CC69901D6540E000E76E38; 77 | remoteInfo = TTPopupViewDemo; 78 | }; 79 | /* End PBXContainerItemProxy section */ 80 | 81 | /* Begin PBXFileReference section */ 82 | B2CC69911D6540E000E76E38 /* TTPopupViewDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TTPopupViewDemo.app; sourceTree = BUILT_PRODUCTS_DIR; }; 83 | B2CC69951D6540E000E76E38 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 84 | B2CC69971D6540E000E76E38 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 85 | B2CC69981D6540E000E76E38 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 86 | B2CC699E1D6540E000E76E38 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 87 | B2CC69A11D6540E000E76E38 /* TTPopupViewDemo.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = TTPopupViewDemo.xcdatamodel; sourceTree = ""; }; 88 | B2CC69A31D6540E000E76E38 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 89 | B2CC69A61D6540E000E76E38 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 90 | B2CC69A81D6540E000E76E38 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 91 | B2CC69AD1D6540E000E76E38 /* TTPopupViewDemoTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TTPopupViewDemoTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 92 | B2CC69B11D6540E000E76E38 /* TTPopupViewDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TTPopupViewDemoTests.m; sourceTree = ""; }; 93 | B2CC69B31D6540E000E76E38 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 94 | B2CC69B81D6540E000E76E38 /* TTPopupViewDemoUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = TTPopupViewDemoUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 95 | B2CC69BC1D6540E000E76E38 /* TTPopupViewDemoUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TTPopupViewDemoUITests.m; sourceTree = ""; }; 96 | B2CC69BE1D6540E000E76E38 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 97 | B2CC69CB1D65410300E76E38 /* TTButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTButton.h; sourceTree = ""; }; 98 | B2CC69CC1D65410300E76E38 /* TTButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTButton.m; sourceTree = ""; }; 99 | B2CC69CD1D65410300E76E38 /* TTPopupView.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = TTPopupView.bundle; sourceTree = ""; }; 100 | B2CC69CE1D65410300E76E38 /* TTPopupView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TTPopupView.h; sourceTree = ""; }; 101 | B2CC69CF1D65410300E76E38 /* TTPopupView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TTPopupView.m; sourceTree = ""; }; 102 | B2CC69D51D65412700E76E38 /* alert_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = alert_72px.png; sourceTree = ""; }; 103 | B2CC69D61D65412700E76E38 /* traffic_sign_forbidden_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = traffic_sign_forbidden_72px.png; sourceTree = ""; }; 104 | B2CC69D81D65412700E76E38 /* acorn_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = acorn_72px.png; sourceTree = ""; }; 105 | B2CC69D91D65412700E76E38 /* badge_google_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = badge_google_72px.png; sourceTree = ""; }; 106 | B2CC69DA1D65412700E76E38 /* badge_twitter_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = badge_twitter_72px.png; sourceTree = ""; }; 107 | B2CC69DB1D65412700E76E38 /* chrome_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chrome_72px.png; sourceTree = ""; }; 108 | B2CC69DC1D65412700E76E38 /* copy_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = copy_72px.png; sourceTree = ""; }; 109 | B2CC69DD1D65412700E76E38 /* cuevana_storm_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cuevana_storm_72px.png; sourceTree = ""; }; 110 | B2CC69DE1D65412700E76E38 /* cutthe_rope_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cutthe_rope_72px.png; sourceTree = ""; }; 111 | B2CC69DF1D65412700E76E38 /* dropbox_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = dropbox_72px.png; sourceTree = ""; }; 112 | B2CC69E01D65412700E76E38 /* evernote_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = evernote_72px.png; sourceTree = ""; }; 113 | B2CC69E11D65412700E76E38 /* facebook_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = facebook_72px.png; sourceTree = ""; }; 114 | B2CC69E21D65412700E76E38 /* google_picasa_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = google_picasa_72px.png; sourceTree = ""; }; 115 | B2CC69E31D65412700E76E38 /* myspace_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = myspace_72px.png; sourceTree = ""; }; 116 | B2CC69E41D65412700E76E38 /* qq.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = qq.png; sourceTree = ""; }; 117 | B2CC69E51D65412700E76E38 /* qzone_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = qzone_72px.png; sourceTree = ""; }; 118 | B2CC69E61D65412700E76E38 /* tencent_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tencent_72px.png; sourceTree = ""; }; 119 | B2CC69E71D65412700E76E38 /* tencent_weixin_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = tencent_weixin_72px.png; sourceTree = ""; }; 120 | B2CC69E81D65412700E76E38 /* wechat_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wechat_72px.png; sourceTree = ""; }; 121 | B2CC69E91D65412700E76E38 /* weibo_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weibo_72px.png; sourceTree = ""; }; 122 | B2CC69EA1D65412700E76E38 /* yahoo_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = yahoo_72px.png; sourceTree = ""; }; 123 | B2CC69EB1D65412700E76E38 /* youtube_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = youtube_72px.png; sourceTree = ""; }; 124 | B2CC69EC1D65412700E76E38 /* zhihu_72px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = zhihu_72px.png; sourceTree = ""; }; 125 | B2CC69EE1D65412700E76E38 /* airdroid_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = airdroid_128px.png; sourceTree = ""; }; 126 | B2CC69EF1D65412700E76E38 /* angrybirds_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = angrybirds_128px.png; sourceTree = ""; }; 127 | B2CC69F01D65412700E76E38 /* chrome_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = chrome_128px.png; sourceTree = ""; }; 128 | B2CC69F11D65412700E76E38 /* cnn_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = cnn_128px.png; sourceTree = ""; }; 129 | B2CC69F21D65412700E76E38 /* drupal_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = drupal_128px.png; sourceTree = ""; }; 130 | B2CC69F31D65412700E76E38 /* earth_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = earth_128px.png; sourceTree = ""; }; 131 | B2CC69F41D65412700E76E38 /* evernote_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = evernote_128px.png; sourceTree = ""; }; 132 | B2CC69F51D65412700E76E38 /* google_picasa_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = google_picasa_128px.png; sourceTree = ""; }; 133 | B2CC69F61D65412700E76E38 /* last_fm_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = last_fm_128px.png; sourceTree = ""; }; 134 | B2CC69F71D65412700E76E38 /* pinterest_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = pinterest_128px.png; sourceTree = ""; }; 135 | B2CC69F81D65412700E76E38 /* qq_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = qq_128px.png; sourceTree = ""; }; 136 | B2CC69F91D65412700E76E38 /* stumbleupon_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = stumbleupon_128px.png; sourceTree = ""; }; 137 | B2CC69FA1D65412700E76E38 /* twitter_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = twitter_128px.png; sourceTree = ""; }; 138 | B2CC69FB1D65412700E76E38 /* vimeo_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = vimeo_128px.png; sourceTree = ""; }; 139 | B2CC69FC1D65412700E76E38 /* wechat_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = wechat_128px.png; sourceTree = ""; }; 140 | B2CC69FD1D65412700E76E38 /* weibo_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = weibo_128px.png; sourceTree = ""; }; 141 | B2CC69FE1D65412700E76E38 /* youtube_128px.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = youtube_128px.png; sourceTree = ""; }; 142 | B2CC69FF1D65412700E76E38 /* TableViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TableViewController.h; sourceTree = ""; }; 143 | B2CC6A001D65412700E76E38 /* TableViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TableViewController.m; sourceTree = ""; }; 144 | /* End PBXFileReference section */ 145 | 146 | /* Begin PBXFrameworksBuildPhase section */ 147 | B2CC698E1D6540E000E76E38 /* Frameworks */ = { 148 | isa = PBXFrameworksBuildPhase; 149 | buildActionMask = 2147483647; 150 | files = ( 151 | ); 152 | runOnlyForDeploymentPostprocessing = 0; 153 | }; 154 | B2CC69AA1D6540E000E76E38 /* Frameworks */ = { 155 | isa = PBXFrameworksBuildPhase; 156 | buildActionMask = 2147483647; 157 | files = ( 158 | ); 159 | runOnlyForDeploymentPostprocessing = 0; 160 | }; 161 | B2CC69B51D6540E000E76E38 /* Frameworks */ = { 162 | isa = PBXFrameworksBuildPhase; 163 | buildActionMask = 2147483647; 164 | files = ( 165 | ); 166 | runOnlyForDeploymentPostprocessing = 0; 167 | }; 168 | /* End PBXFrameworksBuildPhase section */ 169 | 170 | /* Begin PBXGroup section */ 171 | B2CC69881D6540E000E76E38 = { 172 | isa = PBXGroup; 173 | children = ( 174 | B2CC69CA1D65410300E76E38 /* TTPopupView */, 175 | B2CC69931D6540E000E76E38 /* TTPopupViewDemo */, 176 | B2CC69B01D6540E000E76E38 /* TTPopupViewDemoTests */, 177 | B2CC69BB1D6540E000E76E38 /* TTPopupViewDemoUITests */, 178 | B2CC69921D6540E000E76E38 /* Products */, 179 | ); 180 | sourceTree = ""; 181 | }; 182 | B2CC69921D6540E000E76E38 /* Products */ = { 183 | isa = PBXGroup; 184 | children = ( 185 | B2CC69911D6540E000E76E38 /* TTPopupViewDemo.app */, 186 | B2CC69AD1D6540E000E76E38 /* TTPopupViewDemoTests.xctest */, 187 | B2CC69B81D6540E000E76E38 /* TTPopupViewDemoUITests.xctest */, 188 | ); 189 | name = Products; 190 | sourceTree = ""; 191 | }; 192 | B2CC69931D6540E000E76E38 /* TTPopupViewDemo */ = { 193 | isa = PBXGroup; 194 | children = ( 195 | B2CC69D31D65412700E76E38 /* Icons */, 196 | B2CC69FF1D65412700E76E38 /* TableViewController.h */, 197 | B2CC6A001D65412700E76E38 /* TableViewController.m */, 198 | B2CC69971D6540E000E76E38 /* AppDelegate.h */, 199 | B2CC69981D6540E000E76E38 /* AppDelegate.m */, 200 | B2CC699D1D6540E000E76E38 /* Main.storyboard */, 201 | B2CC69A31D6540E000E76E38 /* Assets.xcassets */, 202 | B2CC69A51D6540E000E76E38 /* LaunchScreen.storyboard */, 203 | B2CC69A81D6540E000E76E38 /* Info.plist */, 204 | B2CC69A01D6540E000E76E38 /* TTPopupViewDemo.xcdatamodeld */, 205 | B2CC69941D6540E000E76E38 /* Supporting Files */, 206 | ); 207 | path = TTPopupViewDemo; 208 | sourceTree = ""; 209 | }; 210 | B2CC69941D6540E000E76E38 /* Supporting Files */ = { 211 | isa = PBXGroup; 212 | children = ( 213 | B2CC69951D6540E000E76E38 /* main.m */, 214 | ); 215 | name = "Supporting Files"; 216 | sourceTree = ""; 217 | }; 218 | B2CC69B01D6540E000E76E38 /* TTPopupViewDemoTests */ = { 219 | isa = PBXGroup; 220 | children = ( 221 | B2CC69B11D6540E000E76E38 /* TTPopupViewDemoTests.m */, 222 | B2CC69B31D6540E000E76E38 /* Info.plist */, 223 | ); 224 | path = TTPopupViewDemoTests; 225 | sourceTree = ""; 226 | }; 227 | B2CC69BB1D6540E000E76E38 /* TTPopupViewDemoUITests */ = { 228 | isa = PBXGroup; 229 | children = ( 230 | B2CC69BC1D6540E000E76E38 /* TTPopupViewDemoUITests.m */, 231 | B2CC69BE1D6540E000E76E38 /* Info.plist */, 232 | ); 233 | path = TTPopupViewDemoUITests; 234 | sourceTree = ""; 235 | }; 236 | B2CC69CA1D65410300E76E38 /* TTPopupView */ = { 237 | isa = PBXGroup; 238 | children = ( 239 | B2CC69CB1D65410300E76E38 /* TTButton.h */, 240 | B2CC69CC1D65410300E76E38 /* TTButton.m */, 241 | B2CC69CD1D65410300E76E38 /* TTPopupView.bundle */, 242 | B2CC69CE1D65410300E76E38 /* TTPopupView.h */, 243 | B2CC69CF1D65410300E76E38 /* TTPopupView.m */, 244 | ); 245 | path = TTPopupView; 246 | sourceTree = ""; 247 | }; 248 | B2CC69D31D65412700E76E38 /* Icons */ = { 249 | isa = PBXGroup; 250 | children = ( 251 | B2CC69D41D65412700E76E38 /* funs */, 252 | B2CC69D71D65412700E76E38 /* share */, 253 | B2CC69ED1D65412700E76E38 /* share128 */, 254 | ); 255 | path = Icons; 256 | sourceTree = ""; 257 | }; 258 | B2CC69D41D65412700E76E38 /* funs */ = { 259 | isa = PBXGroup; 260 | children = ( 261 | B2CC69D51D65412700E76E38 /* alert_72px.png */, 262 | B2CC69D61D65412700E76E38 /* traffic_sign_forbidden_72px.png */, 263 | ); 264 | path = funs; 265 | sourceTree = ""; 266 | }; 267 | B2CC69D71D65412700E76E38 /* share */ = { 268 | isa = PBXGroup; 269 | children = ( 270 | B2CC69D81D65412700E76E38 /* acorn_72px.png */, 271 | B2CC69D91D65412700E76E38 /* badge_google_72px.png */, 272 | B2CC69DA1D65412700E76E38 /* badge_twitter_72px.png */, 273 | B2CC69DB1D65412700E76E38 /* chrome_72px.png */, 274 | B2CC69DC1D65412700E76E38 /* copy_72px.png */, 275 | B2CC69DD1D65412700E76E38 /* cuevana_storm_72px.png */, 276 | B2CC69DE1D65412700E76E38 /* cutthe_rope_72px.png */, 277 | B2CC69DF1D65412700E76E38 /* dropbox_72px.png */, 278 | B2CC69E01D65412700E76E38 /* evernote_72px.png */, 279 | B2CC69E11D65412700E76E38 /* facebook_72px.png */, 280 | B2CC69E21D65412700E76E38 /* google_picasa_72px.png */, 281 | B2CC69E31D65412700E76E38 /* myspace_72px.png */, 282 | B2CC69E41D65412700E76E38 /* qq.png */, 283 | B2CC69E51D65412700E76E38 /* qzone_72px.png */, 284 | B2CC69E61D65412700E76E38 /* tencent_72px.png */, 285 | B2CC69E71D65412700E76E38 /* tencent_weixin_72px.png */, 286 | B2CC69E81D65412700E76E38 /* wechat_72px.png */, 287 | B2CC69E91D65412700E76E38 /* weibo_72px.png */, 288 | B2CC69EA1D65412700E76E38 /* yahoo_72px.png */, 289 | B2CC69EB1D65412700E76E38 /* youtube_72px.png */, 290 | B2CC69EC1D65412700E76E38 /* zhihu_72px.png */, 291 | ); 292 | path = share; 293 | sourceTree = ""; 294 | }; 295 | B2CC69ED1D65412700E76E38 /* share128 */ = { 296 | isa = PBXGroup; 297 | children = ( 298 | B2CC69EE1D65412700E76E38 /* airdroid_128px.png */, 299 | B2CC69EF1D65412700E76E38 /* angrybirds_128px.png */, 300 | B2CC69F01D65412700E76E38 /* chrome_128px.png */, 301 | B2CC69F11D65412700E76E38 /* cnn_128px.png */, 302 | B2CC69F21D65412700E76E38 /* drupal_128px.png */, 303 | B2CC69F31D65412700E76E38 /* earth_128px.png */, 304 | B2CC69F41D65412700E76E38 /* evernote_128px.png */, 305 | B2CC69F51D65412700E76E38 /* google_picasa_128px.png */, 306 | B2CC69F61D65412700E76E38 /* last_fm_128px.png */, 307 | B2CC69F71D65412700E76E38 /* pinterest_128px.png */, 308 | B2CC69F81D65412700E76E38 /* qq_128px.png */, 309 | B2CC69F91D65412700E76E38 /* stumbleupon_128px.png */, 310 | B2CC69FA1D65412700E76E38 /* twitter_128px.png */, 311 | B2CC69FB1D65412700E76E38 /* vimeo_128px.png */, 312 | B2CC69FC1D65412700E76E38 /* wechat_128px.png */, 313 | B2CC69FD1D65412700E76E38 /* weibo_128px.png */, 314 | B2CC69FE1D65412700E76E38 /* youtube_128px.png */, 315 | ); 316 | path = share128; 317 | sourceTree = ""; 318 | }; 319 | /* End PBXGroup section */ 320 | 321 | /* Begin PBXNativeTarget section */ 322 | B2CC69901D6540E000E76E38 /* TTPopupViewDemo */ = { 323 | isa = PBXNativeTarget; 324 | buildConfigurationList = B2CC69C11D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemo" */; 325 | buildPhases = ( 326 | B2CC698D1D6540E000E76E38 /* Sources */, 327 | B2CC698E1D6540E000E76E38 /* Frameworks */, 328 | B2CC698F1D6540E000E76E38 /* Resources */, 329 | ); 330 | buildRules = ( 331 | ); 332 | dependencies = ( 333 | ); 334 | name = TTPopupViewDemo; 335 | productName = TTPopupViewDemo; 336 | productReference = B2CC69911D6540E000E76E38 /* TTPopupViewDemo.app */; 337 | productType = "com.apple.product-type.application"; 338 | }; 339 | B2CC69AC1D6540E000E76E38 /* TTPopupViewDemoTests */ = { 340 | isa = PBXNativeTarget; 341 | buildConfigurationList = B2CC69C41D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemoTests" */; 342 | buildPhases = ( 343 | B2CC69A91D6540E000E76E38 /* Sources */, 344 | B2CC69AA1D6540E000E76E38 /* Frameworks */, 345 | B2CC69AB1D6540E000E76E38 /* Resources */, 346 | ); 347 | buildRules = ( 348 | ); 349 | dependencies = ( 350 | B2CC69AF1D6540E000E76E38 /* PBXTargetDependency */, 351 | ); 352 | name = TTPopupViewDemoTests; 353 | productName = TTPopupViewDemoTests; 354 | productReference = B2CC69AD1D6540E000E76E38 /* TTPopupViewDemoTests.xctest */; 355 | productType = "com.apple.product-type.bundle.unit-test"; 356 | }; 357 | B2CC69B71D6540E000E76E38 /* TTPopupViewDemoUITests */ = { 358 | isa = PBXNativeTarget; 359 | buildConfigurationList = B2CC69C71D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemoUITests" */; 360 | buildPhases = ( 361 | B2CC69B41D6540E000E76E38 /* Sources */, 362 | B2CC69B51D6540E000E76E38 /* Frameworks */, 363 | B2CC69B61D6540E000E76E38 /* Resources */, 364 | ); 365 | buildRules = ( 366 | ); 367 | dependencies = ( 368 | B2CC69BA1D6540E000E76E38 /* PBXTargetDependency */, 369 | ); 370 | name = TTPopupViewDemoUITests; 371 | productName = TTPopupViewDemoUITests; 372 | productReference = B2CC69B81D6540E000E76E38 /* TTPopupViewDemoUITests.xctest */; 373 | productType = "com.apple.product-type.bundle.ui-testing"; 374 | }; 375 | /* End PBXNativeTarget section */ 376 | 377 | /* Begin PBXProject section */ 378 | B2CC69891D6540E000E76E38 /* Project object */ = { 379 | isa = PBXProject; 380 | attributes = { 381 | LastUpgradeCheck = 0720; 382 | ORGANIZATIONNAME = "Haitao-Wong"; 383 | TargetAttributes = { 384 | B2CC69901D6540E000E76E38 = { 385 | CreatedOnToolsVersion = 7.2; 386 | DevelopmentTeam = 9Y4A44K462; 387 | }; 388 | B2CC69AC1D6540E000E76E38 = { 389 | CreatedOnToolsVersion = 7.2; 390 | DevelopmentTeam = 9Y4A44K462; 391 | TestTargetID = B2CC69901D6540E000E76E38; 392 | }; 393 | B2CC69B71D6540E000E76E38 = { 394 | CreatedOnToolsVersion = 7.2; 395 | DevelopmentTeam = 9Y4A44K462; 396 | TestTargetID = B2CC69901D6540E000E76E38; 397 | }; 398 | }; 399 | }; 400 | buildConfigurationList = B2CC698C1D6540E000E76E38 /* Build configuration list for PBXProject "TTPopupViewDemo" */; 401 | compatibilityVersion = "Xcode 3.2"; 402 | developmentRegion = English; 403 | hasScannedForEncodings = 0; 404 | knownRegions = ( 405 | en, 406 | Base, 407 | ); 408 | mainGroup = B2CC69881D6540E000E76E38; 409 | productRefGroup = B2CC69921D6540E000E76E38 /* Products */; 410 | projectDirPath = ""; 411 | projectRoot = ""; 412 | targets = ( 413 | B2CC69901D6540E000E76E38 /* TTPopupViewDemo */, 414 | B2CC69AC1D6540E000E76E38 /* TTPopupViewDemoTests */, 415 | B2CC69B71D6540E000E76E38 /* TTPopupViewDemoUITests */, 416 | ); 417 | }; 418 | /* End PBXProject section */ 419 | 420 | /* Begin PBXResourcesBuildPhase section */ 421 | B2CC698F1D6540E000E76E38 /* Resources */ = { 422 | isa = PBXResourcesBuildPhase; 423 | buildActionMask = 2147483647; 424 | files = ( 425 | B2CC6A151D65412700E76E38 /* yahoo_72px.png in Resources */, 426 | B2CC6A0D1D65412700E76E38 /* google_picasa_72px.png in Resources */, 427 | B2CC69A71D6540E000E76E38 /* LaunchScreen.storyboard in Resources */, 428 | B2CC6A031D65412700E76E38 /* acorn_72px.png in Resources */, 429 | B2CC6A201D65412700E76E38 /* last_fm_128px.png in Resources */, 430 | B2CC6A111D65412700E76E38 /* tencent_72px.png in Resources */, 431 | B2CC6A171D65412700E76E38 /* zhihu_72px.png in Resources */, 432 | B2CC6A061D65412700E76E38 /* chrome_72px.png in Resources */, 433 | B2CC6A021D65412700E76E38 /* traffic_sign_forbidden_72px.png in Resources */, 434 | B2CC6A241D65412700E76E38 /* twitter_128px.png in Resources */, 435 | B2CC6A081D65412700E76E38 /* cuevana_storm_72px.png in Resources */, 436 | B2CC6A211D65412700E76E38 /* pinterest_128px.png in Resources */, 437 | B2CC6A051D65412700E76E38 /* badge_twitter_72px.png in Resources */, 438 | B2CC69D11D65410300E76E38 /* TTPopupView.bundle in Resources */, 439 | B2CC6A1D1D65412700E76E38 /* earth_128px.png in Resources */, 440 | B2CC6A0B1D65412700E76E38 /* evernote_72px.png in Resources */, 441 | B2CC6A191D65412700E76E38 /* angrybirds_128px.png in Resources */, 442 | B2CC6A1C1D65412700E76E38 /* drupal_128px.png in Resources */, 443 | B2CC6A121D65412700E76E38 /* tencent_weixin_72px.png in Resources */, 444 | B2CC6A011D65412700E76E38 /* alert_72px.png in Resources */, 445 | B2CC69A41D6540E000E76E38 /* Assets.xcassets in Resources */, 446 | B2CC6A0A1D65412700E76E38 /* dropbox_72px.png in Resources */, 447 | B2CC699F1D6540E000E76E38 /* Main.storyboard in Resources */, 448 | B2CC6A141D65412700E76E38 /* weibo_72px.png in Resources */, 449 | B2CC6A091D65412700E76E38 /* cutthe_rope_72px.png in Resources */, 450 | B2CC6A131D65412700E76E38 /* wechat_72px.png in Resources */, 451 | B2CC6A1E1D65412700E76E38 /* evernote_128px.png in Resources */, 452 | B2CC6A281D65412700E76E38 /* youtube_128px.png in Resources */, 453 | B2CC6A101D65412700E76E38 /* qzone_72px.png in Resources */, 454 | B2CC6A181D65412700E76E38 /* airdroid_128px.png in Resources */, 455 | B2CC6A231D65412700E76E38 /* stumbleupon_128px.png in Resources */, 456 | B2CC6A071D65412700E76E38 /* copy_72px.png in Resources */, 457 | B2CC6A0E1D65412700E76E38 /* myspace_72px.png in Resources */, 458 | B2CC6A161D65412700E76E38 /* youtube_72px.png in Resources */, 459 | B2CC6A0C1D65412700E76E38 /* facebook_72px.png in Resources */, 460 | B2CC6A1A1D65412700E76E38 /* chrome_128px.png in Resources */, 461 | B2CC6A261D65412700E76E38 /* wechat_128px.png in Resources */, 462 | B2CC6A041D65412700E76E38 /* badge_google_72px.png in Resources */, 463 | B2CC6A251D65412700E76E38 /* vimeo_128px.png in Resources */, 464 | B2CC6A0F1D65412700E76E38 /* qq.png in Resources */, 465 | B2CC6A271D65412700E76E38 /* weibo_128px.png in Resources */, 466 | B2CC6A1F1D65412700E76E38 /* google_picasa_128px.png in Resources */, 467 | B2CC6A1B1D65412700E76E38 /* cnn_128px.png in Resources */, 468 | B2CC6A221D65412700E76E38 /* qq_128px.png in Resources */, 469 | ); 470 | runOnlyForDeploymentPostprocessing = 0; 471 | }; 472 | B2CC69AB1D6540E000E76E38 /* Resources */ = { 473 | isa = PBXResourcesBuildPhase; 474 | buildActionMask = 2147483647; 475 | files = ( 476 | ); 477 | runOnlyForDeploymentPostprocessing = 0; 478 | }; 479 | B2CC69B61D6540E000E76E38 /* Resources */ = { 480 | isa = PBXResourcesBuildPhase; 481 | buildActionMask = 2147483647; 482 | files = ( 483 | ); 484 | runOnlyForDeploymentPostprocessing = 0; 485 | }; 486 | /* End PBXResourcesBuildPhase section */ 487 | 488 | /* Begin PBXSourcesBuildPhase section */ 489 | B2CC698D1D6540E000E76E38 /* Sources */ = { 490 | isa = PBXSourcesBuildPhase; 491 | buildActionMask = 2147483647; 492 | files = ( 493 | B2CC69A21D6540E000E76E38 /* TTPopupViewDemo.xcdatamodeld in Sources */, 494 | B2CC69991D6540E000E76E38 /* AppDelegate.m in Sources */, 495 | B2CC69D21D65410300E76E38 /* TTPopupView.m in Sources */, 496 | B2CC69D01D65410300E76E38 /* TTButton.m in Sources */, 497 | B2CC6A291D65412700E76E38 /* TableViewController.m in Sources */, 498 | B2CC69961D6540E000E76E38 /* main.m in Sources */, 499 | ); 500 | runOnlyForDeploymentPostprocessing = 0; 501 | }; 502 | B2CC69A91D6540E000E76E38 /* Sources */ = { 503 | isa = PBXSourcesBuildPhase; 504 | buildActionMask = 2147483647; 505 | files = ( 506 | B2CC69B21D6540E000E76E38 /* TTPopupViewDemoTests.m in Sources */, 507 | ); 508 | runOnlyForDeploymentPostprocessing = 0; 509 | }; 510 | B2CC69B41D6540E000E76E38 /* Sources */ = { 511 | isa = PBXSourcesBuildPhase; 512 | buildActionMask = 2147483647; 513 | files = ( 514 | B2CC69BD1D6540E000E76E38 /* TTPopupViewDemoUITests.m in Sources */, 515 | ); 516 | runOnlyForDeploymentPostprocessing = 0; 517 | }; 518 | /* End PBXSourcesBuildPhase section */ 519 | 520 | /* Begin PBXTargetDependency section */ 521 | B2CC69AF1D6540E000E76E38 /* PBXTargetDependency */ = { 522 | isa = PBXTargetDependency; 523 | target = B2CC69901D6540E000E76E38 /* TTPopupViewDemo */; 524 | targetProxy = B2CC69AE1D6540E000E76E38 /* PBXContainerItemProxy */; 525 | }; 526 | B2CC69BA1D6540E000E76E38 /* PBXTargetDependency */ = { 527 | isa = PBXTargetDependency; 528 | target = B2CC69901D6540E000E76E38 /* TTPopupViewDemo */; 529 | targetProxy = B2CC69B91D6540E000E76E38 /* PBXContainerItemProxy */; 530 | }; 531 | /* End PBXTargetDependency section */ 532 | 533 | /* Begin PBXVariantGroup section */ 534 | B2CC699D1D6540E000E76E38 /* Main.storyboard */ = { 535 | isa = PBXVariantGroup; 536 | children = ( 537 | B2CC699E1D6540E000E76E38 /* Base */, 538 | ); 539 | name = Main.storyboard; 540 | sourceTree = ""; 541 | }; 542 | B2CC69A51D6540E000E76E38 /* LaunchScreen.storyboard */ = { 543 | isa = PBXVariantGroup; 544 | children = ( 545 | B2CC69A61D6540E000E76E38 /* Base */, 546 | ); 547 | name = LaunchScreen.storyboard; 548 | sourceTree = ""; 549 | }; 550 | /* End PBXVariantGroup section */ 551 | 552 | /* Begin XCBuildConfiguration section */ 553 | B2CC69BF1D6540E000E76E38 /* Debug */ = { 554 | isa = XCBuildConfiguration; 555 | buildSettings = { 556 | ALWAYS_SEARCH_USER_PATHS = NO; 557 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 558 | CLANG_CXX_LIBRARY = "libc++"; 559 | CLANG_ENABLE_MODULES = YES; 560 | CLANG_ENABLE_OBJC_ARC = YES; 561 | CLANG_WARN_BOOL_CONVERSION = YES; 562 | CLANG_WARN_CONSTANT_CONVERSION = YES; 563 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 564 | CLANG_WARN_EMPTY_BODY = YES; 565 | CLANG_WARN_ENUM_CONVERSION = YES; 566 | CLANG_WARN_INT_CONVERSION = YES; 567 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 568 | CLANG_WARN_UNREACHABLE_CODE = YES; 569 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 570 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 571 | COPY_PHASE_STRIP = NO; 572 | DEBUG_INFORMATION_FORMAT = dwarf; 573 | ENABLE_STRICT_OBJC_MSGSEND = YES; 574 | ENABLE_TESTABILITY = YES; 575 | GCC_C_LANGUAGE_STANDARD = gnu99; 576 | GCC_DYNAMIC_NO_PIC = NO; 577 | GCC_NO_COMMON_BLOCKS = YES; 578 | GCC_OPTIMIZATION_LEVEL = 0; 579 | GCC_PREPROCESSOR_DEFINITIONS = ( 580 | "DEBUG=1", 581 | "$(inherited)", 582 | ); 583 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 584 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 585 | GCC_WARN_UNDECLARED_SELECTOR = YES; 586 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 587 | GCC_WARN_UNUSED_FUNCTION = YES; 588 | GCC_WARN_UNUSED_VARIABLE = YES; 589 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 590 | MTL_ENABLE_DEBUG_INFO = YES; 591 | ONLY_ACTIVE_ARCH = YES; 592 | SDKROOT = iphoneos; 593 | }; 594 | name = Debug; 595 | }; 596 | B2CC69C01D6540E000E76E38 /* Release */ = { 597 | isa = XCBuildConfiguration; 598 | buildSettings = { 599 | ALWAYS_SEARCH_USER_PATHS = NO; 600 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 601 | CLANG_CXX_LIBRARY = "libc++"; 602 | CLANG_ENABLE_MODULES = YES; 603 | CLANG_ENABLE_OBJC_ARC = YES; 604 | CLANG_WARN_BOOL_CONVERSION = YES; 605 | CLANG_WARN_CONSTANT_CONVERSION = YES; 606 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 607 | CLANG_WARN_EMPTY_BODY = YES; 608 | CLANG_WARN_ENUM_CONVERSION = YES; 609 | CLANG_WARN_INT_CONVERSION = YES; 610 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 611 | CLANG_WARN_UNREACHABLE_CODE = YES; 612 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 613 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 614 | COPY_PHASE_STRIP = NO; 615 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 616 | ENABLE_NS_ASSERTIONS = NO; 617 | ENABLE_STRICT_OBJC_MSGSEND = YES; 618 | GCC_C_LANGUAGE_STANDARD = gnu99; 619 | GCC_NO_COMMON_BLOCKS = YES; 620 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 621 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 622 | GCC_WARN_UNDECLARED_SELECTOR = YES; 623 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 624 | GCC_WARN_UNUSED_FUNCTION = YES; 625 | GCC_WARN_UNUSED_VARIABLE = YES; 626 | IPHONEOS_DEPLOYMENT_TARGET = 9.2; 627 | MTL_ENABLE_DEBUG_INFO = NO; 628 | SDKROOT = iphoneos; 629 | VALIDATE_PRODUCT = YES; 630 | }; 631 | name = Release; 632 | }; 633 | B2CC69C21D6540E000E76E38 /* Debug */ = { 634 | isa = XCBuildConfiguration; 635 | buildSettings = { 636 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 637 | INFOPLIST_FILE = TTPopupViewDemo/Info.plist; 638 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 639 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemo; 640 | PRODUCT_NAME = "$(TARGET_NAME)"; 641 | }; 642 | name = Debug; 643 | }; 644 | B2CC69C31D6540E000E76E38 /* Release */ = { 645 | isa = XCBuildConfiguration; 646 | buildSettings = { 647 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 648 | INFOPLIST_FILE = TTPopupViewDemo/Info.plist; 649 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 650 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemo; 651 | PRODUCT_NAME = "$(TARGET_NAME)"; 652 | }; 653 | name = Release; 654 | }; 655 | B2CC69C51D6540E000E76E38 /* Debug */ = { 656 | isa = XCBuildConfiguration; 657 | buildSettings = { 658 | BUNDLE_LOADER = "$(TEST_HOST)"; 659 | INFOPLIST_FILE = TTPopupViewDemoTests/Info.plist; 660 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 661 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemoTests; 662 | PRODUCT_NAME = "$(TARGET_NAME)"; 663 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TTPopupViewDemo.app/TTPopupViewDemo"; 664 | }; 665 | name = Debug; 666 | }; 667 | B2CC69C61D6540E000E76E38 /* Release */ = { 668 | isa = XCBuildConfiguration; 669 | buildSettings = { 670 | BUNDLE_LOADER = "$(TEST_HOST)"; 671 | INFOPLIST_FILE = TTPopupViewDemoTests/Info.plist; 672 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 673 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemoTests; 674 | PRODUCT_NAME = "$(TARGET_NAME)"; 675 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/TTPopupViewDemo.app/TTPopupViewDemo"; 676 | }; 677 | name = Release; 678 | }; 679 | B2CC69C81D6540E000E76E38 /* Debug */ = { 680 | isa = XCBuildConfiguration; 681 | buildSettings = { 682 | INFOPLIST_FILE = TTPopupViewDemoUITests/Info.plist; 683 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 684 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemoUITests; 685 | PRODUCT_NAME = "$(TARGET_NAME)"; 686 | TEST_TARGET_NAME = TTPopupViewDemo; 687 | USES_XCTRUNNER = YES; 688 | }; 689 | name = Debug; 690 | }; 691 | B2CC69C91D6540E000E76E38 /* Release */ = { 692 | isa = XCBuildConfiguration; 693 | buildSettings = { 694 | INFOPLIST_FILE = TTPopupViewDemoUITests/Info.plist; 695 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 696 | PRODUCT_BUNDLE_IDENTIFIER = com.tt.TTPopupViewDemoUITests; 697 | PRODUCT_NAME = "$(TARGET_NAME)"; 698 | TEST_TARGET_NAME = TTPopupViewDemo; 699 | USES_XCTRUNNER = YES; 700 | }; 701 | name = Release; 702 | }; 703 | /* End XCBuildConfiguration section */ 704 | 705 | /* Begin XCConfigurationList section */ 706 | B2CC698C1D6540E000E76E38 /* Build configuration list for PBXProject "TTPopupViewDemo" */ = { 707 | isa = XCConfigurationList; 708 | buildConfigurations = ( 709 | B2CC69BF1D6540E000E76E38 /* Debug */, 710 | B2CC69C01D6540E000E76E38 /* Release */, 711 | ); 712 | defaultConfigurationIsVisible = 0; 713 | defaultConfigurationName = Release; 714 | }; 715 | B2CC69C11D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemo" */ = { 716 | isa = XCConfigurationList; 717 | buildConfigurations = ( 718 | B2CC69C21D6540E000E76E38 /* Debug */, 719 | B2CC69C31D6540E000E76E38 /* Release */, 720 | ); 721 | defaultConfigurationIsVisible = 0; 722 | }; 723 | B2CC69C41D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemoTests" */ = { 724 | isa = XCConfigurationList; 725 | buildConfigurations = ( 726 | B2CC69C51D6540E000E76E38 /* Debug */, 727 | B2CC69C61D6540E000E76E38 /* Release */, 728 | ); 729 | defaultConfigurationIsVisible = 0; 730 | }; 731 | B2CC69C71D6540E000E76E38 /* Build configuration list for PBXNativeTarget "TTPopupViewDemoUITests" */ = { 732 | isa = XCConfigurationList; 733 | buildConfigurations = ( 734 | B2CC69C81D6540E000E76E38 /* Debug */, 735 | B2CC69C91D6540E000E76E38 /* Release */, 736 | ); 737 | defaultConfigurationIsVisible = 0; 738 | }; 739 | /* End XCConfigurationList section */ 740 | 741 | /* Begin XCVersionGroup section */ 742 | B2CC69A01D6540E000E76E38 /* TTPopupViewDemo.xcdatamodeld */ = { 743 | isa = XCVersionGroup; 744 | children = ( 745 | B2CC69A11D6540E000E76E38 /* TTPopupViewDemo.xcdatamodel */, 746 | ); 747 | currentVersion = B2CC69A11D6540E000E76E38 /* TTPopupViewDemo.xcdatamodel */; 748 | path = TTPopupViewDemo.xcdatamodeld; 749 | sourceTree = ""; 750 | versionGroupType = wrapper.xcdatamodel; 751 | }; 752 | /* End XCVersionGroup section */ 753 | }; 754 | rootObject = B2CC69891D6540E000E76E38 /* Project object */; 755 | } 756 | -------------------------------------------------------------------------------- /TTPopupViewDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /TTPopupViewDemo.xcodeproj/project.xcworkspace/xcuserdata/haitao.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo.xcodeproj/project.xcworkspace/xcuserdata/haitao.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /TTPopupViewDemo.xcodeproj/xcuserdata/haitao.xcuserdatad/xcschemes/TTPopupViewDemo.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 43 | 49 | 50 | 51 | 52 | 53 | 59 | 60 | 61 | 62 | 63 | 64 | 74 | 76 | 82 | 83 | 84 | 85 | 86 | 87 | 93 | 95 | 101 | 102 | 103 | 104 | 106 | 107 | 110 | 111 | 112 | -------------------------------------------------------------------------------- /TTPopupViewDemo.xcodeproj/xcuserdata/haitao.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | TTPopupViewDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | B2CC69901D6540E000E76E38 16 | 17 | primary 18 | 19 | 20 | B2CC69AC1D6540E000E76E38 21 | 22 | primary 23 | 24 | 25 | B2CC69B71D6540E000E76E38 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /TTPopupViewDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TTPopupViewDemo 4 | // 5 | // Created by Haitao-Wong on 8/18/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | @interface AppDelegate : UIResponder 13 | 14 | @property (strong, nonatomic) UIWindow *window; 15 | 16 | @property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; 17 | @property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; 18 | @property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; 19 | 20 | - (void)saveContext; 21 | - (NSURL *)applicationDocumentsDirectory; 22 | 23 | 24 | @end 25 | 26 | -------------------------------------------------------------------------------- /TTPopupViewDemo/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TTPopupViewDemo 4 | // 5 | // Created by Haitao-Wong on 8/18/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | return YES; 21 | } 22 | 23 | - (void)applicationWillResignActive:(UIApplication *)application { 24 | // 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. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application { 29 | // 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. 30 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 31 | } 32 | 33 | - (void)applicationWillEnterForeground:(UIApplication *)application { 34 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 35 | } 36 | 37 | - (void)applicationDidBecomeActive:(UIApplication *)application { 38 | // 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. 39 | } 40 | 41 | - (void)applicationWillTerminate:(UIApplication *)application { 42 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 43 | // Saves changes in the application's managed object context before the application terminates. 44 | [self saveContext]; 45 | } 46 | 47 | #pragma mark - Core Data stack 48 | 49 | @synthesize managedObjectContext = _managedObjectContext; 50 | @synthesize managedObjectModel = _managedObjectModel; 51 | @synthesize persistentStoreCoordinator = _persistentStoreCoordinator; 52 | 53 | - (NSURL *)applicationDocumentsDirectory { 54 | // The directory the application uses to store the Core Data store file. This code uses a directory named "com.tt.TTPopupViewDemo" in the application's documents directory. 55 | return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject]; 56 | } 57 | 58 | - (NSManagedObjectModel *)managedObjectModel { 59 | // The managed object model for the application. It is a fatal error for the application not to be able to find and load its model. 60 | if (_managedObjectModel != nil) { 61 | return _managedObjectModel; 62 | } 63 | NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"TTPopupViewDemo" withExtension:@"momd"]; 64 | _managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; 65 | return _managedObjectModel; 66 | } 67 | 68 | - (NSPersistentStoreCoordinator *)persistentStoreCoordinator { 69 | // The persistent store coordinator for the application. This implementation creates and returns a coordinator, having added the store for the application to it. 70 | if (_persistentStoreCoordinator != nil) { 71 | return _persistentStoreCoordinator; 72 | } 73 | 74 | // Create the coordinator and store 75 | 76 | _persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; 77 | NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"TTPopupViewDemo.sqlite"]; 78 | NSError *error = nil; 79 | NSString *failureReason = @"There was an error creating or loading the application's saved data."; 80 | if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) { 81 | // Report any error we got. 82 | NSMutableDictionary *dict = [NSMutableDictionary dictionary]; 83 | dict[NSLocalizedDescriptionKey] = @"Failed to initialize the application's saved data"; 84 | dict[NSLocalizedFailureReasonErrorKey] = failureReason; 85 | dict[NSUnderlyingErrorKey] = error; 86 | error = [NSError errorWithDomain:@"YOUR_ERROR_DOMAIN" code:9999 userInfo:dict]; 87 | // Replace this with code to handle the error appropriately. 88 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 89 | NSLog(@"Unresolved error %@, %@", error, [error userInfo]); 90 | abort(); 91 | } 92 | 93 | return _persistentStoreCoordinator; 94 | } 95 | 96 | 97 | - (NSManagedObjectContext *)managedObjectContext { 98 | // Returns the managed object context for the application (which is already bound to the persistent store coordinator for the application.) 99 | if (_managedObjectContext != nil) { 100 | return _managedObjectContext; 101 | } 102 | 103 | NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; 104 | if (!coordinator) { 105 | return nil; 106 | } 107 | _managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType]; 108 | [_managedObjectContext setPersistentStoreCoordinator:coordinator]; 109 | return _managedObjectContext; 110 | } 111 | 112 | #pragma mark - Core Data Saving support 113 | 114 | - (void)saveContext { 115 | NSManagedObjectContext *managedObjectContext = self.managedObjectContext; 116 | if (managedObjectContext != nil) { 117 | NSError *error = nil; 118 | if ([managedObjectContext hasChanges] && ![managedObjectContext save:&error]) { 119 | // Replace this implementation with code to handle the error appropriately. 120 | // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 121 | NSLog(@"Unresolved error %@, %@", error, [error userInfo]); 122 | abort(); 123 | } 124 | } 125 | } 126 | 127 | @end 128 | -------------------------------------------------------------------------------- /TTPopupViewDemo/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "29x29", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "29x29", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "40x40", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "40x40", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "60x60", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "60x60", 31 | "scale" : "3x" 32 | } 33 | ], 34 | "info" : { 35 | "version" : 1, 36 | "author" : "xcode" 37 | } 38 | } -------------------------------------------------------------------------------- /TTPopupViewDemo/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 | -------------------------------------------------------------------------------- /TTPopupViewDemo/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 | 28 | 29 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 232 | 233 | 234 | 235 | 236 | 237 | 238 | 239 | 240 | 241 | 242 | 243 | 244 | 245 | 264 | 265 | 266 | 267 | 268 | 269 | 270 | 271 | 272 | 273 | 274 | 275 | 276 | 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 300 | 301 | 302 | 303 | 304 | 305 | 306 | 307 | -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/funs/alert_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/funs/alert_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/funs/traffic_sign_forbidden_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/funs/traffic_sign_forbidden_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/acorn_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/acorn_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/badge_google_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/badge_google_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/badge_twitter_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/badge_twitter_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/chrome_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/chrome_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/copy_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/copy_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/cuevana_storm_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/cuevana_storm_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/cutthe_rope_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/cutthe_rope_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/dropbox_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/dropbox_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/evernote_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/evernote_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/facebook_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/facebook_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/google_picasa_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/google_picasa_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/myspace_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/myspace_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/qq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/qq.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/qzone_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/qzone_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/tencent_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/tencent_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/tencent_weixin_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/tencent_weixin_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/wechat_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/wechat_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/weibo_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/weibo_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/yahoo_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/yahoo_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/youtube_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/youtube_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share/zhihu_72px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share/zhihu_72px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/airdroid_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/airdroid_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/angrybirds_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/angrybirds_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/chrome_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/chrome_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/cnn_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/cnn_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/drupal_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/drupal_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/earth_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/earth_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/evernote_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/evernote_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/google_picasa_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/google_picasa_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/last_fm_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/last_fm_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/pinterest_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/pinterest_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/qq_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/qq_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/stumbleupon_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/stumbleupon_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/twitter_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/twitter_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/vimeo_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/vimeo_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/wechat_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/wechat_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/weibo_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/weibo_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Icons/share128/youtube_128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/TTPopupViewDemo/Icons/share128/youtube_128px.png -------------------------------------------------------------------------------- /TTPopupViewDemo/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /TTPopupViewDemo/TTPopupViewDemo.xcdatamodeld/.xccurrentversion: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | _XCCurrentVersionName 6 | TTPopupViewDemo.xcdatamodel 7 | 8 | 9 | -------------------------------------------------------------------------------- /TTPopupViewDemo/TTPopupViewDemo.xcdatamodeld/TTPopupViewDemo.xcdatamodel/contents: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /TTPopupViewDemo/TableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.h 3 | // TTPopView 4 | // 5 | // Created by Haitao-Wong on 8/10/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /TTPopupViewDemo/TableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // TableViewController.m 3 | // TTPopView 4 | // 5 | // Created by Haitao-Wong on 8/10/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import "TableViewController.h" 10 | #import "TTPopupView.h" 11 | @interface TableViewController () 12 | 13 | @end 14 | 15 | @implementation TableViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | // Uncomment the following line to preserve selection between presentations. 21 | // self.clearsSelectionOnViewWillAppear = NO; 22 | 23 | // Uncomment the following line to display an Edit button in the navigation bar for this view controller. 24 | // self.navigationItem.rightBarButtonItem = self.editButtonItem; 25 | } 26 | 27 | - (void)didReceiveMemoryWarning { 28 | [super didReceiveMemoryWarning]; 29 | // Dispose of any resources that can be recreated. 30 | } 31 | 32 | #pragma mark - Table view data source 33 | 34 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 35 | //#warning Incomplete implementation, return the number of sections 36 | return 1; 37 | } 38 | 39 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 40 | //#warning Incomplete implementation, return the number of rows 41 | return 5; 42 | } 43 | 44 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 45 | NSArray *titles = [[NSArray alloc]initWithObjects:@"拍照",@"从手机相册选择",@"保存图片", nil]; 46 | NSArray *shareIcons = @[@"evernote_128px",@"qq_128px",@"wechat_128px",@"weibo_128px",@"google_picasa_128px",@"youtube_128px",@"chrome_128px",@"cnn_128px",@"angrybirds_128px"]; 47 | NSArray *shareTitles = @[@"印象笔记",@"QQ",@"微信",@"微博",@"Picasa",@"Youtube",@"Chrome",@"CNN",@"AngryBirds"]; 48 | NSArray *funsIcons = @[@"zhihu_72px",@"qq",@"qzone_72px",@"traffic_sign_forbidden_72px",@"alert_72px"]; 49 | NSArray *funsTitles = @[@"复制链接",@"刷新",@"调整字体",@"投诉",@"查看信息"]; 50 | TTPopupView *popup; 51 | 52 | if(indexPath.row == 0) { 53 | popup = [[TTPopupView alloc]initWithPopupTitle:nil funsTitles:titles click:^(NSInteger buttonIndex) { 54 | 55 | UIAlertController *alertController = [UIAlertController 56 | alertControllerWithTitle:@"Message" 57 | message:[NSString stringWithFormat:@"You share to %@", titles[buttonIndex]] 58 | preferredStyle:UIAlertControllerStyleAlert]; 59 | 60 | 61 | UIAlertAction *ok = [UIAlertAction 62 | actionWithTitle:@"Ok" 63 | style:UIAlertActionStyleDefault 64 | handler:^(UIAlertAction *action){ 65 | 66 | }]; 67 | 68 | [alertController addAction:ok]; 69 | [self presentViewController:alertController animated:YES completion:nil]; 70 | 71 | }]; 72 | // [popup setPopupTitle:@"查看"]; 73 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 74 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 75 | [popup setContentTextFont:[UIFont systemFontOfSize:15]]; 76 | [popup setContentTextColor:TTColor(0, 0, 0)]; 77 | [popup setCancelTextColor:TTColor(255, 0, 30)]; 78 | } 79 | if(indexPath.row == 1) { 80 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewNormal popupTitle:nil share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles click:^(NSInteger buttonIndex) { 81 | //NSLog(@"%@-->>%ld",self,(long)buttonIndex); 82 | 83 | NSString *msg = nil; 84 | if(buttonIndex<2000){ 85 | msg = [NSString stringWithFormat:@"You share to %@", shareTitles[buttonIndex-1000]]; 86 | }else{ 87 | msg = [NSString stringWithFormat:@"You share to %@", funsTitles[buttonIndex-2000]]; 88 | } 89 | UIAlertController *alertController = [UIAlertController 90 | alertControllerWithTitle:@"Message" 91 | message:msg 92 | preferredStyle:UIAlertControllerStyleAlert]; 93 | 94 | 95 | UIAlertAction *ok = [UIAlertAction 96 | actionWithTitle:@"Ok" 97 | style:UIAlertActionStyleDefault 98 | handler:^(UIAlertAction *action){ 99 | 100 | }]; 101 | 102 | [alertController addAction:ok]; 103 | [self presentViewController:alertController animated:YES completion:nil]; 104 | 105 | 106 | }]; 107 | 108 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 109 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 110 | [popup setContentTextFont:[UIFont systemFontOfSize:12]]; 111 | [popup setContentTextColor:[UIColor grayColor]]; 112 | [popup setCancelTextColor:[UIColor blackColor]]; 113 | } 114 | 115 | if(indexPath.row == 2) { 116 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewNormalWithCircle popupTitle:@"分享文章" share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles click:^(NSInteger buttonIndex) { 117 | //NSLog(@"%@-->>%ld",self,(long)buttonIndex); 118 | 119 | NSString *msg = nil; 120 | if(buttonIndex<2000){ 121 | msg = [NSString stringWithFormat:@"You share to %@", shareTitles[buttonIndex-1000]]; 122 | }else{ 123 | msg = [NSString stringWithFormat:@"You share to %@", funsTitles[buttonIndex-2000]]; 124 | } 125 | UIAlertController *alertController = [UIAlertController 126 | alertControllerWithTitle:@"Message" 127 | message:msg 128 | preferredStyle:UIAlertControllerStyleAlert]; 129 | 130 | 131 | UIAlertAction *ok = [UIAlertAction 132 | actionWithTitle:@"Ok" 133 | style:UIAlertActionStyleDefault 134 | handler:^(UIAlertAction *action){ 135 | 136 | }]; 137 | 138 | [alertController addAction:ok]; 139 | [self presentViewController:alertController animated:YES completion:nil]; 140 | 141 | 142 | }]; 143 | 144 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 145 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 146 | [popup setContentTextFont:[UIFont systemFontOfSize:12]]; 147 | [popup setContentTextColor:[UIColor grayColor]]; 148 | [popup setCancelTextColor:[UIColor blackColor]]; 149 | } 150 | 151 | if(indexPath.row == 3) { 152 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewWithPageControl popupTitle:@"分享文章" share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles click:^(NSInteger buttonIndex) { 153 | //NSLog(@"%@-->>%ld",self,(long)buttonIndex); 154 | 155 | NSString *msg = nil; 156 | if(buttonIndex<2000){ 157 | msg = [NSString stringWithFormat:@"You share to %@", shareTitles[buttonIndex-1000]]; 158 | }else{ 159 | msg = [NSString stringWithFormat:@"You share to %@", funsTitles[buttonIndex-2000]]; 160 | } 161 | UIAlertController *alertController = [UIAlertController 162 | alertControllerWithTitle:@"Message" 163 | message:msg 164 | preferredStyle:UIAlertControllerStyleAlert]; 165 | 166 | 167 | UIAlertAction *ok = [UIAlertAction 168 | actionWithTitle:@"Ok" 169 | style:UIAlertActionStyleDefault 170 | handler:^(UIAlertAction *action){ 171 | 172 | }]; 173 | 174 | [alertController addAction:ok]; 175 | [self presentViewController:alertController animated:YES completion:nil]; 176 | 177 | 178 | }]; 179 | 180 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 181 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 182 | [popup setContentTextFont:[UIFont systemFontOfSize:12]]; 183 | [popup setContentTextColor:[UIColor grayColor]]; 184 | [popup setCancelTextColor:[UIColor blackColor]]; 185 | } 186 | 187 | if(indexPath.row == 4) { 188 | popup = [[TTPopupView alloc]initWithStyle:TTPopupViewWithPageControlWithCircle popupTitle:@"分享文章" share2Icons:shareIcons share2Titles:shareTitles funsIcons:funsIcons funsTitles:funsTitles click:^(NSInteger buttonIndex) { 189 | //NSLog(@"%@-->>%ld",self,(long)buttonIndex); 190 | 191 | NSString *msg = nil; 192 | if(buttonIndex<2000){ 193 | msg = [NSString stringWithFormat:@"You share to %@", shareTitles[buttonIndex-1000]]; 194 | }else{ 195 | msg = [NSString stringWithFormat:@"You share to %@", funsTitles[buttonIndex-2000]]; 196 | } 197 | UIAlertController *alertController = [UIAlertController 198 | alertControllerWithTitle:@"Message" 199 | message:msg 200 | preferredStyle:UIAlertControllerStyleAlert]; 201 | 202 | 203 | UIAlertAction *ok = [UIAlertAction 204 | actionWithTitle:@"Ok" 205 | style:UIAlertActionStyleDefault 206 | handler:^(UIAlertAction *action){ 207 | 208 | }]; 209 | 210 | [alertController addAction:ok]; 211 | [self presentViewController:alertController animated:YES completion:nil]; 212 | 213 | 214 | }]; 215 | 216 | [popup setPopupTitleTextFont:[UIFont systemFontOfSize:15]]; 217 | [popup setPopupTitleTextColor:TTColor(45, 56, 67)]; 218 | [popup setContentTextFont:[UIFont systemFontOfSize:12]]; 219 | [popup setContentTextColor:[UIColor grayColor]]; 220 | [popup setCancelTextColor:[UIColor blackColor]]; 221 | 222 | [popup setRadius:8]; 223 | } 224 | 225 | 226 | [popup show]; 227 | } 228 | 229 | #pragma mark - ttpopup 230 | 231 | -(void)popupView:(TTPopupView *)popup onClick:(NSInteger)index{ 232 | UIAlertController *alertController = [UIAlertController 233 | alertControllerWithTitle:@"Message" 234 | message:[NSString stringWithFormat:@"You click %ld",(long)index] 235 | preferredStyle:UIAlertControllerStyleAlert]; 236 | 237 | 238 | UIAlertAction *ok = [UIAlertAction 239 | actionWithTitle:@"Ok" 240 | style:UIAlertActionStyleDefault 241 | handler:^(UIAlertAction *action){ 242 | 243 | }]; 244 | 245 | [alertController addAction:ok]; 246 | [self presentViewController:alertController animated:YES completion:nil]; 247 | // NSLog(@"index: %ld",(long)index); 248 | } 249 | 250 | 251 | @end 252 | -------------------------------------------------------------------------------- /TTPopupViewDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TTPopupViewDemo 4 | // 5 | // Created by Haitao-Wong on 8/18/16. 6 | // Copyright © 2016 Haitao-Wong. 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 | -------------------------------------------------------------------------------- /TTPopupViewDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TTPopupViewDemoTests/TTPopupViewDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTPopupViewDemoTests.m 3 | // TTPopupViewDemoTests 4 | // 5 | // Created by Haitao-Wong on 8/18/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TTPopupViewDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TTPopupViewDemoTests 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 | -------------------------------------------------------------------------------- /TTPopupViewDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /TTPopupViewDemoUITests/TTPopupViewDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TTPopupViewDemoUITests.m 3 | // TTPopupViewDemoUITests 4 | // 5 | // Created by Haitao-Wong on 8/18/16. 6 | // Copyright © 2016 Haitao-Wong. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TTPopupViewDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TTPopupViewDemoUITests 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 | -------------------------------------------------------------------------------- /screenshot01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/screenshot01.png -------------------------------------------------------------------------------- /screenshot02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/screenshot02.png -------------------------------------------------------------------------------- /screenshot03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/screenshot03.png -------------------------------------------------------------------------------- /screenshot04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/screenshot04.png -------------------------------------------------------------------------------- /screenshot05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/whtacm/TTPopupView/9b4d98b67e07663d3fe125226f4330daff12d71f/screenshot05.png --------------------------------------------------------------------------------