├── FWPopupViewOC.podspec ├── FWPopupViewOC ├── FWGuideMaskView.h ├── FWGuideMaskView.m ├── FWPanPopupView.h ├── FWPanPopupView.m ├── FWPopupBaseView.h ├── FWPopupBaseView.m ├── FWPopupRootController.h ├── FWPopupRootController.m ├── FWPopupWindow.h ├── FWPopupWindow.m ├── Resources │ └── FWPopupViewOC.bundle │ │ ├── Root.plist │ │ ├── en.lproj │ │ └── Root.strings │ │ └── guide_arrow@3x.png ├── UIView+PopupView.h └── UIView+PopupView.m ├── FWPopupViewOCDemo ├── FWPopupViewOC.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── FWPopupViewOC.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── WorkspaceSettings.xcsettings │ └── xcuserdata │ │ └── yechen.xcuserdatad │ │ └── WorkspaceSettings.xcsettings ├── FWPopupViewOC │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── fw_ad.imageset │ │ │ ├── Contents.json │ │ │ └── fw_ad.png │ │ ├── fw_arrow_01.imageset │ │ │ ├── Contents.json │ │ │ └── fw_arrow_01.png │ │ └── fw_close.imageset │ │ │ ├── Contents.json │ │ │ └── fw_close.png │ ├── Base.lproj │ │ └── LaunchScreen.storyboard │ ├── FWAreaPickerView.h │ ├── FWAreaPickerView.m │ ├── FWCustomAdView.h │ ├── FWCustomAdView.m │ ├── FWCustomView.h │ ├── FWCustomView.m │ ├── FWCustomView2.h │ ├── FWCustomView2.m │ ├── FWCustomView3.h │ ├── FWCustomView3.m │ ├── FWNavigationController.h │ ├── FWNavigationController.m │ ├── GuideMaskTestVC.h │ ├── GuideMaskTestVC.m │ ├── GuideMaskTestVC.xib │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ ├── area_cn.plist │ └── main.m ├── FWPopupViewOCTests │ ├── FWPopupViewOCTests.m │ └── Info.plist ├── FWPopupViewOCUITests │ ├── FWPopupViewOCUITests.m │ └── Info.plist ├── Podfile ├── Podfile.lock └── Pods │ ├── Manifest.lock │ ├── Masonry │ ├── LICENSE │ ├── Masonry │ │ ├── MASCompositeConstraint.h │ │ ├── MASCompositeConstraint.m │ │ ├── MASConstraint+Private.h │ │ ├── MASConstraint.h │ │ ├── MASConstraint.m │ │ ├── MASConstraintMaker.h │ │ ├── MASConstraintMaker.m │ │ ├── MASLayoutConstraint.h │ │ ├── MASLayoutConstraint.m │ │ ├── MASUtilities.h │ │ ├── MASViewAttribute.h │ │ ├── MASViewAttribute.m │ │ ├── MASViewConstraint.h │ │ ├── MASViewConstraint.m │ │ ├── Masonry.h │ │ ├── NSArray+MASAdditions.h │ │ ├── NSArray+MASAdditions.m │ │ ├── NSArray+MASShorthandAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.h │ │ ├── NSLayoutConstraint+MASDebugAdditions.m │ │ ├── View+MASAdditions.h │ │ ├── View+MASAdditions.m │ │ ├── View+MASShorthandAdditions.h │ │ ├── ViewController+MASAdditions.h │ │ └── ViewController+MASAdditions.m │ └── README.md │ ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ └── yechen.xcuserdatad │ │ └── xcschemes │ │ ├── Masonry.xcscheme │ │ └── Pods-FWPopupViewOC.xcscheme │ └── Target Support Files │ ├── Masonry │ ├── Masonry-Info.plist │ ├── Masonry-dummy.m │ ├── Masonry-prefix.pch │ ├── Masonry-umbrella.h │ ├── Masonry.debug.xcconfig │ ├── Masonry.modulemap │ └── Masonry.release.xcconfig │ └── Pods-FWPopupViewOC │ ├── Info.plist │ ├── Pods-FWPopupViewOC-Info.plist │ ├── Pods-FWPopupViewOC-acknowledgements.markdown │ ├── Pods-FWPopupViewOC-acknowledgements.plist │ ├── Pods-FWPopupViewOC-dummy.m │ ├── Pods-FWPopupViewOC-frameworks-Debug-input-files.xcfilelist │ ├── Pods-FWPopupViewOC-frameworks-Debug-output-files.xcfilelist │ ├── Pods-FWPopupViewOC-frameworks-Release-input-files.xcfilelist │ ├── Pods-FWPopupViewOC-frameworks-Release-output-files.xcfilelist │ ├── Pods-FWPopupViewOC-frameworks.sh │ ├── Pods-FWPopupViewOC-resources.sh │ ├── Pods-FWPopupViewOC-umbrella.h │ ├── Pods-FWPopupViewOC.debug.xcconfig │ ├── Pods-FWPopupViewOC.modulemap │ └── Pods-FWPopupViewOC.release.xcconfig ├── README.md └── 效果 ├── IMG_01.png ├── IMG_02.png ├── IMG_0724.PNG ├── 效果1.gif ├── 效果2.gif └── 效果3.gif /FWPopupViewOC.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod spec lint FWPopupViewOC.podspec' to ensure this is a 3 | # valid spec and to remove all comments including this before submitting the spec. 4 | # 5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html 6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/ 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | 11 | # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 12 | # 13 | # These will help people to find your library, and whilst it 14 | # can feel like a chore to fill in it's definitely to your advantage. The 15 | # summary should be tweet-length, and the description more in depth. 16 | # 17 | 18 | s.name = "FWPopupViewOC" 19 | s.version = "3.1.0" 20 | s.summary = "信手拈来的自定义弹窗-OC版本" 21 | 22 | # This description is used to generate tags and improve search results. 23 | # * Think: What does it do? Why did you write it? What is the focus? 24 | # * Try to keep it short, snappy and to the point. 25 | # * Write the description between the DESC delimiters below. 26 | # * Finally, don't worry about the indent, CocoaPods strips it! 27 | s.description = <<-DESC 28 | 只需要基础弹窗基类,可以随意实现各种方向以及n种动画的弹窗。使用非常方便! 29 | DESC 30 | 31 | s.homepage = "https://github.com/choiceyou/FWPopupViewOC" 32 | # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif" 33 | 34 | 35 | # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 36 | # 37 | # Licensing your code is important. See http://choosealicense.com for more info. 38 | # CocoaPods will detect a license file if there is a named LICENSE* 39 | # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'. 40 | # 41 | 42 | s.license = "MIT" 43 | # s.license = { :type => "MIT", :file => "FILE_LICENSE" } 44 | 45 | 46 | # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 47 | # 48 | # Specify the authors of the library, with email addresses. Email addresses 49 | # of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also 50 | # accepts just a name if you'd rather not provide an email address. 51 | # 52 | # Specify a social_media_url where others can refer to, for example a twitter 53 | # profile URL. 54 | # 55 | 56 | s.author = { "xfg" => "853299701@qq.com" } 57 | # Or just: s.author = "xfg" 58 | # s.authors = { "xfg" => "853299701@qq.com" } 59 | # s.social_media_url = "http://twitter.com/xfg" 60 | 61 | # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 62 | # 63 | # If this Pod runs only on iOS or OS X, then specify the platform and 64 | # the deployment target. You can optionally include the target after the platform. 65 | # 66 | 67 | s.platform = :ios, "8.0" 68 | 69 | # When using multiple platforms 70 | # s.ios.deployment_target = "5.0" 71 | # s.osx.deployment_target = "10.7" 72 | # s.watchos.deployment_target = "2.0" 73 | # s.tvos.deployment_target = "9.0" 74 | 75 | 76 | # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 77 | # 78 | # Specify the location from where the source should be retrieved. 79 | # Supports git, hg, bzr, svn and HTTP. 80 | # 81 | 82 | s.source = { :git => "https://github.com/choiceyou/FWPopupViewOC.git", :tag => "#{s.version}" } 83 | 84 | 85 | # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 86 | # 87 | # CocoaPods is smart about how it includes source code. For source files 88 | # giving a folder will include any swift, h, m, mm, c & cpp files. 89 | # For header files it will include any header in the folder. 90 | # Not including the public_header_files will make all headers public. 91 | # 92 | 93 | s.source_files = "FWPopupViewOC", "FWPopupViewOC/**/*.{h,m}" 94 | # s.exclude_files = "Classes/Exclude" 95 | 96 | # s.public_header_files = "Classes/**/*.h" 97 | 98 | 99 | # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 100 | # 101 | # A list of resources included with the Pod. These are copied into the 102 | # target bundle with a build phase script. Anything else will be cleaned. 103 | # You can preserve files from being cleaned, please don't preserve 104 | # non-essential files like tests, examples and documentation. 105 | # 106 | 107 | # s.resource = "icon.png" 108 | s.resources = "FWPopupViewOC/**/Resources/FWPopupViewOC.bundle" 109 | 110 | # s.preserve_paths = "FilesToSave", "MoreFilesToSave" 111 | 112 | 113 | # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 114 | # 115 | # Link your library with frameworks, or libraries. Libraries do not include 116 | # the lib prefix of their name. 117 | # 118 | 119 | # s.framework = "SomeFramework" 120 | s.frameworks = "UIKit", "QuartzCore" 121 | 122 | # s.library = "iconv" 123 | # s.libraries = "iconv", "xml2" 124 | 125 | 126 | # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― # 127 | # 128 | # If your library depends on compiler flags you can set them in the xcconfig hash 129 | # where they will only apply to your library. If you depend on other Podspecs 130 | # you can include multiple dependencies to ensure it works. 131 | 132 | s.requires_arc = true 133 | s.dependency "Masonry" 134 | 135 | # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" } 136 | 137 | end 138 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWGuideMaskView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWGuideMaskView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/5. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 新功能引导弹窗 8 | 9 | /** ************************************************ 10 | 11 | github地址:https://github.com/choiceyou/FWPopupViewOC 12 | bug反馈、交流群:670698309 13 | 14 | *************************************************** 15 | */ 16 | 17 | 18 | #import "FWPopupBaseView.h" 19 | @class FWGuideMaskViewProperty; 20 | @protocol FWGuideMaskViewDataSource; 21 | 22 | 23 | #pragma mark - ======================= FWGuideMaskView ======================= 24 | 25 | @interface FWGuideMaskView : FWPopupBaseView 26 | 27 | @property (nonatomic, weak) id dataSource; 28 | 29 | @end 30 | 31 | 32 | #pragma mark - ======================= FWGuideMaskViewDataSource ======================= 33 | 34 | @protocol FWGuideMaskViewDataSource 35 | 36 | @required 37 | 38 | /** 39 | item的个数 40 | 41 | @param guideMaskView FWGuideMaskView 42 | @return 个数 43 | */ 44 | - (NSInteger)numberOfItemsInGuideMaskView:(FWGuideMaskView *)guideMaskView; 45 | 46 | /** 47 | 每个item对应的view 48 | 49 | @param guideMaskView FWGuideMaskView 50 | @param index 下标 51 | @return 传入的view 52 | */ 53 | - (UIView *)guideMaskView:(FWGuideMaskView *)guideMaskView viewForItemAtIndex:(NSInteger)index; 54 | 55 | /** 56 | 每个item对应的文字 57 | 58 | @param guideMaskView FWGuideMaskView 59 | @param index 下标 60 | @return 文字描述 61 | */ 62 | - (NSString *)guideMaskView:(FWGuideMaskView *)guideMaskView descriptionForItemAtIndex:(NSInteger)index; 63 | 64 | @optional 65 | 66 | /** 67 | 每个item的文字颜色:默认白色 68 | 69 | @param guideMaskView FWGuideMaskView 70 | @param index 下标 71 | @return 颜色 72 | */ 73 | - (UIColor *)guideMaskView:(FWGuideMaskView *)guideMaskView colorForDescriptionAtIndex:(NSInteger)index; 74 | 75 | /** 76 | 每个item对应的文字字体:默认[UIFont systemFontOfSize:14] 77 | 78 | @param guideMaskView FWGuideMaskView 79 | @param index 下标 80 | @return 文字字体 81 | */ 82 | - (UIFont *)guideMaskView:(FWGuideMaskView *)guideMaskView fontForDescriptionAtIndex:(NSInteger)index; 83 | 84 | /** 85 | 每个item可视区域的圆角值 86 | 87 | @param guideMaskView FWGuideMaskView 88 | @param index 下标 89 | @return 圆角值 90 | */ 91 | - (CGFloat)guideMaskView:(FWGuideMaskView *)guideMaskView cornerRadiusForItemAtIndex:(NSInteger)index; 92 | 93 | @end 94 | 95 | 96 | #pragma mark - ======================= FWGuideMaskViewProperty ======================= 97 | 98 | @interface FWGuideMaskViewProperty: FWPopupBaseViewProperty 99 | 100 | /** 101 | item的view与遮罩层的外边距 102 | */ 103 | @property (nonatomic, assign) UIEdgeInsets visibleViewInsets; 104 | 105 | /** 106 | 可传入箭头图标 107 | */ 108 | @property (nonatomic, strong) UIImage *arrowImage; 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPanPopupView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWPanPopupView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/8. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 增加了拖动关闭的弹窗基类 8 | 9 | /** ************************************************ 10 | 11 | github地址:https://github.com/choiceyou/FWPopupViewOC 12 | bug反馈、交流群:670698309 13 | 14 | *************************************************** 15 | */ 16 | 17 | 18 | #import "FWPopupBaseView.h" 19 | 20 | @interface FWPanPopupView : FWPopupBaseView 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPopupBaseView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupBaseView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 弹窗基类 8 | 9 | /** ************************************************ 10 | 11 | github地址:https://github.com/choiceyou/FWPopupViewOC 12 | bug反馈、交流群:670698309 13 | 14 | *************************************************** 15 | */ 16 | 17 | 18 | #import 19 | #import "UIView+PopupView.h" 20 | 21 | /** 22 | 自定义弹窗校准位置,注意:这边设置靠置哪边动画就从哪边出来 23 | 24 | - FWPopupAlignmentCenter: 中间,默认值 25 | - FWPopupAlignmentTopCenter: 上中 26 | - FWPopupAlignmentLeftCenter: 左中 27 | - FWPopupAlignmentBottomCenter: 下中 28 | - FWPopupAlignmentRightCenter: 右中 29 | - FWPopupAlignmentTopLeft: 上左 30 | - FWPopupAlignmentTopRight: 上右 31 | - FWPopupAlignmentBottomLeft: 下左 32 | - FWPopupAlignmentBottomRight: 下右 33 | */ 34 | typedef NS_ENUM(NSInteger, FWPopupAlignment) { 35 | FWPopupAlignmentCenter, 36 | FWPopupAlignmentTopCenter, 37 | FWPopupAlignmentLeftCenter, 38 | FWPopupAlignmentBottomCenter, 39 | FWPopupAlignmentRightCenter, 40 | FWPopupAlignmentTopLeft, 41 | FWPopupAlignmentTopRight, 42 | FWPopupAlignmentBottomLeft, 43 | FWPopupAlignmentBottomRight, 44 | }; 45 | 46 | /** 47 | 自定义弹窗动画类型 48 | 49 | - FWPopupAnimationStylePosition: 位移动画,视图靠边的时候建议使用 50 | - FWPopupAnimationStyleScale: 缩放动画 51 | - FWPopupAnimationStyleScale3D: 3D缩放动画(注意:这边隐藏时用的还是scale动画) 52 | - FWPopupAnimationStyleFrame: 修改frame值的动画,视图未靠边的时候建议使用 53 | */ 54 | typedef NS_ENUM(NSInteger, FWPopupAnimationStyle) { 55 | FWPopupAnimationStylePosition = 0, 56 | FWPopupAnimationStyleScale, 57 | FWPopupAnimationStyleScale3D, 58 | FWPopupAnimationStyleFrame, 59 | }; 60 | 61 | /** 62 | 弹窗箭头的样式 63 | 64 | - FWPopupArrowStyleNone: 无箭头 65 | - FWPopupArrowStyleRound: 圆角箭头 66 | - FWPopupArrowStyleTriangle: 菱角箭头 67 | */ 68 | typedef NS_ENUM(NSInteger, FWPopupArrowStyle) { 69 | FWPopupArrowStyleNone, 70 | FWPopupArrowStyleRound, 71 | FWPopupArrowStyleTriangle, 72 | }; 73 | 74 | /** 75 | 弹窗状态 76 | 77 | - FWPopupStateUnKnow: 未知 78 | - FWPopupStateWillAppear: 将要显示 79 | - FWPopupStateDidAppear: 已经显示 80 | - FWPopupStateWillDisappear: 将要隐藏 81 | - FWPopupStateDidDisappear: 已经隐藏 82 | - FWPopupStateDidAppearButCovered: 已经显示,但是被其他弹窗遮盖住了(实际上当前状态下弹窗是不可见) 83 | - FWPopupStateDidAppearAgain: 已经显示,其上面遮盖的弹窗消失了(实际上当前状态与FWPopupStateDidAppear状态相同) 84 | */ 85 | typedef NS_ENUM(NSInteger, FWPopupState) { 86 | FWPopupStateUnKnow, 87 | FWPopupStateWillAppear, 88 | FWPopupStateDidAppear, 89 | FWPopupStateWillDisappear, 90 | FWPopupStateDidDisappear, 91 | FWPopupStateDidAppearButCovered, 92 | FWPopupStateDidAppearAgain, 93 | }; 94 | 95 | 96 | @class FWPopupBaseView; 97 | @class FWPopupBaseViewProperty; 98 | 99 | /** 100 | 弹窗已经显示回调 101 | 102 | @param popupBaseView self 103 | */ 104 | typedef void(^FWPopupDidAppearBlock)(FWPopupBaseView *popupBaseView); 105 | 106 | /** 107 | 弹窗已经隐藏回调 108 | 109 | @param popupBaseView self 110 | */ 111 | typedef void(^FWPopupDidDisappearBlock)(FWPopupBaseView *popupBaseView); 112 | 113 | /** 114 | 弹窗状态回调,注意:该回调会走N次 115 | 116 | @param popupBaseView self 117 | */ 118 | typedef void(^FWPopupStateBlock)(FWPopupBaseView *popupBaseView, FWPopupState popupState); 119 | 120 | /** 121 | 普通无参数回调 122 | */ 123 | typedef void(^FWPopupVoidBlock)(void); 124 | 125 | // 隐藏所有弹窗的通知 126 | static NSString *const FWHideAllPopupViewNotification = @"FWHideAllPopupViewNotification"; 127 | 128 | 129 | @interface FWPopupBaseView : UIView 130 | 131 | /** 132 | 1、当外部没有传入该参数时,默认为UIWindow的根控制器的视图,即表示弹窗放在FWPopupWindow上; 133 | 2、当外部传入该参数时,该视图为传入的UIView,即表示弹窗放在传入的UIView上; 134 | */ 135 | @property (nonatomic, strong) UIView *attachedView; 136 | 137 | /** 138 | 弹窗真正的frame 139 | */ 140 | @property (nonatomic, assign, readonly) CGRect realFrame; 141 | 142 | /** 143 | 可设置属性 144 | */ 145 | @property (nonatomic, strong) FWPopupBaseViewProperty *vProperty; 146 | 147 | /** 148 | 单击隐藏弹窗,这个当且仅当:attachedView为用户传入的UIView并且 touchWildToHide == YES 时有效 149 | */ 150 | @property (nonatomic, strong) UITapGestureRecognizer *tapGest; 151 | 152 | /** 153 | 当前弹窗是否可见 154 | */ 155 | @property (nonatomic, assign, readonly) BOOL visible; 156 | 157 | /** 158 | 是否有用到键盘 159 | */ 160 | @property (nonatomic, assign) BOOL withKeyboard; 161 | 162 | /** 163 | 是否不需要设置Frame(当前基类使用Masonry,如果子类不希望该父类重置他的Frame,可以传入true) 164 | */ 165 | @property (nonatomic, assign) BOOL isNotMakeFrame; 166 | 167 | /** 168 | 当前弹窗状态 169 | */ 170 | @property (nonatomic, assign) FWPopupState currentPopupState; 171 | 172 | 173 | /** 174 | 显示 175 | */ 176 | - (void)show; 177 | 178 | /** 179 | 弹窗已经显示 180 | 181 | @param didAppearBlock 弹窗已经显示回调 182 | */ 183 | - (void)showWithDidAppearBlock:(FWPopupDidAppearBlock)didAppearBlock; 184 | 185 | /** 186 | 显示:弹窗状态回调,注意:该回调会走N次 187 | 188 | @param stateBlock 弹窗状态回调,注意:该回调会走N次 189 | */ 190 | - (void)showWithStateBlock:(FWPopupStateBlock)stateBlock; 191 | 192 | /** 193 | 隐藏 194 | */ 195 | - (void)hide; 196 | 197 | /** 198 | 弹窗已经隐藏 199 | 200 | @param didDisappearBlock 弹窗已经隐藏回调 201 | */ 202 | - (void)hideWithDidDisappearBlock:(FWPopupDidDisappearBlock)didDisappearBlock; 203 | 204 | /** 205 | 遮罩层被单击,主要用来给子类重写 206 | */ 207 | - (void)clickedMaskView; 208 | 209 | /** 210 | 获取当前视图AnchorPoint 211 | 212 | @return CGPoint 213 | */ 214 | - (CGPoint)obtainAnchorPoint; 215 | 216 | /** 217 | 如要初始化视图后要设置当前视图的约束,必须要使用该方法,因为这个方法会提前将当前视图加入父视图,使用该方法有以下几个注意点: 218 | 1、使用该方法不支持更换父视图,即不支持修改:attachedView; 219 | 2、使用该方法不建议把当前视图设置为成员变量,因为调用隐藏方法时会把当前视图从父视图中移除,调用显示方法后会重新添加到父视图,此时约束就会丢失相对于父视图的那部分; 220 | 3、有些约束可能会影响到某些动画的效果。 221 | 222 | @return self 223 | */ 224 | - (instancetype)initWithConstraints; 225 | 226 | /** 227 | 重置视图size 228 | 229 | @param size 新的size 230 | @param isImmediateEffect 是否立即生效,当 currentPopupState==FWPopupStateDidAppear 时有效,此时弹窗会重新显示,此时相应的回调也会重新走 231 | */ 232 | - (void)resetSize:(CGSize)size isImmediateEffect:(BOOL)isImmediateEffect; 233 | 234 | @end 235 | 236 | 237 | 238 | #pragma mark - ======================= 可配置属性 ======================= 239 | 240 | @interface FWPopupBaseViewProperty: NSObject 241 | 242 | + (instancetype)manager; 243 | 244 | /** 245 | 标题字体大小 246 | */ 247 | @property (nonatomic, assign) CGFloat titleFontSize; 248 | /** 249 | 标题文字颜色 250 | */ 251 | @property (nonatomic, strong) UIColor *titleColor; 252 | 253 | /** 254 | 按钮字体大小 255 | */ 256 | @property (nonatomic, assign) CGFloat buttonFontSize; 257 | /** 258 | 按钮高度 259 | */ 260 | @property (nonatomic, assign) CGFloat buttonHeight; 261 | /** 262 | 普通按钮文字颜色 263 | */ 264 | @property (nonatomic, strong) UIColor *itemNormalColor; 265 | /** 266 | 高亮按钮文字颜色 267 | */ 268 | @property (nonatomic, strong) UIColor *itemHighlightColor; 269 | /** 270 | 选中按钮文字颜色 271 | */ 272 | @property (nonatomic, strong) UIColor *itemPressedColor; 273 | 274 | /** 275 | 上下间距 276 | */ 277 | @property (nonatomic, assign) CGFloat topBottomMargin; 278 | /** 279 | 左右间距 280 | */ 281 | @property (nonatomic, assign) CGFloat letfRigthMargin; 282 | /** 283 | 控件之间的间距 284 | */ 285 | @property (nonatomic, assign) CGFloat commponentMargin; 286 | 287 | /** 288 | 边框、分割线颜色 289 | */ 290 | @property (nonatomic, strong) UIColor *splitColor; 291 | /** 292 | 边框宽度 293 | */ 294 | @property (nonatomic, assign) CGFloat splitWidth; 295 | /** 296 | 圆角值 297 | */ 298 | @property (nonatomic, assign) CGFloat cornerRadius; 299 | 300 | /** 301 | 弹窗的背景色(注意:这边指的是弹窗而不是遮罩层,遮罩层背景色的设置是:fwMaskViewColor) 302 | */ 303 | @property (nonatomic, strong) UIColor *backgroundColor; 304 | /** 305 | 弹窗的最大高度,0:表示不限制 306 | */ 307 | @property (nonatomic, assign) CGFloat popupViewMaxHeight; 308 | 309 | /** 310 | 弹窗箭头的样式 311 | */ 312 | @property (nonatomic, assign) FWPopupArrowStyle popupArrowStyle; 313 | /** 314 | 弹窗箭头的尺寸 315 | */ 316 | @property (nonatomic, assign) CGSize popupArrowSize; 317 | /** 318 | 弹窗箭头的顶点的X值相对于弹窗的宽度,默认在弹窗X轴的一半,因此设置范围:0~1 319 | */ 320 | @property (nonatomic, assign) CGFloat popupArrowVertexScaleX; 321 | /** 322 | 弹窗圆角箭头的圆角值 323 | */ 324 | @property (nonatomic, assign) CGFloat popupArrowCornerRadius; 325 | /** 326 | 弹窗圆角箭头与边线交汇处的圆角值 327 | */ 328 | @property (nonatomic, assign) CGFloat popupArrowBottomCornerRadius; 329 | 330 | 331 | // ===== 自定义弹窗(继承FWPopupView)时可能会用到 ===== 332 | 333 | /** 334 | 弹窗校准位置 335 | */ 336 | @property (nonatomic, assign) FWPopupAlignment popupAlignment; 337 | /** 338 | 弹窗动画类型 339 | */ 340 | @property (nonatomic, assign) FWPopupAnimationStyle popupAnimationStyle; 341 | 342 | /** 343 | 弹窗偏移量 344 | */ 345 | @property (nonatomic, assign) UIEdgeInsets popupEdgeInsets; 346 | /** 347 | 遮罩层的背景色(也可以使用fwMaskViewColor),注意:该参数在弹窗隐藏后,还原为弹窗弹起时的值 348 | */ 349 | @property (nonatomic, strong) UIColor *maskViewColor; 350 | 351 | /** 352 | 0表示NO,1表示YES,YES:用户点击外部遮罩层页面可以隐藏,注意:该参数在弹窗隐藏后,还原为弹窗弹起时的值 353 | */ 354 | @property (nonatomic, copy) NSString *touchWildToHide; 355 | 356 | /** 357 | 显示、隐藏动画所需的时间 358 | */ 359 | @property (nonatomic, assign) NSTimeInterval animationDuration; 360 | 361 | /** 362 | 阻尼系数,范围:0.0f~1.0f,数值越小「弹簧」的振动效果越明显。默认:-1,表示没有「弹簧」效果 363 | */ 364 | @property (nonatomic, assign) CGFloat usingSpringWithDamping; 365 | 366 | /** 367 | 初始速率,数值越大一开始移动越快,默认为:5 368 | */ 369 | @property (nonatomic, assign) CGFloat initialSpringVelocity; 370 | 371 | /** 372 | 3D放射动画(当且仅当:popupAnimationStyle == .scale3D 时有效) 373 | */ 374 | @property (nonatomic, assign) CATransform3D transform3D; 375 | /** 376 | 2D放射动画 377 | */ 378 | @property (nonatomic, assign) CGAffineTransform transform; 379 | 380 | /** 381 | 是否需要让多余部分的遮罩层变为无色(当弹窗没有任何一条边跟遮罩层的任意一条边重合的时候,就可能会把遮罩层分成几部分,此时看上去就不大美观了,因此可以使用该属性把某些部分设置为无色)。注意:使用该属性后不支持横竖屏切换,会出现视图显示的问题 382 | */ 383 | @property (nonatomic, assign) BOOL shouldClearSpilthMask; 384 | 385 | /** 386 | 初始化相关属性 387 | */ 388 | - (void)setupParams; 389 | 390 | @end 391 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPopupRootController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupRootController.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/12/21. 6 | // Copyright © 2018 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface FWPopupRootController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPopupRootController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupRootController.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/12/21. 6 | // Copyright © 2018 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupRootController.h" 10 | 11 | @interface FWPopupRootController () 12 | 13 | @end 14 | 15 | @implementation FWPopupRootController 16 | 17 | - (void)viewDidLoad 18 | { 19 | [super viewDidLoad]; 20 | // Do any additional setup after loading the view. 21 | } 22 | 23 | - (UIStatusBarStyle)preferredStatusBarStyle 24 | { 25 | if (@available(iOS 13.0, *)) { 26 | if ([UIApplication sharedApplication].windows.firstObject) { 27 | return [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarStyle; 28 | } 29 | } 30 | return [UIApplication sharedApplication].statusBarStyle; 31 | } 32 | 33 | - (BOOL)prefersStatusBarHidden 34 | { 35 | if (@available(iOS 13.0, *)) { 36 | if ([UIApplication sharedApplication].windows.firstObject) { 37 | return [UIApplication sharedApplication].windows.firstObject.windowScene.statusBarManager.statusBarHidden; 38 | } 39 | } 40 | return [UIApplication sharedApplication].statusBarHidden; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPopupWindow.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupWindow.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | /** ************************************************ 10 | 11 | github地址:https://github.com/choiceyou/FWPopupViewOC 12 | bug反馈、交流群:670698309 13 | 14 | *************************************************** 15 | */ 16 | 17 | 18 | #import 19 | #import "UIView+PopupView.h" 20 | #import "FWPopupBaseView.h" 21 | 22 | #define kPvRGB(r,g,b) [UIColor colorWithRed:(r)/255.f \ 23 | green:(g)/255.f \ 24 | blue:(b)/255.f \ 25 | alpha:1.f] 26 | 27 | #define kPvRGBA(r,g,b,a) [UIColor colorWithRed:(r)/255.f \ 28 | green:(g)/255.f \ 29 | blue:(b)/255.f \ 30 | alpha:(a)] 31 | 32 | @interface FWPopupWindow : UIWindow 33 | 34 | + (FWPopupWindow *)sharedWindow; 35 | 36 | @property (nonatomic, readonly) UIView *attachView; 37 | 38 | /** 39 | 默认NO,当为YES时:用户点击外部遮罩层页面可以消失 40 | */ 41 | @property (nonatomic, assign) BOOL touchWildToHide; 42 | 43 | /** 44 | 默认NO,当为YES时:用户拖动外部遮罩层页面可以消失 45 | */ 46 | @property (nonatomic, assign) BOOL panWildToHide; 47 | 48 | /** 49 | 被隐藏的视图队列(A视图正在显示,接着B视图显示,此时就把A视图隐藏同时放入该队列) 50 | */ 51 | @property (nonatomic, strong) NSMutableArray *hiddenViews; 52 | /** 53 | 将要展示的视图队列(A视图的显示或者隐藏动画正在进行中时,此时如果B视图要显示,则把B视图放入该队列,等动画结束从该队列中拿出来显示) 54 | */ 55 | @property (nonatomic, strong) NSMutableArray *willShowingViews; 56 | /** 57 | 需要提前设置约束的视图(这些视图不一定会马上展示,但是因为要设置约束,因此要提前设置父视图) 58 | */ 59 | @property (nonatomic, strong) NSMutableArray *needConstraintsViews; 60 | 61 | /** 62 | 是否需要重置DimMaskView 63 | */ 64 | @property (nonatomic, assign) BOOL shouldResetDimMaskView; 65 | 66 | 67 | /// 隐藏全部的弹窗(包括当前不可见的弹窗) 68 | - (void)removeAllPopupView; 69 | 70 | @end 71 | -------------------------------------------------------------------------------- /FWPopupViewOC/FWPopupWindow.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupWindow.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupWindow.h" 10 | #import "FWPopupRootController.h" 11 | 12 | @implementation FWPopupWindow 13 | 14 | + (FWPopupWindow *)sharedWindow 15 | { 16 | static FWPopupWindow *window; 17 | static dispatch_once_t onceToken; 18 | 19 | dispatch_once(&onceToken, ^{ 20 | window = [[FWPopupWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 21 | window.rootViewController = [FWPopupRootController new]; 22 | if (@available(iOS 13.0, *)) { 23 | if (window.windowScene == nil) { 24 | UIWindowScene *windowScene = nil; 25 | for (UIWindowScene *tmpScene in [UIApplication sharedApplication].connectedScenes) { 26 | if (tmpScene.activationState == UISceneActivationStateForegroundActive) { 27 | windowScene = tmpScene; 28 | break; 29 | } 30 | } 31 | if (windowScene) { 32 | window.windowScene = windowScene; 33 | } 34 | } 35 | } 36 | }); 37 | 38 | return window; 39 | } 40 | 41 | - (instancetype)initWithFrame:(CGRect)frame 42 | { 43 | if (frame.size.width == 0 || frame.size.height == 0) { 44 | frame = [UIScreen mainScreen].bounds; 45 | } 46 | self = [super initWithFrame:frame]; 47 | if (self) { 48 | 49 | self.windowLevel = UIWindowLevelStatusBar + 1; 50 | self.backgroundColor = [UIColor clearColor]; 51 | 52 | UITapGestureRecognizer *gesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGestureAction:)]; 53 | gesture.cancelsTouchesInView = NO; 54 | gesture.delegate = self; 55 | [self addGestureRecognizer:gesture]; 56 | 57 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(panGestureAction:)]; 58 | panGesture.delegate = self; 59 | [self addGestureRecognizer:panGesture]; 60 | } 61 | return self; 62 | } 63 | 64 | - (void)tapGestureAction:(UIGestureRecognizer *)gesture 65 | { 66 | if (!self.attachView.dimMaskAnimating) 67 | { 68 | for (UIView *v in [self attachView].dimMaskView.subviews) 69 | { 70 | if ([v isKindOfClass:[FWPopupBaseView class]] && ![self.hiddenViews containsObject:v]) 71 | { 72 | FWPopupBaseView *popupView = (FWPopupBaseView *)v; 73 | [popupView clickedMaskView]; 74 | if (self.touchWildToHide && (popupView.currentPopupState == FWPopupStateDidAppear || popupView.currentPopupState == FWPopupStateDidAppearAgain)) 75 | { 76 | [popupView hide]; 77 | } 78 | } 79 | } 80 | } 81 | } 82 | 83 | - (void)panGestureAction:(UIGestureRecognizer *)gesture 84 | { 85 | if (self.panWildToHide) { 86 | [self tapGestureAction:gesture]; 87 | } 88 | } 89 | 90 | - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch 91 | { 92 | return touch.view == self.attachView.dimMaskView; 93 | } 94 | 95 | #pragma mark 隐藏全部的弹窗(包括当前不可见的弹窗) 96 | - (void)removeAllPopupView 97 | { 98 | for (UIView *tmpView in [self attachView].dimMaskView.subviews) 99 | { 100 | if ([tmpView isKindOfClass:[FWPopupBaseView class]]) 101 | { 102 | FWPopupBaseView *pView = (FWPopupBaseView *)tmpView; 103 | [pView hide]; 104 | } 105 | } 106 | [self.attachView hideDimMask]; 107 | } 108 | 109 | 110 | #pragma mark - 111 | #pragma mark - GET/SET 112 | 113 | - (UIView *)attachView 114 | { 115 | return self.rootViewController.view; 116 | } 117 | 118 | - (NSMutableArray *)hiddenViews 119 | { 120 | if (!_hiddenViews) { 121 | _hiddenViews = [NSMutableArray array]; 122 | } 123 | return _hiddenViews; 124 | } 125 | 126 | - (NSMutableArray *)willShowingViews 127 | { 128 | if (!_willShowingViews) { 129 | _willShowingViews = [NSMutableArray array]; 130 | } 131 | return _willShowingViews; 132 | } 133 | 134 | - (NSMutableArray *)needConstraintsViews 135 | { 136 | if (_needConstraintsViews) { 137 | _needConstraintsViews = [NSMutableArray array]; 138 | } 139 | return _needConstraintsViews; 140 | } 141 | 142 | @end 143 | 144 | -------------------------------------------------------------------------------- /FWPopupViewOC/Resources/FWPopupViewOC.bundle/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | StringsTable 6 | Root 7 | PreferenceSpecifiers 8 | 9 | 10 | Type 11 | PSGroupSpecifier 12 | Title 13 | Group 14 | 15 | 16 | Type 17 | PSTextFieldSpecifier 18 | Title 19 | Name 20 | Key 21 | name_preference 22 | DefaultValue 23 | 24 | IsSecure 25 | 26 | KeyboardType 27 | Alphabet 28 | AutocapitalizationType 29 | None 30 | AutocorrectionType 31 | No 32 | 33 | 34 | Type 35 | PSToggleSwitchSpecifier 36 | Title 37 | Enabled 38 | Key 39 | enabled_preference 40 | DefaultValue 41 | 42 | 43 | 44 | Type 45 | PSSliderSpecifier 46 | Key 47 | slider_preference 48 | DefaultValue 49 | 0.5 50 | MinimumValue 51 | 0 52 | MaximumValue 53 | 1 54 | MinimumValueImage 55 | 56 | MaximumValueImage 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /FWPopupViewOC/Resources/FWPopupViewOC.bundle/en.lproj/Root.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/FWPopupViewOC/Resources/FWPopupViewOC.bundle/en.lproj/Root.strings -------------------------------------------------------------------------------- /FWPopupViewOC/Resources/FWPopupViewOC.bundle/guide_arrow@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/FWPopupViewOC/Resources/FWPopupViewOC.bundle/guide_arrow@3x.png -------------------------------------------------------------------------------- /FWPopupViewOC/UIView+PopupView.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+PopupView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | /** ************************************************ 10 | 11 | github地址:https://github.com/choiceyou/FWPopupViewOC 12 | bug反馈、交流群:670698309 13 | 14 | *************************************************** 15 | */ 16 | 17 | 18 | #import 19 | 20 | 21 | // weakself strongself 22 | #define FWPWeakify(o) __weak typeof(self) fwwo = o; 23 | #define FWPStrongify(o) __strong typeof(self) o = fwwo; 24 | 25 | 26 | @interface UIView (PopupView) 27 | 28 | @property (nonatomic, strong, readonly) UIView *dimMaskView; 29 | @property (nonatomic, strong) UIColor *dimMaskViewColor; 30 | @property (nonatomic, assign) BOOL dimMaskAnimating; 31 | @property (nonatomic, assign) NSTimeInterval dimMaskAnimationDuration; 32 | @property (nonatomic, assign, readwrite) NSInteger dimReferenceCount; 33 | 34 | - (void)showDimMask; 35 | - (void)hideDimMask; 36 | 37 | - (void)resetDimMaskView; 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /FWPopupViewOC/UIView+PopupView.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+PopupView.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | static const void *dimReferenceCountKey = &dimReferenceCountKey; 10 | 11 | static const void *dimMaskViewKey = &dimMaskViewKey; 12 | static const void *dimMaskViewColorKey = &dimMaskViewColorKey; 13 | static const void *dimMaskAnimationDurationKey = &dimMaskAnimationDurationKey; 14 | static const void *dimMaskAnimatingKey = &dimMaskAnimatingKey; 15 | 16 | /** 17 | 遮罩层的默认背景色 18 | */ 19 | #define kDefaultMaskViewColor [UIColor colorWithWhite:0 alpha:0.5] 20 | 21 | #import "UIView+PopupView.h" 22 | #import 23 | #import "FWPopupWindow.h" 24 | #import "Masonry.h" 25 | 26 | @implementation UIView (PopupView) 27 | 28 | @dynamic dimMaskView; 29 | @dynamic dimMaskAnimationDuration; 30 | @dynamic dimMaskAnimating; 31 | 32 | - (NSInteger)dimReferenceCount { 33 | id count = objc_getAssociatedObject(self, dimReferenceCountKey); 34 | if (count == nil) { 35 | return 0; 36 | } else { 37 | return [count integerValue]; 38 | } 39 | } 40 | 41 | - (void)setDimReferenceCount:(NSInteger)dimReferenceCount 42 | { 43 | objc_setAssociatedObject(self, dimReferenceCountKey, @(dimReferenceCount), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | - (UIColor *)dimMaskViewColor 47 | { 48 | id color = objc_getAssociatedObject(self, dimMaskViewColorKey); 49 | if (color == nil) { 50 | return kDefaultMaskViewColor; 51 | } else { 52 | return color; 53 | } 54 | } 55 | 56 | - (void)setDimMaskViewColor:(UIColor *)dimMaskViewColor 57 | { 58 | objc_setAssociatedObject(self, dimMaskViewColorKey, dimMaskViewColor, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 59 | } 60 | 61 | - (BOOL)dimMaskAnimating 62 | { 63 | id isAnimating = objc_getAssociatedObject(self, dimMaskAnimatingKey); 64 | if (isAnimating == nil) { 65 | return NO; 66 | } else { 67 | return [isAnimating boolValue]; 68 | } 69 | } 70 | 71 | - (void)setDimMaskAnimating:(BOOL)dimMaskAnimating 72 | { 73 | objc_setAssociatedObject(self, dimMaskAnimatingKey, @(dimMaskAnimating), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 74 | } 75 | 76 | - (NSTimeInterval)dimMaskAnimationDuration 77 | { 78 | id duration = objc_getAssociatedObject(self, dimMaskAnimationDurationKey); 79 | if (duration == nil) { 80 | return 0; 81 | } else { 82 | return [duration doubleValue]; 83 | } 84 | } 85 | 86 | - (void)setDimMaskAnimationDuration:(NSTimeInterval)dimMaskAnimationDuration 87 | { 88 | objc_setAssociatedObject(self, dimMaskAnimationDurationKey, @(dimMaskAnimationDuration), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 89 | } 90 | 91 | - (UIView *)dimMaskView 92 | { 93 | UIView *dimView = objc_getAssociatedObject(self, dimMaskViewKey); 94 | 95 | if (!dimView) 96 | { 97 | dimView = [[UIView alloc] init]; 98 | [self addSubview:dimView]; 99 | [dimView mas_makeConstraints:^(MASConstraintMaker *make) { 100 | make.edges.width.height.equalTo(self); 101 | }]; 102 | 103 | dimView.alpha = 0.0f; 104 | dimView.layer.zPosition = FLT_MAX; 105 | } 106 | dimView.backgroundColor = self.dimMaskViewColor; 107 | objc_setAssociatedObject(self, dimMaskViewKey, dimView, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 108 | 109 | return dimView; 110 | } 111 | 112 | - (void)resetDimMaskView 113 | { 114 | objc_setAssociatedObject(self, dimMaskViewKey, nil, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 115 | } 116 | 117 | - (void)showDimMask 118 | { 119 | ++self.dimReferenceCount; 120 | if (self.dimReferenceCount > 1) 121 | { 122 | --self.dimReferenceCount; 123 | return; 124 | } 125 | 126 | self.dimMaskView.hidden = NO; 127 | 128 | if (self == [FWPopupWindow sharedWindow].attachView) 129 | { 130 | [FWPopupWindow sharedWindow].hidden = NO; 131 | [[FWPopupWindow sharedWindow] makeKeyAndVisible]; 132 | } 133 | else if ([self isKindOfClass:[UIWindow class]]) 134 | { 135 | self.hidden = NO; 136 | [(UIWindow *)self makeKeyAndVisible]; 137 | } 138 | else 139 | { 140 | [self bringSubviewToFront:self.dimMaskView]; 141 | } 142 | 143 | [UIView animateWithDuration:self.dimMaskAnimationDuration 144 | delay:0 145 | options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionBeginFromCurrentState 146 | animations:^{ 147 | 148 | self.dimMaskView.alpha = 1.0f; 149 | 150 | } completion:^(BOOL finished) { 151 | 152 | }]; 153 | } 154 | 155 | - (void)hideDimMask 156 | { 157 | if (self.dimReferenceCount > 1) 158 | { 159 | return; 160 | } 161 | 162 | [UIView animateWithDuration:self.dimMaskAnimationDuration 163 | delay:0 164 | options:UIViewAnimationOptionCurveLinear | UIViewAnimationOptionBeginFromCurrentState 165 | animations:^{ 166 | 167 | self.dimMaskView.alpha = 0.0f; 168 | 169 | } completion:^(BOOL finished) { 170 | 171 | if (self == [FWPopupWindow sharedWindow].attachView) 172 | { 173 | [FWPopupWindow sharedWindow].hidden = YES; 174 | } 175 | else if (self == [FWPopupWindow sharedWindow]) 176 | { 177 | self.hidden = YES; 178 | } 179 | 180 | --self.dimReferenceCount; 181 | }]; 182 | } 183 | 184 | @end 185 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildSystemType 6 | Original 7 | 8 | 9 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC.xcworkspace/xcuserdata/yechen.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildLocationStyle 6 | UseAppPreferences 7 | CustomBuildLocationType 8 | RelativeToDerivedData 9 | DerivedDataLocationStyle 10 | Default 11 | EnabledFullIndexStoreVisibility 12 | 13 | IssueFilterStyle 14 | ShowActiveSchemeOnly 15 | LiveSourceIssuesEnabled 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | 17 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | //#import 11 | #import "ViewController.h" 12 | #import "FWNavigationController.h" 13 | 14 | @interface AppDelegate () 15 | 16 | @end 17 | 18 | @implementation AppDelegate 19 | 20 | 21 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 22 | 23 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 24 | self.window.rootViewController = [[FWNavigationController alloc] initWithRootViewController:[[ViewController alloc] init]]; 25 | [self.window makeKeyAndVisible]; 26 | 27 | return YES; 28 | } 29 | 30 | 31 | - (void)applicationWillResignActive:(UIApplication *)application { 32 | // 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. 33 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 34 | } 35 | 36 | 37 | - (void)applicationDidEnterBackground:(UIApplication *)application { 38 | // 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. 39 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 40 | } 41 | 42 | 43 | - (void)applicationWillEnterForeground:(UIApplication *)application { 44 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 45 | } 46 | 47 | 48 | - (void)applicationDidBecomeActive:(UIApplication *)application { 49 | // 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. 50 | } 51 | 52 | 53 | - (void)applicationWillTerminate:(UIApplication *)application { 54 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 55 | } 56 | 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_ad.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fw_ad.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_ad.imageset/fw_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_ad.imageset/fw_ad.png -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_arrow_01.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fw_arrow_01.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_arrow_01.imageset/fw_arrow_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_arrow_01.imageset/fw_arrow_01.png -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_close.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "fw_close.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_close.imageset/fw_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/FWPopupViewOCDemo/FWPopupViewOC/Assets.xcassets/fw_close.imageset/fw_close.png -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWAreaPickerView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWAreaPickerView.h 3 | // SafeAreaTest 4 | // 5 | // Created by xfg on 2018/6/6. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupBaseView.h" 10 | 11 | /** 12 | 点击确定按钮回调 13 | 14 | @param province 省 15 | @param city 市 16 | @param area 区(县) 17 | */ 18 | typedef void(^FWAraePickerConfirmBlock)(NSString *province, NSString *city, NSString *area); 19 | 20 | @interface FWAreaPickerView : FWPopupBaseView 21 | 22 | @property (nonatomic, copy) FWAraePickerConfirmBlock confirmBlock; 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWAreaPickerView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWAreaPickerView.m 3 | // SafeAreaTest 4 | // 5 | // Created by xfg on 2018/6/6. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWAreaPickerView.h" 10 | 11 | static const float kBtnWidth = 50; 12 | 13 | @interface FWAreaPickerView() 14 | 15 | /** 16 | 城市列表最原始数据 17 | */ 18 | @property (nonatomic, strong) NSArray *originArray; 19 | 20 | @property (nonatomic, strong) NSMutableArray *provinceArray; 21 | @property (nonatomic, strong) NSMutableArray *cityArray; 22 | @property (nonatomic, strong) NSMutableArray *areaArray; 23 | @property (nonatomic, strong) NSMutableArray *selectedArray; 24 | 25 | @property (nonatomic, strong) UIPickerView *pickerView; 26 | 27 | @property (nonatomic, strong) UIButton *confirmBtn; 28 | @property (nonatomic, strong) UIButton *cancelBtn; 29 | 30 | @end 31 | 32 | @implementation FWAreaPickerView 33 | 34 | - (instancetype)initWithFrame:(CGRect)frame 35 | { 36 | self = [super initWithFrame:frame]; 37 | if (self) { 38 | [self setupUI]; 39 | } 40 | return self; 41 | } 42 | 43 | - (void)setupUI 44 | { 45 | if (self.frame.size.width == 0 || self.frame.size.height == 0) { 46 | CGRect tmpFrame = self.frame; 47 | tmpFrame.size.width = self.attachedView.frame.size.width; 48 | tmpFrame.size.height = 280; 49 | self.frame = tmpFrame; 50 | } 51 | 52 | if (!self.vProperty) { 53 | self.vProperty = [[FWPopupBaseViewProperty alloc] init]; 54 | } 55 | 56 | [self addSubview:self.pickerView]; 57 | [self addSubview:self.confirmBtn]; 58 | [self addSubview:self.cancelBtn]; 59 | 60 | [self.originArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 61 | [self.provinceArray addObject:obj[@"state"]]; 62 | }]; 63 | 64 | NSMutableArray *citys = [NSMutableArray arrayWithArray:[self.originArray firstObject][@"cities"]]; 65 | [citys enumerateObjectsUsingBlock:^(NSDictionary *obj, NSUInteger idx, BOOL * _Nonnull stop) { 66 | [self.cityArray addObject:obj[@"city"]]; 67 | }]; 68 | 69 | self.areaArray = [citys firstObject][@"area"]; 70 | } 71 | 72 | - (void)showWithStateBlock:(FWPopupStateBlock)stateBlock 73 | { 74 | self.vProperty.popupAlignment = FWPopupAlignmentBottomCenter; 75 | self.vProperty.touchWildToHide = @"1"; 76 | 77 | [super showWithStateBlock:stateBlock]; 78 | } 79 | 80 | 81 | #pragma mark - ----------------------- UIPickerViewDataSource ----------------------- 82 | 83 | - (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView 84 | { 85 | return 3; 86 | } 87 | 88 | - (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component 89 | { 90 | if (component == 0) { 91 | return self.provinceArray.count; 92 | } else if (component == 1) { 93 | return self.cityArray.count; 94 | } else { 95 | return self.areaArray.count; 96 | } 97 | } 98 | 99 | 100 | #pragma mark - ----------------------- UIPickerViewDelegate ----------------------- 101 | 102 | - (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component 103 | { 104 | if (component == 0) 105 | { 106 | self.selectedArray = self.originArray[row][@"cities"]; 107 | 108 | [self.cityArray removeAllObjects]; 109 | [self.selectedArray enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 110 | [self.cityArray addObject:obj[@"city"]]; 111 | }]; 112 | 113 | self.areaArray = [NSMutableArray arrayWithArray:[self.selectedArray firstObject][@"areas"]]; 114 | 115 | [pickerView reloadComponent:1]; 116 | [pickerView reloadComponent:2]; 117 | [pickerView selectRow:0 inComponent:1 animated:YES]; 118 | [pickerView selectRow:0 inComponent:2 animated:YES]; 119 | } 120 | else if (component == 1) 121 | { 122 | if (self.selectedArray.count == 0) 123 | { 124 | self.selectedArray = [self.originArray firstObject][@"cities"]; 125 | } 126 | 127 | self.areaArray = [NSMutableArray arrayWithArray:[self.selectedArray objectAtIndex:row][@"areas"]]; 128 | 129 | [pickerView reloadComponent:2]; 130 | [pickerView selectRow:0 inComponent:2 animated:YES]; 131 | } 132 | else 133 | { 134 | 135 | } 136 | } 137 | 138 | - (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view 139 | { 140 | //设置分割线的颜色 141 | [pickerView.subviews enumerateObjectsUsingBlock:^(__kindof UIView * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { 142 | if (obj.frame.size.height <=1) { 143 | obj.backgroundColor = self.vProperty.splitColor; 144 | } 145 | }]; 146 | 147 | NSString *text; 148 | if (component == 0) { 149 | text = self.provinceArray[row]; 150 | }else if (component == 1){ 151 | text = self.cityArray[row]; 152 | }else{ 153 | if (self.areaArray.count > 0) { 154 | text = self.areaArray[row]; 155 | }else{ 156 | text = @""; 157 | } 158 | } 159 | 160 | UILabel *label = [[UILabel alloc]init]; 161 | [label setTextAlignment:NSTextAlignmentCenter]; 162 | [label setFont:[UIFont systemFontOfSize:17]]; 163 | [label setText:text]; 164 | return label; 165 | } 166 | 167 | 168 | #pragma mark - ----------------------- private methods 私有方法 ----------------------- 169 | 170 | - (void)confirmAction 171 | { 172 | NSInteger index0 = [self.pickerView selectedRowInComponent:0]; 173 | NSInteger index1 = [self.pickerView selectedRowInComponent:1]; 174 | NSInteger index2 = [self.pickerView selectedRowInComponent:2]; 175 | 176 | NSString *province = self.provinceArray[index0]; 177 | NSString *city = self.cityArray[index1]; 178 | NSString *area = @""; 179 | if (self.areaArray.count != 0) { 180 | area = self.areaArray[index2]; 181 | } 182 | 183 | if (self.confirmBlock) { 184 | self.confirmBlock(province, city, area); 185 | } 186 | 187 | [self hide]; 188 | } 189 | 190 | - (void)cancelAction 191 | { 192 | [self hide]; 193 | } 194 | 195 | 196 | #pragma mark - ----------------------- GET/SET ----------------------- 197 | 198 | - (NSArray *)originArray 199 | { 200 | if (!_originArray) { 201 | NSString *path = [[NSBundle bundleForClass:[FWAreaPickerView class]] pathForResource:@"area_cn" ofType:@"plist"]; 202 | _originArray = [[NSArray alloc]initWithContentsOfFile:path]; 203 | } 204 | return _originArray; 205 | } 206 | 207 | - (NSMutableArray *)provinceArray 208 | { 209 | if (!_provinceArray) { 210 | _provinceArray = [NSMutableArray array]; 211 | } 212 | return _provinceArray; 213 | } 214 | 215 | - (NSMutableArray *)cityArray 216 | { 217 | if (!_cityArray) { 218 | _cityArray = [NSMutableArray array]; 219 | } 220 | return _cityArray; 221 | } 222 | 223 | - (NSMutableArray *)areaArray 224 | { 225 | if (!_areaArray) { 226 | _areaArray = [NSMutableArray array]; 227 | } 228 | return _areaArray; 229 | } 230 | 231 | - (NSMutableArray *)selectedArray 232 | { 233 | if (!_selectedArray) { 234 | _selectedArray = [NSMutableArray array]; 235 | } 236 | return _selectedArray; 237 | } 238 | 239 | - (UIPickerView *)pickerView 240 | { 241 | if (!_pickerView) { 242 | _pickerView = [[UIPickerView alloc] initWithFrame:CGRectMake(0, self.vProperty.buttonHeight, self.frame.size.width, self.frame.size.height)]; 243 | _pickerView.backgroundColor = [UIColor clearColor]; 244 | _pickerView.delegate = self; 245 | _pickerView.dataSource = self; 246 | } 247 | return _pickerView; 248 | } 249 | 250 | - (UIButton *)confirmBtn 251 | { 252 | if (!_confirmBtn) { 253 | _confirmBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 254 | _confirmBtn.frame = CGRectMake(self.attachedView.frame.size.width-kBtnWidth, 0, kBtnWidth, self.vProperty.buttonHeight); 255 | [_confirmBtn setTitle:@"确定" forState:UIControlStateNormal]; 256 | [_confirmBtn setTitleColor:self.vProperty.itemNormalColor forState:UIControlStateNormal]; 257 | _confirmBtn.backgroundColor = [UIColor clearColor]; 258 | _confirmBtn.titleLabel.font = [UIFont systemFontOfSize:self.vProperty.buttonFontSize]; 259 | [_confirmBtn addTarget:self action:@selector(confirmAction) forControlEvents:UIControlEventTouchUpInside]; 260 | } 261 | return _confirmBtn; 262 | } 263 | 264 | - (UIButton *)cancelBtn 265 | { 266 | if (!_cancelBtn) { 267 | _cancelBtn = [UIButton buttonWithType:UIButtonTypeCustom]; 268 | _cancelBtn.frame = CGRectMake(0, 0, kBtnWidth, self.vProperty.buttonHeight); 269 | [_cancelBtn setTitle:@"取消" forState:UIControlStateNormal]; 270 | [_cancelBtn setTitleColor:self.vProperty.itemNormalColor forState:UIControlStateNormal]; 271 | _cancelBtn.backgroundColor = [UIColor clearColor]; 272 | _cancelBtn.titleLabel.font = [UIFont systemFontOfSize:self.vProperty.buttonFontSize]; 273 | [_cancelBtn addTarget:self action:@selector(cancelAction) forControlEvents:UIControlEventTouchUpInside]; 274 | } 275 | return _cancelBtn; 276 | } 277 | 278 | @end 279 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomAdView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomAdView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/4/24. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupBaseView.h" 10 | 11 | /** 12 | 关闭按钮位置 13 | 14 | - FWCustomAdCloseBtnBottom: 正下方 15 | - FWCustomAdCloseBtnRightTop: 右上角 16 | */ 17 | typedef NS_ENUM(NSUInteger, FWCustomAdCloseBtnType) { 18 | FWCustomAdCloseBtnBottom = 0, 19 | FWCustomAdCloseBtnRightTop, 20 | }; 21 | 22 | 23 | NS_ASSUME_NONNULL_BEGIN 24 | 25 | @interface FWCustomAdView : FWPopupBaseView 26 | 27 | - (instancetype)initWithCloseBtnType:(FWCustomAdCloseBtnType)adCloseBtnType; 28 | 29 | @end 30 | 31 | NS_ASSUME_NONNULL_END 32 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomAdView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomAdView.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/4/24. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWCustomAdView.h" 10 | #import "Masonry.h" 11 | 12 | /// 关闭按钮尺寸 13 | #define kCloseBtnSize CGSizeMake(50, 50) 14 | /// 关闭按钮上下 15 | static CGFloat kCloseBtnMargin = 20; 16 | /// 广告图宽高比 17 | static float kAdViewScale = 0.7; 18 | /// 广告图宽 19 | #define kAdViewWidth ([UIScreen mainScreen].bounds.size.width * 0.7) 20 | 21 | @interface FWCustomAdView () 22 | 23 | @property (nonatomic, strong) UIImageView *adImgView; 24 | @property (nonatomic, strong) UIButton *closeBtn; 25 | 26 | @end 27 | 28 | 29 | @implementation FWCustomAdView 30 | 31 | - (instancetype)initWithCloseBtnType:(FWCustomAdCloseBtnType)adCloseBtnType 32 | { 33 | self = [super init]; 34 | if (self) { 35 | 36 | CGFloat height = 0.0; 37 | if (adCloseBtnType == FWCustomAdCloseBtnBottom) { 38 | height = kAdViewWidth/kAdViewScale + kCloseBtnSize.height + kCloseBtnMargin; 39 | } else if (adCloseBtnType == FWCustomAdCloseBtnRightTop) { 40 | height = kAdViewWidth/kAdViewScale; 41 | } 42 | self.frame = CGRectMake(0, 0, kAdViewWidth, height); 43 | 44 | 45 | self.backgroundColor = [UIColor clearColor]; 46 | 47 | [self.adImgView mas_makeConstraints:^(MASConstraintMaker *make) { 48 | make.top.left.right.equalTo(self); 49 | if (adCloseBtnType == FWCustomAdCloseBtnBottom) { 50 | make.bottom.equalTo(self).offset(-kCloseBtnSize.height-kCloseBtnMargin); 51 | } else if (adCloseBtnType == FWCustomAdCloseBtnRightTop) { 52 | make.bottom.equalTo(self); 53 | } 54 | }]; 55 | 56 | if (adCloseBtnType == FWCustomAdCloseBtnBottom) { 57 | [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { 58 | make.size.mas_equalTo(kCloseBtnSize); 59 | make.centerX.bottom.equalTo(self); 60 | }]; 61 | } else if (adCloseBtnType == FWCustomAdCloseBtnRightTop) { 62 | [self.closeBtn mas_makeConstraints:^(MASConstraintMaker *make) { 63 | make.size.mas_equalTo(CGSizeMake(kCloseBtnSize.width/1.5, kCloseBtnSize.height/1.5)); 64 | make.top.equalTo(self).offset(kCloseBtnMargin/2); 65 | make.right.equalTo(self).offset(-kCloseBtnMargin/2); 66 | }]; 67 | } 68 | 69 | [self configProperty]; 70 | } 71 | return self; 72 | } 73 | 74 | - (void)configProperty 75 | { 76 | FWPopupBaseViewProperty *property = [FWPopupBaseViewProperty manager]; 77 | property.popupAlignment = FWPopupAlignmentCenter; 78 | property.popupAnimationStyle = FWPopupAnimationStyleScale; 79 | // property.maskViewColor = [UIColor colorWithWhite:0 alpha:0.2]; 80 | self.vProperty = property; 81 | } 82 | 83 | - (void)closeBtnAction 84 | { 85 | [self hide]; 86 | } 87 | 88 | - (UIImageView *)adImgView 89 | { 90 | if (!_adImgView) { 91 | _adImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fw_ad"]]; 92 | _adImgView.layer.cornerRadius = 5; 93 | _adImgView.clipsToBounds = YES; 94 | [self addSubview:_adImgView]; 95 | } 96 | return _adImgView; 97 | } 98 | 99 | - (UIButton *)closeBtn 100 | { 101 | if (!_closeBtn) { 102 | _closeBtn = [[UIButton alloc] init]; 103 | [_closeBtn addTarget:self action:@selector(closeBtnAction) forControlEvents:UIControlEventTouchUpInside]; 104 | [_closeBtn setBackgroundImage:[UIImage imageNamed:@"fw_close"] forState:UIControlStateNormal]; 105 | [self addSubview:_closeBtn]; 106 | } 107 | return _closeBtn; 108 | } 109 | 110 | @end 111 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/28. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupBaseView.h" 10 | 11 | @interface FWCustomView : FWPopupBaseView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/28. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWCustomView.h" 10 | 11 | @implementation FWCustomView 12 | 13 | - (void)dealloc 14 | { 15 | NSLog(@"FWCustomView dealloc"); 16 | } 17 | 18 | - (instancetype)initWithFrame:(CGRect)frame 19 | { 20 | self = [super initWithFrame:frame]; 21 | if (self) { 22 | self.backgroundColor = [UIColor whiteColor]; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView2.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView2.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/20. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupBaseView.h" 10 | 11 | @interface FWCustomView2 : FWPopupBaseView 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView2.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView2.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/20. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWCustomView2.h" 10 | 11 | @implementation FWCustomView2 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | self.backgroundColor = [UIColor whiteColor]; 18 | [self configProperty]; 19 | } 20 | return self; 21 | } 22 | 23 | - (void)configProperty 24 | { 25 | FWPopupBaseViewProperty *property = [FWPopupBaseViewProperty manager]; 26 | property.popupAlignment = FWPopupAlignmentCenter; 27 | property.popupAnimationStyle = FWPopupAnimationStyleScale; 28 | property.touchWildToHide = @"1"; 29 | // property.maskViewColor = [UIColor colorWithWhite:0 alpha:0.3]; 30 | // property.popupEdgeInsets = UIEdgeInsetsMake(0, 0, 0, 0); 31 | // property.animationDuration = 0.2; 32 | self.vProperty = property; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView3.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView3.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/4/24. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWPopupBaseView.h" 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface FWCustomView3 : FWPopupBaseView 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWCustomView3.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWCustomView3.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/4/24. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWCustomView3.h" 10 | #import "Masonry.h" 11 | 12 | static CGFloat kArrowHeight = 15; 13 | 14 | 15 | @interface FWCustomView3 () 16 | 17 | @property (nonatomic, strong) UIView *bgView; 18 | @property (nonatomic, strong) UIImageView *arrowImgView; 19 | 20 | @end 21 | 22 | 23 | @implementation FWCustomView3 24 | 25 | - (instancetype)initWithFrame:(CGRect)frame 26 | { 27 | self = [super initWithFrame:frame]; 28 | if (self) { 29 | self.backgroundColor = [UIColor clearColor]; 30 | 31 | [self.bgView mas_makeConstraints:^(MASConstraintMaker *make) { 32 | make.left.bottom.right.equalTo(self); 33 | make.top.equalTo(self).offset(kArrowHeight); 34 | }]; 35 | 36 | [self.arrowImgView mas_makeConstraints:^(MASConstraintMaker *make) { 37 | make.size.mas_equalTo(CGSizeMake(kArrowHeight*2, kArrowHeight)); 38 | make.centerX.top.equalTo(self); 39 | }]; 40 | 41 | [self configProperty]; 42 | } 43 | return self; 44 | } 45 | 46 | - (void)configProperty 47 | { 48 | FWPopupBaseViewProperty *property = [FWPopupBaseViewProperty manager]; 49 | property.popupAlignment = FWPopupAlignmentTopCenter; 50 | property.popupAnimationStyle = FWPopupAnimationStyleScale; 51 | property.touchWildToHide = @"1"; 52 | property.popupEdgeInsets = UIEdgeInsetsMake(100, 0, 0, 0); 53 | property.popupArrowStyle = FWPopupArrowStyleRound; 54 | property.popupArrowSize = CGSizeMake(kArrowHeight*2, kArrowHeight); 55 | self.vProperty = property; 56 | } 57 | 58 | - (UIView *)bgView 59 | { 60 | if (!_bgView) { 61 | _bgView = [[UIView alloc] init]; 62 | _bgView.backgroundColor = [UIColor whiteColor]; 63 | _bgView.layer.cornerRadius = 5; 64 | _bgView.clipsToBounds = YES; 65 | [self addSubview:_bgView]; 66 | } 67 | return _bgView; 68 | } 69 | 70 | - (UIImageView *)arrowImgView 71 | { 72 | if (!_arrowImgView) { 73 | _arrowImgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"fw_arrow_01"]]; 74 | [self addSubview:_arrowImgView]; 75 | } 76 | return _arrowImgView; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // FWNavigationController.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/7/20. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface FWNavigationController : UINavigationController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/FWNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWNavigationController.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2019/7/20. 6 | // Copyright © 2019 xfg. All rights reserved. 7 | // 8 | 9 | #import "FWNavigationController.h" 10 | 11 | @interface FWNavigationController () 12 | 13 | @end 14 | 15 | @implementation FWNavigationController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | // Do any additional setup after loading the view. 20 | } 21 | 22 | - (BOOL)prefersStatusBarHidden 23 | { 24 | if (self.topViewController) { 25 | return [self.topViewController prefersStatusBarHidden]; 26 | } else { 27 | return YES; 28 | } 29 | } 30 | 31 | - (UIStatusBarStyle)preferredStatusBarStyle 32 | { 33 | if (self.topViewController) { 34 | return [self.topViewController preferredStatusBarStyle]; 35 | } else { 36 | return UIStatusBarStyleDefault; 37 | } 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/GuideMaskTestVC.h: -------------------------------------------------------------------------------- 1 | // 2 | // GuideMaskTestVC.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/5. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface GuideMaskTestVC : UIViewController 12 | 13 | @property (strong, nonatomic) IBOutletCollection(UIView) NSArray *collectionViews; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/GuideMaskTestVC.m: -------------------------------------------------------------------------------- 1 | // 2 | // GuideMaskTestVC.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2018/6/5. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import "GuideMaskTestVC.h" 10 | #import "FWGuideMaskView.h" 11 | 12 | @interface GuideMaskTestVC () 13 | 14 | @end 15 | 16 | @implementation GuideMaskTestVC 17 | 18 | - (BOOL)prefersStatusBarHidden 19 | { 20 | return YES; 21 | } 22 | 23 | - (void)viewDidLoad 24 | { 25 | [super viewDidLoad]; 26 | 27 | self.navigationItem.title = @"新手引导页"; 28 | } 29 | 30 | - (IBAction)showAction:(id)sender 31 | { 32 | FWGuideMaskView *guideMaskView = [[FWGuideMaskView alloc] init]; 33 | guideMaskView.dataSource = self; 34 | [guideMaskView show]; 35 | } 36 | 37 | - (NSString *)guideMaskView:(FWGuideMaskView *)guideMaskView descriptionForItemAtIndex:(NSInteger)index { 38 | return [NSString stringWithFormat:@"这是第 %zi 个视图的描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述描述", index]; 39 | } 40 | 41 | - (UIView *)guideMaskView:(FWGuideMaskView *)guideMaskView viewForItemAtIndex:(NSInteger)index { 42 | return self.collectionViews[index]; 43 | } 44 | 45 | - (NSInteger)numberOfItemsInGuideMaskView:(FWGuideMaskView *)guideMaskView { 46 | return self.collectionViews.count; 47 | } 48 | 49 | - (CGFloat)guideMaskView:(FWGuideMaskView *)guideMaskView cornerRadiusForItemAtIndex:(NSInteger)index 50 | { 51 | if (index == self.collectionViews.count-1) { 52 | return 30; 53 | } 54 | return 5; 55 | } 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/GuideMaskTestVC.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | 29 | UISupportedInterfaceOrientations 30 | 31 | UIInterfaceOrientationPortrait 32 | UIInterfaceOrientationLandscapeLeft 33 | UIInterfaceOrientationLandscapeRight 34 | 35 | UISupportedInterfaceOrientations~ipad 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationPortraitUpsideDown 39 | UIInterfaceOrientationLandscapeLeft 40 | UIInterfaceOrientationLandscapeRight 41 | 42 | UIViewControllerBasedStatusBarAppearance 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOC/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // FWPopupViewOC 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. 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 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOCTests/FWPopupViewOCTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupViewOCTests.m 3 | // FWPopupViewOCTests 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FWPopupViewOCTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation FWPopupViewOCTests 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 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOCTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOCUITests/FWPopupViewOCUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // FWPopupViewOCUITests.m 3 | // FWPopupViewOCUITests 4 | // 5 | // Created by xfg on 2017/5/25. 6 | // Copyright © 2018年 xfg. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface FWPopupViewOCUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation FWPopupViewOCUITests 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 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/FWPopupViewOCUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Podfile: -------------------------------------------------------------------------------- 1 | # Uncomment the next line to define a global platform for your project 2 | platform :ios, '9.0' 3 | source 'https://github.com/CocoaPods/Specs.git' 4 | 5 | target 'FWPopupViewOC' do 6 | 7 | use_frameworks! 8 | 9 | # 布局:https://github.com/SnapKit/Masonry 10 | pod 'Masonry' 11 | 12 | end 13 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - Masonry 6 | 7 | SPEC REPOS: 8 | https://github.com/CocoaPods/Specs.git: 9 | - Masonry 10 | 11 | SPEC CHECKSUMS: 12 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 13 | 14 | PODFILE CHECKSUM: a0d38bdf2e5852ff47f53aad1366e6978c8df5b8 15 | 16 | COCOAPODS: 1.9.2 17 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Masonry (1.1.0) 3 | 4 | DEPENDENCIES: 5 | - Masonry 6 | 7 | SPEC REPOS: 8 | https://github.com/CocoaPods/Specs.git: 9 | - Masonry 10 | 11 | SPEC CHECKSUMS: 12 | Masonry: 678fab65091a9290e40e2832a55e7ab731aad201 13 | 14 | PODFILE CHECKSUM: a0d38bdf2e5852ff47f53aad1366e6978c8df5b8 15 | 16 | COCOAPODS: 1.9.2 17 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASCompositeConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | /** 13 | * A group of MASConstraint objects 14 | */ 15 | @interface MASCompositeConstraint : MASConstraint 16 | 17 | /** 18 | * Creates a composite with a predefined array of children 19 | * 20 | * @param children child MASConstraints 21 | * 22 | * @return a composite constraint 23 | */ 24 | - (id)initWithChildren:(NSArray *)children; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASCompositeConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASCompositeConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASCompositeConstraint.h" 10 | #import "MASConstraint+Private.h" 11 | 12 | @interface MASCompositeConstraint () 13 | 14 | @property (nonatomic, strong) id mas_key; 15 | @property (nonatomic, strong) NSMutableArray *childConstraints; 16 | 17 | @end 18 | 19 | @implementation MASCompositeConstraint 20 | 21 | - (id)initWithChildren:(NSArray *)children { 22 | self = [super init]; 23 | if (!self) return nil; 24 | 25 | _childConstraints = [children mutableCopy]; 26 | for (MASConstraint *constraint in _childConstraints) { 27 | constraint.delegate = self; 28 | } 29 | 30 | return self; 31 | } 32 | 33 | #pragma mark - MASConstraintDelegate 34 | 35 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint { 36 | NSUInteger index = [self.childConstraints indexOfObject:constraint]; 37 | NSAssert(index != NSNotFound, @"Could not find constraint %@", constraint); 38 | [self.childConstraints replaceObjectAtIndex:index withObject:replacementConstraint]; 39 | } 40 | 41 | - (MASConstraint *)constraint:(MASConstraint __unused *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 42 | id strongDelegate = self.delegate; 43 | MASConstraint *newConstraint = [strongDelegate constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 44 | newConstraint.delegate = self; 45 | [self.childConstraints addObject:newConstraint]; 46 | return newConstraint; 47 | } 48 | 49 | #pragma mark - NSLayoutConstraint multiplier proxies 50 | 51 | - (MASConstraint * (^)(CGFloat))multipliedBy { 52 | return ^id(CGFloat multiplier) { 53 | for (MASConstraint *constraint in self.childConstraints) { 54 | constraint.multipliedBy(multiplier); 55 | } 56 | return self; 57 | }; 58 | } 59 | 60 | - (MASConstraint * (^)(CGFloat))dividedBy { 61 | return ^id(CGFloat divider) { 62 | for (MASConstraint *constraint in self.childConstraints) { 63 | constraint.dividedBy(divider); 64 | } 65 | return self; 66 | }; 67 | } 68 | 69 | #pragma mark - MASLayoutPriority proxy 70 | 71 | - (MASConstraint * (^)(MASLayoutPriority))priority { 72 | return ^id(MASLayoutPriority priority) { 73 | for (MASConstraint *constraint in self.childConstraints) { 74 | constraint.priority(priority); 75 | } 76 | return self; 77 | }; 78 | } 79 | 80 | #pragma mark - NSLayoutRelation proxy 81 | 82 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { 83 | return ^id(id attr, NSLayoutRelation relation) { 84 | for (MASConstraint *constraint in self.childConstraints.copy) { 85 | constraint.equalToWithRelation(attr, relation); 86 | } 87 | return self; 88 | }; 89 | } 90 | 91 | #pragma mark - attribute chaining 92 | 93 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute { 94 | [self constraint:self addConstraintWithLayoutAttribute:layoutAttribute]; 95 | return self; 96 | } 97 | 98 | #pragma mark - Animator proxy 99 | 100 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 101 | 102 | - (MASConstraint *)animator { 103 | for (MASConstraint *constraint in self.childConstraints) { 104 | [constraint animator]; 105 | } 106 | return self; 107 | } 108 | 109 | #endif 110 | 111 | #pragma mark - debug helpers 112 | 113 | - (MASConstraint * (^)(id))key { 114 | return ^id(id key) { 115 | self.mas_key = key; 116 | int i = 0; 117 | for (MASConstraint *constraint in self.childConstraints) { 118 | constraint.key([NSString stringWithFormat:@"%@[%d]", key, i++]); 119 | } 120 | return self; 121 | }; 122 | } 123 | 124 | #pragma mark - NSLayoutConstraint constant setters 125 | 126 | - (void)setInsets:(MASEdgeInsets)insets { 127 | for (MASConstraint *constraint in self.childConstraints) { 128 | constraint.insets = insets; 129 | } 130 | } 131 | 132 | - (void)setInset:(CGFloat)inset { 133 | for (MASConstraint *constraint in self.childConstraints) { 134 | constraint.inset = inset; 135 | } 136 | } 137 | 138 | - (void)setOffset:(CGFloat)offset { 139 | for (MASConstraint *constraint in self.childConstraints) { 140 | constraint.offset = offset; 141 | } 142 | } 143 | 144 | - (void)setSizeOffset:(CGSize)sizeOffset { 145 | for (MASConstraint *constraint in self.childConstraints) { 146 | constraint.sizeOffset = sizeOffset; 147 | } 148 | } 149 | 150 | - (void)setCenterOffset:(CGPoint)centerOffset { 151 | for (MASConstraint *constraint in self.childConstraints) { 152 | constraint.centerOffset = centerOffset; 153 | } 154 | } 155 | 156 | #pragma mark - MASConstraint 157 | 158 | - (void)activate { 159 | for (MASConstraint *constraint in self.childConstraints) { 160 | [constraint activate]; 161 | } 162 | } 163 | 164 | - (void)deactivate { 165 | for (MASConstraint *constraint in self.childConstraints) { 166 | [constraint deactivate]; 167 | } 168 | } 169 | 170 | - (void)install { 171 | for (MASConstraint *constraint in self.childConstraints) { 172 | constraint.updateExisting = self.updateExisting; 173 | [constraint install]; 174 | } 175 | } 176 | 177 | - (void)uninstall { 178 | for (MASConstraint *constraint in self.childConstraints) { 179 | [constraint uninstall]; 180 | } 181 | } 182 | 183 | @end 184 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASConstraint+Private.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint+Private.h 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 29/04/14. 6 | // Copyright (c) 2014 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | 11 | @protocol MASConstraintDelegate; 12 | 13 | 14 | @interface MASConstraint () 15 | 16 | /** 17 | * Whether or not to check for an existing constraint instead of adding constraint 18 | */ 19 | @property (nonatomic, assign) BOOL updateExisting; 20 | 21 | /** 22 | * Usually MASConstraintMaker but could be a parent MASConstraint 23 | */ 24 | @property (nonatomic, weak) id delegate; 25 | 26 | /** 27 | * Based on a provided value type, is equal to calling: 28 | * NSNumber - setOffset: 29 | * NSValue with CGPoint - setPointOffset: 30 | * NSValue with CGSize - setSizeOffset: 31 | * NSValue with MASEdgeInsets - setInsets: 32 | */ 33 | - (void)setLayoutConstantWithValue:(NSValue *)value; 34 | 35 | @end 36 | 37 | 38 | @interface MASConstraint (Abstract) 39 | 40 | /** 41 | * Sets the constraint relation to given NSLayoutRelation 42 | * returns a block which accepts one of the following: 43 | * MASViewAttribute, UIView, NSValue, NSArray 44 | * see readme for more details. 45 | */ 46 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation; 47 | 48 | /** 49 | * Override to set a custom chaining behaviour 50 | */ 51 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 52 | 53 | @end 54 | 55 | 56 | @protocol MASConstraintDelegate 57 | 58 | /** 59 | * Notifies the delegate when the constraint needs to be replaced with another constraint. For example 60 | * A MASViewConstraint may turn into a MASCompositeConstraint when an array is passed to one of the equality blocks 61 | */ 62 | - (void)constraint:(MASConstraint *)constraint shouldBeReplacedWithConstraint:(MASConstraint *)replacementConstraint; 63 | 64 | - (MASConstraint *)constraint:(MASConstraint *)constraint addConstraintWithLayoutAttribute:(NSLayoutAttribute)layoutAttribute; 65 | 66 | @end 67 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * Enables Constraints to be created with chainable syntax 13 | * Constraint can represent single NSLayoutConstraint (MASViewConstraint) 14 | * or a group of NSLayoutConstraints (MASComposisteConstraint) 15 | */ 16 | @interface MASConstraint : NSObject 17 | 18 | // Chaining Support 19 | 20 | /** 21 | * Modifies the NSLayoutConstraint constant, 22 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 23 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight 24 | */ 25 | - (MASConstraint * (^)(MASEdgeInsets insets))insets; 26 | 27 | /** 28 | * Modifies the NSLayoutConstraint constant, 29 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 30 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight 31 | */ 32 | - (MASConstraint * (^)(CGFloat inset))inset; 33 | 34 | /** 35 | * Modifies the NSLayoutConstraint constant, 36 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 37 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight 38 | */ 39 | - (MASConstraint * (^)(CGSize offset))sizeOffset; 40 | 41 | /** 42 | * Modifies the NSLayoutConstraint constant, 43 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 44 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY 45 | */ 46 | - (MASConstraint * (^)(CGPoint offset))centerOffset; 47 | 48 | /** 49 | * Modifies the NSLayoutConstraint constant 50 | */ 51 | - (MASConstraint * (^)(CGFloat offset))offset; 52 | 53 | /** 54 | * Modifies the NSLayoutConstraint constant based on a value type 55 | */ 56 | - (MASConstraint * (^)(NSValue *value))valueOffset; 57 | 58 | /** 59 | * Sets the NSLayoutConstraint multiplier property 60 | */ 61 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy; 62 | 63 | /** 64 | * Sets the NSLayoutConstraint multiplier to 1.0/dividedBy 65 | */ 66 | - (MASConstraint * (^)(CGFloat divider))dividedBy; 67 | 68 | /** 69 | * Sets the NSLayoutConstraint priority to a float or MASLayoutPriority 70 | */ 71 | - (MASConstraint * (^)(MASLayoutPriority priority))priority; 72 | 73 | /** 74 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityLow 75 | */ 76 | - (MASConstraint * (^)(void))priorityLow; 77 | 78 | /** 79 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityMedium 80 | */ 81 | - (MASConstraint * (^)(void))priorityMedium; 82 | 83 | /** 84 | * Sets the NSLayoutConstraint priority to MASLayoutPriorityHigh 85 | */ 86 | - (MASConstraint * (^)(void))priorityHigh; 87 | 88 | /** 89 | * Sets the constraint relation to NSLayoutRelationEqual 90 | * returns a block which accepts one of the following: 91 | * MASViewAttribute, UIView, NSValue, NSArray 92 | * see readme for more details. 93 | */ 94 | - (MASConstraint * (^)(id attr))equalTo; 95 | 96 | /** 97 | * Sets the constraint relation to NSLayoutRelationGreaterThanOrEqual 98 | * returns a block which accepts one of the following: 99 | * MASViewAttribute, UIView, NSValue, NSArray 100 | * see readme for more details. 101 | */ 102 | - (MASConstraint * (^)(id attr))greaterThanOrEqualTo; 103 | 104 | /** 105 | * Sets the constraint relation to NSLayoutRelationLessThanOrEqual 106 | * returns a block which accepts one of the following: 107 | * MASViewAttribute, UIView, NSValue, NSArray 108 | * see readme for more details. 109 | */ 110 | - (MASConstraint * (^)(id attr))lessThanOrEqualTo; 111 | 112 | /** 113 | * Optional semantic property which has no effect but improves the readability of constraint 114 | */ 115 | - (MASConstraint *)with; 116 | 117 | /** 118 | * Optional semantic property which has no effect but improves the readability of constraint 119 | */ 120 | - (MASConstraint *)and; 121 | 122 | /** 123 | * Creates a new MASCompositeConstraint with the called attribute and reciever 124 | */ 125 | - (MASConstraint *)left; 126 | - (MASConstraint *)top; 127 | - (MASConstraint *)right; 128 | - (MASConstraint *)bottom; 129 | - (MASConstraint *)leading; 130 | - (MASConstraint *)trailing; 131 | - (MASConstraint *)width; 132 | - (MASConstraint *)height; 133 | - (MASConstraint *)centerX; 134 | - (MASConstraint *)centerY; 135 | - (MASConstraint *)baseline; 136 | 137 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 138 | 139 | - (MASConstraint *)firstBaseline; 140 | - (MASConstraint *)lastBaseline; 141 | 142 | #endif 143 | 144 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 145 | 146 | - (MASConstraint *)leftMargin; 147 | - (MASConstraint *)rightMargin; 148 | - (MASConstraint *)topMargin; 149 | - (MASConstraint *)bottomMargin; 150 | - (MASConstraint *)leadingMargin; 151 | - (MASConstraint *)trailingMargin; 152 | - (MASConstraint *)centerXWithinMargins; 153 | - (MASConstraint *)centerYWithinMargins; 154 | 155 | #endif 156 | 157 | 158 | /** 159 | * Sets the constraint debug name 160 | */ 161 | - (MASConstraint * (^)(id key))key; 162 | 163 | // NSLayoutConstraint constant Setters 164 | // for use outside of mas_updateConstraints/mas_makeConstraints blocks 165 | 166 | /** 167 | * Modifies the NSLayoutConstraint constant, 168 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 169 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight 170 | */ 171 | - (void)setInsets:(MASEdgeInsets)insets; 172 | 173 | /** 174 | * Modifies the NSLayoutConstraint constant, 175 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 176 | * NSLayoutAttributeTop, NSLayoutAttributeLeft, NSLayoutAttributeBottom, NSLayoutAttributeRight 177 | */ 178 | - (void)setInset:(CGFloat)inset; 179 | 180 | /** 181 | * Modifies the NSLayoutConstraint constant, 182 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 183 | * NSLayoutAttributeWidth, NSLayoutAttributeHeight 184 | */ 185 | - (void)setSizeOffset:(CGSize)sizeOffset; 186 | 187 | /** 188 | * Modifies the NSLayoutConstraint constant, 189 | * only affects MASConstraints in which the first item's NSLayoutAttribute is one of the following 190 | * NSLayoutAttributeCenterX, NSLayoutAttributeCenterY 191 | */ 192 | - (void)setCenterOffset:(CGPoint)centerOffset; 193 | 194 | /** 195 | * Modifies the NSLayoutConstraint constant 196 | */ 197 | - (void)setOffset:(CGFloat)offset; 198 | 199 | 200 | // NSLayoutConstraint Installation support 201 | 202 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 203 | /** 204 | * Whether or not to go through the animator proxy when modifying the constraint 205 | */ 206 | @property (nonatomic, copy, readonly) MASConstraint *animator; 207 | #endif 208 | 209 | /** 210 | * Activates an NSLayoutConstraint if it's supported by an OS. 211 | * Invokes install otherwise. 212 | */ 213 | - (void)activate; 214 | 215 | /** 216 | * Deactivates previously installed/activated NSLayoutConstraint. 217 | */ 218 | - (void)deactivate; 219 | 220 | /** 221 | * Creates a NSLayoutConstraint and adds it to the appropriate view. 222 | */ 223 | - (void)install; 224 | 225 | /** 226 | * Removes previously installed NSLayoutConstraint 227 | */ 228 | - (void)uninstall; 229 | 230 | @end 231 | 232 | 233 | /** 234 | * Convenience auto-boxing macros for MASConstraint methods. 235 | * 236 | * Defining MAS_SHORTHAND_GLOBALS will turn on auto-boxing for default syntax. 237 | * A potential drawback of this is that the unprefixed macros will appear in global scope. 238 | */ 239 | #define mas_equalTo(...) equalTo(MASBoxValue((__VA_ARGS__))) 240 | #define mas_greaterThanOrEqualTo(...) greaterThanOrEqualTo(MASBoxValue((__VA_ARGS__))) 241 | #define mas_lessThanOrEqualTo(...) lessThanOrEqualTo(MASBoxValue((__VA_ARGS__))) 242 | 243 | #define mas_offset(...) valueOffset(MASBoxValue((__VA_ARGS__))) 244 | 245 | 246 | #ifdef MAS_SHORTHAND_GLOBALS 247 | 248 | #define equalTo(...) mas_equalTo(__VA_ARGS__) 249 | #define greaterThanOrEqualTo(...) mas_greaterThanOrEqualTo(__VA_ARGS__) 250 | #define lessThanOrEqualTo(...) mas_lessThanOrEqualTo(__VA_ARGS__) 251 | 252 | #define offset(...) mas_offset(__VA_ARGS__) 253 | 254 | #endif 255 | 256 | 257 | @interface MASConstraint (AutoboxingSupport) 258 | 259 | /** 260 | * Aliases to corresponding relation methods (for shorthand macros) 261 | * Also needed to aid autocompletion 262 | */ 263 | - (MASConstraint * (^)(id attr))mas_equalTo; 264 | - (MASConstraint * (^)(id attr))mas_greaterThanOrEqualTo; 265 | - (MASConstraint * (^)(id attr))mas_lessThanOrEqualTo; 266 | 267 | /** 268 | * A dummy method to aid autocompletion 269 | */ 270 | - (MASConstraint * (^)(id offset))mas_offset; 271 | 272 | @end 273 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraint.m 3 | // Masonry 4 | // 5 | // Created by Nick Tymchenko on 1/20/14. 6 | // 7 | 8 | #import "MASConstraint.h" 9 | #import "MASConstraint+Private.h" 10 | 11 | #define MASMethodNotImplemented() \ 12 | @throw [NSException exceptionWithName:NSInternalInconsistencyException \ 13 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \ 14 | userInfo:nil] 15 | 16 | @implementation MASConstraint 17 | 18 | #pragma mark - Init 19 | 20 | - (id)init { 21 | NSAssert(![self isMemberOfClass:[MASConstraint class]], @"MASConstraint is an abstract class, you should not instantiate it directly."); 22 | return [super init]; 23 | } 24 | 25 | #pragma mark - NSLayoutRelation proxies 26 | 27 | - (MASConstraint * (^)(id))equalTo { 28 | return ^id(id attribute) { 29 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual); 30 | }; 31 | } 32 | 33 | - (MASConstraint * (^)(id))mas_equalTo { 34 | return ^id(id attribute) { 35 | return self.equalToWithRelation(attribute, NSLayoutRelationEqual); 36 | }; 37 | } 38 | 39 | - (MASConstraint * (^)(id))greaterThanOrEqualTo { 40 | return ^id(id attribute) { 41 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); 42 | }; 43 | } 44 | 45 | - (MASConstraint * (^)(id))mas_greaterThanOrEqualTo { 46 | return ^id(id attribute) { 47 | return self.equalToWithRelation(attribute, NSLayoutRelationGreaterThanOrEqual); 48 | }; 49 | } 50 | 51 | - (MASConstraint * (^)(id))lessThanOrEqualTo { 52 | return ^id(id attribute) { 53 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); 54 | }; 55 | } 56 | 57 | - (MASConstraint * (^)(id))mas_lessThanOrEqualTo { 58 | return ^id(id attribute) { 59 | return self.equalToWithRelation(attribute, NSLayoutRelationLessThanOrEqual); 60 | }; 61 | } 62 | 63 | #pragma mark - MASLayoutPriority proxies 64 | 65 | - (MASConstraint * (^)(void))priorityLow { 66 | return ^id{ 67 | self.priority(MASLayoutPriorityDefaultLow); 68 | return self; 69 | }; 70 | } 71 | 72 | - (MASConstraint * (^)(void))priorityMedium { 73 | return ^id{ 74 | self.priority(MASLayoutPriorityDefaultMedium); 75 | return self; 76 | }; 77 | } 78 | 79 | - (MASConstraint * (^)(void))priorityHigh { 80 | return ^id{ 81 | self.priority(MASLayoutPriorityDefaultHigh); 82 | return self; 83 | }; 84 | } 85 | 86 | #pragma mark - NSLayoutConstraint constant proxies 87 | 88 | - (MASConstraint * (^)(MASEdgeInsets))insets { 89 | return ^id(MASEdgeInsets insets){ 90 | self.insets = insets; 91 | return self; 92 | }; 93 | } 94 | 95 | - (MASConstraint * (^)(CGFloat))inset { 96 | return ^id(CGFloat inset){ 97 | self.inset = inset; 98 | return self; 99 | }; 100 | } 101 | 102 | - (MASConstraint * (^)(CGSize))sizeOffset { 103 | return ^id(CGSize offset) { 104 | self.sizeOffset = offset; 105 | return self; 106 | }; 107 | } 108 | 109 | - (MASConstraint * (^)(CGPoint))centerOffset { 110 | return ^id(CGPoint offset) { 111 | self.centerOffset = offset; 112 | return self; 113 | }; 114 | } 115 | 116 | - (MASConstraint * (^)(CGFloat))offset { 117 | return ^id(CGFloat offset){ 118 | self.offset = offset; 119 | return self; 120 | }; 121 | } 122 | 123 | - (MASConstraint * (^)(NSValue *value))valueOffset { 124 | return ^id(NSValue *offset) { 125 | NSAssert([offset isKindOfClass:NSValue.class], @"expected an NSValue offset, got: %@", offset); 126 | [self setLayoutConstantWithValue:offset]; 127 | return self; 128 | }; 129 | } 130 | 131 | - (MASConstraint * (^)(id offset))mas_offset { 132 | // Will never be called due to macro 133 | return nil; 134 | } 135 | 136 | #pragma mark - NSLayoutConstraint constant setter 137 | 138 | - (void)setLayoutConstantWithValue:(NSValue *)value { 139 | if ([value isKindOfClass:NSNumber.class]) { 140 | self.offset = [(NSNumber *)value doubleValue]; 141 | } else if (strcmp(value.objCType, @encode(CGPoint)) == 0) { 142 | CGPoint point; 143 | [value getValue:&point]; 144 | self.centerOffset = point; 145 | } else if (strcmp(value.objCType, @encode(CGSize)) == 0) { 146 | CGSize size; 147 | [value getValue:&size]; 148 | self.sizeOffset = size; 149 | } else if (strcmp(value.objCType, @encode(MASEdgeInsets)) == 0) { 150 | MASEdgeInsets insets; 151 | [value getValue:&insets]; 152 | self.insets = insets; 153 | } else { 154 | NSAssert(NO, @"attempting to set layout constant with unsupported value: %@", value); 155 | } 156 | } 157 | 158 | #pragma mark - Semantic properties 159 | 160 | - (MASConstraint *)with { 161 | return self; 162 | } 163 | 164 | - (MASConstraint *)and { 165 | return self; 166 | } 167 | 168 | #pragma mark - Chaining 169 | 170 | - (MASConstraint *)addConstraintWithLayoutAttribute:(NSLayoutAttribute __unused)layoutAttribute { 171 | MASMethodNotImplemented(); 172 | } 173 | 174 | - (MASConstraint *)left { 175 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeft]; 176 | } 177 | 178 | - (MASConstraint *)top { 179 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTop]; 180 | } 181 | 182 | - (MASConstraint *)right { 183 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRight]; 184 | } 185 | 186 | - (MASConstraint *)bottom { 187 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottom]; 188 | } 189 | 190 | - (MASConstraint *)leading { 191 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeading]; 192 | } 193 | 194 | - (MASConstraint *)trailing { 195 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailing]; 196 | } 197 | 198 | - (MASConstraint *)width { 199 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeWidth]; 200 | } 201 | 202 | - (MASConstraint *)height { 203 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeHeight]; 204 | } 205 | 206 | - (MASConstraint *)centerX { 207 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterX]; 208 | } 209 | 210 | - (MASConstraint *)centerY { 211 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterY]; 212 | } 213 | 214 | - (MASConstraint *)baseline { 215 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBaseline]; 216 | } 217 | 218 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 219 | 220 | - (MASConstraint *)firstBaseline { 221 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeFirstBaseline]; 222 | } 223 | - (MASConstraint *)lastBaseline { 224 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLastBaseline]; 225 | } 226 | 227 | #endif 228 | 229 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 230 | 231 | - (MASConstraint *)leftMargin { 232 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeftMargin]; 233 | } 234 | 235 | - (MASConstraint *)rightMargin { 236 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeRightMargin]; 237 | } 238 | 239 | - (MASConstraint *)topMargin { 240 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTopMargin]; 241 | } 242 | 243 | - (MASConstraint *)bottomMargin { 244 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeBottomMargin]; 245 | } 246 | 247 | - (MASConstraint *)leadingMargin { 248 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeLeadingMargin]; 249 | } 250 | 251 | - (MASConstraint *)trailingMargin { 252 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeTrailingMargin]; 253 | } 254 | 255 | - (MASConstraint *)centerXWithinMargins { 256 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterXWithinMargins]; 257 | } 258 | 259 | - (MASConstraint *)centerYWithinMargins { 260 | return [self addConstraintWithLayoutAttribute:NSLayoutAttributeCenterYWithinMargins]; 261 | } 262 | 263 | #endif 264 | 265 | #pragma mark - Abstract 266 | 267 | - (MASConstraint * (^)(CGFloat multiplier))multipliedBy { MASMethodNotImplemented(); } 268 | 269 | - (MASConstraint * (^)(CGFloat divider))dividedBy { MASMethodNotImplemented(); } 270 | 271 | - (MASConstraint * (^)(MASLayoutPriority priority))priority { MASMethodNotImplemented(); } 272 | 273 | - (MASConstraint * (^)(id, NSLayoutRelation))equalToWithRelation { MASMethodNotImplemented(); } 274 | 275 | - (MASConstraint * (^)(id key))key { MASMethodNotImplemented(); } 276 | 277 | - (void)setInsets:(MASEdgeInsets __unused)insets { MASMethodNotImplemented(); } 278 | 279 | - (void)setInset:(CGFloat __unused)inset { MASMethodNotImplemented(); } 280 | 281 | - (void)setSizeOffset:(CGSize __unused)sizeOffset { MASMethodNotImplemented(); } 282 | 283 | - (void)setCenterOffset:(CGPoint __unused)centerOffset { MASMethodNotImplemented(); } 284 | 285 | - (void)setOffset:(CGFloat __unused)offset { MASMethodNotImplemented(); } 286 | 287 | #if TARGET_OS_MAC && !(TARGET_OS_IPHONE || TARGET_OS_TV) 288 | 289 | - (MASConstraint *)animator { MASMethodNotImplemented(); } 290 | 291 | #endif 292 | 293 | - (void)activate { MASMethodNotImplemented(); } 294 | 295 | - (void)deactivate { MASMethodNotImplemented(); } 296 | 297 | - (void)install { MASMethodNotImplemented(); } 298 | 299 | - (void)uninstall { MASMethodNotImplemented(); } 300 | 301 | @end 302 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASConstraintMaker.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASConstraintMaker.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASConstraint.h" 10 | #import "MASUtilities.h" 11 | 12 | typedef NS_OPTIONS(NSInteger, MASAttribute) { 13 | MASAttributeLeft = 1 << NSLayoutAttributeLeft, 14 | MASAttributeRight = 1 << NSLayoutAttributeRight, 15 | MASAttributeTop = 1 << NSLayoutAttributeTop, 16 | MASAttributeBottom = 1 << NSLayoutAttributeBottom, 17 | MASAttributeLeading = 1 << NSLayoutAttributeLeading, 18 | MASAttributeTrailing = 1 << NSLayoutAttributeTrailing, 19 | MASAttributeWidth = 1 << NSLayoutAttributeWidth, 20 | MASAttributeHeight = 1 << NSLayoutAttributeHeight, 21 | MASAttributeCenterX = 1 << NSLayoutAttributeCenterX, 22 | MASAttributeCenterY = 1 << NSLayoutAttributeCenterY, 23 | MASAttributeBaseline = 1 << NSLayoutAttributeBaseline, 24 | 25 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 26 | 27 | MASAttributeFirstBaseline = 1 << NSLayoutAttributeFirstBaseline, 28 | MASAttributeLastBaseline = 1 << NSLayoutAttributeLastBaseline, 29 | 30 | #endif 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 33 | 34 | MASAttributeLeftMargin = 1 << NSLayoutAttributeLeftMargin, 35 | MASAttributeRightMargin = 1 << NSLayoutAttributeRightMargin, 36 | MASAttributeTopMargin = 1 << NSLayoutAttributeTopMargin, 37 | MASAttributeBottomMargin = 1 << NSLayoutAttributeBottomMargin, 38 | MASAttributeLeadingMargin = 1 << NSLayoutAttributeLeadingMargin, 39 | MASAttributeTrailingMargin = 1 << NSLayoutAttributeTrailingMargin, 40 | MASAttributeCenterXWithinMargins = 1 << NSLayoutAttributeCenterXWithinMargins, 41 | MASAttributeCenterYWithinMargins = 1 << NSLayoutAttributeCenterYWithinMargins, 42 | 43 | #endif 44 | 45 | }; 46 | 47 | /** 48 | * Provides factory methods for creating MASConstraints. 49 | * Constraints are collected until they are ready to be installed 50 | * 51 | */ 52 | @interface MASConstraintMaker : NSObject 53 | 54 | /** 55 | * The following properties return a new MASViewConstraint 56 | * with the first item set to the makers associated view and the appropriate MASViewAttribute 57 | */ 58 | @property (nonatomic, strong, readonly) MASConstraint *left; 59 | @property (nonatomic, strong, readonly) MASConstraint *top; 60 | @property (nonatomic, strong, readonly) MASConstraint *right; 61 | @property (nonatomic, strong, readonly) MASConstraint *bottom; 62 | @property (nonatomic, strong, readonly) MASConstraint *leading; 63 | @property (nonatomic, strong, readonly) MASConstraint *trailing; 64 | @property (nonatomic, strong, readonly) MASConstraint *width; 65 | @property (nonatomic, strong, readonly) MASConstraint *height; 66 | @property (nonatomic, strong, readonly) MASConstraint *centerX; 67 | @property (nonatomic, strong, readonly) MASConstraint *centerY; 68 | @property (nonatomic, strong, readonly) MASConstraint *baseline; 69 | 70 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 71 | 72 | @property (nonatomic, strong, readonly) MASConstraint *firstBaseline; 73 | @property (nonatomic, strong, readonly) MASConstraint *lastBaseline; 74 | 75 | #endif 76 | 77 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 78 | 79 | @property (nonatomic, strong, readonly) MASConstraint *leftMargin; 80 | @property (nonatomic, strong, readonly) MASConstraint *rightMargin; 81 | @property (nonatomic, strong, readonly) MASConstraint *topMargin; 82 | @property (nonatomic, strong, readonly) MASConstraint *bottomMargin; 83 | @property (nonatomic, strong, readonly) MASConstraint *leadingMargin; 84 | @property (nonatomic, strong, readonly) MASConstraint *trailingMargin; 85 | @property (nonatomic, strong, readonly) MASConstraint *centerXWithinMargins; 86 | @property (nonatomic, strong, readonly) MASConstraint *centerYWithinMargins; 87 | 88 | #endif 89 | 90 | /** 91 | * Returns a block which creates a new MASCompositeConstraint with the first item set 92 | * to the makers associated view and children corresponding to the set bits in the 93 | * MASAttribute parameter. Combine multiple attributes via binary-or. 94 | */ 95 | @property (nonatomic, strong, readonly) MASConstraint *(^attributes)(MASAttribute attrs); 96 | 97 | /** 98 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeEdges 99 | * which generates the appropriate MASViewConstraint children (top, left, bottom, right) 100 | * with the first item set to the makers associated view 101 | */ 102 | @property (nonatomic, strong, readonly) MASConstraint *edges; 103 | 104 | /** 105 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeSize 106 | * which generates the appropriate MASViewConstraint children (width, height) 107 | * with the first item set to the makers associated view 108 | */ 109 | @property (nonatomic, strong, readonly) MASConstraint *size; 110 | 111 | /** 112 | * Creates a MASCompositeConstraint with type MASCompositeConstraintTypeCenter 113 | * which generates the appropriate MASViewConstraint children (centerX, centerY) 114 | * with the first item set to the makers associated view 115 | */ 116 | @property (nonatomic, strong, readonly) MASConstraint *center; 117 | 118 | /** 119 | * Whether or not to check for an existing constraint instead of adding constraint 120 | */ 121 | @property (nonatomic, assign) BOOL updateExisting; 122 | 123 | /** 124 | * Whether or not to remove existing constraints prior to installing 125 | */ 126 | @property (nonatomic, assign) BOOL removeExisting; 127 | 128 | /** 129 | * initialises the maker with a default view 130 | * 131 | * @param view any MASConstraint are created with this view as the first item 132 | * 133 | * @return a new MASConstraintMaker 134 | */ 135 | - (id)initWithView:(MAS_VIEW *)view; 136 | 137 | /** 138 | * Calls install method on any MASConstraints which have been created by this maker 139 | * 140 | * @return an array of all the installed MASConstraints 141 | */ 142 | - (NSArray *)install; 143 | 144 | - (MASConstraint * (^)(dispatch_block_t))group; 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASLayoutConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * When you are debugging or printing the constraints attached to a view this subclass 13 | * makes it easier to identify which constraints have been created via Masonry 14 | */ 15 | @interface MASLayoutConstraint : NSLayoutConstraint 16 | 17 | /** 18 | * a key to associate with this constraint 19 | */ 20 | @property (nonatomic, strong) id mas_key; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASLayoutConstraint.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASLayoutConstraint.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASLayoutConstraint.h" 10 | 11 | @implementation MASLayoutConstraint 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASUtilities.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 19/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | 13 | #if TARGET_OS_IPHONE || TARGET_OS_TV 14 | 15 | #import 16 | #define MAS_VIEW UIView 17 | #define MAS_VIEW_CONTROLLER UIViewController 18 | #define MASEdgeInsets UIEdgeInsets 19 | 20 | typedef UILayoutPriority MASLayoutPriority; 21 | static const MASLayoutPriority MASLayoutPriorityRequired = UILayoutPriorityRequired; 22 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = UILayoutPriorityDefaultHigh; 23 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 500; 24 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = UILayoutPriorityDefaultLow; 25 | static const MASLayoutPriority MASLayoutPriorityFittingSizeLevel = UILayoutPriorityFittingSizeLevel; 26 | 27 | #elif TARGET_OS_MAC 28 | 29 | #import 30 | #define MAS_VIEW NSView 31 | #define MASEdgeInsets NSEdgeInsets 32 | 33 | typedef NSLayoutPriority MASLayoutPriority; 34 | static const MASLayoutPriority MASLayoutPriorityRequired = NSLayoutPriorityRequired; 35 | static const MASLayoutPriority MASLayoutPriorityDefaultHigh = NSLayoutPriorityDefaultHigh; 36 | static const MASLayoutPriority MASLayoutPriorityDragThatCanResizeWindow = NSLayoutPriorityDragThatCanResizeWindow; 37 | static const MASLayoutPriority MASLayoutPriorityDefaultMedium = 501; 38 | static const MASLayoutPriority MASLayoutPriorityWindowSizeStayPut = NSLayoutPriorityWindowSizeStayPut; 39 | static const MASLayoutPriority MASLayoutPriorityDragThatCannotResizeWindow = NSLayoutPriorityDragThatCannotResizeWindow; 40 | static const MASLayoutPriority MASLayoutPriorityDefaultLow = NSLayoutPriorityDefaultLow; 41 | static const MASLayoutPriority MASLayoutPriorityFittingSizeCompression = NSLayoutPriorityFittingSizeCompression; 42 | 43 | #endif 44 | 45 | /** 46 | * Allows you to attach keys to objects matching the variable names passed. 47 | * 48 | * view1.mas_key = @"view1", view2.mas_key = @"view2"; 49 | * 50 | * is equivalent to: 51 | * 52 | * MASAttachKeys(view1, view2); 53 | */ 54 | #define MASAttachKeys(...) \ 55 | { \ 56 | NSDictionary *keyPairs = NSDictionaryOfVariableBindings(__VA_ARGS__); \ 57 | for (id key in keyPairs.allKeys) { \ 58 | id obj = keyPairs[key]; \ 59 | NSAssert([obj respondsToSelector:@selector(setMas_key:)], \ 60 | @"Cannot attach mas_key to %@", obj); \ 61 | [obj setMas_key:key]; \ 62 | } \ 63 | } 64 | 65 | /** 66 | * Used to create object hashes 67 | * Based on http://www.mikeash.com/pyblog/friday-qa-2010-06-18-implementing-equality-and-hashing.html 68 | */ 69 | #define MAS_NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger)) 70 | #define MAS_NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (MAS_NSUINT_BIT - howmuch))) 71 | 72 | /** 73 | * Given a scalar or struct value, wraps it in NSValue 74 | * Based on EXPObjectify: https://github.com/specta/expecta 75 | */ 76 | static inline id _MASBoxValue(const char *type, ...) { 77 | va_list v; 78 | va_start(v, type); 79 | id obj = nil; 80 | if (strcmp(type, @encode(id)) == 0) { 81 | id actual = va_arg(v, id); 82 | obj = actual; 83 | } else if (strcmp(type, @encode(CGPoint)) == 0) { 84 | CGPoint actual = (CGPoint)va_arg(v, CGPoint); 85 | obj = [NSValue value:&actual withObjCType:type]; 86 | } else if (strcmp(type, @encode(CGSize)) == 0) { 87 | CGSize actual = (CGSize)va_arg(v, CGSize); 88 | obj = [NSValue value:&actual withObjCType:type]; 89 | } else if (strcmp(type, @encode(MASEdgeInsets)) == 0) { 90 | MASEdgeInsets actual = (MASEdgeInsets)va_arg(v, MASEdgeInsets); 91 | obj = [NSValue value:&actual withObjCType:type]; 92 | } else if (strcmp(type, @encode(double)) == 0) { 93 | double actual = (double)va_arg(v, double); 94 | obj = [NSNumber numberWithDouble:actual]; 95 | } else if (strcmp(type, @encode(float)) == 0) { 96 | float actual = (float)va_arg(v, double); 97 | obj = [NSNumber numberWithFloat:actual]; 98 | } else if (strcmp(type, @encode(int)) == 0) { 99 | int actual = (int)va_arg(v, int); 100 | obj = [NSNumber numberWithInt:actual]; 101 | } else if (strcmp(type, @encode(long)) == 0) { 102 | long actual = (long)va_arg(v, long); 103 | obj = [NSNumber numberWithLong:actual]; 104 | } else if (strcmp(type, @encode(long long)) == 0) { 105 | long long actual = (long long)va_arg(v, long long); 106 | obj = [NSNumber numberWithLongLong:actual]; 107 | } else if (strcmp(type, @encode(short)) == 0) { 108 | short actual = (short)va_arg(v, int); 109 | obj = [NSNumber numberWithShort:actual]; 110 | } else if (strcmp(type, @encode(char)) == 0) { 111 | char actual = (char)va_arg(v, int); 112 | obj = [NSNumber numberWithChar:actual]; 113 | } else if (strcmp(type, @encode(bool)) == 0) { 114 | bool actual = (bool)va_arg(v, int); 115 | obj = [NSNumber numberWithBool:actual]; 116 | } else if (strcmp(type, @encode(unsigned char)) == 0) { 117 | unsigned char actual = (unsigned char)va_arg(v, unsigned int); 118 | obj = [NSNumber numberWithUnsignedChar:actual]; 119 | } else if (strcmp(type, @encode(unsigned int)) == 0) { 120 | unsigned int actual = (unsigned int)va_arg(v, unsigned int); 121 | obj = [NSNumber numberWithUnsignedInt:actual]; 122 | } else if (strcmp(type, @encode(unsigned long)) == 0) { 123 | unsigned long actual = (unsigned long)va_arg(v, unsigned long); 124 | obj = [NSNumber numberWithUnsignedLong:actual]; 125 | } else if (strcmp(type, @encode(unsigned long long)) == 0) { 126 | unsigned long long actual = (unsigned long long)va_arg(v, unsigned long long); 127 | obj = [NSNumber numberWithUnsignedLongLong:actual]; 128 | } else if (strcmp(type, @encode(unsigned short)) == 0) { 129 | unsigned short actual = (unsigned short)va_arg(v, unsigned int); 130 | obj = [NSNumber numberWithUnsignedShort:actual]; 131 | } 132 | va_end(v); 133 | return obj; 134 | } 135 | 136 | #define MASBoxValue(value) _MASBoxValue(@encode(__typeof__((value))), (value)) 137 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASViewAttribute.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * An immutable tuple which stores the view and the related NSLayoutAttribute. 13 | * Describes part of either the left or right hand side of a constraint equation 14 | */ 15 | @interface MASViewAttribute : NSObject 16 | 17 | /** 18 | * The view which the reciever relates to. Can be nil if item is not a view. 19 | */ 20 | @property (nonatomic, weak, readonly) MAS_VIEW *view; 21 | 22 | /** 23 | * The item which the reciever relates to. 24 | */ 25 | @property (nonatomic, weak, readonly) id item; 26 | 27 | /** 28 | * The attribute which the reciever relates to 29 | */ 30 | @property (nonatomic, assign, readonly) NSLayoutAttribute layoutAttribute; 31 | 32 | /** 33 | * Convenience initializer. 34 | */ 35 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute; 36 | 37 | /** 38 | * The designated initializer. 39 | */ 40 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute; 41 | 42 | /** 43 | * Determine whether the layoutAttribute is a size attribute 44 | * 45 | * @return YES if layoutAttribute is equal to NSLayoutAttributeWidth or NSLayoutAttributeHeight 46 | */ 47 | - (BOOL)isSizeAttribute; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASViewAttribute.m: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewAttribute.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 21/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | 11 | @implementation MASViewAttribute 12 | 13 | - (id)initWithView:(MAS_VIEW *)view layoutAttribute:(NSLayoutAttribute)layoutAttribute { 14 | self = [self initWithView:view item:view layoutAttribute:layoutAttribute]; 15 | return self; 16 | } 17 | 18 | - (id)initWithView:(MAS_VIEW *)view item:(id)item layoutAttribute:(NSLayoutAttribute)layoutAttribute { 19 | self = [super init]; 20 | if (!self) return nil; 21 | 22 | _view = view; 23 | _item = item; 24 | _layoutAttribute = layoutAttribute; 25 | 26 | return self; 27 | } 28 | 29 | - (BOOL)isSizeAttribute { 30 | return self.layoutAttribute == NSLayoutAttributeWidth 31 | || self.layoutAttribute == NSLayoutAttributeHeight; 32 | } 33 | 34 | - (BOOL)isEqual:(MASViewAttribute *)viewAttribute { 35 | if ([viewAttribute isKindOfClass:self.class]) { 36 | return self.view == viewAttribute.view 37 | && self.layoutAttribute == viewAttribute.layoutAttribute; 38 | } 39 | return [super isEqual:viewAttribute]; 40 | } 41 | 42 | - (NSUInteger)hash { 43 | return MAS_NSUINTROTATE([self.view hash], MAS_NSUINT_BIT / 2) ^ self.layoutAttribute; 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/MASViewConstraint.h: -------------------------------------------------------------------------------- 1 | // 2 | // MASViewConstraint.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASViewAttribute.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | #import "MASUtilities.h" 13 | 14 | /** 15 | * A single constraint. 16 | * Contains the attributes neccessary for creating a NSLayoutConstraint and adding it to the appropriate view 17 | */ 18 | @interface MASViewConstraint : MASConstraint 19 | 20 | /** 21 | * First item/view and first attribute of the NSLayoutConstraint 22 | */ 23 | @property (nonatomic, strong, readonly) MASViewAttribute *firstViewAttribute; 24 | 25 | /** 26 | * Second item/view and second attribute of the NSLayoutConstraint 27 | */ 28 | @property (nonatomic, strong, readonly) MASViewAttribute *secondViewAttribute; 29 | 30 | /** 31 | * initialises the MASViewConstraint with the first part of the equation 32 | * 33 | * @param firstViewAttribute view.mas_left, view.mas_width etc. 34 | * 35 | * @return a new view constraint 36 | */ 37 | - (id)initWithFirstViewAttribute:(MASViewAttribute *)firstViewAttribute; 38 | 39 | /** 40 | * Returns all MASViewConstraints installed with this view as a first item. 41 | * 42 | * @param view A view to retrieve constraints for. 43 | * 44 | * @return An array of MASViewConstraints. 45 | */ 46 | + (NSArray *)installedConstraintsForView:(MAS_VIEW *)view; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/Masonry.h: -------------------------------------------------------------------------------- 1 | // 2 | // Masonry.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | //! Project version number for Masonry. 12 | FOUNDATION_EXPORT double MasonryVersionNumber; 13 | 14 | //! Project version string for Masonry. 15 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 16 | 17 | #import "MASUtilities.h" 18 | #import "View+MASAdditions.h" 19 | #import "View+MASShorthandAdditions.h" 20 | #import "ViewController+MASAdditions.h" 21 | #import "NSArray+MASAdditions.h" 22 | #import "NSArray+MASShorthandAdditions.h" 23 | #import "MASConstraint.h" 24 | #import "MASCompositeConstraint.h" 25 | #import "MASViewAttribute.h" 26 | #import "MASViewConstraint.h" 27 | #import "MASConstraintMaker.h" 28 | #import "MASLayoutConstraint.h" 29 | #import "NSLayoutConstraint+MASDebugAdditions.h" 30 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/NSArray+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.h 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | typedef NS_ENUM(NSUInteger, MASAxisType) { 14 | MASAxisTypeHorizontal, 15 | MASAxisTypeVertical 16 | }; 17 | 18 | @interface NSArray (MASAdditions) 19 | 20 | /** 21 | * Creates a MASConstraintMaker with each view in the callee. 22 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing on each view 23 | * 24 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 25 | * 26 | * @return Array of created MASConstraints 27 | */ 28 | - (NSArray *)mas_makeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 29 | 30 | /** 31 | * Creates a MASConstraintMaker with each view in the callee. 32 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 33 | * If an existing constraint exists then it will be updated instead. 34 | * 35 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 36 | * 37 | * @return Array of created/updated MASConstraints 38 | */ 39 | - (NSArray *)mas_updateConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 40 | 41 | /** 42 | * Creates a MASConstraintMaker with each view in the callee. 43 | * Any constraints defined are added to each view or the appropriate superview once the block has finished executing on each view. 44 | * All constraints previously installed for the views will be removed. 45 | * 46 | * @param block scope within which you can build up the constraints which you wish to apply to each view. 47 | * 48 | * @return Array of created/updated MASConstraints 49 | */ 50 | - (NSArray *)mas_remakeConstraints:(void (NS_NOESCAPE ^)(MASConstraintMaker *make))block; 51 | 52 | /** 53 | * distribute with fixed spacing 54 | * 55 | * @param axisType which axis to distribute items along 56 | * @param fixedSpacing the spacing between each item 57 | * @param leadSpacing the spacing before the first item and the container 58 | * @param tailSpacing the spacing after the last item and the container 59 | */ 60 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 61 | 62 | /** 63 | * distribute with fixed item size 64 | * 65 | * @param axisType which axis to distribute items along 66 | * @param fixedItemLength the fixed length of each item 67 | * @param leadSpacing the spacing before the first item and the container 68 | * @param tailSpacing the spacing after the last item and the container 69 | */ 70 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/NSArray+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASAdditions.m 3 | // 4 | // 5 | // Created by Daniel Hammond on 11/26/13. 6 | // 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | #import "View+MASAdditions.h" 11 | 12 | @implementation NSArray (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *make))block { 15 | NSMutableArray *constraints = [NSMutableArray array]; 16 | for (MAS_VIEW *view in self) { 17 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 18 | [constraints addObjectsFromArray:[view mas_makeConstraints:block]]; 19 | } 20 | return constraints; 21 | } 22 | 23 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *make))block { 24 | NSMutableArray *constraints = [NSMutableArray array]; 25 | for (MAS_VIEW *view in self) { 26 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 27 | [constraints addObjectsFromArray:[view mas_updateConstraints:block]]; 28 | } 29 | return constraints; 30 | } 31 | 32 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 33 | NSMutableArray *constraints = [NSMutableArray array]; 34 | for (MAS_VIEW *view in self) { 35 | NSAssert([view isKindOfClass:[MAS_VIEW class]], @"All objects in the array must be views"); 36 | [constraints addObjectsFromArray:[view mas_remakeConstraints:block]]; 37 | } 38 | return constraints; 39 | } 40 | 41 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedSpacing:(CGFloat)fixedSpacing leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 42 | if (self.count < 2) { 43 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 44 | return; 45 | } 46 | 47 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 48 | if (axisType == MASAxisTypeHorizontal) { 49 | MAS_VIEW *prev; 50 | for (int i = 0; i < self.count; i++) { 51 | MAS_VIEW *v = self[i]; 52 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 53 | if (prev) { 54 | make.width.equalTo(prev); 55 | make.left.equalTo(prev.mas_right).offset(fixedSpacing); 56 | if (i == self.count - 1) {//last one 57 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 58 | } 59 | } 60 | else {//first one 61 | make.left.equalTo(tempSuperView).offset(leadSpacing); 62 | } 63 | 64 | }]; 65 | prev = v; 66 | } 67 | } 68 | else { 69 | MAS_VIEW *prev; 70 | for (int i = 0; i < self.count; i++) { 71 | MAS_VIEW *v = self[i]; 72 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 73 | if (prev) { 74 | make.height.equalTo(prev); 75 | make.top.equalTo(prev.mas_bottom).offset(fixedSpacing); 76 | if (i == self.count - 1) {//last one 77 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 78 | } 79 | } 80 | else {//first one 81 | make.top.equalTo(tempSuperView).offset(leadSpacing); 82 | } 83 | 84 | }]; 85 | prev = v; 86 | } 87 | } 88 | } 89 | 90 | - (void)mas_distributeViewsAlongAxis:(MASAxisType)axisType withFixedItemLength:(CGFloat)fixedItemLength leadSpacing:(CGFloat)leadSpacing tailSpacing:(CGFloat)tailSpacing { 91 | if (self.count < 2) { 92 | NSAssert(self.count>1,@"views to distribute need to bigger than one"); 93 | return; 94 | } 95 | 96 | MAS_VIEW *tempSuperView = [self mas_commonSuperviewOfViews]; 97 | if (axisType == MASAxisTypeHorizontal) { 98 | MAS_VIEW *prev; 99 | for (int i = 0; i < self.count; i++) { 100 | MAS_VIEW *v = self[i]; 101 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 102 | make.width.equalTo(@(fixedItemLength)); 103 | if (prev) { 104 | if (i == self.count - 1) {//last one 105 | make.right.equalTo(tempSuperView).offset(-tailSpacing); 106 | } 107 | else { 108 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 109 | make.right.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 110 | } 111 | } 112 | else {//first one 113 | make.left.equalTo(tempSuperView).offset(leadSpacing); 114 | } 115 | }]; 116 | prev = v; 117 | } 118 | } 119 | else { 120 | MAS_VIEW *prev; 121 | for (int i = 0; i < self.count; i++) { 122 | MAS_VIEW *v = self[i]; 123 | [v mas_makeConstraints:^(MASConstraintMaker *make) { 124 | make.height.equalTo(@(fixedItemLength)); 125 | if (prev) { 126 | if (i == self.count - 1) {//last one 127 | make.bottom.equalTo(tempSuperView).offset(-tailSpacing); 128 | } 129 | else { 130 | CGFloat offset = (1-(i/((CGFloat)self.count-1)))*(fixedItemLength+leadSpacing)-i*tailSpacing/(((CGFloat)self.count-1)); 131 | make.bottom.equalTo(tempSuperView).multipliedBy(i/((CGFloat)self.count-1)).with.offset(offset); 132 | } 133 | } 134 | else {//first one 135 | make.top.equalTo(tempSuperView).offset(leadSpacing); 136 | } 137 | }]; 138 | prev = v; 139 | } 140 | } 141 | } 142 | 143 | - (MAS_VIEW *)mas_commonSuperviewOfViews 144 | { 145 | MAS_VIEW *commonSuperview = nil; 146 | MAS_VIEW *previousView = nil; 147 | for (id object in self) { 148 | if ([object isKindOfClass:[MAS_VIEW class]]) { 149 | MAS_VIEW *view = (MAS_VIEW *)object; 150 | if (previousView) { 151 | commonSuperview = [view mas_closestCommonSuperview:commonSuperview]; 152 | } else { 153 | commonSuperview = view; 154 | } 155 | previousView = view; 156 | } 157 | } 158 | NSAssert(commonSuperview, @"Can't constrain views that do not share a common superview. Make sure that all the views in this array have been added into the same view hierarchy."); 159 | return commonSuperview; 160 | } 161 | 162 | @end 163 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/NSArray+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSArray+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSArray+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand array additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface NSArray (MASShorthandAdditions) 18 | 19 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 20 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 21 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 22 | 23 | @end 24 | 25 | @implementation NSArray (MASShorthandAdditions) 26 | 27 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *))block { 28 | return [self mas_makeConstraints:block]; 29 | } 30 | 31 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *))block { 32 | return [self mas_updateConstraints:block]; 33 | } 34 | 35 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *))block { 36 | return [self mas_remakeConstraints:block]; 37 | } 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | 11 | /** 12 | * makes debug and log output of NSLayoutConstraints more readable 13 | */ 14 | @interface NSLayoutConstraint (MASDebugAdditions) 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/NSLayoutConstraint+MASDebugAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSLayoutConstraint+MASDebugAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 3/08/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "NSLayoutConstraint+MASDebugAdditions.h" 10 | #import "MASConstraint.h" 11 | #import "MASLayoutConstraint.h" 12 | 13 | @implementation NSLayoutConstraint (MASDebugAdditions) 14 | 15 | #pragma mark - description maps 16 | 17 | + (NSDictionary *)layoutRelationDescriptionsByValue { 18 | static dispatch_once_t once; 19 | static NSDictionary *descriptionMap; 20 | dispatch_once(&once, ^{ 21 | descriptionMap = @{ 22 | @(NSLayoutRelationEqual) : @"==", 23 | @(NSLayoutRelationGreaterThanOrEqual) : @">=", 24 | @(NSLayoutRelationLessThanOrEqual) : @"<=", 25 | }; 26 | }); 27 | return descriptionMap; 28 | } 29 | 30 | + (NSDictionary *)layoutAttributeDescriptionsByValue { 31 | static dispatch_once_t once; 32 | static NSDictionary *descriptionMap; 33 | dispatch_once(&once, ^{ 34 | descriptionMap = @{ 35 | @(NSLayoutAttributeTop) : @"top", 36 | @(NSLayoutAttributeLeft) : @"left", 37 | @(NSLayoutAttributeBottom) : @"bottom", 38 | @(NSLayoutAttributeRight) : @"right", 39 | @(NSLayoutAttributeLeading) : @"leading", 40 | @(NSLayoutAttributeTrailing) : @"trailing", 41 | @(NSLayoutAttributeWidth) : @"width", 42 | @(NSLayoutAttributeHeight) : @"height", 43 | @(NSLayoutAttributeCenterX) : @"centerX", 44 | @(NSLayoutAttributeCenterY) : @"centerY", 45 | @(NSLayoutAttributeBaseline) : @"baseline", 46 | 47 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 48 | @(NSLayoutAttributeFirstBaseline) : @"firstBaseline", 49 | @(NSLayoutAttributeLastBaseline) : @"lastBaseline", 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 53 | @(NSLayoutAttributeLeftMargin) : @"leftMargin", 54 | @(NSLayoutAttributeRightMargin) : @"rightMargin", 55 | @(NSLayoutAttributeTopMargin) : @"topMargin", 56 | @(NSLayoutAttributeBottomMargin) : @"bottomMargin", 57 | @(NSLayoutAttributeLeadingMargin) : @"leadingMargin", 58 | @(NSLayoutAttributeTrailingMargin) : @"trailingMargin", 59 | @(NSLayoutAttributeCenterXWithinMargins) : @"centerXWithinMargins", 60 | @(NSLayoutAttributeCenterYWithinMargins) : @"centerYWithinMargins", 61 | #endif 62 | 63 | }; 64 | 65 | }); 66 | return descriptionMap; 67 | } 68 | 69 | 70 | + (NSDictionary *)layoutPriorityDescriptionsByValue { 71 | static dispatch_once_t once; 72 | static NSDictionary *descriptionMap; 73 | dispatch_once(&once, ^{ 74 | #if TARGET_OS_IPHONE || TARGET_OS_TV 75 | descriptionMap = @{ 76 | @(MASLayoutPriorityDefaultHigh) : @"high", 77 | @(MASLayoutPriorityDefaultLow) : @"low", 78 | @(MASLayoutPriorityDefaultMedium) : @"medium", 79 | @(MASLayoutPriorityRequired) : @"required", 80 | @(MASLayoutPriorityFittingSizeLevel) : @"fitting size", 81 | }; 82 | #elif TARGET_OS_MAC 83 | descriptionMap = @{ 84 | @(MASLayoutPriorityDefaultHigh) : @"high", 85 | @(MASLayoutPriorityDragThatCanResizeWindow) : @"drag can resize window", 86 | @(MASLayoutPriorityDefaultMedium) : @"medium", 87 | @(MASLayoutPriorityWindowSizeStayPut) : @"window size stay put", 88 | @(MASLayoutPriorityDragThatCannotResizeWindow) : @"drag cannot resize window", 89 | @(MASLayoutPriorityDefaultLow) : @"low", 90 | @(MASLayoutPriorityFittingSizeCompression) : @"fitting size", 91 | @(MASLayoutPriorityRequired) : @"required", 92 | }; 93 | #endif 94 | }); 95 | return descriptionMap; 96 | } 97 | 98 | #pragma mark - description override 99 | 100 | + (NSString *)descriptionForObject:(id)obj { 101 | if ([obj respondsToSelector:@selector(mas_key)] && [obj mas_key]) { 102 | return [NSString stringWithFormat:@"%@:%@", [obj class], [obj mas_key]]; 103 | } 104 | return [NSString stringWithFormat:@"%@:%p", [obj class], obj]; 105 | } 106 | 107 | - (NSString *)description { 108 | NSMutableString *description = [[NSMutableString alloc] initWithString:@"<"]; 109 | 110 | [description appendString:[self.class descriptionForObject:self]]; 111 | 112 | [description appendFormat:@" %@", [self.class descriptionForObject:self.firstItem]]; 113 | if (self.firstAttribute != NSLayoutAttributeNotAnAttribute) { 114 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.firstAttribute)]]; 115 | } 116 | 117 | [description appendFormat:@" %@", self.class.layoutRelationDescriptionsByValue[@(self.relation)]]; 118 | 119 | if (self.secondItem) { 120 | [description appendFormat:@" %@", [self.class descriptionForObject:self.secondItem]]; 121 | } 122 | if (self.secondAttribute != NSLayoutAttributeNotAnAttribute) { 123 | [description appendFormat:@".%@", self.class.layoutAttributeDescriptionsByValue[@(self.secondAttribute)]]; 124 | } 125 | 126 | if (self.multiplier != 1) { 127 | [description appendFormat:@" * %g", self.multiplier]; 128 | } 129 | 130 | if (self.secondAttribute == NSLayoutAttributeNotAnAttribute) { 131 | [description appendFormat:@" %g", self.constant]; 132 | } else { 133 | if (self.constant) { 134 | [description appendFormat:@" %@ %g", (self.constant < 0 ? @"-" : @"+"), ABS(self.constant)]; 135 | } 136 | } 137 | 138 | if (self.priority != MASLayoutPriorityRequired) { 139 | [description appendFormat:@" ^%@", self.class.layoutPriorityDescriptionsByValue[@(self.priority)] ?: [NSNumber numberWithDouble:self.priority]]; 140 | } 141 | 142 | [description appendString:@">"]; 143 | return description; 144 | } 145 | 146 | @end 147 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/View+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | /** 14 | * Provides constraint maker block 15 | * and convience methods for creating MASViewAttribute which are view + NSLayoutAttribute pairs 16 | */ 17 | @interface MAS_VIEW (MASAdditions) 18 | 19 | /** 20 | * following properties return a new MASViewAttribute with current view and appropriate NSLayoutAttribute 21 | */ 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_left; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_top; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_right; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottom; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leading; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailing; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_width; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_height; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerX; 31 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerY; 32 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_baseline; 33 | @property (nonatomic, strong, readonly) MASViewAttribute *(^mas_attribute)(NSLayoutAttribute attr); 34 | 35 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 36 | 37 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_firstBaseline; 38 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_lastBaseline; 39 | 40 | #endif 41 | 42 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 43 | 44 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leftMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_rightMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomMargin; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_leadingMargin; 49 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_trailingMargin; 50 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerXWithinMargins; 51 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_centerYWithinMargins; 52 | 53 | #endif 54 | 55 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 56 | 57 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuide API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 59 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 60 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 61 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 62 | 63 | #endif 64 | 65 | /** 66 | * a key to associate with this view 67 | */ 68 | @property (nonatomic, strong) id mas_key; 69 | 70 | /** 71 | * Finds the closest common superview between this view and another view 72 | * 73 | * @param view other view 74 | * 75 | * @return returns nil if common superview could not be found 76 | */ 77 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view; 78 | 79 | /** 80 | * Creates a MASConstraintMaker with the callee view. 81 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing 82 | * 83 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 84 | * 85 | * @return Array of created MASConstraints 86 | */ 87 | - (NSArray *)mas_makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 88 | 89 | /** 90 | * Creates a MASConstraintMaker with the callee view. 91 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 92 | * If an existing constraint exists then it will be updated instead. 93 | * 94 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 95 | * 96 | * @return Array of created/updated MASConstraints 97 | */ 98 | - (NSArray *)mas_updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 99 | 100 | /** 101 | * Creates a MASConstraintMaker with the callee view. 102 | * Any constraints defined are added to the view or the appropriate superview once the block has finished executing. 103 | * All constraints previously installed for the view will be removed. 104 | * 105 | * @param block scope within which you can build up the constraints which you wish to apply to the view. 106 | * 107 | * @return Array of created/updated MASConstraints 108 | */ 109 | - (NSArray *)mas_remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *make))block; 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/View+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 20/07/13. 6 | // Copyright (c) 2013 cloudling. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | #import 11 | 12 | @implementation MAS_VIEW (MASAdditions) 13 | 14 | - (NSArray *)mas_makeConstraints:(void(^)(MASConstraintMaker *))block { 15 | self.translatesAutoresizingMaskIntoConstraints = NO; 16 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 17 | block(constraintMaker); 18 | return [constraintMaker install]; 19 | } 20 | 21 | - (NSArray *)mas_updateConstraints:(void(^)(MASConstraintMaker *))block { 22 | self.translatesAutoresizingMaskIntoConstraints = NO; 23 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 24 | constraintMaker.updateExisting = YES; 25 | block(constraintMaker); 26 | return [constraintMaker install]; 27 | } 28 | 29 | - (NSArray *)mas_remakeConstraints:(void(^)(MASConstraintMaker *make))block { 30 | self.translatesAutoresizingMaskIntoConstraints = NO; 31 | MASConstraintMaker *constraintMaker = [[MASConstraintMaker alloc] initWithView:self]; 32 | constraintMaker.removeExisting = YES; 33 | block(constraintMaker); 34 | return [constraintMaker install]; 35 | } 36 | 37 | #pragma mark - NSLayoutAttribute properties 38 | 39 | - (MASViewAttribute *)mas_left { 40 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeft]; 41 | } 42 | 43 | - (MASViewAttribute *)mas_top { 44 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTop]; 45 | } 46 | 47 | - (MASViewAttribute *)mas_right { 48 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRight]; 49 | } 50 | 51 | - (MASViewAttribute *)mas_bottom { 52 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottom]; 53 | } 54 | 55 | - (MASViewAttribute *)mas_leading { 56 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeading]; 57 | } 58 | 59 | - (MASViewAttribute *)mas_trailing { 60 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailing]; 61 | } 62 | 63 | - (MASViewAttribute *)mas_width { 64 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeWidth]; 65 | } 66 | 67 | - (MASViewAttribute *)mas_height { 68 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeHeight]; 69 | } 70 | 71 | - (MASViewAttribute *)mas_centerX { 72 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterX]; 73 | } 74 | 75 | - (MASViewAttribute *)mas_centerY { 76 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterY]; 77 | } 78 | 79 | - (MASViewAttribute *)mas_baseline { 80 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBaseline]; 81 | } 82 | 83 | - (MASViewAttribute *(^)(NSLayoutAttribute))mas_attribute 84 | { 85 | return ^(NSLayoutAttribute attr) { 86 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:attr]; 87 | }; 88 | } 89 | 90 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 91 | 92 | - (MASViewAttribute *)mas_firstBaseline { 93 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeFirstBaseline]; 94 | } 95 | - (MASViewAttribute *)mas_lastBaseline { 96 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLastBaseline]; 97 | } 98 | 99 | #endif 100 | 101 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 102 | 103 | - (MASViewAttribute *)mas_leftMargin { 104 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeftMargin]; 105 | } 106 | 107 | - (MASViewAttribute *)mas_rightMargin { 108 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeRightMargin]; 109 | } 110 | 111 | - (MASViewAttribute *)mas_topMargin { 112 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTopMargin]; 113 | } 114 | 115 | - (MASViewAttribute *)mas_bottomMargin { 116 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeBottomMargin]; 117 | } 118 | 119 | - (MASViewAttribute *)mas_leadingMargin { 120 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeLeadingMargin]; 121 | } 122 | 123 | - (MASViewAttribute *)mas_trailingMargin { 124 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeTrailingMargin]; 125 | } 126 | 127 | - (MASViewAttribute *)mas_centerXWithinMargins { 128 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterXWithinMargins]; 129 | } 130 | 131 | - (MASViewAttribute *)mas_centerYWithinMargins { 132 | return [[MASViewAttribute alloc] initWithView:self layoutAttribute:NSLayoutAttributeCenterYWithinMargins]; 133 | } 134 | 135 | #endif 136 | 137 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 138 | 139 | - (MASViewAttribute *)mas_safeAreaLayoutGuide { 140 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 141 | } 142 | - (MASViewAttribute *)mas_safeAreaLayoutGuideTop { 143 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 144 | } 145 | - (MASViewAttribute *)mas_safeAreaLayoutGuideBottom { 146 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 147 | } 148 | - (MASViewAttribute *)mas_safeAreaLayoutGuideLeft { 149 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeLeft]; 150 | } 151 | - (MASViewAttribute *)mas_safeAreaLayoutGuideRight { 152 | return [[MASViewAttribute alloc] initWithView:self item:self.safeAreaLayoutGuide layoutAttribute:NSLayoutAttributeRight]; 153 | } 154 | 155 | #endif 156 | 157 | #pragma mark - associated properties 158 | 159 | - (id)mas_key { 160 | return objc_getAssociatedObject(self, @selector(mas_key)); 161 | } 162 | 163 | - (void)setMas_key:(id)key { 164 | objc_setAssociatedObject(self, @selector(mas_key), key, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 165 | } 166 | 167 | #pragma mark - heirachy 168 | 169 | - (instancetype)mas_closestCommonSuperview:(MAS_VIEW *)view { 170 | MAS_VIEW *closestCommonSuperview = nil; 171 | 172 | MAS_VIEW *secondViewSuperview = view; 173 | while (!closestCommonSuperview && secondViewSuperview) { 174 | MAS_VIEW *firstViewSuperview = self; 175 | while (!closestCommonSuperview && firstViewSuperview) { 176 | if (secondViewSuperview == firstViewSuperview) { 177 | closestCommonSuperview = secondViewSuperview; 178 | } 179 | firstViewSuperview = firstViewSuperview.superview; 180 | } 181 | secondViewSuperview = secondViewSuperview.superview; 182 | } 183 | return closestCommonSuperview; 184 | } 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/View+MASShorthandAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+MASShorthandAdditions.h 3 | // Masonry 4 | // 5 | // Created by Jonas Budelmann on 22/07/13. 6 | // Copyright (c) 2013 Jonas Budelmann. All rights reserved. 7 | // 8 | 9 | #import "View+MASAdditions.h" 10 | 11 | #ifdef MAS_SHORTHAND 12 | 13 | /** 14 | * Shorthand view additions without the 'mas_' prefixes, 15 | * only enabled if MAS_SHORTHAND is defined 16 | */ 17 | @interface MAS_VIEW (MASShorthandAdditions) 18 | 19 | @property (nonatomic, strong, readonly) MASViewAttribute *left; 20 | @property (nonatomic, strong, readonly) MASViewAttribute *top; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *right; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *bottom; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *leading; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *trailing; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *width; 26 | @property (nonatomic, strong, readonly) MASViewAttribute *height; 27 | @property (nonatomic, strong, readonly) MASViewAttribute *centerX; 28 | @property (nonatomic, strong, readonly) MASViewAttribute *centerY; 29 | @property (nonatomic, strong, readonly) MASViewAttribute *baseline; 30 | @property (nonatomic, strong, readonly) MASViewAttribute *(^attribute)(NSLayoutAttribute attr); 31 | 32 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 33 | 34 | @property (nonatomic, strong, readonly) MASViewAttribute *firstBaseline; 35 | @property (nonatomic, strong, readonly) MASViewAttribute *lastBaseline; 36 | 37 | #endif 38 | 39 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 40 | 41 | @property (nonatomic, strong, readonly) MASViewAttribute *leftMargin; 42 | @property (nonatomic, strong, readonly) MASViewAttribute *rightMargin; 43 | @property (nonatomic, strong, readonly) MASViewAttribute *topMargin; 44 | @property (nonatomic, strong, readonly) MASViewAttribute *bottomMargin; 45 | @property (nonatomic, strong, readonly) MASViewAttribute *leadingMargin; 46 | @property (nonatomic, strong, readonly) MASViewAttribute *trailingMargin; 47 | @property (nonatomic, strong, readonly) MASViewAttribute *centerXWithinMargins; 48 | @property (nonatomic, strong, readonly) MASViewAttribute *centerYWithinMargins; 49 | 50 | #endif 51 | 52 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 53 | 54 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideTop API_AVAILABLE(ios(11.0),tvos(11.0)); 55 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideBottom API_AVAILABLE(ios(11.0),tvos(11.0)); 56 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideLeft API_AVAILABLE(ios(11.0),tvos(11.0)); 57 | @property (nonatomic, strong, readonly) MASViewAttribute *safeAreaLayoutGuideRight API_AVAILABLE(ios(11.0),tvos(11.0)); 58 | 59 | #endif 60 | 61 | - (NSArray *)makeConstraints:(void(^)(MASConstraintMaker *make))block; 62 | - (NSArray *)updateConstraints:(void(^)(MASConstraintMaker *make))block; 63 | - (NSArray *)remakeConstraints:(void(^)(MASConstraintMaker *make))block; 64 | 65 | @end 66 | 67 | #define MAS_ATTR_FORWARD(attr) \ 68 | - (MASViewAttribute *)attr { \ 69 | return [self mas_##attr]; \ 70 | } 71 | 72 | @implementation MAS_VIEW (MASShorthandAdditions) 73 | 74 | MAS_ATTR_FORWARD(top); 75 | MAS_ATTR_FORWARD(left); 76 | MAS_ATTR_FORWARD(bottom); 77 | MAS_ATTR_FORWARD(right); 78 | MAS_ATTR_FORWARD(leading); 79 | MAS_ATTR_FORWARD(trailing); 80 | MAS_ATTR_FORWARD(width); 81 | MAS_ATTR_FORWARD(height); 82 | MAS_ATTR_FORWARD(centerX); 83 | MAS_ATTR_FORWARD(centerY); 84 | MAS_ATTR_FORWARD(baseline); 85 | 86 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) || (__MAC_OS_X_VERSION_MIN_REQUIRED >= 101100) 87 | 88 | MAS_ATTR_FORWARD(firstBaseline); 89 | MAS_ATTR_FORWARD(lastBaseline); 90 | 91 | #endif 92 | 93 | #if (__IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (__TV_OS_VERSION_MIN_REQUIRED >= 9000) 94 | 95 | MAS_ATTR_FORWARD(leftMargin); 96 | MAS_ATTR_FORWARD(rightMargin); 97 | MAS_ATTR_FORWARD(topMargin); 98 | MAS_ATTR_FORWARD(bottomMargin); 99 | MAS_ATTR_FORWARD(leadingMargin); 100 | MAS_ATTR_FORWARD(trailingMargin); 101 | MAS_ATTR_FORWARD(centerXWithinMargins); 102 | MAS_ATTR_FORWARD(centerYWithinMargins); 103 | 104 | #endif 105 | 106 | #if (__IPHONE_OS_VERSION_MAX_ALLOWED >= 110000) || (__TV_OS_VERSION_MAX_ALLOWED >= 110000) 107 | 108 | MAS_ATTR_FORWARD(safeAreaLayoutGuideTop); 109 | MAS_ATTR_FORWARD(safeAreaLayoutGuideBottom); 110 | MAS_ATTR_FORWARD(safeAreaLayoutGuideLeft); 111 | MAS_ATTR_FORWARD(safeAreaLayoutGuideRight); 112 | 113 | #endif 114 | 115 | - (MASViewAttribute *(^)(NSLayoutAttribute))attribute { 116 | return [self mas_attribute]; 117 | } 118 | 119 | - (NSArray *)makeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 120 | return [self mas_makeConstraints:block]; 121 | } 122 | 123 | - (NSArray *)updateConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 124 | return [self mas_updateConstraints:block]; 125 | } 126 | 127 | - (NSArray *)remakeConstraints:(void(NS_NOESCAPE ^)(MASConstraintMaker *))block { 128 | return [self mas_remakeConstraints:block]; 129 | } 130 | 131 | @end 132 | 133 | #endif 134 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/ViewController+MASAdditions.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.h 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "MASUtilities.h" 10 | #import "MASConstraintMaker.h" 11 | #import "MASViewAttribute.h" 12 | 13 | #ifdef MAS_VIEW_CONTROLLER 14 | 15 | @interface MAS_VIEW_CONTROLLER (MASAdditions) 16 | 17 | /** 18 | * following properties return a new MASViewAttribute with appropriate UILayoutGuide and NSLayoutAttribute 19 | */ 20 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuide; 21 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuide; 22 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideTop; 23 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_topLayoutGuideBottom; 24 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideTop; 25 | @property (nonatomic, strong, readonly) MASViewAttribute *mas_bottomLayoutGuideBottom; 26 | 27 | 28 | @end 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Masonry/Masonry/ViewController+MASAdditions.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+MASAdditions.m 3 | // Masonry 4 | // 5 | // Created by Craig Siemens on 2015-06-23. 6 | // 7 | // 8 | 9 | #import "ViewController+MASAdditions.h" 10 | 11 | #ifdef MAS_VIEW_CONTROLLER 12 | 13 | @implementation MAS_VIEW_CONTROLLER (MASAdditions) 14 | 15 | - (MASViewAttribute *)mas_topLayoutGuide { 16 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 17 | } 18 | - (MASViewAttribute *)mas_topLayoutGuideTop { 19 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 20 | } 21 | - (MASViewAttribute *)mas_topLayoutGuideBottom { 22 | return [[MASViewAttribute alloc] initWithView:self.view item:self.topLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 23 | } 24 | 25 | - (MASViewAttribute *)mas_bottomLayoutGuide { 26 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 27 | } 28 | - (MASViewAttribute *)mas_bottomLayoutGuideTop { 29 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeTop]; 30 | } 31 | - (MASViewAttribute *)mas_bottomLayoutGuideBottom { 32 | return [[MASViewAttribute alloc] initWithView:self.view item:self.bottomLayoutGuide layoutAttribute:NSLayoutAttributeBottom]; 33 | } 34 | 35 | 36 | 37 | @end 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Pods.xcodeproj/xcuserdata/yechen.xcuserdatad/xcschemes/Masonry.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Pods.xcodeproj/xcuserdata/yechen.xcuserdatad/xcschemes/Pods-FWPopupViewOC.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Masonry : NSObject 3 | @end 4 | @implementation PodsDummy_Masonry 5 | @end 6 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | #import "MASCompositeConstraint.h" 14 | #import "MASConstraint+Private.h" 15 | #import "MASConstraint.h" 16 | #import "MASConstraintMaker.h" 17 | #import "MASLayoutConstraint.h" 18 | #import "Masonry.h" 19 | #import "MASUtilities.h" 20 | #import "MASViewAttribute.h" 21 | #import "MASViewConstraint.h" 22 | #import "NSArray+MASAdditions.h" 23 | #import "NSArray+MASShorthandAdditions.h" 24 | #import "NSLayoutConstraint+MASDebugAdditions.h" 25 | #import "View+MASAdditions.h" 26 | #import "View+MASShorthandAdditions.h" 27 | #import "ViewController+MASAdditions.h" 28 | 29 | FOUNDATION_EXPORT double MasonryVersionNumber; 30 | FOUNDATION_EXPORT const unsigned char MasonryVersionString[]; 31 | 32 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry.debug.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry.modulemap: -------------------------------------------------------------------------------- 1 | framework module Masonry { 2 | umbrella header "Masonry-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Masonry/Masonry.release.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/Masonry 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "UIKit" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/Masonry 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## Masonry 5 | 6 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | Generated by CocoaPods - https://cocoapods.org 26 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright (c) 2011-2012 Masonry Team - https://github.com/Masonry 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | License 37 | MIT 38 | Title 39 | Masonry 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | Generated by CocoaPods - https://cocoapods.org 46 | Title 47 | 48 | Type 49 | PSGroupSpecifier 50 | 51 | 52 | StringsTable 53 | Acknowledgements 54 | Title 55 | Acknowledgements 56 | 57 | 58 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_FWPopupViewOC : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_FWPopupViewOC 5 | @end 6 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks-Debug-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks-Debug-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks-Release-input-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${PODS_ROOT}/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks.sh 2 | ${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks-Release-output-files.xcfilelist: -------------------------------------------------------------------------------- 1 | ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-frameworks.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | function on_error { 7 | echo "$(realpath -mq "${0}"):$1: error: Unexpected failure" 8 | } 9 | trap 'on_error $LINENO' ERR 10 | 11 | if [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then 12 | # If FRAMEWORKS_FOLDER_PATH is not set, then there's nowhere for us to copy 13 | # frameworks to, so exit 0 (signalling the script phase was successful). 14 | exit 0 15 | fi 16 | 17 | echo "mkdir -p ${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 18 | mkdir -p "${CONFIGURATION_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 19 | 20 | COCOAPODS_PARALLEL_CODE_SIGN="${COCOAPODS_PARALLEL_CODE_SIGN:-false}" 21 | SWIFT_STDLIB_PATH="${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}" 22 | 23 | # Used as a return value for each invocation of `strip_invalid_archs` function. 24 | STRIP_BINARY_RETVAL=0 25 | 26 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 27 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 28 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 29 | 30 | # Copies and strips a vendored framework 31 | install_framework() 32 | { 33 | if [ -r "${BUILT_PRODUCTS_DIR}/$1" ]; then 34 | local source="${BUILT_PRODUCTS_DIR}/$1" 35 | elif [ -r "${BUILT_PRODUCTS_DIR}/$(basename "$1")" ]; then 36 | local source="${BUILT_PRODUCTS_DIR}/$(basename "$1")" 37 | elif [ -r "$1" ]; then 38 | local source="$1" 39 | fi 40 | 41 | local destination="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 42 | 43 | if [ -L "${source}" ]; then 44 | echo "Symlinked..." 45 | source="$(readlink "${source}")" 46 | fi 47 | 48 | # Use filter instead of exclude so missing patterns don't throw errors. 49 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${destination}\"" 50 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${destination}" 51 | 52 | local basename 53 | basename="$(basename -s .framework "$1")" 54 | binary="${destination}/${basename}.framework/${basename}" 55 | 56 | if ! [ -r "$binary" ]; then 57 | binary="${destination}/${basename}" 58 | elif [ -L "${binary}" ]; then 59 | echo "Destination binary is symlinked..." 60 | dirname="$(dirname "${binary}")" 61 | binary="${dirname}/$(readlink "${binary}")" 62 | fi 63 | 64 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 65 | if [[ "$(file "$binary")" == *"dynamically linked shared library"* ]]; then 66 | strip_invalid_archs "$binary" 67 | fi 68 | 69 | # Resign the code if required by the build settings to avoid unstable apps 70 | code_sign_if_enabled "${destination}/$(basename "$1")" 71 | 72 | # Embed linked Swift runtime libraries. No longer necessary as of Xcode 7. 73 | if [ "${XCODE_VERSION_MAJOR}" -lt 7 ]; then 74 | local swift_runtime_libs 75 | swift_runtime_libs=$(xcrun otool -LX "$binary" | grep --color=never @rpath/libswift | sed -E s/@rpath\\/\(.+dylib\).*/\\1/g | uniq -u) 76 | for lib in $swift_runtime_libs; do 77 | echo "rsync -auv \"${SWIFT_STDLIB_PATH}/${lib}\" \"${destination}\"" 78 | rsync -auv "${SWIFT_STDLIB_PATH}/${lib}" "${destination}" 79 | code_sign_if_enabled "${destination}/${lib}" 80 | done 81 | fi 82 | } 83 | 84 | # Copies and strips a vendored dSYM 85 | install_dsym() { 86 | local source="$1" 87 | warn_missing_arch=${2:-true} 88 | if [ -r "$source" ]; then 89 | # Copy the dSYM into the targets temp dir. 90 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${source}\" \"${DERIVED_FILES_DIR}\"" 91 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${source}" "${DERIVED_FILES_DIR}" 92 | 93 | local basename 94 | basename="$(basename -s .dSYM "$source")" 95 | binary_name="$(ls "$source/Contents/Resources/DWARF")" 96 | binary="${DERIVED_FILES_DIR}/${basename}.dSYM/Contents/Resources/DWARF/${binary_name}" 97 | 98 | # Strip invalid architectures so "fat" simulator / device frameworks work on device 99 | if [[ "$(file "$binary")" == *"Mach-O "*"dSYM companion"* ]]; then 100 | strip_invalid_archs "$binary" "$warn_missing_arch" 101 | fi 102 | 103 | if [[ $STRIP_BINARY_RETVAL == 1 ]]; then 104 | # Move the stripped file into its final destination. 105 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter \"- CVS/\" --filter \"- .svn/\" --filter \"- .git/\" --filter \"- .hg/\" --filter \"- Headers\" --filter \"- PrivateHeaders\" --filter \"- Modules\" \"${DERIVED_FILES_DIR}/${basename}.framework.dSYM\" \"${DWARF_DSYM_FOLDER_PATH}\"" 106 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --links --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${DERIVED_FILES_DIR}/${basename}.dSYM" "${DWARF_DSYM_FOLDER_PATH}" 107 | else 108 | # The dSYM was not stripped at all, in this case touch a fake folder so the input/output paths from Xcode do not reexecute this script because the file is missing. 109 | touch "${DWARF_DSYM_FOLDER_PATH}/${basename}.dSYM" 110 | fi 111 | fi 112 | } 113 | 114 | # Copies the bcsymbolmap files of a vendored framework 115 | install_bcsymbolmap() { 116 | local bcsymbolmap_path="$1" 117 | local destination="${BUILT_PRODUCTS_DIR}" 118 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}"" 119 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" --filter "- CVS/" --filter "- .svn/" --filter "- .git/" --filter "- .hg/" --filter "- Headers" --filter "- PrivateHeaders" --filter "- Modules" "${bcsymbolmap_path}" "${destination}" 120 | } 121 | 122 | # Signs a framework with the provided identity 123 | code_sign_if_enabled() { 124 | if [ -n "${EXPANDED_CODE_SIGN_IDENTITY:-}" -a "${CODE_SIGNING_REQUIRED:-}" != "NO" -a "${CODE_SIGNING_ALLOWED}" != "NO" ]; then 125 | # Use the current code_sign_identity 126 | echo "Code Signing $1 with Identity ${EXPANDED_CODE_SIGN_IDENTITY_NAME}" 127 | local code_sign_cmd="/usr/bin/codesign --force --sign ${EXPANDED_CODE_SIGN_IDENTITY} ${OTHER_CODE_SIGN_FLAGS:-} --preserve-metadata=identifier,entitlements '$1'" 128 | 129 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 130 | code_sign_cmd="$code_sign_cmd &" 131 | fi 132 | echo "$code_sign_cmd" 133 | eval "$code_sign_cmd" 134 | fi 135 | } 136 | 137 | # Strip invalid architectures 138 | strip_invalid_archs() { 139 | binary="$1" 140 | warn_missing_arch=${2:-true} 141 | # Get architectures for current target binary 142 | binary_archs="$(lipo -info "$binary" | rev | cut -d ':' -f1 | awk '{$1=$1;print}' | rev)" 143 | # Intersect them with the architectures we are building for 144 | intersected_archs="$(echo ${ARCHS[@]} ${binary_archs[@]} | tr ' ' '\n' | sort | uniq -d)" 145 | # If there are no archs supported by this binary then warn the user 146 | if [[ -z "$intersected_archs" ]]; then 147 | if [[ "$warn_missing_arch" == "true" ]]; then 148 | echo "warning: [CP] Vendored binary '$binary' contains architectures ($binary_archs) none of which match the current build architectures ($ARCHS)." 149 | fi 150 | STRIP_BINARY_RETVAL=0 151 | return 152 | fi 153 | stripped="" 154 | for arch in $binary_archs; do 155 | if ! [[ "${ARCHS}" == *"$arch"* ]]; then 156 | # Strip non-valid architectures in-place 157 | lipo -remove "$arch" -output "$binary" "$binary" 158 | stripped="$stripped $arch" 159 | fi 160 | done 161 | if [[ "$stripped" ]]; then 162 | echo "Stripped $binary of architectures:$stripped" 163 | fi 164 | STRIP_BINARY_RETVAL=1 165 | } 166 | 167 | install_artifact() { 168 | artifact="$1" 169 | base="$(basename "$artifact")" 170 | case $base in 171 | *.framework) 172 | install_framework "$artifact" 173 | ;; 174 | *.dSYM) 175 | # Suppress arch warnings since XCFrameworks will include many dSYM files 176 | install_dsym "$artifact" "false" 177 | ;; 178 | *.bcsymbolmap) 179 | install_bcsymbolmap "$artifact" 180 | ;; 181 | *) 182 | echo "error: Unrecognized artifact "$artifact"" 183 | ;; 184 | esac 185 | } 186 | 187 | copy_artifacts() { 188 | file_list="$1" 189 | while read artifact; do 190 | install_artifact "$artifact" 191 | done <$file_list 192 | } 193 | 194 | ARTIFACT_LIST_FILE="${BUILT_PRODUCTS_DIR}/cocoapods-artifacts-${CONFIGURATION}.txt" 195 | if [ -r "${ARTIFACT_LIST_FILE}" ]; then 196 | copy_artifacts "${ARTIFACT_LIST_FILE}" 197 | fi 198 | 199 | if [[ "$CONFIGURATION" == "Debug" ]]; then 200 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework" 201 | fi 202 | if [[ "$CONFIGURATION" == "Release" ]]; then 203 | install_framework "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework" 204 | fi 205 | if [ "${COCOAPODS_PARALLEL_CODE_SIGN}" == "true" ]; then 206 | wait 207 | fi 208 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-resources.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | set -u 4 | set -o pipefail 5 | 6 | if [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then 7 | # If UNLOCALIZED_RESOURCES_FOLDER_PATH is not set, then there's nowhere for us to copy 8 | # resources to, so exit 0 (signalling the script phase was successful). 9 | exit 0 10 | fi 11 | 12 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 13 | 14 | RESOURCES_TO_COPY=${PODS_ROOT}/resources-to-copy-${TARGETNAME}.txt 15 | > "$RESOURCES_TO_COPY" 16 | 17 | XCASSET_FILES=() 18 | 19 | # This protects against multiple targets copying the same framework dependency at the same time. The solution 20 | # was originally proposed here: https://lists.samba.org/archive/rsync/2008-February/020158.html 21 | RSYNC_PROTECT_TMP_FILES=(--filter "P .*.??????") 22 | 23 | case "${TARGETED_DEVICE_FAMILY:-}" in 24 | 1,2) 25 | TARGET_DEVICE_ARGS="--target-device ipad --target-device iphone" 26 | ;; 27 | 1) 28 | TARGET_DEVICE_ARGS="--target-device iphone" 29 | ;; 30 | 2) 31 | TARGET_DEVICE_ARGS="--target-device ipad" 32 | ;; 33 | 3) 34 | TARGET_DEVICE_ARGS="--target-device tv" 35 | ;; 36 | 4) 37 | TARGET_DEVICE_ARGS="--target-device watch" 38 | ;; 39 | *) 40 | TARGET_DEVICE_ARGS="--target-device mac" 41 | ;; 42 | esac 43 | 44 | install_resource() 45 | { 46 | if [[ "$1" = /* ]] ; then 47 | RESOURCE_PATH="$1" 48 | else 49 | RESOURCE_PATH="${PODS_ROOT}/$1" 50 | fi 51 | if [[ ! -e "$RESOURCE_PATH" ]] ; then 52 | cat << EOM 53 | error: Resource "$RESOURCE_PATH" not found. Run 'pod install' to update the copy resources script. 54 | EOM 55 | exit 1 56 | fi 57 | case $RESOURCE_PATH in 58 | *.storyboard) 59 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 60 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 61 | ;; 62 | *.xib) 63 | echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}" || true 64 | ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \"$RESOURCE_PATH\" .xib`.nib" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS} 65 | ;; 66 | *.framework) 67 | echo "mkdir -p ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 68 | mkdir -p "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 69 | echo "rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" $RESOURCE_PATH ${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" || true 70 | rsync --delete -av "${RSYNC_PROTECT_TMP_FILES[@]}" "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" 71 | ;; 72 | *.xcdatamodel) 73 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH"`.mom\"" || true 74 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodel`.mom" 75 | ;; 76 | *.xcdatamodeld) 77 | echo "xcrun momc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd\"" || true 78 | xcrun momc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcdatamodeld`.momd" 79 | ;; 80 | *.xcmappingmodel) 81 | echo "xcrun mapc \"$RESOURCE_PATH\" \"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm\"" || true 82 | xcrun mapc "$RESOURCE_PATH" "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename "$RESOURCE_PATH" .xcmappingmodel`.cdm" 83 | ;; 84 | *.xcassets) 85 | ABSOLUTE_XCASSET_FILE="$RESOURCE_PATH" 86 | XCASSET_FILES+=("$ABSOLUTE_XCASSET_FILE") 87 | ;; 88 | *) 89 | echo "$RESOURCE_PATH" || true 90 | echo "$RESOURCE_PATH" >> "$RESOURCES_TO_COPY" 91 | ;; 92 | esac 93 | } 94 | 95 | mkdir -p "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 96 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 97 | if [[ "${ACTION}" == "install" ]] && [[ "${SKIP_INSTALL}" == "NO" ]]; then 98 | mkdir -p "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 99 | rsync -avr --copy-links --no-relative --exclude '*/.svn/*' --files-from="$RESOURCES_TO_COPY" / "${INSTALL_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 100 | fi 101 | rm -f "$RESOURCES_TO_COPY" 102 | 103 | if [[ -n "${WRAPPER_EXTENSION}" ]] && [ "`xcrun --find actool`" ] && [ -n "${XCASSET_FILES:-}" ] 104 | then 105 | # Find all other xcassets (this unfortunately includes those of path pods and other targets). 106 | OTHER_XCASSETS=$(find "$PWD" -iname "*.xcassets" -type d) 107 | while read line; do 108 | if [[ $line != "${PODS_ROOT}*" ]]; then 109 | XCASSET_FILES+=("$line") 110 | fi 111 | done <<<"$OTHER_XCASSETS" 112 | 113 | if [ -z ${ASSETCATALOG_COMPILER_APPICON_NAME+x} ]; then 114 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" 115 | else 116 | printf "%s\0" "${XCASSET_FILES[@]}" | xargs -0 xcrun actool --output-format human-readable-text --notices --warnings --platform "${PLATFORM_NAME}" --minimum-deployment-target "${!DEPLOYMENT_TARGET_SETTING_NAME}" ${TARGET_DEVICE_ARGS} --compress-pngs --compile "${BUILT_PRODUCTS_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}" --app-icon "${ASSETCATALOG_COMPILER_APPICON_NAME}" --output-partial-info-plist "${TARGET_BUILD_DIR}/assetcatalog_generated_info.plist" 117 | fi 118 | fi 119 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC-umbrella.h: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | 14 | FOUNDATION_EXPORT double Pods_FWPopupViewOCVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_FWPopupViewOCVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC.debug.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "Masonry" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_FWPopupViewOC { 2 | umbrella header "Pods-FWPopupViewOC-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /FWPopupViewOCDemo/Pods/Target Support Files/Pods-FWPopupViewOC/Pods-FWPopupViewOC.release.xcconfig: -------------------------------------------------------------------------------- 1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry" 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/Masonry/Masonry.framework/Headers" 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_LDFLAGS = $(inherited) -framework "Foundation" -framework "Masonry" -framework "UIKit" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES = YES 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IOS之弹窗 -- OC/[Swift4.x](https://github.com/choiceyou/FWPopupView) 2 | 3 | [![Platform](http://img.shields.io/badge/platform-iOS-blue.svg?style=flat)](http://cocoapods.org/?q=FWPopupView)  4 | ![Language](https://img.shields.io/badge/language-swift-orange.svg?style=flat)  5 | [![License](http://img.shields.io/badge/license-MIT-green.svg?style=flat)](https://github.com/choiceyou/FWPopupView/blob/master/FWPopupView/LICENSE) 6 | 7 | 8 | 9 | ## 温馨提示: 10 | ```cocoaPods 11 | 1、同一窗口内目前只支持弹窗一个弹窗,如果需要同时展示两个弹窗,建议与系统或者其他自定义弹窗配合使用; 12 | 2、如需两个弹窗接连使用,请保证第一个弹窗完全消失再调用第二个弹窗; 13 | 3、鉴于方法或者属性可能跟着版本改动,因此强烈建议使用该库时封装一层后再使用; 14 | 4、如需在弹窗上展示SVProgressHUD,可设置:[SVProgressHUD setMaxSupportedWindowLevel:UIWindowLevelStatusBar+1]; 15 | ``` 16 | 17 | 18 | 19 | ## 支持pod导入: 20 | 21 | ```cocoaPods 22 | pod 'FWPopupViewOC' 23 | 注意:如出现 [!] Unable to find a specification for 'FWPopupViewOC' 错误,可执行 pod repo update 命令。 24 | ``` 25 | 26 | 27 | 28 | 29 | ## 简单使用: 30 | 31 | ### OC:
32 | ```oc 33 | 只需要继承FWPopupBaseView: 34 | 35 | @interface FWCustomView : FWPopupBaseView 36 | @end 37 | 38 | ``` 39 | 40 | 41 | 42 | ## 可设置参数: 43 | ```参数 44 | /** 45 | 标题字体大小 46 | */ 47 | @property (nonatomic, assign) CGFloat titleFontSize; 48 | /** 49 | 标题文字颜色 50 | */ 51 | @property (nonatomic, strong) UIColor *titleColor; 52 | 53 | /** 54 | 按钮字体大小 55 | */ 56 | @property (nonatomic, assign) CGFloat buttonFontSize; 57 | /** 58 | 按钮高度 59 | */ 60 | @property (nonatomic, assign) CGFloat buttonHeight; 61 | /** 62 | 普通按钮文字颜色 63 | */ 64 | @property (nonatomic, strong) UIColor *itemNormalColor; 65 | /** 66 | 高亮按钮文字颜色 67 | */ 68 | @property (nonatomic, strong) UIColor *itemHighlightColor; 69 | /** 70 | 选中按钮文字颜色 71 | */ 72 | @property (nonatomic, strong) UIColor *itemPressedColor; 73 | 74 | /** 75 | 上下间距 76 | */ 77 | @property (nonatomic, assign) CGFloat topBottomMargin; 78 | /** 79 | 左右间距 80 | */ 81 | @property (nonatomic, assign) CGFloat letfRigthMargin; 82 | /** 83 | 控件之间的间距 84 | */ 85 | @property (nonatomic, assign) CGFloat commponentMargin; 86 | 87 | /** 88 | 边框、分割线颜色 89 | */ 90 | @property (nonatomic, strong) UIColor *splitColor; 91 | /** 92 | 边框宽度 93 | */ 94 | @property (nonatomic, assign) CGFloat splitWidth; 95 | /** 96 | 圆角值 97 | */ 98 | @property (nonatomic, assign) CGFloat cornerRadius; 99 | 100 | /** 101 | 弹窗的背景色(注意:这边指的是弹窗而不是遮罩层,遮罩层背景色的设置是:fwMaskViewColor) 102 | */ 103 | @property (nonatomic, strong) UIColor *backgroundColor; 104 | /** 105 | 弹窗的最大高度,0:表示不限制 106 | */ 107 | @property (nonatomic, assign) CGFloat popupViewMaxHeight; 108 | 109 | /** 110 | 弹窗箭头的样式 111 | */ 112 | @property (nonatomic, assign) FWPopupArrowStyle popupArrowStyle; 113 | /** 114 | 弹窗箭头的尺寸 115 | */ 116 | @property (nonatomic, assign) CGSize popupArrowSize; 117 | /** 118 | 弹窗箭头的顶点的X值相对于弹窗的宽度,默认在弹窗X轴的一半,因此设置范围:0~1 119 | */ 120 | @property (nonatomic, assign) CGFloat popupArrowVertexScaleX; 121 | /** 122 | 弹窗圆角箭头的圆角值 123 | */ 124 | @property (nonatomic, assign) CGFloat popupArrowCornerRadius; 125 | /** 126 | 弹窗圆角箭头与边线交汇处的圆角值 127 | */ 128 | @property (nonatomic, assign) CGFloat popupArrowBottomCornerRadius; 129 | 130 | 131 | // ===== 自定义弹窗(继承FWPopupView)时可能会用到 ===== 132 | 133 | /** 134 | 弹窗校准位置 135 | */ 136 | @property (nonatomic, assign) FWPopupAlignment popupAlignment; 137 | /** 138 | 弹窗动画类型 139 | */ 140 | @property (nonatomic, assign) FWPopupAnimationStyle popupAnimationStyle; 141 | 142 | /** 143 | 弹窗偏移量 144 | */ 145 | @property (nonatomic, assign) UIEdgeInsets popupEdgeInsets; 146 | /** 147 | 遮罩层的背景色(也可以使用fwMaskViewColor),注意:该参数在弹窗隐藏后,还原为弹窗弹起时的值 148 | */ 149 | @property (nonatomic, strong) UIColor *maskViewColor; 150 | 151 | /** 152 | 0表示NO,1表示YES,YES:用户点击外部遮罩层页面可以消失,注意:该参数在弹窗隐藏后,还原为弹窗弹起时的值 153 | */ 154 | @property (nonatomic, copy) NSString *touchWildToHide; 155 | 156 | /** 157 | 显示、隐藏动画所需的时间 158 | */ 159 | @property (nonatomic, assign) NSTimeInterval animationDuration; 160 | 161 | /** 162 | 3D放射动画(当且仅当:popupAnimationStyle == .scale3D 时有效) 163 | */ 164 | @property (nonatomic, assign) CATransform3D transform3D; 165 | /** 166 | 2D放射动画 167 | */ 168 | @property (nonatomic, assign) CGAffineTransform transform; 169 | ``` 170 | 171 | 172 | 173 | ## 效果: 174 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/%E6%95%88%E6%9E%9C1.gif) 175 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/%E6%95%88%E6%9E%9C3.gif) 176 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/%E6%95%88%E6%9E%9C2.gif) 177 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/IMG_0724.PNG) 178 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/IMG_01.png) 179 | ![](https://github.com/choiceyou/FWPopupViewOC/blob/master/%E6%95%88%E6%9E%9C/IMG_02.png) 180 | 181 | 182 | 183 | ## 更新记录: 184 | 185 | • v2.1.0: 186 | - [x] 弹窗基类(FWPopupBaseView)中增加让多余部分的遮罩层变为无色属性:shouldClearSpilthMask; 187 | - [x] 新增新手引导弹窗:FWGuideMaskView; 188 | 189 | • v2.1.1: 190 | - [x] 新增拖动关闭的弹窗基类:FWPanPopupView; 191 | 192 | • v2.1.2: 193 | - [x] 修复点击非遮罩层视图会显示的问题; 194 | 195 | • v2.1.3: 196 | - [x] 修复弹窗为成员变量时,再次调起弹窗后位置发生变化的问题; 197 | 198 | • v2.1.4: 199 | - [x] 增加:保证前一次弹窗销毁的处理机制; 200 | 201 | • v2.1.5: 202 | - [x] 修复弹窗消失时内存泄漏问题; 203 | 204 | • v2.1.6: 205 | - [x] 修复xib加载View方式时,继承弹窗基类FWPopupBaseView崩溃问题; 206 | 207 | • v2.1.9: 208 | - [x] 添加弹窗状态:FWPopupState; 209 | - [x] 根据状态对应的进行回调,这样子可以根据实际使用来回调,废除原:showWithBlock 和 hideWithBlock 方法,新增:showWithDidAppearBlock、showWithStateBlock、hideWithDidDisappearBlock 方法; 210 | 211 | • v3.0.0(大版本): 212 | - [x] 使用Masonry库重构了弹窗基类及部分弹窗视图; 213 | - [x] 支持横竖屏切换(注意:shouldClearSpilthMask属性为YES时不支持横竖屏切换,会出现视图显示的问题); 214 | - [x] 支持多个弹窗存在(详细请查看:同时显示两个弹窗的演示); 215 | 216 | • v3.0.1: 217 | - [x] 解决app进入后台时隐藏弹窗可能出现界面卡死问题; 218 | - [x] 解决多次调用显示、隐藏的安全判断(会导致约束出错问题); 219 | - [x] 增加hiddenViews添加视图的条件判断,解决某些视图已经创建了,但还未显示过一次依然会加入hiddenViews的问题; 220 | 221 | • v3.0.3: 222 | - [x] 支持重新设置弹窗视图size; 223 | - [x] 添加两种弹窗状态:FWPopupStateDidAppearButCovered、FWPopupStateDidAppearAgain; 224 | 225 | • v3.0.4: 226 | - [x] 解决多个弹窗同时存在时,最后一个弹窗可能无法外部点击的问题; 227 | 228 | • v3.0.5: 229 | - [x] 解决(View controller-based status bar appearance = "YES")状态栏隐藏的情况下,弹窗时会显示出状态栏的问题; 230 | 231 | 232 | ## 结尾语: 233 | 234 | - 使用过程中发现bug请issues或加入FW问题反馈群:670698309(此群只接受FW相关组件问题); 235 | - 有新的需求欢迎提出; 236 | -------------------------------------------------------------------------------- /效果/IMG_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/IMG_01.png -------------------------------------------------------------------------------- /效果/IMG_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/IMG_02.png -------------------------------------------------------------------------------- /效果/IMG_0724.PNG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/IMG_0724.PNG -------------------------------------------------------------------------------- /效果/效果1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/效果1.gif -------------------------------------------------------------------------------- /效果/效果2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/效果2.gif -------------------------------------------------------------------------------- /效果/效果3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/choiceyou/FWPopupViewOC/a2a96ce407d4ee73efc323859e459021585fd577/效果/效果3.gif --------------------------------------------------------------------------------