├── .gitignore ├── .travis.yml ├── Example ├── Podfile ├── PopupsManager.xcodeproj │ ├── project.pbxproj │ └── xcshareddata │ │ └── xcschemes │ │ └── PopupsManager-Example.xcscheme ├── PopupsManager.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── PopupsManager │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── BottomPopView.h │ ├── BottomPopView.m │ ├── CenterPopView.h │ ├── CenterPopView.m │ ├── FullPopView.h │ ├── FullPopView.m │ ├── HLLAppDelegate.h │ ├── HLLAppDelegate.m │ ├── HLLShowViewController.h │ ├── HLLShowViewController.m │ ├── HLLViewController.h │ ├── HLLViewController.m │ ├── Images.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ ├── Contents.json │ │ ├── FullAdver.imageset │ │ │ ├── Contents.json │ │ │ └── Simulator Screen Shot - iPhone 13 Pro - 2023-02-10 at 15.11.50.png │ │ ├── bottom.imageset │ │ │ ├── Contents.json │ │ │ └── 底部弹窗.jpg │ │ ├── bottomShare.imageset │ │ │ ├── Contents.json │ │ │ └── bottomShare.jpg │ │ ├── center.imageset │ │ │ ├── Contents.json │ │ │ └── 居中弹窗.jpg │ │ ├── newVersion.imageset │ │ │ ├── Contents.json │ │ │ └── 新版本升级.jpg │ │ └── topbar.imageset │ │ │ ├── Contents.json │ │ │ └── topbar.jpg │ ├── KeyboardPopView.h │ ├── KeyboardPopView.m │ ├── PopupsManager-Info.plist │ ├── PopupsManager-Prefix.pch │ ├── TopBarPopView.h │ ├── TopBarPopView.m │ ├── en.lproj │ │ └── InfoPlist.strings │ └── main.m └── Tests │ ├── Tests-Info.plist │ ├── Tests-Prefix.pch │ ├── Tests.m │ └── en.lproj │ └── InfoPlist.strings ├── LICENSE ├── PopupsManager.podspec ├── PopupsManager ├── Assets │ └── .gitkeep └── Classes │ ├── .gitkeep │ ├── HLLPopupConfigure.h │ ├── HLLPopupConfigure.m │ ├── HLLPopupInterface.h │ ├── HLLPopupsManager.h │ └── HLLPopupsManager.m ├── README.md ├── README_CN.md ├── _Pods.xcodeproj └── image ├── 2.mov ├── title.png └── 演示.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # macOS 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | *.moved-aside 17 | DerivedData 18 | *.hmap 19 | *.ipa 20 | 21 | # Bundler 22 | .bundle 23 | 24 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 25 | # Carthage/Checkouts 26 | 27 | Carthage/Build 28 | 29 | # We recommend against adding the Pods directory to your .gitignore. However 30 | # you should judge for yourself, the pros and cons are mentioned at: 31 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 32 | # 33 | # Note: if you ignore the Pods directory, make sure to uncomment 34 | # `pod install` in .travis.yml 35 | # 36 | # Pods/ 37 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/PopupsManager.xcworkspace -scheme PopupsManager-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | platform :ios, '10.0' 4 | 5 | target 'PopupsManager_Example' do 6 | 7 | #开发库 8 | pod 'PopupsManager', :path => '../' 9 | 10 | #debug demo import 11 | pod 'Masonry' 12 | pod 'LookinServer', :configurations => ['Debug'] 13 | 14 | target 'PopupsManager_Tests' do 15 | inherit! :search_paths 16 | 17 | pod 'FBSnapshotTestCase' 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /Example/PopupsManager.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 016E70A529D3DBAE00610C88 /* HLLShowViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70A429D3DBAE00610C88 /* HLLShowViewController.m */; }; 11 | 016E70A929D3DF3B00610C88 /* CenterPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70A829D3DF3B00610C88 /* CenterPopView.m */; }; 12 | 016E70AC29D3DF7900610C88 /* BottomPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70AB29D3DF7900610C88 /* BottomPopView.m */; }; 13 | 016E70AF29D3DF9200610C88 /* FullPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70AE29D3DF9200610C88 /* FullPopView.m */; }; 14 | 016E70B229D3E00B00610C88 /* TopBarPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70B129D3E00B00610C88 /* TopBarPopView.m */; }; 15 | 016E70B529D45A4D00610C88 /* KeyboardPopView.m in Sources */ = {isa = PBXBuildFile; fileRef = 016E70B429D45A4D00610C88 /* KeyboardPopView.m */; }; 16 | 314F95493AD404B0E0E8F9BD /* Pods_PopupsManager_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BEF91858BA48788F264090C /* Pods_PopupsManager_Tests.framework */; }; 17 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 18 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58F195388D20070C39A /* CoreGraphics.framework */; }; 19 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 20 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; }; 21 | 6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; }; 22 | 6003F59E195388D20070C39A /* HLLAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* HLLAppDelegate.m */; }; 23 | 6003F5A7195388D20070C39A /* HLLViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* HLLViewController.m */; }; 24 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; }; 25 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; }; 26 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; }; 27 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F591195388D20070C39A /* UIKit.framework */; }; 28 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5B8195388D20070C39A /* InfoPlist.strings */; }; 29 | 6003F5BC195388D20070C39A /* Tests.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5BB195388D20070C39A /* Tests.m */; }; 30 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */; }; 31 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */; }; 32 | 9EF3166B55C01496025B8C2D /* Pods_PopupsManager_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 00EC7022F47EDBECDD17E7CA /* Pods_PopupsManager_Example.framework */; }; 33 | /* End PBXBuildFile section */ 34 | 35 | /* Begin PBXContainerItemProxy section */ 36 | 6003F5B3195388D20070C39A /* PBXContainerItemProxy */ = { 37 | isa = PBXContainerItemProxy; 38 | containerPortal = 6003F582195388D10070C39A /* Project object */; 39 | proxyType = 1; 40 | remoteGlobalIDString = 6003F589195388D20070C39A; 41 | remoteInfo = PopupsManager; 42 | }; 43 | /* End PBXContainerItemProxy section */ 44 | 45 | /* Begin PBXFileReference section */ 46 | 00EC7022F47EDBECDD17E7CA /* Pods_PopupsManager_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PopupsManager_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 47 | 016E70A329D3DBAE00610C88 /* HLLShowViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HLLShowViewController.h; sourceTree = ""; }; 48 | 016E70A429D3DBAE00610C88 /* HLLShowViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HLLShowViewController.m; sourceTree = ""; }; 49 | 016E70A729D3DF3B00610C88 /* CenterPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CenterPopView.h; sourceTree = ""; }; 50 | 016E70A829D3DF3B00610C88 /* CenterPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CenterPopView.m; sourceTree = ""; }; 51 | 016E70AA29D3DF7900610C88 /* BottomPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BottomPopView.h; sourceTree = ""; }; 52 | 016E70AB29D3DF7900610C88 /* BottomPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = BottomPopView.m; sourceTree = ""; }; 53 | 016E70AD29D3DF9200610C88 /* FullPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FullPopView.h; sourceTree = ""; }; 54 | 016E70AE29D3DF9200610C88 /* FullPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FullPopView.m; sourceTree = ""; }; 55 | 016E70B029D3E00B00610C88 /* TopBarPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TopBarPopView.h; sourceTree = ""; }; 56 | 016E70B129D3E00B00610C88 /* TopBarPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = TopBarPopView.m; sourceTree = ""; }; 57 | 016E70B329D45A4D00610C88 /* KeyboardPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = KeyboardPopView.h; sourceTree = ""; }; 58 | 016E70B429D45A4D00610C88 /* KeyboardPopView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = KeyboardPopView.m; sourceTree = ""; }; 59 | 2236CDBCDF7234880978FE2B /* Pods-PopupsManager_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupsManager_Example.release.xcconfig"; path = "Target Support Files/Pods-PopupsManager_Example/Pods-PopupsManager_Example.release.xcconfig"; sourceTree = ""; }; 60 | 24CD610D784A26C3E243B8B0 /* PopupsManager.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = PopupsManager.podspec; path = ../PopupsManager.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 61 | 2ECAF141FA1F1403B64DF396 /* Pods-PopupsManager_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupsManager_Example.debug.xcconfig"; path = "Target Support Files/Pods-PopupsManager_Example/Pods-PopupsManager_Example.debug.xcconfig"; sourceTree = ""; }; 62 | 3FA9DCF9682A5946D914A0AF /* Pods-PopupsManager_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupsManager_Tests.release.xcconfig"; path = "Target Support Files/Pods-PopupsManager_Tests/Pods-PopupsManager_Tests.release.xcconfig"; sourceTree = ""; }; 63 | 4BEF91858BA48788F264090C /* Pods_PopupsManager_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_PopupsManager_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | 4EC0404C8569A7FF9644F021 /* Pods-PopupsManager_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-PopupsManager_Tests.debug.xcconfig"; path = "Target Support Files/Pods-PopupsManager_Tests/Pods-PopupsManager_Tests.debug.xcconfig"; sourceTree = ""; }; 65 | 6003F58A195388D20070C39A /* PopupsManager_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PopupsManager_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 66 | 6003F58D195388D20070C39A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 67 | 6003F58F195388D20070C39A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 68 | 6003F591195388D20070C39A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 69 | 6003F595195388D20070C39A /* PopupsManager-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PopupsManager-Info.plist"; sourceTree = ""; }; 70 | 6003F597195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 71 | 6003F599195388D20070C39A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 72 | 6003F59B195388D20070C39A /* PopupsManager-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PopupsManager-Prefix.pch"; sourceTree = ""; }; 73 | 6003F59C195388D20070C39A /* HLLAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HLLAppDelegate.h; sourceTree = ""; }; 74 | 6003F59D195388D20070C39A /* HLLAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HLLAppDelegate.m; sourceTree = ""; }; 75 | 6003F5A5195388D20070C39A /* HLLViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HLLViewController.h; sourceTree = ""; }; 76 | 6003F5A6195388D20070C39A /* HLLViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HLLViewController.m; sourceTree = ""; }; 77 | 6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 78 | 6003F5AE195388D20070C39A /* PopupsManager_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = PopupsManager_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 79 | 6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 80 | 6003F5B7195388D20070C39A /* Tests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "Tests-Info.plist"; sourceTree = ""; }; 81 | 6003F5B9195388D20070C39A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 82 | 6003F5BB195388D20070C39A /* Tests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Tests.m; sourceTree = ""; }; 83 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Tests-Prefix.pch"; sourceTree = ""; }; 84 | 71719F9E1E33DC2100824A3D /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 85 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; name = Main.storyboard; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 86 | 921B288CD1D035A76F6D578F /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 87 | CD986AB75347E96FCD7EB680 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 88 | /* End PBXFileReference section */ 89 | 90 | /* Begin PBXFrameworksBuildPhase section */ 91 | 6003F587195388D20070C39A /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | 6003F590195388D20070C39A /* CoreGraphics.framework in Frameworks */, 96 | 6003F592195388D20070C39A /* UIKit.framework in Frameworks */, 97 | 6003F58E195388D20070C39A /* Foundation.framework in Frameworks */, 98 | 9EF3166B55C01496025B8C2D /* Pods_PopupsManager_Example.framework in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | 6003F5AB195388D20070C39A /* Frameworks */ = { 103 | isa = PBXFrameworksBuildPhase; 104 | buildActionMask = 2147483647; 105 | files = ( 106 | 6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */, 107 | 6003F5B2195388D20070C39A /* UIKit.framework in Frameworks */, 108 | 6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */, 109 | 314F95493AD404B0E0E8F9BD /* Pods_PopupsManager_Tests.framework in Frameworks */, 110 | ); 111 | runOnlyForDeploymentPostprocessing = 0; 112 | }; 113 | /* End PBXFrameworksBuildPhase section */ 114 | 115 | /* Begin PBXGroup section */ 116 | 0167C1462996202F00F5458F /* ExampleVC */ = { 117 | isa = PBXGroup; 118 | children = ( 119 | 016E70A329D3DBAE00610C88 /* HLLShowViewController.h */, 120 | 016E70A429D3DBAE00610C88 /* HLLShowViewController.m */, 121 | 016E70A629D3DF1100610C88 /* CustomPopView */, 122 | ); 123 | name = ExampleVC; 124 | sourceTree = ""; 125 | }; 126 | 016E70A629D3DF1100610C88 /* CustomPopView */ = { 127 | isa = PBXGroup; 128 | children = ( 129 | 016E70A729D3DF3B00610C88 /* CenterPopView.h */, 130 | 016E70A829D3DF3B00610C88 /* CenterPopView.m */, 131 | 016E70AA29D3DF7900610C88 /* BottomPopView.h */, 132 | 016E70AB29D3DF7900610C88 /* BottomPopView.m */, 133 | 016E70AD29D3DF9200610C88 /* FullPopView.h */, 134 | 016E70AE29D3DF9200610C88 /* FullPopView.m */, 135 | 016E70B029D3E00B00610C88 /* TopBarPopView.h */, 136 | 016E70B129D3E00B00610C88 /* TopBarPopView.m */, 137 | 016E70B329D45A4D00610C88 /* KeyboardPopView.h */, 138 | 016E70B429D45A4D00610C88 /* KeyboardPopView.m */, 139 | ); 140 | name = CustomPopView; 141 | sourceTree = ""; 142 | }; 143 | 17B09A56E429704413BAC4E0 /* Pods */ = { 144 | isa = PBXGroup; 145 | children = ( 146 | 2ECAF141FA1F1403B64DF396 /* Pods-PopupsManager_Example.debug.xcconfig */, 147 | 2236CDBCDF7234880978FE2B /* Pods-PopupsManager_Example.release.xcconfig */, 148 | 4EC0404C8569A7FF9644F021 /* Pods-PopupsManager_Tests.debug.xcconfig */, 149 | 3FA9DCF9682A5946D914A0AF /* Pods-PopupsManager_Tests.release.xcconfig */, 150 | ); 151 | path = Pods; 152 | sourceTree = ""; 153 | }; 154 | 6003F581195388D10070C39A = { 155 | isa = PBXGroup; 156 | children = ( 157 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */, 158 | 6003F593195388D20070C39A /* Example for PopupsManager */, 159 | 6003F5B5195388D20070C39A /* Tests */, 160 | 6003F58C195388D20070C39A /* Frameworks */, 161 | 6003F58B195388D20070C39A /* Products */, 162 | 17B09A56E429704413BAC4E0 /* Pods */, 163 | ); 164 | sourceTree = ""; 165 | }; 166 | 6003F58B195388D20070C39A /* Products */ = { 167 | isa = PBXGroup; 168 | children = ( 169 | 6003F58A195388D20070C39A /* PopupsManager_Example.app */, 170 | 6003F5AE195388D20070C39A /* PopupsManager_Tests.xctest */, 171 | ); 172 | name = Products; 173 | sourceTree = ""; 174 | }; 175 | 6003F58C195388D20070C39A /* Frameworks */ = { 176 | isa = PBXGroup; 177 | children = ( 178 | 6003F58D195388D20070C39A /* Foundation.framework */, 179 | 6003F58F195388D20070C39A /* CoreGraphics.framework */, 180 | 6003F591195388D20070C39A /* UIKit.framework */, 181 | 6003F5AF195388D20070C39A /* XCTest.framework */, 182 | 00EC7022F47EDBECDD17E7CA /* Pods_PopupsManager_Example.framework */, 183 | 4BEF91858BA48788F264090C /* Pods_PopupsManager_Tests.framework */, 184 | ); 185 | name = Frameworks; 186 | sourceTree = ""; 187 | }; 188 | 6003F593195388D20070C39A /* Example for PopupsManager */ = { 189 | isa = PBXGroup; 190 | children = ( 191 | 0167C1462996202F00F5458F /* ExampleVC */, 192 | 6003F59C195388D20070C39A /* HLLAppDelegate.h */, 193 | 6003F59D195388D20070C39A /* HLLAppDelegate.m */, 194 | 873B8AEA1B1F5CCA007FD442 /* Main.storyboard */, 195 | 6003F5A5195388D20070C39A /* HLLViewController.h */, 196 | 6003F5A6195388D20070C39A /* HLLViewController.m */, 197 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */, 198 | 6003F5A8195388D20070C39A /* Images.xcassets */, 199 | 6003F594195388D20070C39A /* Supporting Files */, 200 | ); 201 | name = "Example for PopupsManager"; 202 | path = PopupsManager; 203 | sourceTree = ""; 204 | }; 205 | 6003F594195388D20070C39A /* Supporting Files */ = { 206 | isa = PBXGroup; 207 | children = ( 208 | 6003F595195388D20070C39A /* PopupsManager-Info.plist */, 209 | 6003F596195388D20070C39A /* InfoPlist.strings */, 210 | 6003F599195388D20070C39A /* main.m */, 211 | 6003F59B195388D20070C39A /* PopupsManager-Prefix.pch */, 212 | ); 213 | name = "Supporting Files"; 214 | sourceTree = ""; 215 | }; 216 | 6003F5B5195388D20070C39A /* Tests */ = { 217 | isa = PBXGroup; 218 | children = ( 219 | 6003F5BB195388D20070C39A /* Tests.m */, 220 | 6003F5B6195388D20070C39A /* Supporting Files */, 221 | ); 222 | path = Tests; 223 | sourceTree = ""; 224 | }; 225 | 6003F5B6195388D20070C39A /* Supporting Files */ = { 226 | isa = PBXGroup; 227 | children = ( 228 | 6003F5B7195388D20070C39A /* Tests-Info.plist */, 229 | 6003F5B8195388D20070C39A /* InfoPlist.strings */, 230 | 606FC2411953D9B200FFA9A0 /* Tests-Prefix.pch */, 231 | ); 232 | name = "Supporting Files"; 233 | sourceTree = ""; 234 | }; 235 | 60FF7A9C1954A5C5007DD14C /* Podspec Metadata */ = { 236 | isa = PBXGroup; 237 | children = ( 238 | 24CD610D784A26C3E243B8B0 /* PopupsManager.podspec */, 239 | CD986AB75347E96FCD7EB680 /* README.md */, 240 | 921B288CD1D035A76F6D578F /* LICENSE */, 241 | ); 242 | name = "Podspec Metadata"; 243 | sourceTree = ""; 244 | }; 245 | /* End PBXGroup section */ 246 | 247 | /* Begin PBXNativeTarget section */ 248 | 6003F589195388D20070C39A /* PopupsManager_Example */ = { 249 | isa = PBXNativeTarget; 250 | buildConfigurationList = 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PopupsManager_Example" */; 251 | buildPhases = ( 252 | 919F839CF8FB30587B3F3CF0 /* [CP] Check Pods Manifest.lock */, 253 | 6003F586195388D20070C39A /* Sources */, 254 | 6003F587195388D20070C39A /* Frameworks */, 255 | 6003F588195388D20070C39A /* Resources */, 256 | 57E1CC297EB7CC00D653A8B4 /* [CP] Embed Pods Frameworks */, 257 | ); 258 | buildRules = ( 259 | ); 260 | dependencies = ( 261 | ); 262 | name = PopupsManager_Example; 263 | productName = PopupsManager; 264 | productReference = 6003F58A195388D20070C39A /* PopupsManager_Example.app */; 265 | productType = "com.apple.product-type.application"; 266 | }; 267 | 6003F5AD195388D20070C39A /* PopupsManager_Tests */ = { 268 | isa = PBXNativeTarget; 269 | buildConfigurationList = 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PopupsManager_Tests" */; 270 | buildPhases = ( 271 | 83F56550171D45CDDDDA8D58 /* [CP] Check Pods Manifest.lock */, 272 | 6003F5AA195388D20070C39A /* Sources */, 273 | 6003F5AB195388D20070C39A /* Frameworks */, 274 | 6003F5AC195388D20070C39A /* Resources */, 275 | 9E25F6B158FBD6148149DAAB /* [CP] Embed Pods Frameworks */, 276 | ); 277 | buildRules = ( 278 | ); 279 | dependencies = ( 280 | 6003F5B4195388D20070C39A /* PBXTargetDependency */, 281 | ); 282 | name = PopupsManager_Tests; 283 | productName = PopupsManagerTests; 284 | productReference = 6003F5AE195388D20070C39A /* PopupsManager_Tests.xctest */; 285 | productType = "com.apple.product-type.bundle.unit-test"; 286 | }; 287 | /* End PBXNativeTarget section */ 288 | 289 | /* Begin PBXProject section */ 290 | 6003F582195388D10070C39A /* Project object */ = { 291 | isa = PBXProject; 292 | attributes = { 293 | CLASSPREFIX = HLL; 294 | LastUpgradeCheck = 0720; 295 | ORGANIZATIONNAME = liuzf; 296 | TargetAttributes = { 297 | 6003F589195388D20070C39A = { 298 | DevelopmentTeam = CX9244259Y; 299 | ProvisioningStyle = Automatic; 300 | }; 301 | 6003F5AD195388D20070C39A = { 302 | TestTargetID = 6003F589195388D20070C39A; 303 | }; 304 | }; 305 | }; 306 | buildConfigurationList = 6003F585195388D10070C39A /* Build configuration list for PBXProject "PopupsManager" */; 307 | compatibilityVersion = "Xcode 3.2"; 308 | developmentRegion = English; 309 | hasScannedForEncodings = 0; 310 | knownRegions = ( 311 | English, 312 | en, 313 | Base, 314 | ); 315 | mainGroup = 6003F581195388D10070C39A; 316 | productRefGroup = 6003F58B195388D20070C39A /* Products */; 317 | projectDirPath = ""; 318 | projectRoot = ""; 319 | targets = ( 320 | 6003F589195388D20070C39A /* PopupsManager_Example */, 321 | 6003F5AD195388D20070C39A /* PopupsManager_Tests */, 322 | ); 323 | }; 324 | /* End PBXProject section */ 325 | 326 | /* Begin PBXResourcesBuildPhase section */ 327 | 6003F588195388D20070C39A /* Resources */ = { 328 | isa = PBXResourcesBuildPhase; 329 | buildActionMask = 2147483647; 330 | files = ( 331 | 873B8AEB1B1F5CCA007FD442 /* Main.storyboard in Resources */, 332 | 71719F9F1E33DC2100824A3D /* LaunchScreen.storyboard in Resources */, 333 | 6003F5A9195388D20070C39A /* Images.xcassets in Resources */, 334 | 6003F598195388D20070C39A /* InfoPlist.strings in Resources */, 335 | ); 336 | runOnlyForDeploymentPostprocessing = 0; 337 | }; 338 | 6003F5AC195388D20070C39A /* Resources */ = { 339 | isa = PBXResourcesBuildPhase; 340 | buildActionMask = 2147483647; 341 | files = ( 342 | 6003F5BA195388D20070C39A /* InfoPlist.strings in Resources */, 343 | ); 344 | runOnlyForDeploymentPostprocessing = 0; 345 | }; 346 | /* End PBXResourcesBuildPhase section */ 347 | 348 | /* Begin PBXShellScriptBuildPhase section */ 349 | 57E1CC297EB7CC00D653A8B4 /* [CP] Embed Pods Frameworks */ = { 350 | isa = PBXShellScriptBuildPhase; 351 | buildActionMask = 2147483647; 352 | files = ( 353 | ); 354 | inputPaths = ( 355 | "${PODS_ROOT}/Target Support Files/Pods-PopupsManager_Example/Pods-PopupsManager_Example-frameworks.sh", 356 | "${BUILT_PRODUCTS_DIR}/LookinServer/LookinServer.framework", 357 | "${BUILT_PRODUCTS_DIR}/Masonry/Masonry.framework", 358 | "${BUILT_PRODUCTS_DIR}/PopupsManager/PopupsManager.framework", 359 | "${BUILT_PRODUCTS_DIR}/YYModel/YYModel.framework", 360 | ); 361 | name = "[CP] Embed Pods Frameworks"; 362 | outputPaths = ( 363 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/LookinServer.framework", 364 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/Masonry.framework", 365 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/PopupsManager.framework", 366 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/YYModel.framework", 367 | ); 368 | runOnlyForDeploymentPostprocessing = 0; 369 | shellPath = /bin/sh; 370 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PopupsManager_Example/Pods-PopupsManager_Example-frameworks.sh\"\n"; 371 | showEnvVarsInLog = 0; 372 | }; 373 | 83F56550171D45CDDDDA8D58 /* [CP] Check Pods Manifest.lock */ = { 374 | isa = PBXShellScriptBuildPhase; 375 | buildActionMask = 2147483647; 376 | files = ( 377 | ); 378 | inputFileListPaths = ( 379 | ); 380 | inputPaths = ( 381 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 382 | "${PODS_ROOT}/Manifest.lock", 383 | ); 384 | name = "[CP] Check Pods Manifest.lock"; 385 | outputFileListPaths = ( 386 | ); 387 | outputPaths = ( 388 | "$(DERIVED_FILE_DIR)/Pods-PopupsManager_Tests-checkManifestLockResult.txt", 389 | ); 390 | runOnlyForDeploymentPostprocessing = 0; 391 | shellPath = /bin/sh; 392 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 393 | showEnvVarsInLog = 0; 394 | }; 395 | 919F839CF8FB30587B3F3CF0 /* [CP] Check Pods Manifest.lock */ = { 396 | isa = PBXShellScriptBuildPhase; 397 | buildActionMask = 2147483647; 398 | files = ( 399 | ); 400 | inputFileListPaths = ( 401 | ); 402 | inputPaths = ( 403 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 404 | "${PODS_ROOT}/Manifest.lock", 405 | ); 406 | name = "[CP] Check Pods Manifest.lock"; 407 | outputFileListPaths = ( 408 | ); 409 | outputPaths = ( 410 | "$(DERIVED_FILE_DIR)/Pods-PopupsManager_Example-checkManifestLockResult.txt", 411 | ); 412 | runOnlyForDeploymentPostprocessing = 0; 413 | shellPath = /bin/sh; 414 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 415 | showEnvVarsInLog = 0; 416 | }; 417 | 9E25F6B158FBD6148149DAAB /* [CP] Embed Pods Frameworks */ = { 418 | isa = PBXShellScriptBuildPhase; 419 | buildActionMask = 2147483647; 420 | files = ( 421 | ); 422 | inputPaths = ( 423 | "${PODS_ROOT}/Target Support Files/Pods-PopupsManager_Tests/Pods-PopupsManager_Tests-frameworks.sh", 424 | "${BUILT_PRODUCTS_DIR}/FBSnapshotTestCase/FBSnapshotTestCase.framework", 425 | ); 426 | name = "[CP] Embed Pods Frameworks"; 427 | outputPaths = ( 428 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/FBSnapshotTestCase.framework", 429 | ); 430 | runOnlyForDeploymentPostprocessing = 0; 431 | shellPath = /bin/sh; 432 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-PopupsManager_Tests/Pods-PopupsManager_Tests-frameworks.sh\"\n"; 433 | showEnvVarsInLog = 0; 434 | }; 435 | /* End PBXShellScriptBuildPhase section */ 436 | 437 | /* Begin PBXSourcesBuildPhase section */ 438 | 6003F586195388D20070C39A /* Sources */ = { 439 | isa = PBXSourcesBuildPhase; 440 | buildActionMask = 2147483647; 441 | files = ( 442 | 016E70AC29D3DF7900610C88 /* BottomPopView.m in Sources */, 443 | 6003F59E195388D20070C39A /* HLLAppDelegate.m in Sources */, 444 | 016E70B529D45A4D00610C88 /* KeyboardPopView.m in Sources */, 445 | 016E70A529D3DBAE00610C88 /* HLLShowViewController.m in Sources */, 446 | 6003F5A7195388D20070C39A /* HLLViewController.m in Sources */, 447 | 016E70B229D3E00B00610C88 /* TopBarPopView.m in Sources */, 448 | 6003F59A195388D20070C39A /* main.m in Sources */, 449 | 016E70A929D3DF3B00610C88 /* CenterPopView.m in Sources */, 450 | 016E70AF29D3DF9200610C88 /* FullPopView.m in Sources */, 451 | ); 452 | runOnlyForDeploymentPostprocessing = 0; 453 | }; 454 | 6003F5AA195388D20070C39A /* Sources */ = { 455 | isa = PBXSourcesBuildPhase; 456 | buildActionMask = 2147483647; 457 | files = ( 458 | 6003F5BC195388D20070C39A /* Tests.m in Sources */, 459 | ); 460 | runOnlyForDeploymentPostprocessing = 0; 461 | }; 462 | /* End PBXSourcesBuildPhase section */ 463 | 464 | /* Begin PBXTargetDependency section */ 465 | 6003F5B4195388D20070C39A /* PBXTargetDependency */ = { 466 | isa = PBXTargetDependency; 467 | target = 6003F589195388D20070C39A /* PopupsManager_Example */; 468 | targetProxy = 6003F5B3195388D20070C39A /* PBXContainerItemProxy */; 469 | }; 470 | /* End PBXTargetDependency section */ 471 | 472 | /* Begin PBXVariantGroup section */ 473 | 6003F596195388D20070C39A /* InfoPlist.strings */ = { 474 | isa = PBXVariantGroup; 475 | children = ( 476 | 6003F597195388D20070C39A /* en */, 477 | ); 478 | name = InfoPlist.strings; 479 | sourceTree = ""; 480 | }; 481 | 6003F5B8195388D20070C39A /* InfoPlist.strings */ = { 482 | isa = PBXVariantGroup; 483 | children = ( 484 | 6003F5B9195388D20070C39A /* en */, 485 | ); 486 | name = InfoPlist.strings; 487 | sourceTree = ""; 488 | }; 489 | 71719F9D1E33DC2100824A3D /* LaunchScreen.storyboard */ = { 490 | isa = PBXVariantGroup; 491 | children = ( 492 | 71719F9E1E33DC2100824A3D /* Base */, 493 | ); 494 | name = LaunchScreen.storyboard; 495 | sourceTree = ""; 496 | }; 497 | /* End PBXVariantGroup section */ 498 | 499 | /* Begin XCBuildConfiguration section */ 500 | 6003F5BD195388D20070C39A /* Debug */ = { 501 | isa = XCBuildConfiguration; 502 | buildSettings = { 503 | ALWAYS_SEARCH_USER_PATHS = NO; 504 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 505 | CLANG_CXX_LIBRARY = "libc++"; 506 | CLANG_ENABLE_MODULES = YES; 507 | CLANG_ENABLE_OBJC_ARC = YES; 508 | CLANG_WARN_BOOL_CONVERSION = YES; 509 | CLANG_WARN_CONSTANT_CONVERSION = YES; 510 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 511 | CLANG_WARN_EMPTY_BODY = YES; 512 | CLANG_WARN_ENUM_CONVERSION = YES; 513 | CLANG_WARN_INT_CONVERSION = YES; 514 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 515 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 516 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 517 | COPY_PHASE_STRIP = NO; 518 | ENABLE_TESTABILITY = YES; 519 | GCC_C_LANGUAGE_STANDARD = gnu99; 520 | GCC_DYNAMIC_NO_PIC = NO; 521 | GCC_OPTIMIZATION_LEVEL = 0; 522 | GCC_PREPROCESSOR_DEFINITIONS = ( 523 | "DEBUG=1", 524 | "$(inherited)", 525 | ); 526 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 527 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 528 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 529 | GCC_WARN_UNDECLARED_SELECTOR = YES; 530 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 531 | GCC_WARN_UNUSED_FUNCTION = YES; 532 | GCC_WARN_UNUSED_VARIABLE = YES; 533 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 534 | ONLY_ACTIVE_ARCH = YES; 535 | SDKROOT = iphoneos; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | }; 538 | name = Debug; 539 | }; 540 | 6003F5BE195388D20070C39A /* Release */ = { 541 | isa = XCBuildConfiguration; 542 | buildSettings = { 543 | ALWAYS_SEARCH_USER_PATHS = NO; 544 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 545 | CLANG_CXX_LIBRARY = "libc++"; 546 | CLANG_ENABLE_MODULES = YES; 547 | CLANG_ENABLE_OBJC_ARC = YES; 548 | CLANG_WARN_BOOL_CONVERSION = YES; 549 | CLANG_WARN_CONSTANT_CONVERSION = YES; 550 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 551 | CLANG_WARN_EMPTY_BODY = YES; 552 | CLANG_WARN_ENUM_CONVERSION = YES; 553 | CLANG_WARN_INT_CONVERSION = YES; 554 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 555 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 556 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 557 | COPY_PHASE_STRIP = YES; 558 | ENABLE_NS_ASSERTIONS = NO; 559 | GCC_C_LANGUAGE_STANDARD = gnu99; 560 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 561 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 562 | GCC_WARN_UNDECLARED_SELECTOR = YES; 563 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 564 | GCC_WARN_UNUSED_FUNCTION = YES; 565 | GCC_WARN_UNUSED_VARIABLE = YES; 566 | IPHONEOS_DEPLOYMENT_TARGET = 9.3; 567 | SDKROOT = iphoneos; 568 | TARGETED_DEVICE_FAMILY = "1,2"; 569 | VALIDATE_PRODUCT = YES; 570 | }; 571 | name = Release; 572 | }; 573 | 6003F5C0195388D20070C39A /* Debug */ = { 574 | isa = XCBuildConfiguration; 575 | baseConfigurationReference = 2ECAF141FA1F1403B64DF396 /* Pods-PopupsManager_Example.debug.xcconfig */; 576 | buildSettings = { 577 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 578 | CODE_SIGN_IDENTITY = "Apple Development"; 579 | CODE_SIGN_STYLE = Automatic; 580 | DEVELOPMENT_TEAM = CX9244259Y; 581 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 582 | GCC_PREFIX_HEADER = "PopupsManager/PopupsManager-Prefix.pch"; 583 | INFOPLIST_FILE = "PopupsManager/PopupsManager-Info.plist"; 584 | MODULE_NAME = ExampleApp; 585 | PRODUCT_BUNDLE_IDENTIFIER = com.huolala.liuzf; 586 | PRODUCT_NAME = "$(TARGET_NAME)"; 587 | PROVISIONING_PROFILE_SPECIFIER = ""; 588 | SWIFT_VERSION = 4.0; 589 | WRAPPER_EXTENSION = app; 590 | }; 591 | name = Debug; 592 | }; 593 | 6003F5C1195388D20070C39A /* Release */ = { 594 | isa = XCBuildConfiguration; 595 | baseConfigurationReference = 2236CDBCDF7234880978FE2B /* Pods-PopupsManager_Example.release.xcconfig */; 596 | buildSettings = { 597 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 598 | CODE_SIGN_STYLE = Manual; 599 | DEVELOPMENT_TEAM = 39BS6H7U26; 600 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 601 | GCC_PREFIX_HEADER = "PopupsManager/PopupsManager-Prefix.pch"; 602 | INFOPLIST_FILE = "PopupsManager/PopupsManager-Info.plist"; 603 | MODULE_NAME = ExampleApp; 604 | PRODUCT_BUNDLE_IDENTIFIER = com.huolala.liuzf; 605 | PRODUCT_NAME = "$(TARGET_NAME)"; 606 | PROVISIONING_PROFILE_SPECIFIER = wildcardcomdev; 607 | SWIFT_VERSION = 4.0; 608 | WRAPPER_EXTENSION = app; 609 | }; 610 | name = Release; 611 | }; 612 | 6003F5C3195388D20070C39A /* Debug */ = { 613 | isa = XCBuildConfiguration; 614 | baseConfigurationReference = 4EC0404C8569A7FF9644F021 /* Pods-PopupsManager_Tests.debug.xcconfig */; 615 | buildSettings = { 616 | BUNDLE_LOADER = "$(TEST_HOST)"; 617 | FRAMEWORK_SEARCH_PATHS = ( 618 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 619 | "$(inherited)", 620 | "$(DEVELOPER_FRAMEWORKS_DIR)", 621 | ); 622 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 623 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 624 | GCC_PREPROCESSOR_DEFINITIONS = ( 625 | "DEBUG=1", 626 | "$(inherited)", 627 | ); 628 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 629 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 630 | PRODUCT_NAME = "$(TARGET_NAME)"; 631 | SWIFT_VERSION = 4.0; 632 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopupsManager_Example.app/PopupsManager_Example"; 633 | WRAPPER_EXTENSION = xctest; 634 | }; 635 | name = Debug; 636 | }; 637 | 6003F5C4195388D20070C39A /* Release */ = { 638 | isa = XCBuildConfiguration; 639 | baseConfigurationReference = 3FA9DCF9682A5946D914A0AF /* Pods-PopupsManager_Tests.release.xcconfig */; 640 | buildSettings = { 641 | BUNDLE_LOADER = "$(TEST_HOST)"; 642 | FRAMEWORK_SEARCH_PATHS = ( 643 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 644 | "$(inherited)", 645 | "$(DEVELOPER_FRAMEWORKS_DIR)", 646 | ); 647 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 648 | GCC_PREFIX_HEADER = "Tests/Tests-Prefix.pch"; 649 | INFOPLIST_FILE = "Tests/Tests-Info.plist"; 650 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.${PRODUCT_NAME:rfc1034identifier}"; 651 | PRODUCT_NAME = "$(TARGET_NAME)"; 652 | SWIFT_VERSION = 4.0; 653 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/PopupsManager_Example.app/PopupsManager_Example"; 654 | WRAPPER_EXTENSION = xctest; 655 | }; 656 | name = Release; 657 | }; 658 | /* End XCBuildConfiguration section */ 659 | 660 | /* Begin XCConfigurationList section */ 661 | 6003F585195388D10070C39A /* Build configuration list for PBXProject "PopupsManager" */ = { 662 | isa = XCConfigurationList; 663 | buildConfigurations = ( 664 | 6003F5BD195388D20070C39A /* Debug */, 665 | 6003F5BE195388D20070C39A /* Release */, 666 | ); 667 | defaultConfigurationIsVisible = 0; 668 | defaultConfigurationName = Release; 669 | }; 670 | 6003F5BF195388D20070C39A /* Build configuration list for PBXNativeTarget "PopupsManager_Example" */ = { 671 | isa = XCConfigurationList; 672 | buildConfigurations = ( 673 | 6003F5C0195388D20070C39A /* Debug */, 674 | 6003F5C1195388D20070C39A /* Release */, 675 | ); 676 | defaultConfigurationIsVisible = 0; 677 | defaultConfigurationName = Release; 678 | }; 679 | 6003F5C2195388D20070C39A /* Build configuration list for PBXNativeTarget "PopupsManager_Tests" */ = { 680 | isa = XCConfigurationList; 681 | buildConfigurations = ( 682 | 6003F5C3195388D20070C39A /* Debug */, 683 | 6003F5C4195388D20070C39A /* Release */, 684 | ); 685 | defaultConfigurationIsVisible = 0; 686 | defaultConfigurationName = Release; 687 | }; 688 | /* End XCConfigurationList section */ 689 | }; 690 | rootObject = 6003F582195388D10070C39A /* Project object */; 691 | } 692 | -------------------------------------------------------------------------------- /Example/PopupsManager.xcodeproj/xcshareddata/xcschemes/PopupsManager-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 53 | 54 | 64 | 66 | 72 | 73 | 74 | 75 | 76 | 77 | 83 | 85 | 91 | 92 | 93 | 94 | 96 | 97 | 100 | 101 | 102 | -------------------------------------------------------------------------------- /Example/PopupsManager.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/PopupsManager.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/PopupsManager/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 | -------------------------------------------------------------------------------- /Example/PopupsManager/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /Example/PopupsManager/BottomPopView.h: -------------------------------------------------------------------------------- 1 | // 2 | // BottomPopView.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface BottomPopView : UIView 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/PopupsManager/BottomPopView.m: -------------------------------------------------------------------------------- 1 | // 2 | // BottomPopView.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "BottomPopView.h" 10 | #import 11 | 12 | @interface BottomPopView () 13 | @property (nonatomic, strong) UIImageView *imgView; 14 | @end 15 | 16 | @implementation BottomPopView 17 | 18 | - (instancetype)init 19 | { 20 | self = [super init]; 21 | if (self) { 22 | [self addSubview:self.imgView]; 23 | [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { 24 | make.edges.equalTo(self).with.insets(UIEdgeInsetsZero); 25 | }]; 26 | } 27 | return self; 28 | } 29 | 30 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 31 | [self endEditing:YES]; 32 | } 33 | 34 | #pragma mark - HLLPopupInterface 35 | 36 | - (UIView *)supplyCustomPopupView { 37 | return self; 38 | } 39 | 40 | - (void)layoutWithSuperView:(UIView *)superView { 41 | [self mas_makeConstraints:^(MASConstraintMaker *make) { 42 | make.left.right.bottom.equalTo(superView); 43 | make.height.mas_equalTo(220); 44 | }]; 45 | } 46 | 47 | #pragma mark - Getter 48 | 49 | - (UIImageView *)imgView { 50 | if (!_imgView) { 51 | _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bottomShare"]]; 52 | } 53 | return _imgView; 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /Example/PopupsManager/CenterPopView.h: -------------------------------------------------------------------------------- 1 | // 2 | // CenterPopView.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface CenterPopView : UIView 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/PopupsManager/CenterPopView.m: -------------------------------------------------------------------------------- 1 | // 2 | // CenterPopView.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "CenterPopView.h" 10 | #import 11 | 12 | @interface CenterPopView () 13 | @property (nonatomic, strong) UIImageView *imgView; 14 | @end 15 | 16 | @implementation CenterPopView 17 | 18 | - (instancetype)init 19 | { 20 | self = [super init]; 21 | if (self) { 22 | [self addSubview:self.imgView]; 23 | [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { 24 | make.edges.equalTo(self).with.insets(UIEdgeInsetsZero); 25 | }]; 26 | } 27 | return self; 28 | } 29 | 30 | #pragma mark - HLLPopupInterface 31 | 32 | - (UIView *)supplyCustomPopupView { 33 | return self; 34 | } 35 | 36 | - (void)layoutWithSuperView:(UIView *)superView { 37 | [self mas_makeConstraints:^(MASConstraintMaker *make) { 38 | make.left.equalTo(superView).offset(50); 39 | make.right.equalTo(superView).offset(-50); 40 | make.centerY.equalTo(superView); 41 | make.height.mas_equalTo(400); 42 | }]; 43 | } 44 | 45 | #pragma mark - Getter 46 | 47 | - (UIImageView *)imgView { 48 | if (!_imgView) { 49 | _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"center"]]; 50 | } 51 | return _imgView; 52 | } 53 | @end 54 | -------------------------------------------------------------------------------- /Example/PopupsManager/FullPopView.h: -------------------------------------------------------------------------------- 1 | // 2 | // FullPopView.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface FullPopView : UIView 15 | @property (nonatomic, copy) dispatch_block_t popViewDismissBlock; 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/PopupsManager/FullPopView.m: -------------------------------------------------------------------------------- 1 | // 2 | // FullPopView.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "FullPopView.h" 10 | #import 11 | 12 | @interface FullPopView () 13 | @property (nonatomic, strong) UIImageView *imgView; 14 | @property (nonatomic, strong) UILabel *timeCountLabl; 15 | @end 16 | 17 | @implementation FullPopView 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | [self addSubview:self.imgView]; 24 | [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { 25 | make.edges.equalTo(self).with.insets(UIEdgeInsetsZero); 26 | }]; 27 | [self addSubview:self.timeCountLabl]; 28 | [self.timeCountLabl mas_makeConstraints:^(MASConstraintMaker *make) { 29 | make.center.equalTo(self); 30 | }]; 31 | 32 | } 33 | return self; 34 | } 35 | 36 | #pragma mark - HLLPopupInterface 37 | 38 | - (UIView *)supplyCustomPopupView { 39 | return self; 40 | } 41 | 42 | - (void)layoutWithSuperView:(UIView *)superView { 43 | [self mas_makeConstraints:^(MASConstraintMaker *make) { 44 | make.edges.equalTo(superView).with.insets(UIEdgeInsetsZero); 45 | }]; 46 | } 47 | 48 | - (void)countTimeWithCount:(NSInteger)count { 49 | self.timeCountLabl.text = [NSString stringWithFormat:@"测试剩余:%lds",(long)count]; 50 | } 51 | 52 | - (void)popupViewDidDisappear { 53 | NSLog(@"闪屏广告消失了"); 54 | if (self.popViewDismissBlock) { 55 | self.popViewDismissBlock(); 56 | } 57 | } 58 | 59 | #pragma mark - Getter 60 | 61 | - (UIImageView *)imgView { 62 | if (!_imgView) { 63 | _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"FullAdver"]]; 64 | } 65 | return _imgView; 66 | } 67 | 68 | - (UILabel *)timeCountLabl { 69 | if (!_timeCountLabl) { 70 | _timeCountLabl = [[UILabel alloc] init]; 71 | _timeCountLabl.backgroundColor = [UIColor blackColor]; 72 | _timeCountLabl.textColor = [UIColor whiteColor]; 73 | _timeCountLabl.font = [UIFont systemFontOfSize:30]; 74 | _timeCountLabl.text = @"测试剩余:3s"; 75 | } 76 | return _timeCountLabl; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLAppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLAppDelegate.h 3 | // PopupsManager 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface HLLAppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLAppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLAppDelegate.m 3 | // PopupsManager 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "HLLAppDelegate.h" 10 | #import "HLLViewController.h" 11 | @implementation HLLAppDelegate 12 | 13 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 14 | { 15 | HLLViewController *rootVC = [[HLLViewController alloc] init]; 16 | UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootVC]; 17 | [self.window setRootViewController:nav]; 18 | [self.window makeKeyAndVisible]; 19 | return YES; 20 | } 21 | 22 | - (void)applicationWillResignActive:(UIApplication *)application 23 | { 24 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 25 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 26 | } 27 | 28 | - (void)applicationDidEnterBackground:(UIApplication *)application 29 | { 30 | // 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. 31 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 32 | } 33 | 34 | - (void)applicationWillEnterForeground:(UIApplication *)application 35 | { 36 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 37 | } 38 | 39 | - (void)applicationDidBecomeActive:(UIApplication *)application 40 | { 41 | // 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. 42 | } 43 | 44 | - (void)applicationWillTerminate:(UIApplication *)application 45 | { 46 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 47 | } 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLShowViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLShowViewController.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface HLLShowViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLShowViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLShowViewController.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "HLLShowViewController.h" 10 | #import 11 | #import "CenterPopView.h" 12 | #import "BottomPopView.h" 13 | #import "FullPopView.h" 14 | #import "TopBarPopView.h" 15 | #import "KeyboardPopView.h" 16 | #import 17 | 18 | @implementation HLLShowViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = @"演示效果"; 23 | self.view.backgroundColor = [UIColor whiteColor]; 24 | 25 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 26 | [button setTitle:@"开始演示" forState:UIControlStateNormal]; 27 | [button addTarget:self action:@selector(clickShow) forControlEvents:UIControlEventTouchUpInside]; 28 | button.backgroundColor = [UIColor blueColor]; 29 | [self.view addSubview:button]; 30 | [button mas_makeConstraints:^(MASConstraintMaker *make) { 31 | make.center.equalTo(self.view); 32 | }]; 33 | 34 | UIButton *button1 = [UIButton buttonWithType:UIButtonTypeCustom]; 35 | [button1 setTitle:@"优先级覆盖" forState:UIControlStateNormal]; 36 | [button1 addTarget:self action:@selector(clickShow1) forControlEvents:UIControlEventTouchUpInside]; 37 | button1.backgroundColor = [UIColor blueColor]; 38 | [self.view addSubview:button1]; 39 | [button1 mas_makeConstraints:^(MASConstraintMaker *make) { 40 | make.centerX.equalTo(button); 41 | make.top.equalTo(button.mas_bottom).offset(10); 42 | }]; 43 | 44 | UIButton *button2 = [UIButton buttonWithType:UIButtonTypeCustom]; 45 | [button2 setTitle:@"通知条覆盖" forState:UIControlStateNormal]; 46 | [button2 addTarget:self action:@selector(clickShow2) forControlEvents:UIControlEventTouchUpInside]; 47 | button2.backgroundColor = [UIColor blueColor]; 48 | [self.view addSubview:button2]; 49 | [button2 mas_makeConstraints:^(MASConstraintMaker *make) { 50 | make.centerX.equalTo(button); 51 | make.top.equalTo(button1.mas_bottom).offset(10); 52 | }]; 53 | } 54 | 55 | - (void)clickShow { 56 | // [self showFullAdvert]; 57 | // [self showBottomShare1]; 58 | [self showCenter1]; 59 | } 60 | 61 | - (void)clickShow1 { 62 | [self showBottomShare1]; 63 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 64 | [self showCenter1]; 65 | }); 66 | } 67 | 68 | - (void)clickShow2 { 69 | [self showTopbar]; 70 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 71 | [self showTopbar1]; 72 | }); 73 | } 74 | 75 | - (void)showMorePopView { 76 | NSTimeInterval time = 0.5; 77 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 78 | [self showCenter]; 79 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 80 | [self showBottomShare]; 81 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 82 | [self showTopbar]; 83 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 84 | [self showCenter]; 85 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(time * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 86 | [self showBottomKeyboard]; 87 | }); 88 | }); 89 | }); 90 | }); 91 | }); 92 | } 93 | 94 | - (void)showCenter { 95 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 96 | config.sceneStyle = HLLPopupSceneCenter; 97 | config.clickOutsideDismiss = YES; 98 | config.cornerRadius = 8; 99 | config.popAnimationStyle = HLLPopAnimationStyleScale; 100 | config.aloneMode = YES; 101 | CenterPopView *centerPopView = [[CenterPopView alloc] init]; 102 | [HLLPopupsManager addPopup:centerPopView options:config]; 103 | } 104 | 105 | - (void)showCenter1 { 106 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 107 | config.sceneStyle = HLLPopupSceneCenter; 108 | config.clickOutsideDismiss = YES; 109 | config.cornerRadius = 8; 110 | config.popAnimationStyle = HLLPopAnimationStyleScale; 111 | config.priority = 200; 112 | CenterPopView *centerPopView = [[CenterPopView alloc] init]; 113 | [HLLPopupsManager addPopup:centerPopView options:config]; 114 | } 115 | 116 | - (void)showBottomShare { 117 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 118 | config.sceneStyle = HLLPopupSceneHalfPage; 119 | config.clickOutsideDismiss = YES; 120 | config.cornerRadius = 8; 121 | config.popAnimationStyle = HLLPopAnimationStyleScale; 122 | config.dismissAnimationStyle = HLLDismissAnimationStyleFade; 123 | config.aloneMode = YES; 124 | BottomPopView *bottomSharePopView = [[BottomPopView alloc] init]; 125 | [HLLPopupsManager addPopup:bottomSharePopView options:config]; 126 | } 127 | 128 | - (void)showBottomShare1 { 129 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 130 | config.sceneStyle = HLLPopupSceneHalfPage; 131 | config.clickOutsideDismiss = YES; 132 | config.cornerRadius = 8; 133 | config.popAnimationStyle = HLLPopAnimationStyleScale; 134 | config.dismissAnimationStyle = HLLDismissAnimationStyleFade; 135 | config.priority = 100; 136 | BottomPopView *bottomSharePopView = [[BottomPopView alloc] init]; 137 | [HLLPopupsManager addPopup:bottomSharePopView options:config]; 138 | } 139 | 140 | - (void)showFullAdvert{ 141 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 142 | config.sceneStyle = HLLPopupSceneFull; 143 | config.aloneMode = YES; 144 | config.dismissDuration = 3; 145 | FullPopView *popView = [[FullPopView alloc] init]; 146 | popView.popViewDismissBlock = ^{ 147 | [self showMorePopView]; 148 | }; 149 | [HLLPopupsManager addPopup:popView options:config]; 150 | } 151 | 152 | - (void)showTopbar{ 153 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 154 | config.sceneStyle = HLLPopupSceneTopNoticeView; 155 | config.dismissDuration = 3; 156 | config.cornerRadius = 8; 157 | config.aloneMode = YES; 158 | TopBarPopView *topBar = [[TopBarPopView alloc] init]; 159 | [HLLPopupsManager addPopup:topBar options:config]; 160 | } 161 | 162 | - (void)showTopbar1{ 163 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 164 | config.sceneStyle = HLLPopupSceneTopNoticeView; 165 | config.dismissDuration = 3; 166 | config.cornerRadius = 8; 167 | config.priority = 100; 168 | TopBarPopView *topBar = [[TopBarPopView alloc] init]; 169 | [HLLPopupsManager addPopup:topBar options:config]; 170 | } 171 | 172 | - (void)showBottomKeyboard{ 173 | HLLPopupConfigure *config = [[HLLPopupConfigure alloc] init]; 174 | config.sceneStyle = HLLPopupSceneHalfPage; 175 | config.cornerRadius = 8; 176 | config.aloneMode = YES; 177 | config.clickOutsideDismiss = YES; 178 | KeyboardPopView *popView = [[KeyboardPopView alloc] init]; 179 | [HLLPopupsManager addPopup:popView options:config]; 180 | } 181 | 182 | - (void)dealloc { 183 | NSLog(@"控制器释放"); 184 | } 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLViewController.h 3 | // PopupsManager 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | 11 | @interface HLLViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/PopupsManager/HLLViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLViewController.m 3 | // PopupsManager 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "HLLViewController.h" 10 | #import 11 | #import 12 | #import "HLLShowViewController.h" 13 | 14 | @interface HLLViewController () 15 | @property (nonatomic, strong) UITableView *tableView; 16 | @property (nonatomic, strong) NSArray *exampleList; 17 | @property (nonatomic, strong) UIButton *popButton; 18 | @end 19 | 20 | @implementation HLLViewController 21 | 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | self.title = @"Example"; 25 | self.view.backgroundColor = [UIColor whiteColor]; 26 | self.tableView = [[UITableView alloc] init]; 27 | self.tableView.delegate = self; 28 | self.tableView.dataSource = self; 29 | [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"cell"]; 30 | [self.view addSubview:self.tableView]; 31 | [_tableView mas_makeConstraints:^(MASConstraintMaker *make) { 32 | make.edges.equalTo(self.view); 33 | }]; 34 | 35 | _exampleList = @[ 36 | @"场景演示", 37 | ]; 38 | } 39 | 40 | - (void)viewWillAppear:(BOOL)animated { 41 | [super viewWillAppear:animated]; 42 | NSInteger count = [HLLPopupsManager getTotalPopupCount]; 43 | NSLog(@"总的弹窗数:%ld",(long)count); 44 | } 45 | 46 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 47 | return _exampleList.count; 48 | } 49 | 50 | - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { 51 | return 50; 52 | } 53 | 54 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 55 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 56 | if (!cell) { 57 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 58 | } 59 | cell.selectionStyle = UITableViewCellSelectionStyleNone; 60 | cell.textLabel.font = [UIFont boldSystemFontOfSize:17]; 61 | cell.textLabel.text = _exampleList[indexPath.row]; 62 | return cell; 63 | } 64 | 65 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { 66 | HLLShowViewController *vc = [[HLLShowViewController alloc] init]; 67 | [self.navigationController pushViewController:vc animated:YES]; 68 | 69 | } 70 | 71 | - (void)didReceiveMemoryWarning 72 | { 73 | [super didReceiveMemoryWarning]; 74 | // Dispose of any resources that can be recreated. 75 | } 76 | 77 | @end 78 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.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 | } 99 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "author" : "xcode", 4 | "version" : 1 5 | } 6 | } 7 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/FullAdver.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "Simulator Screen Shot - iPhone 13 Pro - 2023-02-10 at 15.11.50.png", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/FullAdver.imageset/Simulator Screen Shot - iPhone 13 Pro - 2023-02-10 at 15.11.50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/FullAdver.imageset/Simulator Screen Shot - iPhone 13 Pro - 2023-02-10 at 15.11.50.png -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/bottom.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "底部弹窗.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/bottom.imageset/底部弹窗.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/bottom.imageset/底部弹窗.jpg -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/bottomShare.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "bottomShare.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/bottomShare.imageset/bottomShare.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/bottomShare.imageset/bottomShare.jpg -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/center.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "居中弹窗.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/center.imageset/居中弹窗.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/center.imageset/居中弹窗.jpg -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/newVersion.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "新版本升级.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/newVersion.imageset/新版本升级.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/newVersion.imageset/新版本升级.jpg -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/topbar.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "filename" : "topbar.jpg", 5 | "idiom" : "universal", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "author" : "xcode", 19 | "version" : 1 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /Example/PopupsManager/Images.xcassets/topbar.imageset/topbar.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/Example/PopupsManager/Images.xcassets/topbar.imageset/topbar.jpg -------------------------------------------------------------------------------- /Example/PopupsManager/KeyboardPopView.h: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardPopView.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface KeyboardPopView : UIView 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/PopupsManager/KeyboardPopView.m: -------------------------------------------------------------------------------- 1 | // 2 | // KeyboardPopView.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "KeyboardPopView.h" 10 | #import 11 | 12 | @interface KeyboardPopView () 13 | @property (nonatomic, strong) UIImageView *imgView; 14 | @property (nonatomic, strong) UITextField *textField; 15 | @end 16 | 17 | @implementation KeyboardPopView 18 | 19 | - (instancetype)init 20 | { 21 | self = [super init]; 22 | if (self) { 23 | [self addSubview:self.imgView]; 24 | [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { 25 | make.edges.equalTo(self).with.insets(UIEdgeInsetsZero); 26 | }]; 27 | [self addSubview:self.textField]; 28 | [self.textField mas_makeConstraints:^(MASConstraintMaker *make) { 29 | make.left.right.equalTo(self); 30 | make.height.mas_equalTo(40); 31 | make.top.equalTo(self).offset(40); 32 | }]; 33 | } 34 | return self; 35 | } 36 | 37 | - (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 38 | [self endEditing:YES]; 39 | } 40 | 41 | #pragma mark - HLLPopupInterface 42 | 43 | - (UIView *)supplyCustomPopupView { 44 | return self; 45 | } 46 | 47 | - (void)layoutWithSuperView:(UIView *)superView { 48 | [self mas_makeConstraints:^(MASConstraintMaker *make) { 49 | make.left.right.bottom.equalTo(superView); 50 | make.height.mas_equalTo(320); 51 | }]; 52 | } 53 | 54 | #pragma mark - Getter 55 | 56 | - (UIImageView *)imgView { 57 | if (!_imgView) { 58 | _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"bottom"]]; 59 | } 60 | return _imgView; 61 | } 62 | 63 | - (UITextField *)textField { 64 | if (!_textField) { 65 | _textField = [[UITextField alloc] init]; 66 | _textField.placeholder = @"测试输出框"; 67 | _textField.textAlignment = NSTextAlignmentCenter; 68 | } 69 | return _textField; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Example/PopupsManager/PopupsManager-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIMainStoryboardFile 30 | Main 31 | UIRequiredDeviceCapabilities 32 | 33 | armv7 34 | 35 | UISupportedInterfaceOrientations 36 | 37 | UIInterfaceOrientationPortrait 38 | UIInterfaceOrientationLandscapeLeft 39 | UIInterfaceOrientationLandscapeRight 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /Example/PopupsManager/PopupsManager-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_5_0 10 | #warning "This project uses features only available in iOS SDK 5.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | @import UIKit; 15 | @import Foundation; 16 | #endif 17 | -------------------------------------------------------------------------------- /Example/PopupsManager/TopBarPopView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TopBarPopView.h 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | 14 | @interface TopBarPopView : UIView 15 | 16 | @end 17 | 18 | NS_ASSUME_NONNULL_END 19 | -------------------------------------------------------------------------------- /Example/PopupsManager/TopBarPopView.m: -------------------------------------------------------------------------------- 1 | // 2 | // TopBarPopView.m 3 | // PopupsManager_Example 4 | // 5 | // Created by Kris on 2023/3/29. 6 | // Copyright © 2023 liuzf. All rights reserved. 7 | // 8 | 9 | #import "TopBarPopView.h" 10 | #import 11 | 12 | @interface TopBarPopView () 13 | @property (nonatomic, strong) UIImageView *imgView; 14 | @end 15 | 16 | @implementation TopBarPopView 17 | 18 | - (instancetype)init 19 | { 20 | self = [super init]; 21 | if (self) { 22 | [self addSubview:self.imgView]; 23 | [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) { 24 | make.edges.equalTo(self).with.insets(UIEdgeInsetsZero); 25 | }]; 26 | } 27 | return self; 28 | } 29 | 30 | #pragma mark - HLLPopupInterface 31 | 32 | - (UIView *)supplyCustomPopupView { 33 | return self; 34 | } 35 | 36 | - (void)layoutWithSuperView:(UIView *)superView { 37 | [self mas_makeConstraints:^(MASConstraintMaker *make) { 38 | make.left.equalTo(superView).offset(10); 39 | make.right.equalTo(superView).offset(-10); 40 | make.top.equalTo(superView).offset(40); 41 | make.height.mas_equalTo(80); 42 | }]; 43 | } 44 | 45 | #pragma mark - Getter 46 | 47 | - (UIImageView *)imgView { 48 | if (!_imgView) { 49 | _imgView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"topbar"]]; 50 | } 51 | return _imgView; 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /Example/PopupsManager/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Example/PopupsManager/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PopupsManager 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | @import UIKit; 10 | #import "HLLAppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) 13 | { 14 | @autoreleasepool { 15 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([HLLAppDelegate class])); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /Example/Tests/Tests-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 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/Tests/Tests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // The contents of this file are implicitly included at the beginning of every test case source file. 2 | 3 | #ifdef __OBJC__ 4 | 5 | @import FBSnapshotTestCase; 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /Example/Tests/Tests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PopupsManagerTests.m 3 | // PopupsManagerTests 4 | // 5 | // Created by liuzf on 01/05/2023. 6 | // Copyright (c) 2023 liuzf. All rights reserved. 7 | // 8 | 9 | @import XCTest; 10 | 11 | @interface Tests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation Tests 16 | 17 | - (void)setUp 18 | { 19 | [super setUp]; 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | } 22 | 23 | - (void)tearDown 24 | { 25 | // Put teardown code here. This method is called after the invocation of each test method in the class. 26 | [super tearDown]; 27 | } 28 | 29 | - (void)testExample 30 | { 31 | XCTFail(@"No implementation for \"%s\"", __PRETTY_FUNCTION__); 32 | } 33 | 34 | @end 35 | 36 | -------------------------------------------------------------------------------- /Example/Tests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. 10 | 11 | "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. 12 | 13 | "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. 14 | 15 | "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. 16 | 17 | "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. 18 | 19 | "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. 20 | 21 | "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). 22 | 23 | "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. 24 | 25 | "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." 26 | 27 | "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 28 | 29 | 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 30 | 31 | 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 32 | 33 | 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: 34 | 35 | You must give any other recipients of the Work or Derivative Works a copy of this License; and 36 | You must cause any modified files to carry prominent notices stating that You changed the files; and 37 | You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and 38 | If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. 39 | 40 | You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 41 | 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 42 | 43 | 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 44 | 45 | 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 46 | 47 | 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 48 | 49 | 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. 50 | 51 | END OF TERMS AND CONDITIONS 52 | -------------------------------------------------------------------------------- /PopupsManager.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint PopupsManager.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'PopupsManager' 11 | s.version = '0.1.0' 12 | s.summary = 'A short description of PopupsManager.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | TODO: Add long description of the pod here. 22 | DESC 23 | 24 | s.homepage = 'https://github.com/liuzf/PopupsManager' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'liuzf' => 'jun.liu' } 28 | s.source = { :git => 'https://github.com/liuzf/PopupsManager.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '10.0' 32 | 33 | s.source_files = 'PopupsManager/Classes/**/*' 34 | 35 | # s.resource_bundles = { 36 | # 'PopupsManager' => ['PopupsManager/Assets/*.png'] 37 | # } 38 | 39 | # s.public_header_files = 'Pod/Classes/**/*.h' 40 | # s.frameworks = 'UIKit', 'MapKit' 41 | s.dependency 'YYModel', '1.0.4' 42 | end 43 | -------------------------------------------------------------------------------- /PopupsManager/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/PopupsManager/Assets/.gitkeep -------------------------------------------------------------------------------- /PopupsManager/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/PopupsManager/Classes/.gitkeep -------------------------------------------------------------------------------- /PopupsManager/Classes/HLLPopupConfigure.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLPopoverWidgetConfigure.h 3 | // 4 | // Created by Kris on 2021/9/22. 5 | // 6 | 7 | /*弹窗元素配置类 */ 8 | #import 9 | #import 10 | #import "HLLPopupInterface.h" 11 | 12 | ///弹窗场景类型 13 | typedef NS_ENUM(NSInteger, HLLPopupScene) { 14 | HLLPopupSceneCenter = 0,//中心弹窗 15 | HLLPopupSceneHalfPage,//底部半页弹窗 16 | HLLPopupSceneTopNoticeView,//顶部通知条 17 | HLLPopupSceneFull,//全屏广告 18 | }; 19 | 20 | /** 显示动画样式 */ 21 | typedef NS_ENUM(NSInteger, HLLPopAnimationStyle) { 22 | HLLPopAnimationStyleFade = 0, //渐隐渐变出现 23 | HLLPopAnimationStyleFallTop, //顶部降落 适用:(HLLPopupSceneCenter) 24 | HLLPopAnimationStyleRiseBottom, //底部升起 适用:(HLLPopupSceneHalfPage) 25 | HLLPopAnimationStyleScale, //比例动画 26 | }; 27 | 28 | /** 消失动画样式 */ 29 | typedef NS_ENUM(NSInteger, HLLDismissAnimationStyle) { 30 | HLLDismissAnimationStyleFade = 0, //渐隐渐变消失 31 | HLLDismissAnimationStyleNO, //无动画 32 | }; 33 | 34 | typedef CGFloat HLLPopupStrategyPriority;//优先级类型 35 | typedef dispatch_block_t HLLPopupCallback; 36 | typedef void (^HLLPopupKeyBoardChange)(CGRect beginFrame,CGRect endFrame,CGFloat duration);//键盘信息回调 37 | 38 | NS_ASSUME_NONNULL_BEGIN 39 | 40 | @interface HLLPopupConfigure : NSObject 41 | 42 | /// 弹窗唯一标识 43 | @property (nonatomic, copy) NSString *identifier; 44 | 45 | /// 优先级 范围0~1000 (默认0,遵循先进先出) 46 | @property (nonatomic, assign) CGFloat priority; 47 | 48 | /// 弹窗场景风格 49 | @property (nonatomic, assign) HLLPopupScene sceneStyle; 50 | 51 | /// 点击弹窗背景(弹窗内容之外的区域)弹窗是否消失 default NO 52 | @property (nonatomic, assign, getter=isClickOutsideDismiss) BOOL clickOutsideDismiss; 53 | 54 | /// 弹窗的容器视图,默认是当前APP的keywindow,可以设置成其他容器 55 | @property (nonatomic, weak) UIView *containerView; 56 | 57 | /// 持续时长 设置后会在设定时间结束后自动dismiss,不设置不会自动消失 58 | @property (nonatomic, assign) NSTimeInterval dismissDuration; 59 | 60 | /// 该属性默认NO。设置YES会让之前的所有同组弹窗全部清除掉(优先级属性失效) 61 | @property (nonatomic, assign, getter=isAloneMode) BOOL aloneMode; 62 | 63 | /// 和aloneMode模式类似,不过terminatorMode会清除掉之前所有分组的弹窗 64 | @property (nonatomic, assign, getter=isTerminatorMode) BOOL terminatorMode; 65 | 66 | /// pop/dismiss动画样式 67 | @property (nonatomic, assign) HLLPopAnimationStyle popAnimationStyle; 68 | @property (nonatomic, assign) HLLDismissAnimationStyle dismissAnimationStyle; 69 | 70 | /// 弹窗视图后面的背景色,通常是默认的半透明黑色,可自定义设置 71 | @property (nonatomic, strong) UIColor *backgroundColor; 72 | 73 | /// 背景透明度 74 | @property (nonatomic, assign) CGFloat backgroundAlpha; 75 | 76 | /* 分组ID,如果设置了分组ID,不同分组ID的弹窗不受影响,独立调度展示, 77 | HLLPopupSceneTopNoticeView 类型的默认自带分组(因为顶部通知条可覆盖普通弹窗)*/ 78 | @property (nonatomic, copy) NSString *groupID; 79 | 80 | /// 弹窗内容圆角方向,默认UIRectCornerAllCorners,当cornerRadius>0时生效 81 | @property (nonatomic, assign) UIRectCorner rectCorners; 82 | 83 | /// 弹窗内容圆角大小 84 | @property (nonatomic, assign) CGFloat cornerRadius; 85 | 86 | /// 顶部通知条支持上滑关闭 默认YES 87 | @property (nonatomic, assign) BOOL needNoticeBarPanGesture; 88 | 89 | //不设置内部会默认根据动画类型设置 90 | @property (nonatomic, assign) NSTimeInterval popAnimationTime; 91 | @property (nonatomic, assign) NSTimeInterval dismissAnimationTime; 92 | 93 | /// 是否隐藏背景 94 | @property (nonatomic, assign,getter=isHiddenBackgroundView) BOOL hiddenBackgroundView; 95 | 96 | /// 键盘和弹窗之间的垂直间距,通常默认为10,底部弹窗默认0 97 | @property (nonatomic, assign) CGFloat keyboardVSpace; 98 | 99 | #pragma mark - 事件回调 100 | /// 点击背景回调 101 | @property (nullable, nonatomic, copy) HLLPopupCallback clickBgCallback; 102 | 103 | #pragma mark - 弹窗显示生命周期 104 | @property (nullable, nonatomic, copy) HLLPopupCallback popViewDidShowCallback; 105 | @property (nullable, nonatomic, copy) HLLPopupCallback popViewDidDismissCallback; 106 | 107 | #pragma mark - 键盘处理 108 | @property (nullable, nonatomic, copy) HLLPopupCallback keyboardWillShowCallback; 109 | @property (nullable, nonatomic, copy) HLLPopupCallback keyboardDidShowCallback; 110 | @property (nullable, nonatomic, copy) HLLPopupKeyBoardChange keyboardFrameWillChange; 111 | @property (nullable, nonatomic, copy) HLLPopupKeyBoardChange keyboardFrameDidChange; 112 | @property (nullable, nonatomic, copy) HLLPopupCallback keyboardWillHideCallback; 113 | @property (nullable, nonatomic, copy) HLLPopupCallback keyboardDidHideCallback; 114 | 115 | /// 配置默认参数(业务中无需调用) 116 | - (void)configureDefaultParams; 117 | @end 118 | 119 | NS_ASSUME_NONNULL_END 120 | -------------------------------------------------------------------------------- /PopupsManager/Classes/HLLPopupConfigure.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLPopoverWidgetConfigure.m 3 | // 4 | // Created by Kris on 2021/9/22. 5 | // 6 | 7 | #import "HLLPopupConfigure.h" 8 | #import 9 | 10 | @implementation HLLPopupConfigure 11 | 12 | - (instancetype)init 13 | { 14 | self = [super init]; 15 | if (self) { 16 | //弹窗配置初始化 17 | _clickOutsideDismiss = NO; 18 | _sceneStyle = HLLPopupSceneCenter; 19 | _popAnimationStyle = HLLPopAnimationStyleFade; 20 | _dismissAnimationStyle = HLLDismissAnimationStyleFade; 21 | _priority = 0; 22 | _aloneMode = NO; 23 | _backgroundColor = [UIColor blackColor]; 24 | _backgroundAlpha = 0.25; 25 | _popAnimationTime = 0.3; 26 | _dismissAnimationTime = 0.3; 27 | _keyboardVSpace = 10; 28 | } 29 | return self; 30 | } 31 | 32 | - (void)configureDefaultParams { 33 | if (_cornerRadius > 0 && _rectCorners == 0) { 34 | _rectCorners = UIRectCornerAllCorners; 35 | } 36 | //通知条场景默认进行独立分组 37 | if (_sceneStyle == HLLPopupSceneTopNoticeView && _groupID == nil) { 38 | _groupID = @"PopupSceneTopNoticeBar"; 39 | _hiddenBackgroundView = YES; 40 | } 41 | //通知条默认自带上滑关闭手势 42 | if (_sceneStyle == HLLPopupSceneTopNoticeView) { 43 | _needNoticeBarPanGesture = YES; 44 | _clickOutsideDismiss = NO; 45 | } 46 | //底部半页 47 | if (_sceneStyle == HLLPopupSceneHalfPage) { 48 | _keyboardVSpace = 0.f; 49 | } 50 | } 51 | 52 | - (void)setPopAnimationTime:(NSTimeInterval)popAnimationTime { 53 | if (popAnimationTime > 0 && popAnimationTime < 3) { 54 | _popAnimationTime = popAnimationTime; 55 | } 56 | } 57 | 58 | - (void)setDismissAnimationTime:(NSTimeInterval)dismissAnimationTime { 59 | if (dismissAnimationTime > 0 && dismissAnimationTime < 3) { 60 | _dismissAnimationTime = dismissAnimationTime; 61 | } 62 | } 63 | 64 | - (id)copyWithZone:(NSZone *)zone { 65 | return [self yy_modelCopy]; 66 | } 67 | 68 | - (id)initWithCoder:(NSCoder *)decoder { 69 | if (self = [super init]) { 70 | [self yy_modelInitWithCoder:decoder]; 71 | } 72 | return self; 73 | } 74 | 75 | - (void)encodeWithCoder:(NSCoder *)encoder { 76 | [self yy_modelEncodeWithCoder:encoder]; 77 | } 78 | 79 | @end 80 | -------------------------------------------------------------------------------- /PopupsManager/Classes/HLLPopupInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLPopupViewInterface.h 3 | // 4 | // Created by Kris on 2021/9/2. 5 | // 6 | 7 | #import "HLLPopupConfigure.h" 8 | 9 | @protocol HLLPopupInterface 10 | 11 | @required 12 | /// 提供一个弹窗view对象 13 | - (UIView *)supplyCustomPopupView; 14 | 15 | @optional 16 | /// 对自定义view进行布局 17 | - (void)layoutWithSuperView:(UIView *)superView; 18 | 19 | /// 执行自定义动画 20 | - (void)executeCustomAnimation; 21 | 22 | /// 提供一个需要设置圆角的view 默认是 supplyCustomPopupView 提供的view 23 | - (UIView *)needSetCornerRadiusView; 24 | 25 | /// 倒计时剩余时间回调 26 | /// @param count count 27 | - (void)countTimeWithCount:(NSInteger)count; 28 | 29 | /* 弹窗的生命周期 */ 30 | - (void)popupViewDidAppear; 31 | - (void)popupViewDidDisappear; 32 | @end 33 | -------------------------------------------------------------------------------- /PopupsManager/Classes/HLLPopupsManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // HLLWindowManager.h 3 | // 4 | // Created by Kris on 2021/8/24. 5 | // 6 | 7 | #import 8 | #import "HLLPopupInterface.h" 9 | #import "HLLPopupConfigure.h" 10 | #import 11 | 12 | NS_ASSUME_NONNULL_BEGIN 13 | /** 14 | HLLWindowManager:一个负责管理APP整个生命周期内,所有以弹窗样式展示的视图。 15 | */ 16 | @class HLLPopupViewInterface; 17 | 18 | @interface HLLPopupsManager : NSObject 19 | 20 | //单例对象 21 | + (instancetype)defaultManager; 22 | 23 | - (instancetype)init UNAVAILABLE_ATTRIBUTE; 24 | + (instancetype)new UNAVAILABLE_ATTRIBUTE; 25 | 26 | //当前所有队列中的弹窗 27 | @property(nonatomic, strong, readonly) NSArray> *allPopups; 28 | 29 | /// 增加弹窗 (快速调用API方法,优先级和配置对象都采用默认) 30 | /// @param popup popup:一个遵守了指定协议的类,该类不限制是否是UIView的子类,只要业务代码中保证实现了协议中的必选方法即可,在方法中告诉弹窗调度你 31 | /// 真正的内容视图对象即可 32 | + (void)addPopup:(id)popup; 33 | 34 | /// 增加弹窗 35 | /// @param popup popup target 36 | /// @param priority 优先级:弹窗调度会根据不同优先级的弹窗来决定是否需要立即展示,高优先级的弹窗总是会先于低优先级的弹窗展示 37 | + (void)addPopup:(id)popup priority:(HLLPopupStrategyPriority)priority; 38 | 39 | /// 增加弹窗 40 | /// @param popup popup target 41 | /// @param options configure:一个弹窗配置对象,里面提供了涵哥各种弹窗场景的属性供调用者设置 42 | + (void)addPopup:(id)popup options:(HLLPopupConfigure * _Nullable )options; 43 | 44 | /// 移除指定弹窗 45 | /// @param popup popup:触发弹窗时传入的遵守协议的对象 46 | + (void)dismissWithPopup:(id)popup; 47 | 48 | /// 移除指定弹窗 49 | /// @param identifier identifier: 业务调用中设置的唯一标识符 50 | + (void)dismissPopupWithIdentifier:(NSString *)identifier; 51 | 52 | /// 从指定容器中移除所有的弹窗 53 | /// @param containerView 指定容器,传nil则移除当前APP的keywindow上的 54 | + (void)removeAllPopupFromContainerView:(UIView *)containerView; 55 | 56 | /// 移除调度管理中之前加入的所有弹窗 57 | + (void)removeAllPopup; 58 | 59 | /// 获取指定容器中的所有弹窗个数 60 | /// @param containerView 容器view 61 | + (NSInteger)getAllPopupCountFromContainerView:(UIView *)containerView; 62 | 63 | /// 获取所有容器中的弹窗个数 64 | + (NSInteger)getTotalPopupCount; 65 | 66 | @end 67 | 68 | NS_ASSUME_NONNULL_END 69 | -------------------------------------------------------------------------------- /PopupsManager/Classes/HLLPopupsManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // HLLWindowManager.m 3 | // 4 | // Created by Kris on 2021/8/24. 5 | // 6 | 7 | #import "HLLPopupsManager.h" 8 | 9 | /* 弹窗背景视图 */ 10 | @interface HLLPopViewBgView : UIView 11 | //是否隐藏背景 default:NO 12 | @property (nonatomic, assign, getter=isHiddenBg) BOOL hiddenBg; 13 | @end 14 | 15 | @implementation HLLPopViewBgView 16 | 17 | - (instancetype)init 18 | { 19 | self = [super init]; 20 | if (self) { 21 | self.backgroundColor = [UIColor clearColor]; 22 | } 23 | return self; 24 | } 25 | 26 | - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event{ 27 | UIView *hitView = [super hitTest:point withEvent:event]; 28 | if(hitView == self && self.isHiddenBg){ 29 | return nil; 30 | } 31 | return hitView; 32 | } 33 | @end 34 | 35 | /** 弹窗对象模型 */ 36 | @interface HLLPopupModel : NSObject 37 | @property (nonatomic, strong) id popupObj;//弹窗内容对象 38 | @property (nonatomic, strong) HLLPopupConfigure *config;//弹窗的配置 39 | @property (nonatomic, strong) HLLPopViewBgView *popupBgView;//弹窗背景 40 | @property (nonatomic, assign) BOOL isValidModel;//校验模型是否有效 41 | @property (nonatomic, assign) CGRect originalFrame; 42 | @property (nonatomic, strong) NSTimer *timer;//定时器 43 | @property (nonatomic, assign) NSTimeInterval dismissTime; 44 | @end 45 | 46 | @implementation HLLPopupModel 47 | 48 | - (BOOL)isValidModel { 49 | if (!self.config || 50 | !self.popupBgView || 51 | !_popupObj || 52 | CGSizeEqualToSize(_popupBgView.bounds.size, CGSizeZero)) { 53 | return NO; 54 | } 55 | return YES; 56 | } 57 | 58 | - (void)setConfig:(HLLPopupConfigure *)config { 59 | _config = config; 60 | if (config.dismissDuration > 0) { 61 | _dismissTime = config.dismissDuration; 62 | } 63 | } 64 | 65 | - (UIView *)contentView { 66 | return (UIView *)[_popupObj supplyCustomPopupView]; 67 | } 68 | 69 | //给自定义的弹窗内容设置圆角 70 | - (void)setupCustomViewCorners { 71 | [self.popupBgView layoutIfNeeded]; 72 | BOOL isSetCorner = NO; 73 | if (self.config.rectCorners & UIRectCornerTopLeft) { 74 | isSetCorner = YES; 75 | } 76 | if (self.config.rectCorners & UIRectCornerTopRight) { 77 | isSetCorner = YES; 78 | } 79 | if (self.config.rectCorners & UIRectCornerBottomLeft) { 80 | isSetCorner = YES; 81 | } 82 | if (self.config.rectCorners & UIRectCornerBottomRight) { 83 | isSetCorner = YES; 84 | } 85 | if (self.config.rectCorners & UIRectCornerAllCorners) { 86 | isSetCorner = YES; 87 | } 88 | 89 | if (isSetCorner && self.config.rectCorners > 0) { 90 | UIView *cornerRadiusView = [self contentView]; 91 | if ([self.popupObj respondsToSelector:@selector(needSetCornerRadiusView)]) { 92 | UIView *view = [self.popupObj needSetCornerRadiusView]; 93 | if (view && CGSizeEqualToSize(view.bounds.size, CGSizeZero) != YES) { 94 | cornerRadiusView = view; 95 | } 96 | } 97 | UIBezierPath * path = [UIBezierPath bezierPathWithRoundedRect:cornerRadiusView.bounds 98 | byRoundingCorners:self.config.rectCorners 99 | cornerRadii:CGSizeMake(self.config.cornerRadius, self.config.cornerRadius)]; 100 | CAShapeLayer * layer = [[CAShapeLayer alloc]init]; 101 | layer.frame = cornerRadiusView.bounds; 102 | layer.path = path.CGPath; 103 | cornerRadiusView.layer.mask = layer; 104 | } 105 | } 106 | 107 | //开始倒计时 108 | - (void)startCountTime { 109 | _timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(timerLoopExecute) userInfo:nil repeats:YES]; 110 | //加入runloop循环池 111 | [[NSRunLoop mainRunLoop] addTimer:_timer forMode:NSRunLoopCommonModes]; 112 | //开启定时器 113 | [_timer fire]; 114 | } 115 | 116 | - (void)closeTimer { 117 | if (_timer) { 118 | [_timer invalidate]; 119 | _timer = nil; 120 | } 121 | _dismissTime = self.config.dismissDuration;//定时器计数复原 122 | } 123 | 124 | - (void)timerLoopExecute { 125 | if (self.dismissTime < 1) { 126 | [self closeTimer]; 127 | //关闭弹窗 128 | [HLLPopupsManager dismissWithPopup:self.popupObj]; 129 | return; 130 | } 131 | self.dismissTime --; 132 | if ([self.popupObj respondsToSelector:@selector(countTimeWithCount:)]) { 133 | [self.popupObj countTimeWithCount:self.dismissTime]; 134 | } 135 | } 136 | 137 | #pragma mark - 手势处理 138 | 139 | //添加相关手势 140 | - (void)addGestureRecognizer { 141 | //弹窗背景添加手势 142 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(popupBgViewTap:)]; 143 | tap.delegate = self; 144 | [self.popupBgView addGestureRecognizer:tap]; 145 | 146 | //添加上滑手势 147 | if (self.config.needNoticeBarPanGesture) { 148 | UIPanGestureRecognizer *panGesture = [[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(popupBgViewPan:)]; 149 | panGesture.delegate = self; 150 | [self.popupBgView addGestureRecognizer:panGesture]; 151 | } 152 | 153 | } 154 | 155 | -(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{ 156 | if ([touch.view isDescendantOfView:[self contentView]] && self.config.sceneStyle != HLLPopupSceneTopNoticeView) { 157 | return NO; 158 | } 159 | return YES; 160 | } 161 | 162 | //背景手势回调 163 | - (void)popupBgViewTap:(UIGestureRecognizer *)gestureRecognizer { 164 | if (self.config.clickOutsideDismiss) { 165 | [self.popupBgView endEditing:YES]; 166 | [HLLPopupsManager dismissWithPopup:self.popupObj]; 167 | } 168 | } 169 | 170 | - (void)popupBgViewPan:(UIPanGestureRecognizer *)gestureRecognizer { 171 | // 获取手指的偏移量 172 | CGPoint transP = [gestureRecognizer translationInView:[self contentView]]; 173 | CGRect originFrame = self.originalFrame; 174 | if (transP.y < 0) { 175 | CGFloat offy = (originFrame.origin.y + originFrame.size.height/2) - ABS(transP.y); 176 | [self contentView].layer.position = CGPointMake([self contentView].layer.position.x, offy); 177 | }else{ 178 | [self contentView].frame = self.originalFrame; 179 | } 180 | if(gestureRecognizer.state == UIGestureRecognizerStateEnded) { 181 | if (ABS(transP.y) >= (self.originalFrame.size.height/2)) { 182 | //向上滑动了至少内容的一半高度,触发关闭弹窗 183 | [HLLPopupsManager dismissWithPopup:self.popupObj]; 184 | }else{ 185 | [self contentView].frame = self.originalFrame;//复原 186 | } 187 | } 188 | } 189 | 190 | #pragma mark - Keyboard 191 | 192 | - (void)addKeyboardMonitor { 193 | id observer = self; 194 | //键盘将要显示 195 | [[NSNotificationCenter defaultCenter] addObserver:observer 196 | selector:@selector(keyboardWillShow:) 197 | name:UIKeyboardWillShowNotification 198 | object:nil]; 199 | //键盘显示完毕 200 | [[NSNotificationCenter defaultCenter] addObserver:observer 201 | selector:@selector(keyboardDidShow:) 202 | name:UIKeyboardDidShowNotification 203 | object:nil]; 204 | //键盘frame将要改变 205 | [[NSNotificationCenter defaultCenter] addObserver:observer 206 | selector:@selector(keyboardWillChangeFrame:) 207 | name:UIKeyboardWillChangeFrameNotification 208 | object:nil]; 209 | //键盘frame改变完毕 210 | [[NSNotificationCenter defaultCenter] addObserver:observer 211 | selector:@selector(keyboardDidChangeFrame:) 212 | name:UIKeyboardDidChangeFrameNotification 213 | object:nil]; 214 | //键盘将要收起 215 | [[NSNotificationCenter defaultCenter] addObserver:observer 216 | selector:@selector(keyboardWillHide:) 217 | name:UIKeyboardWillHideNotification 218 | object:nil]; 219 | //键盘收起完毕 220 | [[NSNotificationCenter defaultCenter] addObserver:observer 221 | selector:@selector(keyboardDidHide:) 222 | name:UIKeyboardDidHideNotification 223 | object:nil]; 224 | } 225 | 226 | #pragma mark - 键盘事件处理 227 | 228 | - (void)keyboardWillShow:(NSNotification *)notification{ 229 | self.config.keyboardWillShowCallback ? self.config.keyboardWillShowCallback() : nil; 230 | CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 231 | CGRect keyboardEedFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 232 | CGFloat keyboardMaxY = keyboardEedFrame.origin.y; 233 | CGPoint popViewPoint = [self contentView].layer.position; 234 | CGFloat currMaxY = popViewPoint.y + [self contentView].frame.size.height/2; 235 | CGFloat offY = currMaxY - keyboardMaxY; 236 | if (keyboardMaxY < currMaxY) {//键盘被遮挡 237 | //执行动画 238 | CGPoint originPoint = [self contentView].layer.position; 239 | [UIView animateWithDuration:duration animations:^{ 240 | [self contentView].layer.position = CGPointMake(originPoint.x, originPoint.y - offY); 241 | }]; 242 | } 243 | } 244 | 245 | - (void)keyboardDidShow:(NSNotification *)notification{ 246 | self.config.keyboardDidShowCallback ? self.config.keyboardDidShowCallback() : nil; 247 | } 248 | 249 | - (void)keyboardWillHide:(NSNotification *)notification{ 250 | self.config.keyboardWillHideCallback ? self.config.keyboardWillHideCallback() : nil; 251 | CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 252 | [UIView animateWithDuration:duration animations:^{ 253 | [self contentView].frame = self.originalFrame; 254 | }]; 255 | } 256 | 257 | - (void)keyboardDidHide:(NSNotification *)notification{ 258 | self.config.keyboardDidHideCallback ? self.config.keyboardDidHideCallback() : nil; 259 | } 260 | 261 | - (void)keyboardWillChangeFrame:(NSNotification *)notification{ 262 | if (self.config.keyboardFrameWillChange) { 263 | CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue]; 264 | CGRect keyboardEedFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 265 | CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 266 | self.config.keyboardFrameWillChange(keyboardBeginFrame,keyboardEedFrame,duration); 267 | } 268 | } 269 | 270 | - (void)keyboardDidChangeFrame:(NSNotification *)notification{ 271 | if (self.config.keyboardFrameDidChange) { 272 | CGRect keyboardBeginFrame = [notification.userInfo[UIKeyboardFrameBeginUserInfoKey] CGRectValue]; 273 | CGRect keyboardEedFrame = [notification.userInfo[UIKeyboardFrameEndUserInfoKey] CGRectValue]; 274 | CGFloat duration = [notification.userInfo[UIKeyboardAnimationDurationUserInfoKey] floatValue]; 275 | self.config.keyboardFrameDidChange(keyboardBeginFrame,keyboardEedFrame,duration); 276 | } 277 | } 278 | 279 | - (void)dealloc { 280 | [[NSNotificationCenter defaultCenter] removeObserver:self]; 281 | } 282 | 283 | @end 284 | 285 | #pragma mark - 弹窗调度管理器 286 | @interface HLLPopupsManager () 287 | //window弹窗存放的缓存队列 288 | @property (nonatomic, strong) NSMutableArray *windowQueue; 289 | //等待删除的弹窗模型 290 | @property (nonatomic, strong) NSHashTable *waitRemovePool; 291 | @end 292 | 293 | @implementation HLLPopupsManager 294 | 295 | + (instancetype)defaultManager { 296 | static dispatch_once_t onceToken; 297 | static HLLPopupsManager *instance = nil; 298 | dispatch_once(&onceToken, ^{ 299 | instance = [[super allocWithZone:NULL] init]; 300 | }); 301 | return instance; 302 | } 303 | 304 | + (id)allocWithZone:(struct _NSZone *)zone { 305 | return [self defaultManager]; 306 | } 307 | 308 | #pragma mark - Public API 309 | 310 | + (void)addPopup:(id)popup { 311 | HLLPopupsManager *manage = [HLLPopupsManager defaultManager]; 312 | [manage addPopup:popup 313 | priority:0 314 | options:nil]; 315 | } 316 | 317 | + (void)addPopup:(id)popup priority:(HLLPopupStrategyPriority)priority{ 318 | HLLPopupsManager *manage = [HLLPopupsManager defaultManager]; 319 | [manage addPopup:popup 320 | priority:priority 321 | options:nil]; 322 | } 323 | 324 | + (void)addPopup:(id)popup options:(HLLPopupConfigure *)options{ 325 | HLLPopupsManager *manage = [HLLPopupsManager defaultManager]; 326 | [manage addPopup:popup 327 | priority:0 328 | options:options]; 329 | } 330 | 331 | //新增弹窗 332 | - (void)addPopup:(id)popup priority:(HLLPopupStrategyPriority)priority options:(HLLPopupConfigure *)options{ 333 | if (!popup || ![[self class] checkMainThread]) { 334 | return; 335 | } 336 | //弹窗配置对象 337 | HLLPopupConfigure *config = [HLLPopupConfigure new]; 338 | if (options) { 339 | config = [options copy]; 340 | }else{ 341 | if (priority != 0) { 342 | config.priority = priority; 343 | } 344 | } 345 | [config configureDefaultParams];//配置默认参数 346 | config.containerView = config.containerView ? config.containerView : [UIApplication sharedApplication].keyWindow; 347 | CGRect popupFrame = config.containerView.bounds; 348 | if (CGSizeEqualToSize(popupFrame.size, CGSizeZero)) { 349 | CGSize size = [UIScreen mainScreen].bounds.size; 350 | popupFrame = CGRectMake(0, 0, size.width, size.height); 351 | } 352 | 353 | //弹窗数据模型 354 | HLLPopupModel *model = [[HLLPopupModel alloc] init]; 355 | model.config = config; 356 | model.popupObj = popup; 357 | HLLPopViewBgView *bgView = [[HLLPopViewBgView alloc] initWithFrame:popupFrame]; 358 | bgView.backgroundColor = config.backgroundColor; 359 | bgView.hiddenBg = config.isHiddenBackgroundView; 360 | model.popupBgView = bgView; 361 | 362 | if (![popup conformsToProtocol:@protocol(HLLPopupInterface)]) { 363 | return; 364 | } 365 | //将弹窗内容视图添加到弹窗背景视图中 366 | [model.popupBgView addSubview:[popup supplyCustomPopupView]]; 367 | //增加相关手势处理 368 | [model addGestureRecognizer]; 369 | //适配键盘 370 | [model addKeyboardMonitor]; 371 | //pop 372 | [self popWithModel:model isRecover:NO]; 373 | } 374 | 375 | + (void)dismissWithPopup:(id)popup { 376 | if (!popup || ![self checkMainThread]) { 377 | return; 378 | } 379 | HLLPopupModel *model = [[HLLPopupsManager defaultManager] getModelWithPopup:popup]; 380 | if (model) { 381 | [[HLLPopupsManager defaultManager] dismissWithModel:model]; 382 | } 383 | } 384 | 385 | + (void)dismissPopupWithIdentifier:(NSString *)identifier { 386 | if (!identifier || identifier.length < 1 || ![self checkMainThread]) { 387 | return; 388 | } 389 | HLLPopupModel *model = [[HLLPopupsManager defaultManager] getModelWithIdentifirer:identifier]; 390 | if (model) { 391 | [[HLLPopupsManager defaultManager] dismissWithModel:model]; 392 | } 393 | } 394 | 395 | + (void)removeAllPopupFromContainerView:(UIView *)containerView { 396 | if (![self checkMainThread]) { 397 | return; 398 | } 399 | UIView *view = containerView; 400 | if (!view) { 401 | view = [UIApplication sharedApplication].keyWindow; 402 | } 403 | NSArray *arr = [[HLLPopupsManager defaultManager] getAllPopViewFromContainerView:view]; 404 | if (arr.count < 1) { 405 | return; 406 | } 407 | NSMutableArray *waitRemoveArr = [[NSMutableArray alloc] initWithArray:arr]; 408 | //移除之前所有的弹窗 409 | while (waitRemoveArr.count) { 410 | HLLPopupModel *model = waitRemoveArr.lastObject; 411 | if ([model.popupObj respondsToSelector:@selector(popupViewDidDisappear)]) { 412 | [model.popupObj popupViewDidDisappear]; 413 | } 414 | [model.popupBgView removeFromSuperview]; 415 | [waitRemoveArr removeLastObject]; 416 | } 417 | [[HLLPopupsManager defaultManager].windowQueue removeObjectsInArray:arr]; 418 | } 419 | 420 | + (void)removeAllPopup { 421 | NSMutableArray *array = [[NSMutableArray alloc] init]; 422 | for (HLLPopupModel *itemModel in [HLLPopupsManager defaultManager].windowQueue) { 423 | //剔除通知条类型的 424 | if (itemModel.config.sceneStyle != HLLPopupSceneTopNoticeView) { 425 | [array addObject:itemModel]; 426 | } 427 | } 428 | NSMutableArray *waitRemoveArr = [[NSMutableArray alloc] initWithArray:array]; 429 | //移除之前所有的弹窗 430 | while (waitRemoveArr.count) { 431 | HLLPopupModel *model = waitRemoveArr.lastObject; 432 | if ([model.popupObj respondsToSelector:@selector(popupViewDidDisappear)]) { 433 | [model.popupObj popupViewDidDisappear]; 434 | } 435 | [model.popupBgView removeFromSuperview]; 436 | [waitRemoveArr removeLastObject]; 437 | } 438 | [[HLLPopupsManager defaultManager].windowQueue removeObjectsInArray:array]; 439 | 440 | } 441 | 442 | + (NSInteger)getAllPopupCountFromContainerView:(UIView *)containerView { 443 | if (![self checkMainThread]) { 444 | return 0; 445 | } 446 | UIView *view = containerView; 447 | if (!view) { 448 | view = [UIApplication sharedApplication].keyWindow; 449 | } 450 | NSArray *arr = [[HLLPopupsManager defaultManager] getAllPopViewFromContainerView:view]; 451 | return arr.count; 452 | } 453 | 454 | + (NSInteger)getTotalPopupCount { 455 | if (![self checkMainThread]) { 456 | return 0; 457 | } 458 | return [HLLPopupsManager defaultManager].windowQueue.count; 459 | } 460 | 461 | #pragma mark - Pop 462 | 463 | - (void)popWithModel:(HLLPopupModel *)model isRecover:(BOOL)isRecover { 464 | if (!model || !model.isValidModel) { 465 | return; 466 | } 467 | //移除掉前面指定数组内的弹窗 468 | void(^clearAgoPopsBlock)(NSArray *) = ^(NSArray *list){ 469 | if (list.count < 1) { 470 | return; 471 | } 472 | NSMutableArray *waitRemoveArr = [[NSMutableArray alloc] initWithArray:list]; 473 | //移除之前所有的弹窗 474 | while (waitRemoveArr.count) { 475 | [self dismissWithModel:waitRemoveArr.lastObject isRemoveQueue:YES]; 476 | [waitRemoveArr removeLastObject]; 477 | } 478 | }; 479 | 480 | if (model.config.isAloneMode) {//isAloneMode模式只会把相同的Group下的弹窗移除 481 | NSArray *popupsList = [self getPopupsFromAllPopupsWithGroupId:model.config.groupID]; 482 | clearAgoPopsBlock(popupsList); 483 | } 484 | 485 | if(model.config.isTerminatorMode){//isTerminatorMode模式把不同的Group下的弹窗都给移除 486 | NSArray *popupsList = self.windowQueue; 487 | clearAgoPopsBlock(popupsList); 488 | }else{ 489 | //根据优先级叠加展示,被叠加的弹窗会隐藏看不到,无论是加到哪个容器里面的弹窗都会放到一起进行优先级比对 490 | NSArray *allPopModelArr = [self getPopupsFromAllPopupsWithGroupId:model.config.groupID]; 491 | if (allPopModelArr.count && !isRecover) { 492 | HLLPopupModel *lastModel = allPopModelArr.lastObject; 493 | //如果新进来的弹窗优先级比当前展示的弹窗优先级高 494 | if (model.config.priority >= lastModel.config.priority) { 495 | [lastModel.popupBgView endEditing:YES]; 496 | //当前组展示的弹窗被优先级高的顶替掉了 497 | [self dismissWithModel:lastModel isRemoveQueue:NO]; 498 | }else{ 499 | [self enterPopWindsQueueWithModel:model];//先入列排队等待展示 500 | return; 501 | } 502 | } 503 | } 504 | if (!model.popupBgView.superview) { 505 | [model.config.containerView addSubview:model.popupBgView]; 506 | [model.config.containerView bringSubviewToFront:model.popupBgView]; 507 | } 508 | //弹窗内容自定义布局 509 | if ([model.popupObj respondsToSelector:@selector(layoutWithSuperView:)]) { 510 | [model.popupObj layoutWithSuperView:model.popupBgView]; 511 | } 512 | //获取到业务中ContentView的frame 513 | [model.popupBgView layoutIfNeeded]; 514 | //缓存弹窗内容的原始frame 515 | model.originalFrame = [model.popupObj supplyCustomPopupView].frame; 516 | //开启定时器 517 | if (model.config.dismissDuration >= 1) { 518 | [model startCountTime]; 519 | } 520 | //pop动画 521 | [self popAnimationWithPopViewModel:model isNeedAnimation:YES]; 522 | //入列 523 | if (!isRecover) { 524 | [self enterPopWindsQueueWithModel:model]; 525 | } 526 | //配置圆角 527 | [model setupCustomViewCorners]; 528 | //将要展示回调 529 | model.config.popViewDidShowCallback ? model.config.popViewDidShowCallback() : nil; 530 | if ([model.popupObj respondsToSelector:@selector(popupViewDidAppear)]) { 531 | [model.popupObj popupViewDidAppear]; 532 | } 533 | } 534 | 535 | //执行pop动画 536 | - (void)popAnimationWithPopViewModel:(HLLPopupModel *)model isNeedAnimation:(BOOL)isNeedAnimation { 537 | if (!isNeedAnimation) { 538 | //不需要动画就基础渐隐展示即可 539 | [self baseAlphaChangeWithModel:model isPop:YES]; 540 | return; 541 | } 542 | if ([model.popupObj respondsToSelector:@selector(executeCustomAnimation)]) { 543 | [self baseAlphaChangeWithModel:model isPop:YES]; 544 | [model.popupObj executeCustomAnimation]; 545 | return; 546 | } 547 | //背景动画执行 548 | model.popupBgView.backgroundColor = [self drawBackgroundViewColorWith:model.config.backgroundColor 549 | alpha:0 550 | withModel:model]; 551 | [model contentView].alpha = 1.0f; 552 | [UIView animateWithDuration:model.config.popAnimationTime animations:^{ 553 | model.popupBgView.backgroundColor = [self drawBackgroundViewColorWith:model.config.backgroundColor 554 | alpha:model.config.backgroundAlpha 555 | withModel:model]; 556 | }]; 557 | CGSize popViewSize = model.originalFrame.size; 558 | CGPoint originPoint = model.originalFrame.origin; 559 | CGPoint startPosition = CGPointMake(originPoint.x + popViewSize.width/2, originPoint.y + popViewSize.height/2); 560 | switch (model.config.sceneStyle) { 561 | case HLLPopupSceneHalfPage:{ 562 | UIView *contentView = [model contentView]; 563 | contentView.layer.position = CGPointMake(contentView.layer.position.x, CGRectGetMaxY(model.popupBgView.frame) + model.originalFrame.size.height*0.5); 564 | [UIView animateWithDuration:model.config.popAnimationTime 565 | delay:0 566 | usingSpringWithDamping:1 567 | initialSpringVelocity:1.0 568 | options:UIViewAnimationOptionCurveEaseOut 569 | animations:^{ 570 | contentView.layer.position = startPosition; 571 | } completion:nil]; 572 | 573 | }break; 574 | case HLLPopupSceneTopNoticeView:{ 575 | UIView *contentView = [model contentView]; 576 | contentView.layer.position = CGPointMake(contentView.layer.position.x,-(model.originalFrame.size.height*0.5)); 577 | [UIView animateWithDuration:model.config.popAnimationTime 578 | delay:0 579 | usingSpringWithDamping:1 580 | initialSpringVelocity:1.0 581 | options:UIViewAnimationOptionCurveEaseOut 582 | animations:^{ 583 | 584 | contentView.layer.position = startPosition; 585 | } completion:nil]; 586 | }break; 587 | case HLLPopupSceneCenter:{ 588 | [self handlePopAnimaationForCenterSceneWithModel:model]; 589 | }break; 590 | default: 591 | break; 592 | } 593 | } 594 | 595 | //执行center scene 类型的配置动画 596 | - (void)handlePopAnimaationForCenterSceneWithModel:(HLLPopupModel *)model { 597 | UIView *contentView = [model contentView]; 598 | CGPoint startPosition = contentView.layer.position; 599 | switch (model.config.popAnimationStyle) { 600 | case HLLPopAnimationStyleFade:{ 601 | //基础渐显动画 602 | [self baseAlphaChangeWithModel:model isPop:YES]; 603 | return; 604 | }break; 605 | case HLLPopAnimationStyleFallTop:{ 606 | contentView.layer.position = CGPointMake(contentView.layer.position.x, CGRectGetMidY(model.popupBgView.frame) - model.originalFrame.size.height*0.5); 607 | }break; 608 | case HLLPopAnimationStyleRiseBottom:{ 609 | contentView.layer.position = CGPointMake(contentView.layer.position.x, CGRectGetMaxY(model.popupBgView.frame) + model.originalFrame.size.height*0.5); 610 | }break; 611 | case HLLPopAnimationStyleScale:{ 612 | [self baseAlphaChangeWithModel:model isPop:YES]; 613 | //先变大后恢复至原始大小 614 | [self animationWithLayer:[model contentView].layer 615 | duration:(model.config.popAnimationTime) 616 | values:@[@0.0, @1.2, @1.0]]; 617 | return; 618 | }break; 619 | default: 620 | break; 621 | } 622 | 623 | [UIView animateWithDuration:model.config.popAnimationTime 624 | delay:0 625 | usingSpringWithDamping:1 626 | initialSpringVelocity:1.0 627 | options:UIViewAnimationOptionCurveEaseOut 628 | animations:^{ 629 | contentView.layer.position = startPosition; 630 | } completion:nil]; 631 | } 632 | 633 | - (void)animationWithLayer:(CALayer *)layer duration:(CGFloat)duration values:(NSArray *)values { 634 | 635 | CAKeyframeAnimation *popAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform"]; 636 | popAnimation.duration = duration; 637 | popAnimation.values = @[ 638 | [NSValue valueWithCATransform3D:CATransform3DMakeScale(1.1f, 1.1f, 1.0f)], 639 | [NSValue valueWithCATransform3D:CATransform3DIdentity]]; 640 | popAnimation.timingFunctions = @[ 641 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut], 642 | [CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; 643 | [layer addAnimation:popAnimation forKey:nil]; 644 | } 645 | 646 | 647 | //搭配动画展示 648 | - (void)baseAlphaChangeWithModel:(HLLPopupModel *)model isPop:(BOOL)isPop { 649 | if (isPop) { 650 | model.popupBgView.backgroundColor = [self drawBackgroundViewColorWith:model.config.backgroundColor 651 | alpha:0 652 | withModel:model]; 653 | [model contentView].alpha = 0.0f; 654 | [UIView animateWithDuration:model.config.popAnimationTime animations:^{ 655 | model.popupBgView.backgroundColor = [self drawBackgroundViewColorWith:model.config.backgroundColor 656 | alpha:model.config.backgroundAlpha 657 | withModel:model]; 658 | [model contentView].alpha = 1.0f; 659 | }]; 660 | }else{ 661 | [UIView animateWithDuration:model.config.dismissAnimationTime animations:^{ 662 | model.popupBgView.backgroundColor = [self drawBackgroundViewColorWith:model.config.backgroundColor 663 | alpha:0 664 | withModel:model]; 665 | [model contentView].alpha = 0.0f; 666 | }]; 667 | } 668 | } 669 | 670 | 671 | #pragma mark - Dismiss 672 | 673 | - (void)dismissWithModel:(HLLPopupModel *)model { 674 | [self dismissWithModel:model isRemoveQueue:YES]; 675 | } 676 | 677 | - (void)dismissWithModel:(HLLPopupModel *)model isRemoveQueue:(BOOL)isRemoveQueue { 678 | if (isRemoveQueue) { 679 | [self divertToWaitRemoveQueueWithModel:model];//存放入待移除的队列中 680 | } 681 | NSInteger queueCount = [self getPopupsFromAllPopupsWithGroupId:model.config.groupID].count; 682 | if (!model.config.isAloneMode && (isRemoveQueue && queueCount >= 1)) { 683 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(model.config.dismissAnimationTime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 684 | if (queueCount >= 1) { 685 | //如果当前移除的弹窗之前还有被覆盖的,则把之前的重新展示出来 686 | NSArray *allArr = [self getPopupsFromAllPopupsWithGroupId:model.config.groupID]; 687 | HLLPopupModel *model = allArr.lastObject; 688 | if (!model.popupBgView.superview) { 689 | [model.config.containerView addSubview:model.popupBgView]; 690 | [model.config.containerView bringSubviewToFront:model.popupBgView]; 691 | //弹窗内容自定义布局 692 | if ([model.popupObj respondsToSelector:@selector(layoutWithSuperView:)]) { 693 | [model.popupObj layoutWithSuperView:model.popupBgView]; 694 | } 695 | //获取到业务中ContentView的frame 696 | [model.popupBgView layoutIfNeeded]; 697 | //缓存弹窗内容的原始frame 698 | model.originalFrame = [model.popupObj supplyCustomPopupView].frame; 699 | } 700 | 701 | //开启定时器 702 | if (model.config.dismissDuration >= 1) { 703 | [model startCountTime]; 704 | } 705 | //pop动画 706 | [self popAnimationWithPopViewModel:model isNeedAnimation:YES]; 707 | } 708 | }); 709 | } 710 | //执行动画 711 | BOOL needDismissAnimation = YES; 712 | if ((model.config.sceneStyle == HLLPopupSceneTopNoticeView || model.config.sceneStyle == HLLPopupSceneCenter) && !isRemoveQueue) { 713 | needDismissAnimation = NO; 714 | } 715 | [self dismissAnimationWithPopViewModel:model isNeedAnimation:needDismissAnimation]; 716 | if (model.config.dismissDuration > 0) { 717 | [model closeTimer]; 718 | } 719 | if (isRemoveQueue) { 720 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(model.config.dismissAnimationTime * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 721 | //将要关闭 722 | model.config.popViewDidDismissCallback ? model.config.popViewDidDismissCallback() : nil; 723 | if ([model.popupObj respondsToSelector:@selector(popupViewDidDisappear)]) { 724 | [model.popupObj popupViewDidDisappear]; 725 | } 726 | [model closeTimer]; 727 | [model.popupBgView removeFromSuperview]; 728 | }); 729 | } 730 | } 731 | 732 | - (void)dismissAnimationWithPopViewModel:(HLLPopupModel *)model isNeedAnimation:(BOOL)isNeedAnimation { 733 | [self baseAlphaChangeWithModel:model isPop:NO]; 734 | if (!isNeedAnimation) { 735 | return; 736 | } 737 | switch (model.config.sceneStyle) { 738 | case HLLPopupSceneHalfPage:{ 739 | UIView *contentView = [model contentView]; 740 | [UIView animateWithDuration:model.config.dismissAnimationTime 741 | animations:^{ 742 | contentView.layer.position = CGPointMake(contentView.layer.position.x, CGRectGetMaxY(model.popupBgView.frame) + model.originalFrame.size.height*0.5); 743 | }]; 744 | }break; 745 | case HLLPopupSceneTopNoticeView:{ 746 | UIView *contentView = [model contentView]; 747 | [UIView animateWithDuration:model.config.dismissAnimationTime 748 | animations:^{ 749 | contentView.layer.position = CGPointMake(contentView.layer.position.x,-(model.originalFrame.size.height*0.5)); 750 | }]; 751 | }break; 752 | default: 753 | break; 754 | } 755 | } 756 | 757 | #pragma mark - Getter 758 | 759 | - (NSMutableArray *)windowQueue { 760 | if (!_windowQueue) { 761 | _windowQueue = [[NSMutableArray alloc] init]; 762 | } 763 | return _windowQueue; 764 | } 765 | 766 | - (NSHashTable *)waitRemovePool { 767 | if (!_waitRemovePool) { 768 | _waitRemovePool = [NSHashTable hashTableWithOptions:NSPointerFunctionsWeakMemory]; 769 | } 770 | return _waitRemovePool; 771 | } 772 | 773 | #pragma mark - Helper 774 | 775 | - (NSArray *)getPopupsFromAllPopupsWithGroupId:(NSString *)groupId { 776 | return [self getSameGroupPopupsWithGroupId:groupId popupList:self.windowQueue]; 777 | } 778 | 779 | //筛选出给定弹窗数组中相同GroupID的弹窗模型 780 | - (NSArray *)getSameGroupPopupsWithGroupId:(NSString *)groupId popupList:(NSArray *)popupList { 781 | if (popupList.count < 1) { 782 | return nil; 783 | } 784 | NSMutableArray *resultArr = [[NSMutableArray alloc] init]; 785 | for (HLLPopupModel *itemModel in popupList) { 786 | if (itemModel.config.groupID == nil && groupId == nil) { 787 | [resultArr addObject:itemModel];//没有设置分组,即为同一默认组 788 | continue; 789 | } 790 | if ([itemModel.config.groupID isEqualToString:groupId]) { 791 | [resultArr addObject:itemModel]; 792 | continue; 793 | } 794 | 795 | } 796 | return [resultArr copy]; 797 | } 798 | 799 | //取出同一容器内的相同Group的弹窗 800 | - (NSArray *)getAllPopViewWithModel:(HLLPopupModel *)model { 801 | NSArray *allPops = [self getAllPopViewFromContainerView:model.config.containerView]; 802 | return [self getSameGroupPopupsWithGroupId:model.config.groupID popupList:allPops]; 803 | } 804 | 805 | //获取同一个容器中的所有未移除的弹窗(包含所有Group) 806 | - (NSArray *)getAllPopViewFromContainerView:(UIView *)containerView { 807 | NSMutableArray *fromArr = self.windowQueue; 808 | NSMutableArray *toArr = [NSMutableArray array]; 809 | for (HLLPopupModel *item in fromArr) { 810 | if ([item.config.containerView isEqual:containerView]) { 811 | [toArr addObject:item]; 812 | } 813 | } 814 | return [NSArray arrayWithArray:toArr]; 815 | } 816 | 817 | //进入队列的元素都要进行优先级排序,优先级最高的放到数组的末尾 818 | - (void)enterPopWindsQueueWithModel:(HLLPopupModel *)model { 819 | for (HLLPopupModel *item in self.windowQueue) { 820 | if (item == model) { 821 | return; 822 | } 823 | } 824 | [self.windowQueue addObject:model]; 825 | if (self.windowQueue.count < 2) { 826 | return; 827 | } 828 | //插入排序进行优先级调整 829 | HLLPopupModel *lastModel = self.windowQueue.lastObject; 830 | NSInteger i = self.windowQueue.count - 1; 831 | NSInteger j = i-1; 832 | while (j >= 0 && self.windowQueue[j].config.priority > lastModel.config.priority) { 833 | [self.windowQueue replaceObjectAtIndex:j+1 withObject:self.windowQueue[j]]; 834 | j--; 835 | } 836 | self.windowQueue[j+1] = lastModel; 837 | } 838 | 839 | //将需要移除的弹窗转移到另外一个队列 840 | - (void)divertToWaitRemoveQueueWithModel:(HLLPopupModel *)model { 841 | NSArray *allArr = [self getAllPopViewFromContainerView:model.config.containerView]; 842 | [allArr enumerateObjectsUsingBlock:^(HLLPopupModel *obj, NSUInteger idx, BOOL * stop) { 843 | if ([obj.popupObj isEqual:model.popupObj]) { 844 | [self.waitRemovePool addObject:model]; 845 | [self.windowQueue removeObject:model]; 846 | } 847 | }]; 848 | } 849 | 850 | - (HLLPopupModel *)getModelWithPopup:(id)popup { 851 | if (!popup) { 852 | return nil; 853 | } 854 | for (HLLPopupModel *itemModel in self.windowQueue) { 855 | if (itemModel.popupObj == popup) { 856 | return itemModel; 857 | } 858 | } 859 | return nil; 860 | } 861 | 862 | - (HLLPopupModel *)getModelWithIdentifirer:(NSString *)identifirer { 863 | if (!identifirer || identifirer.length < 1) { 864 | return nil; 865 | } 866 | for (HLLPopupModel *itemModel in self.windowQueue) { 867 | if ([itemModel.config.identifier isEqualToString:identifirer]) { 868 | return itemModel; 869 | } 870 | } 871 | return nil; 872 | } 873 | 874 | - (UIColor *)drawBackgroundViewColorWith:(UIColor *)color alpha:(CGFloat)alpha withModel:(HLLPopupModel *)model { 875 | if (model.popupBgView.isHiddenBg) { 876 | return UIColor.clearColor; 877 | } 878 | if (model.config.backgroundColor == UIColor.clearColor) { 879 | return UIColor.clearColor; 880 | } 881 | CGFloat red = 0.0; 882 | CGFloat green = 0.0; 883 | CGFloat blue = 0.0; 884 | CGFloat resAlpha = 0.0; 885 | [color getRed:&red green:&green blue:&blue alpha:&resAlpha]; 886 | UIColor *resColor = [UIColor colorWithRed:red green:green blue:blue alpha:alpha]; 887 | return resColor; 888 | } 889 | 890 | - (NSArray> *)allPopups { 891 | NSMutableArray *res = [[NSMutableArray alloc] initWithCapacity:self.windowQueue.count]; 892 | for (HLLPopupModel *itemModel in self.windowQueue) { 893 | if (itemModel.popupObj) { 894 | [res addObject:itemModel.popupObj]; 895 | } 896 | } 897 | return [res copy]; 898 | } 899 | 900 | + (BOOL)checkMainThread { 901 | BOOL isMainThread = [NSThread currentThread].isMainThread; 902 | if (!isMainThread) { 903 | NSLog(@"⚠️弹窗调度使用必须在主线程中进行"); 904 | } 905 | return isMainThread; 906 | } 907 | 908 | @end 909 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [![license](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0) 4 | ![Pod Version](https://img.shields.io/badge/pod-v1.0.0-green.svg) 5 | ![Platform](https://img.shields.io/badge/platform-iOS-blue.svg) 6 | ![Language](https://img.shields.io/badge/language-ObjectC-green.svg) 7 | 8 | > [中文文档](README_CN.md) 9 | ## 介绍 10 | 11 | HLLPopupsManager is a general-purpose pop-up window scheduling management component, which is mainly used in some complex business projects to effectively manage the display scheduling between various types of pop-up windows in the APP. It is more like a traffic light system at a complex intersection, effectively managing the normal passage of vehicles and pedestrians in all directions. 12 | 13 | |Demo| 14 | 15 | ## Feature 16 | 17 | - Support pop-up view customization 18 | - Support adaptive keyboard input scene 19 | - Support the display of pop-up windows according to the priority mode 20 | - Support basic show and hide animation 21 | - Support mixed scheduling of multiple types of pop-up windows 22 | - Support batch removal of pop-up windows 23 | - Support pop-up windows disappearing at regular intervals 24 | 25 | ## Require 26 | 27 | - iOS 9.0 or higher 28 | - Xcode 11.0 or later 29 | - CocoaPods 1.11.2 or later 30 | 31 | ## Install 32 | 33 | ```ruby 34 | pod 'PopupsManager' 35 | ``` 36 | 37 | ## Use 38 | 39 | ### first step 40 | 41 | Usually, our pop-up windows realize the page of the pop-up window by customizing a subclass of UIView. All you need to do is to let your custom View implement a protocol `HLLPopupInterface`, which will require your pop-up window to implement One required method: `- (UIView *)supplyCustomPopupView; 42 | ` The function of this method is to return your pop-up View class object to `HLLPopupsManager` 43 | 44 | ```objc 45 | //.h 46 | @interface xxx : UIView 47 | @end 48 | 49 | //.m 50 | #pragma mark - HLLPopupViewInterface 51 | - (UIView *)supplyCustomPopupView { 52 | return self; 53 | } 54 | 55 | ``` 56 | If your pop-up window object View is related to some existing logic classes, and the transformation process cannot separate the View, then you can let your other logic-related classes implement this protocol, and then give you in the protocol method The custom pop-up View can be returned: 57 | 58 | ```objc 59 | //.h 60 | @interface xxx : NSObject 61 | @end 62 | 63 | //.m 64 | @property (nonatomic, strong) UIView *customPopupView; 65 | #pragma mark - HLLPopupViewInterface 66 | - (UIView *)supplyCustomPopupView { 67 | return self.customPopupView; 68 | } 69 | ``` 70 | 71 | ### The second step 72 | 73 | To configure your popup window, `HLLPopupsManager` provides a lot of configuration properties for popup window types, just need to set them. 74 | 75 | ```objc 76 | /// 弹窗唯一标识 77 | @property (nonatomic, copy) NSString *identifier; 78 | 79 | /// 优先级 范围0~1000 (默认0,遵循先进先出) 80 | @property (nonatomic, assign) CGFloat priority; 81 | 82 | /// 弹窗场景风格 83 | @property (nonatomic, assign) HLLPopupScene sceneStyle; 84 | 85 | /// 点击弹窗背景(弹窗内容之外的区域)弹窗是否消失 default NO 86 | @property (nonatomic, assign, getter=isClickOutsideDismiss) BOOL clickOutsideDismiss; 87 | 88 | /// 弹窗的容器视图,默认是当前APP的keywindow,可以设置成其他容器 89 | @property (nonatomic, weak) UIView *containerView; 90 | 91 | /// 持续时长 设置后会在设定时间结束后自动dismiss,不设置不会自动消失 92 | @property (nonatomic, assign) NSTimeInterval dismissDuration; 93 | 94 | ··· 95 | 96 | ``` 97 | 98 | For some attributes of these knowledge configurations, see the reference source code for details. 99 | 100 | ### third step 101 | 102 | Add the popup to the dispatch queue: 103 | 104 | ```objc 105 | //配置对象 106 | HLLPopupConfigure *configure = [[HLLPopupConfigure alloc] init]; 107 | configure.sceneStyle = HLLPopupSceneHalfPage; 108 | //加入到弹窗调度中 109 | [HLLPopupsManager addPopup:contextView options:configure]; 110 | 111 | ``` 112 | 113 | `HLLPopupsManager` also provides several convenience methods, which can be used according to specific situations: 114 | 115 | ```objc 116 | + (void)addPopup:(id)popup; 117 | 118 | + (void)addPopup:(id)popup priority:(HLLPopupStrategyPriority)priority; 119 | ``` 120 | 121 | ## Author 122 | [HUOLALA mobile technology team](https://juejin.cn/user/1768489241815070). 123 | 124 | ## License 125 | 126 | ``` 127 | Copyright 2023 Huolala, Inc. 128 | 129 | Licensed under the Apache License, Version 2.0 (the "License"); 130 | you may not use this file except in compliance with the License. 131 | You may obtain a copy of the License at 132 | 133 | http://www.apache.org/licenses/LICENSE-2.0 134 | 135 | Unless required by applicable law or agreed to in writing, software 136 | distributed under the License is distributed on an "AS IS" BASIS, 137 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 138 | See the License for the specific language governing permissions and 139 | limitations under the License. 140 | ``` 141 | 142 | -------------------------------------------------------------------------------- /README_CN.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | [![license](https://img.shields.io/hexpm/l/plug.svg)](https://www.apache.org/licenses/LICENSE-2.0) 4 | ![Pod Version](https://img.shields.io/badge/pod-v1.0.0-green.svg) 5 | ![Platform](https://img.shields.io/badge/platform-iOS-blue.svg) 6 | ![Language](https://img.shields.io/badge/language-ObjectC-green.svg) 7 | 8 | > [英文文档](README.md) 9 | 10 | ## 介绍 11 | 12 | HLLPopupsManager是一个通用的弹窗调度管理组件,主要应用在一些业务复杂的项目中,来有效管理APP中各种类型弹窗之间的显示调度。它更像是一个复杂十字路口的红绿灯系统,有效管理各个方向的车辆和行人正常通行。 13 | 14 | |Demo| 15 | 16 | ## 特点 17 | 18 | - 支持弹窗视图自定义 19 | - 支持自适应键盘输入场景 20 | - 支持弹窗按照优先级模式展示 21 | - 支持基础的显示隐藏动画 22 | - 支持多种类型弹窗混合调度 23 | - 支持弹窗批量移除 24 | - 支持弹窗定时消失 25 | 26 | ## 要求 27 | 28 | - iOS 9.0 或更高版本 29 | - Xcode 11.0 或更高版本 30 | - CocoaPods 1.11.2 或更高版本 31 | 32 | 33 | ## 安装 34 | 35 | ```ruby 36 | pod 'PopupsManager' 37 | ``` 38 | 39 | ## 使用 40 | 41 | ### 第一步 42 | 43 | 通常我们的弹窗都是通过自定义一个继续UIView的子类来实现弹窗的页面,你需要做的就是让你的自定义View来实现一个协议`HLLPopupInterface` 该协议会要求你的弹窗实现一个必要方法:`- (UIView *)supplyCustomPopupView; 44 | ` 这个方法的作用就是需要把你的弹窗View类对象给返回给`HLLPopupsManager` 45 | 46 | 47 | ```objc 48 | //.h 49 | //遵守指定协议 50 | @interface xxx : UIView 51 | @end 52 | 53 | //.m 54 | #pragma mark - HLLPopupViewInterface 55 | - (UIView *)supplyCustomPopupView { 56 | return self; 57 | } 58 | 59 | ``` 60 | 如果你的弹窗对象View和现有的一些逻辑类有关联,改造的过程没法把View单独出来,那么你可以让你的其他逻辑相关的类去实现这个协议,然后在协议方法中给你的自定义弹窗View返回即可: 61 | 62 | ```objc 63 | //.h 64 | //逻辑类 65 | @interface xxx : NSObject 66 | @end 67 | 68 | //.m 69 | @property (nonatomic, strong) UIView *customPopupView;//自定义的弹窗View 70 | #pragma mark - HLLPopupViewInterface 71 | - (UIView *)supplyCustomPopupView { 72 | return self.customPopupView; 73 | } 74 | ``` 75 | 76 | ### 第二步 77 | 78 | 给你的弹窗进行配置,`PopupsManager` 提供了很多应对弹窗类型的配置属性,只需要设置即可。 79 | 80 | ```objc 81 | /// 弹窗唯一标识 82 | @property (nonatomic, copy) NSString *identifier; 83 | 84 | /// 优先级 范围0~1000 (默认0,遵循先进先出) 85 | @property (nonatomic, assign) CGFloat priority; 86 | 87 | /// 弹窗场景风格 88 | @property (nonatomic, assign) HLLPopupScene sceneStyle; 89 | 90 | /// 点击弹窗背景(弹窗内容之外的区域)弹窗是否消失 default NO 91 | @property (nonatomic, assign, getter=isClickOutsideDismiss) BOOL clickOutsideDismiss; 92 | 93 | /// 弹窗的容器视图,默认是当前APP的keywindow,可以设置成其他容器 94 | @property (nonatomic, weak) UIView *containerView; 95 | 96 | /// 持续时长 设置后会在设定时间结束后自动dismiss,不设置不会自动消失 97 | @property (nonatomic, assign) NSTimeInterval dismissDuration; 98 | 99 | ··· 100 | 101 | ``` 102 | 103 | 这些知识配置的一部分属性,详情看参考源码进行查阅。 104 | 105 | ### 第三步 106 | 107 | 将弹窗加入到调度队列: 108 | 109 | ```objc 110 | //配置对象 111 | HLLPopupConfigure *configure = [[HLLPopupConfigure alloc] init]; 112 | configure.sceneStyle = HLLPopupSceneHalfPage; 113 | //加入到弹窗调度中 114 | [HLLPopupsManager addPopup:contextView options:configure]; 115 | 116 | ``` 117 | 118 | `PopupsManager`还提供了几种便捷方法,可以根据具体情况具体使用: 119 | 120 | ```objc 121 | //采用默认配置,无需创建一个配置对象了 122 | + (void)addPopup:(id)popup; 123 | 124 | //只用到优先级配置属性,可以这样调用 125 | + (void)addPopup:(id)popup priority:(HLLPopupStrategyPriority)priority; 126 | ``` 127 | 128 | ## Author 129 | [HUOLALA mobile technology team](https://juejin.cn/user/1768489241815070). 130 | ## License 131 | ``` 132 | Copyright 2023 Huolala, Inc. 133 | 134 | Licensed under the Apache License, Version 2.0 (the "License"); 135 | you may not use this file except in compliance with the License. 136 | You may obtain a copy of the License at 137 | 138 | http://www.apache.org/licenses/LICENSE-2.0 139 | 140 | Unless required by applicable law or agreed to in writing, software 141 | distributed under the License is distributed on an "AS IS" BASIS, 142 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 143 | See the License for the specific language governing permissions and 144 | limitations under the License. 145 | ``` 146 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj -------------------------------------------------------------------------------- /image/2.mov: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/image/2.mov -------------------------------------------------------------------------------- /image/title.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/image/title.png -------------------------------------------------------------------------------- /image/演示.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/HuolalaTech/hll-popupsmanager-ios/8dffe532a35e6bd8512f4e0ada6e437916ca0d85/image/演示.gif --------------------------------------------------------------------------------