├── .gitignore ├── .swift-version ├── IMXEventBus.podspec ├── IMXEventBus.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── IMXEventBus ├── AppDelegate.h ├── AppDelegate.m ├── Assets.xcassets │ └── AppIcon.appiconset │ │ └── Contents.json ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── IMXEventBus │ ├── Action │ │ ├── IMXEventPoster.h │ │ ├── IMXEventPoster.m │ │ ├── IMXEventSubscriber.h │ │ └── IMXEventSubscriber.m │ ├── Debug │ │ ├── IMXEventDebug.h │ │ └── IMXEventDebug.m │ ├── Event │ │ ├── IMXEvent.h │ │ ├── IMXEvent.m │ │ ├── IMXEventBus.h │ │ └── IMXEventBus.m │ ├── IMXEventBusKit.h │ ├── IMXEventDefinition.h │ └── Objs │ │ ├── IMXEventSubscribModel.h │ │ ├── IMXEventSubscribModel.m │ │ ├── IMXEventUserInfo.h │ │ └── IMXEventUserInfo.m ├── Info.plist ├── SecondViewController.h ├── SecondViewController.m ├── ThirdViewController.h ├── ThirdViewController.m ├── ViewController.h ├── ViewController.m └── main.m ├── IMXEventBusTests ├── IMXEventBusTests.m └── Info.plist ├── IMXEventBusUITests ├── IMXEventBusUITests.m └── Info.plist ├── LICENSE ├── README.md └── docs ├── IMXEventBus注册监听.gliffy ├── IMXEventBus类图.gliffy ├── IMXEventBus触发.gliffy └── imgs ├── IMXEventBus注册监听.png ├── IMXEventBus类图.png └── IMXEventBus触发.png /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | echo "3.0" > .swift-version -------------------------------------------------------------------------------- /IMXEventBus.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "IMXEventBus" 3 | s.version = "1.0.0" 4 | s.summary = "a delightful EventBus for Object-C" 5 | s.license = { :type => "MIT", :file => "LICENSE" } 6 | s.homepage = "https://github.com/PanZhow/IMXEventBus.git" 7 | s.author = { "zhoupanpan" => "2331838272@qq.com" } 8 | s.source = { :git => "https://github.com/PanZhow/IMXEventBus.git", :tag => "#{s.version}" } 9 | s.requires_arc = true 10 | 11 | s.public_header_files = [ 12 | 'IMXEventBus/IMXEventBus/*{h}', 13 | 'IMXEventBus/IMXEventBus/Debug/*{h}', 14 | 'IMXEventBus/IMXEventBus/Action/*{h}', 15 | 'IMXEventBus/IMXEventBus/Objs/*{h}', 16 | 'IMXEventBus/IMXEventBus/Event/*{h}', 17 | ] 18 | s.source_files = [ 19 | 'IMXEventBus/IMXEventBus/*{h,m}', 20 | 'IMXEventBus/IMXEventBus/Debug/*{h,m}', 21 | 'IMXEventBus/IMXEventBus/Action/*{h,m}', 22 | 'IMXEventBus/IMXEventBus/Objs/*{h,m}', 23 | 'IMXEventBus/IMXEventBus/Event/*{h,m}', 24 | ] 25 | 26 | s.platform = :ios, '8.0' 27 | 28 | end 29 | -------------------------------------------------------------------------------- /IMXEventBus.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 48; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | A107C99F205F949600AA41AC /* IMXEventUserInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = A107C99E205F949600AA41AC /* IMXEventUserInfo.m */; }; 11 | A145D5182058C0AD00370BF0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D5172058C0AD00370BF0 /* AppDelegate.m */; }; 12 | A145D51B2058C0AD00370BF0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D51A2058C0AD00370BF0 /* ViewController.m */; }; 13 | A145D51E2058C0AD00370BF0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A145D51C2058C0AD00370BF0 /* Main.storyboard */; }; 14 | A145D5202058C0AD00370BF0 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = A145D51F2058C0AD00370BF0 /* Assets.xcassets */; }; 15 | A145D5232058C0AD00370BF0 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A145D5212058C0AD00370BF0 /* LaunchScreen.storyboard */; }; 16 | A145D5262058C0AD00370BF0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D5252058C0AD00370BF0 /* main.m */; }; 17 | A145D5302058C0AD00370BF0 /* IMXEventBusTests.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D52F2058C0AD00370BF0 /* IMXEventBusTests.m */; }; 18 | A145D53B2058C0AD00370BF0 /* IMXEventBusUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D53A2058C0AD00370BF0 /* IMXEventBusUITests.m */; }; 19 | A145D5512058C0D900370BF0 /* IMXEvent.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D54B2058C0D900370BF0 /* IMXEvent.m */; }; 20 | A145D5522058C0D900370BF0 /* IMXEventSubscriber.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D54D2058C0D900370BF0 /* IMXEventSubscriber.m */; }; 21 | A145D5532058C0D900370BF0 /* IMXEventBus.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D54F2058C0D900370BF0 /* IMXEventBus.m */; }; 22 | A145D5562058C39A00370BF0 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D5552058C39A00370BF0 /* SecondViewController.m */; }; 23 | A145D5592058C3A800370BF0 /* ThirdViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A145D5582058C3A800370BF0 /* ThirdViewController.m */; }; 24 | A15FD313206B421A00EF485B /* IMXEventSubscribModel.m in Sources */ = {isa = PBXBuildFile; fileRef = A15FD312206B421A00EF485B /* IMXEventSubscribModel.m */; }; 25 | A15FD317206B66DF00EF485B /* IMXEventPoster.m in Sources */ = {isa = PBXBuildFile; fileRef = A15FD316206B66DF00EF485B /* IMXEventPoster.m */; }; 26 | A15FD31B206C883700EF485B /* IMXEventDebug.m in Sources */ = {isa = PBXBuildFile; fileRef = A15FD31A206C883600EF485B /* IMXEventDebug.m */; }; 27 | /* End PBXBuildFile section */ 28 | 29 | /* Begin PBXContainerItemProxy section */ 30 | A145D52C2058C0AD00370BF0 /* PBXContainerItemProxy */ = { 31 | isa = PBXContainerItemProxy; 32 | containerPortal = A145D50B2058C0AC00370BF0 /* Project object */; 33 | proxyType = 1; 34 | remoteGlobalIDString = A145D5122058C0AD00370BF0; 35 | remoteInfo = IMXEventBus; 36 | }; 37 | A145D5372058C0AD00370BF0 /* PBXContainerItemProxy */ = { 38 | isa = PBXContainerItemProxy; 39 | containerPortal = A145D50B2058C0AC00370BF0 /* Project object */; 40 | proxyType = 1; 41 | remoteGlobalIDString = A145D5122058C0AD00370BF0; 42 | remoteInfo = IMXEventBus; 43 | }; 44 | /* End PBXContainerItemProxy section */ 45 | 46 | /* Begin PBXFileReference section */ 47 | A107C99D205F949600AA41AC /* IMXEventUserInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMXEventUserInfo.h; sourceTree = ""; }; 48 | A107C99E205F949600AA41AC /* IMXEventUserInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventUserInfo.m; sourceTree = ""; }; 49 | A145D5132058C0AD00370BF0 /* IMXEventBus.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = IMXEventBus.app; sourceTree = BUILT_PRODUCTS_DIR; }; 50 | A145D5162058C0AD00370BF0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 51 | A145D5172058C0AD00370BF0 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 52 | A145D5192058C0AD00370BF0 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; }; 53 | A145D51A2058C0AD00370BF0 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; }; 54 | A145D51D2058C0AD00370BF0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 55 | A145D51F2058C0AD00370BF0 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; 56 | A145D5222058C0AD00370BF0 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; }; 57 | A145D5242058C0AD00370BF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 58 | A145D5252058C0AD00370BF0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | A145D52B2058C0AD00370BF0 /* IMXEventBusTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IMXEventBusTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 60 | A145D52F2058C0AD00370BF0 /* IMXEventBusTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventBusTests.m; sourceTree = ""; }; 61 | A145D5312058C0AD00370BF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 62 | A145D5362058C0AD00370BF0 /* IMXEventBusUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = IMXEventBusUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 63 | A145D53A2058C0AD00370BF0 /* IMXEventBusUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventBusUITests.m; sourceTree = ""; }; 64 | A145D53C2058C0AD00370BF0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 65 | A145D54A2058C0D900370BF0 /* IMXEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMXEvent.h; sourceTree = ""; }; 66 | A145D54B2058C0D900370BF0 /* IMXEvent.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IMXEvent.m; sourceTree = ""; }; 67 | A145D54C2058C0D900370BF0 /* IMXEventSubscriber.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMXEventSubscriber.h; sourceTree = ""; }; 68 | A145D54D2058C0D900370BF0 /* IMXEventSubscriber.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IMXEventSubscriber.m; sourceTree = ""; }; 69 | A145D54E2058C0D900370BF0 /* IMXEventBus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMXEventBus.h; sourceTree = ""; }; 70 | A145D54F2058C0D900370BF0 /* IMXEventBus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = IMXEventBus.m; sourceTree = ""; }; 71 | A145D5502058C0D900370BF0 /* IMXEventDefinition.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IMXEventDefinition.h; sourceTree = ""; }; 72 | A145D5542058C39A00370BF0 /* SecondViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = ""; }; 73 | A145D5552058C39A00370BF0 /* SecondViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = ""; }; 74 | A145D5572058C3A800370BF0 /* ThirdViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ThirdViewController.h; sourceTree = ""; }; 75 | A145D5582058C3A800370BF0 /* ThirdViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThirdViewController.m; sourceTree = ""; }; 76 | A15FD311206B421A00EF485B /* IMXEventSubscribModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMXEventSubscribModel.h; sourceTree = ""; }; 77 | A15FD312206B421A00EF485B /* IMXEventSubscribModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventSubscribModel.m; sourceTree = ""; }; 78 | A15FD315206B66DF00EF485B /* IMXEventPoster.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMXEventPoster.h; sourceTree = ""; }; 79 | A15FD316206B66DF00EF485B /* IMXEventPoster.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventPoster.m; sourceTree = ""; }; 80 | A15FD319206C883600EF485B /* IMXEventDebug.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMXEventDebug.h; sourceTree = ""; }; 81 | A15FD31A206C883600EF485B /* IMXEventDebug.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = IMXEventDebug.m; sourceTree = ""; }; 82 | A15FD31C206CB59A00EF485B /* IMXEventBusKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = IMXEventBusKit.h; sourceTree = ""; }; 83 | /* End PBXFileReference section */ 84 | 85 | /* Begin PBXFrameworksBuildPhase section */ 86 | A145D5102058C0AD00370BF0 /* Frameworks */ = { 87 | isa = PBXFrameworksBuildPhase; 88 | buildActionMask = 2147483647; 89 | files = ( 90 | ); 91 | runOnlyForDeploymentPostprocessing = 0; 92 | }; 93 | A145D5282058C0AD00370BF0 /* Frameworks */ = { 94 | isa = PBXFrameworksBuildPhase; 95 | buildActionMask = 2147483647; 96 | files = ( 97 | ); 98 | runOnlyForDeploymentPostprocessing = 0; 99 | }; 100 | A145D5332058C0AD00370BF0 /* Frameworks */ = { 101 | isa = PBXFrameworksBuildPhase; 102 | buildActionMask = 2147483647; 103 | files = ( 104 | ); 105 | runOnlyForDeploymentPostprocessing = 0; 106 | }; 107 | /* End PBXFrameworksBuildPhase section */ 108 | 109 | /* Begin PBXGroup section */ 110 | A107C9932059322000AA41AC /* Objs */ = { 111 | isa = PBXGroup; 112 | children = ( 113 | A107C99D205F949600AA41AC /* IMXEventUserInfo.h */, 114 | A107C99E205F949600AA41AC /* IMXEventUserInfo.m */, 115 | A15FD311206B421A00EF485B /* IMXEventSubscribModel.h */, 116 | A15FD312206B421A00EF485B /* IMXEventSubscribModel.m */, 117 | ); 118 | path = Objs; 119 | sourceTree = ""; 120 | }; 121 | A145D50A2058C0AC00370BF0 = { 122 | isa = PBXGroup; 123 | children = ( 124 | A145D5152058C0AD00370BF0 /* IMXEventBus */, 125 | A145D52E2058C0AD00370BF0 /* IMXEventBusTests */, 126 | A145D5392058C0AD00370BF0 /* IMXEventBusUITests */, 127 | A145D5142058C0AD00370BF0 /* Products */, 128 | ); 129 | sourceTree = ""; 130 | }; 131 | A145D5142058C0AD00370BF0 /* Products */ = { 132 | isa = PBXGroup; 133 | children = ( 134 | A145D5132058C0AD00370BF0 /* IMXEventBus.app */, 135 | A145D52B2058C0AD00370BF0 /* IMXEventBusTests.xctest */, 136 | A145D5362058C0AD00370BF0 /* IMXEventBusUITests.xctest */, 137 | ); 138 | name = Products; 139 | sourceTree = ""; 140 | }; 141 | A145D5152058C0AD00370BF0 /* IMXEventBus */ = { 142 | isa = PBXGroup; 143 | children = ( 144 | A145D5482058C0D800370BF0 /* IMXEventBus */, 145 | A145D5162058C0AD00370BF0 /* AppDelegate.h */, 146 | A145D5172058C0AD00370BF0 /* AppDelegate.m */, 147 | A145D5192058C0AD00370BF0 /* ViewController.h */, 148 | A145D51A2058C0AD00370BF0 /* ViewController.m */, 149 | A145D5542058C39A00370BF0 /* SecondViewController.h */, 150 | A145D5552058C39A00370BF0 /* SecondViewController.m */, 151 | A145D5572058C3A800370BF0 /* ThirdViewController.h */, 152 | A145D5582058C3A800370BF0 /* ThirdViewController.m */, 153 | A145D51C2058C0AD00370BF0 /* Main.storyboard */, 154 | A145D51F2058C0AD00370BF0 /* Assets.xcassets */, 155 | A145D5212058C0AD00370BF0 /* LaunchScreen.storyboard */, 156 | A145D5242058C0AD00370BF0 /* Info.plist */, 157 | A145D5252058C0AD00370BF0 /* main.m */, 158 | ); 159 | path = IMXEventBus; 160 | sourceTree = ""; 161 | }; 162 | A145D52E2058C0AD00370BF0 /* IMXEventBusTests */ = { 163 | isa = PBXGroup; 164 | children = ( 165 | A145D52F2058C0AD00370BF0 /* IMXEventBusTests.m */, 166 | A145D5312058C0AD00370BF0 /* Info.plist */, 167 | ); 168 | path = IMXEventBusTests; 169 | sourceTree = ""; 170 | }; 171 | A145D5392058C0AD00370BF0 /* IMXEventBusUITests */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | A145D53A2058C0AD00370BF0 /* IMXEventBusUITests.m */, 175 | A145D53C2058C0AD00370BF0 /* Info.plist */, 176 | ); 177 | path = IMXEventBusUITests; 178 | sourceTree = ""; 179 | }; 180 | A145D5482058C0D800370BF0 /* IMXEventBus */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | A15FD318206C881400EF485B /* Debug */, 184 | A15FD314206B42A800EF485B /* Action */, 185 | A107C9932059322000AA41AC /* Objs */, 186 | A145D5492058C0D800370BF0 /* Event */, 187 | A145D5502058C0D900370BF0 /* IMXEventDefinition.h */, 188 | A15FD31C206CB59A00EF485B /* IMXEventBusKit.h */, 189 | ); 190 | path = IMXEventBus; 191 | sourceTree = ""; 192 | }; 193 | A145D5492058C0D800370BF0 /* Event */ = { 194 | isa = PBXGroup; 195 | children = ( 196 | A145D54A2058C0D900370BF0 /* IMXEvent.h */, 197 | A145D54B2058C0D900370BF0 /* IMXEvent.m */, 198 | A145D54E2058C0D900370BF0 /* IMXEventBus.h */, 199 | A145D54F2058C0D900370BF0 /* IMXEventBus.m */, 200 | ); 201 | path = Event; 202 | sourceTree = ""; 203 | }; 204 | A15FD314206B42A800EF485B /* Action */ = { 205 | isa = PBXGroup; 206 | children = ( 207 | A145D54C2058C0D900370BF0 /* IMXEventSubscriber.h */, 208 | A145D54D2058C0D900370BF0 /* IMXEventSubscriber.m */, 209 | A15FD315206B66DF00EF485B /* IMXEventPoster.h */, 210 | A15FD316206B66DF00EF485B /* IMXEventPoster.m */, 211 | ); 212 | path = Action; 213 | sourceTree = ""; 214 | }; 215 | A15FD318206C881400EF485B /* Debug */ = { 216 | isa = PBXGroup; 217 | children = ( 218 | A15FD319206C883600EF485B /* IMXEventDebug.h */, 219 | A15FD31A206C883600EF485B /* IMXEventDebug.m */, 220 | ); 221 | path = Debug; 222 | sourceTree = ""; 223 | }; 224 | /* End PBXGroup section */ 225 | 226 | /* Begin PBXNativeTarget section */ 227 | A145D5122058C0AD00370BF0 /* IMXEventBus */ = { 228 | isa = PBXNativeTarget; 229 | buildConfigurationList = A145D53F2058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBus" */; 230 | buildPhases = ( 231 | A145D50F2058C0AD00370BF0 /* Sources */, 232 | A145D5102058C0AD00370BF0 /* Frameworks */, 233 | A145D5112058C0AD00370BF0 /* Resources */, 234 | ); 235 | buildRules = ( 236 | ); 237 | dependencies = ( 238 | ); 239 | name = IMXEventBus; 240 | productName = IMXEventBus; 241 | productReference = A145D5132058C0AD00370BF0 /* IMXEventBus.app */; 242 | productType = "com.apple.product-type.application"; 243 | }; 244 | A145D52A2058C0AD00370BF0 /* IMXEventBusTests */ = { 245 | isa = PBXNativeTarget; 246 | buildConfigurationList = A145D5422058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBusTests" */; 247 | buildPhases = ( 248 | A145D5272058C0AD00370BF0 /* Sources */, 249 | A145D5282058C0AD00370BF0 /* Frameworks */, 250 | A145D5292058C0AD00370BF0 /* Resources */, 251 | ); 252 | buildRules = ( 253 | ); 254 | dependencies = ( 255 | A145D52D2058C0AD00370BF0 /* PBXTargetDependency */, 256 | ); 257 | name = IMXEventBusTests; 258 | productName = IMXEventBusTests; 259 | productReference = A145D52B2058C0AD00370BF0 /* IMXEventBusTests.xctest */; 260 | productType = "com.apple.product-type.bundle.unit-test"; 261 | }; 262 | A145D5352058C0AD00370BF0 /* IMXEventBusUITests */ = { 263 | isa = PBXNativeTarget; 264 | buildConfigurationList = A145D5452058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBusUITests" */; 265 | buildPhases = ( 266 | A145D5322058C0AD00370BF0 /* Sources */, 267 | A145D5332058C0AD00370BF0 /* Frameworks */, 268 | A145D5342058C0AD00370BF0 /* Resources */, 269 | ); 270 | buildRules = ( 271 | ); 272 | dependencies = ( 273 | A145D5382058C0AD00370BF0 /* PBXTargetDependency */, 274 | ); 275 | name = IMXEventBusUITests; 276 | productName = IMXEventBusUITests; 277 | productReference = A145D5362058C0AD00370BF0 /* IMXEventBusUITests.xctest */; 278 | productType = "com.apple.product-type.bundle.ui-testing"; 279 | }; 280 | /* End PBXNativeTarget section */ 281 | 282 | /* Begin PBXProject section */ 283 | A145D50B2058C0AC00370BF0 /* Project object */ = { 284 | isa = PBXProject; 285 | attributes = { 286 | LastUpgradeCheck = 0920; 287 | ORGANIZATIONNAME = panzhow; 288 | TargetAttributes = { 289 | A145D5122058C0AD00370BF0 = { 290 | CreatedOnToolsVersion = 9.2; 291 | ProvisioningStyle = Automatic; 292 | }; 293 | A145D52A2058C0AD00370BF0 = { 294 | CreatedOnToolsVersion = 9.2; 295 | ProvisioningStyle = Automatic; 296 | TestTargetID = A145D5122058C0AD00370BF0; 297 | }; 298 | A145D5352058C0AD00370BF0 = { 299 | CreatedOnToolsVersion = 9.2; 300 | ProvisioningStyle = Automatic; 301 | TestTargetID = A145D5122058C0AD00370BF0; 302 | }; 303 | }; 304 | }; 305 | buildConfigurationList = A145D50E2058C0AC00370BF0 /* Build configuration list for PBXProject "IMXEventBus" */; 306 | compatibilityVersion = "Xcode 8.0"; 307 | developmentRegion = en; 308 | hasScannedForEncodings = 0; 309 | knownRegions = ( 310 | en, 311 | Base, 312 | ); 313 | mainGroup = A145D50A2058C0AC00370BF0; 314 | productRefGroup = A145D5142058C0AD00370BF0 /* Products */; 315 | projectDirPath = ""; 316 | projectRoot = ""; 317 | targets = ( 318 | A145D5122058C0AD00370BF0 /* IMXEventBus */, 319 | A145D52A2058C0AD00370BF0 /* IMXEventBusTests */, 320 | A145D5352058C0AD00370BF0 /* IMXEventBusUITests */, 321 | ); 322 | }; 323 | /* End PBXProject section */ 324 | 325 | /* Begin PBXResourcesBuildPhase section */ 326 | A145D5112058C0AD00370BF0 /* Resources */ = { 327 | isa = PBXResourcesBuildPhase; 328 | buildActionMask = 2147483647; 329 | files = ( 330 | A145D5232058C0AD00370BF0 /* LaunchScreen.storyboard in Resources */, 331 | A145D5202058C0AD00370BF0 /* Assets.xcassets in Resources */, 332 | A145D51E2058C0AD00370BF0 /* Main.storyboard in Resources */, 333 | ); 334 | runOnlyForDeploymentPostprocessing = 0; 335 | }; 336 | A145D5292058C0AD00370BF0 /* Resources */ = { 337 | isa = PBXResourcesBuildPhase; 338 | buildActionMask = 2147483647; 339 | files = ( 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | A145D5342058C0AD00370BF0 /* Resources */ = { 344 | isa = PBXResourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | ); 348 | runOnlyForDeploymentPostprocessing = 0; 349 | }; 350 | /* End PBXResourcesBuildPhase section */ 351 | 352 | /* Begin PBXSourcesBuildPhase section */ 353 | A145D50F2058C0AD00370BF0 /* Sources */ = { 354 | isa = PBXSourcesBuildPhase; 355 | buildActionMask = 2147483647; 356 | files = ( 357 | A107C99F205F949600AA41AC /* IMXEventUserInfo.m in Sources */, 358 | A145D51B2058C0AD00370BF0 /* ViewController.m in Sources */, 359 | A145D5512058C0D900370BF0 /* IMXEvent.m in Sources */, 360 | A145D5592058C3A800370BF0 /* ThirdViewController.m in Sources */, 361 | A145D5262058C0AD00370BF0 /* main.m in Sources */, 362 | A145D5562058C39A00370BF0 /* SecondViewController.m in Sources */, 363 | A15FD317206B66DF00EF485B /* IMXEventPoster.m in Sources */, 364 | A145D5182058C0AD00370BF0 /* AppDelegate.m in Sources */, 365 | A145D5532058C0D900370BF0 /* IMXEventBus.m in Sources */, 366 | A15FD31B206C883700EF485B /* IMXEventDebug.m in Sources */, 367 | A145D5522058C0D900370BF0 /* IMXEventSubscriber.m in Sources */, 368 | A15FD313206B421A00EF485B /* IMXEventSubscribModel.m in Sources */, 369 | ); 370 | runOnlyForDeploymentPostprocessing = 0; 371 | }; 372 | A145D5272058C0AD00370BF0 /* Sources */ = { 373 | isa = PBXSourcesBuildPhase; 374 | buildActionMask = 2147483647; 375 | files = ( 376 | A145D5302058C0AD00370BF0 /* IMXEventBusTests.m in Sources */, 377 | ); 378 | runOnlyForDeploymentPostprocessing = 0; 379 | }; 380 | A145D5322058C0AD00370BF0 /* Sources */ = { 381 | isa = PBXSourcesBuildPhase; 382 | buildActionMask = 2147483647; 383 | files = ( 384 | A145D53B2058C0AD00370BF0 /* IMXEventBusUITests.m in Sources */, 385 | ); 386 | runOnlyForDeploymentPostprocessing = 0; 387 | }; 388 | /* End PBXSourcesBuildPhase section */ 389 | 390 | /* Begin PBXTargetDependency section */ 391 | A145D52D2058C0AD00370BF0 /* PBXTargetDependency */ = { 392 | isa = PBXTargetDependency; 393 | target = A145D5122058C0AD00370BF0 /* IMXEventBus */; 394 | targetProxy = A145D52C2058C0AD00370BF0 /* PBXContainerItemProxy */; 395 | }; 396 | A145D5382058C0AD00370BF0 /* PBXTargetDependency */ = { 397 | isa = PBXTargetDependency; 398 | target = A145D5122058C0AD00370BF0 /* IMXEventBus */; 399 | targetProxy = A145D5372058C0AD00370BF0 /* PBXContainerItemProxy */; 400 | }; 401 | /* End PBXTargetDependency section */ 402 | 403 | /* Begin PBXVariantGroup section */ 404 | A145D51C2058C0AD00370BF0 /* Main.storyboard */ = { 405 | isa = PBXVariantGroup; 406 | children = ( 407 | A145D51D2058C0AD00370BF0 /* Base */, 408 | ); 409 | name = Main.storyboard; 410 | sourceTree = ""; 411 | }; 412 | A145D5212058C0AD00370BF0 /* LaunchScreen.storyboard */ = { 413 | isa = PBXVariantGroup; 414 | children = ( 415 | A145D5222058C0AD00370BF0 /* Base */, 416 | ); 417 | name = LaunchScreen.storyboard; 418 | sourceTree = ""; 419 | }; 420 | /* End PBXVariantGroup section */ 421 | 422 | /* Begin XCBuildConfiguration section */ 423 | A145D53D2058C0AD00370BF0 /* Debug */ = { 424 | isa = XCBuildConfiguration; 425 | buildSettings = { 426 | ALWAYS_SEARCH_USER_PATHS = NO; 427 | CLANG_ANALYZER_NONNULL = YES; 428 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 429 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 430 | CLANG_CXX_LIBRARY = "libc++"; 431 | CLANG_ENABLE_MODULES = YES; 432 | CLANG_ENABLE_OBJC_ARC = YES; 433 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 434 | CLANG_WARN_BOOL_CONVERSION = YES; 435 | CLANG_WARN_COMMA = YES; 436 | CLANG_WARN_CONSTANT_CONVERSION = YES; 437 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 438 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 439 | CLANG_WARN_EMPTY_BODY = YES; 440 | CLANG_WARN_ENUM_CONVERSION = YES; 441 | CLANG_WARN_INFINITE_RECURSION = YES; 442 | CLANG_WARN_INT_CONVERSION = YES; 443 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 444 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 445 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 446 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 447 | CLANG_WARN_STRICT_PROTOTYPES = YES; 448 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 449 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 450 | CLANG_WARN_UNREACHABLE_CODE = YES; 451 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 452 | CODE_SIGN_IDENTITY = "iPhone Developer"; 453 | COPY_PHASE_STRIP = NO; 454 | DEBUG_INFORMATION_FORMAT = dwarf; 455 | ENABLE_STRICT_OBJC_MSGSEND = YES; 456 | ENABLE_TESTABILITY = YES; 457 | GCC_C_LANGUAGE_STANDARD = gnu11; 458 | GCC_DYNAMIC_NO_PIC = NO; 459 | GCC_NO_COMMON_BLOCKS = YES; 460 | GCC_OPTIMIZATION_LEVEL = 0; 461 | GCC_PREPROCESSOR_DEFINITIONS = ( 462 | "DEBUG=1", 463 | "$(inherited)", 464 | ); 465 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 466 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 467 | GCC_WARN_UNDECLARED_SELECTOR = YES; 468 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 469 | GCC_WARN_UNUSED_FUNCTION = YES; 470 | GCC_WARN_UNUSED_VARIABLE = YES; 471 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 472 | MTL_ENABLE_DEBUG_INFO = YES; 473 | ONLY_ACTIVE_ARCH = YES; 474 | SDKROOT = iphoneos; 475 | }; 476 | name = Debug; 477 | }; 478 | A145D53E2058C0AD00370BF0 /* Release */ = { 479 | isa = XCBuildConfiguration; 480 | buildSettings = { 481 | ALWAYS_SEARCH_USER_PATHS = NO; 482 | CLANG_ANALYZER_NONNULL = YES; 483 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; 484 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; 485 | CLANG_CXX_LIBRARY = "libc++"; 486 | CLANG_ENABLE_MODULES = YES; 487 | CLANG_ENABLE_OBJC_ARC = YES; 488 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 489 | CLANG_WARN_BOOL_CONVERSION = YES; 490 | CLANG_WARN_COMMA = YES; 491 | CLANG_WARN_CONSTANT_CONVERSION = YES; 492 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 493 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES; 494 | CLANG_WARN_EMPTY_BODY = YES; 495 | CLANG_WARN_ENUM_CONVERSION = YES; 496 | CLANG_WARN_INFINITE_RECURSION = YES; 497 | CLANG_WARN_INT_CONVERSION = YES; 498 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 499 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 500 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 501 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 502 | CLANG_WARN_STRICT_PROTOTYPES = YES; 503 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 504 | CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; 505 | CLANG_WARN_UNREACHABLE_CODE = YES; 506 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 507 | CODE_SIGN_IDENTITY = "iPhone Developer"; 508 | COPY_PHASE_STRIP = NO; 509 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 510 | ENABLE_NS_ASSERTIONS = NO; 511 | ENABLE_STRICT_OBJC_MSGSEND = YES; 512 | GCC_C_LANGUAGE_STANDARD = gnu11; 513 | GCC_NO_COMMON_BLOCKS = YES; 514 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 515 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 516 | GCC_WARN_UNDECLARED_SELECTOR = YES; 517 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 518 | GCC_WARN_UNUSED_FUNCTION = YES; 519 | GCC_WARN_UNUSED_VARIABLE = YES; 520 | IPHONEOS_DEPLOYMENT_TARGET = 11.2; 521 | MTL_ENABLE_DEBUG_INFO = NO; 522 | SDKROOT = iphoneos; 523 | VALIDATE_PRODUCT = YES; 524 | }; 525 | name = Release; 526 | }; 527 | A145D5402058C0AD00370BF0 /* Debug */ = { 528 | isa = XCBuildConfiguration; 529 | buildSettings = { 530 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 531 | CODE_SIGN_STYLE = Automatic; 532 | INFOPLIST_FILE = IMXEventBus/Info.plist; 533 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 534 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBus"; 535 | PRODUCT_NAME = "$(TARGET_NAME)"; 536 | TARGETED_DEVICE_FAMILY = "1,2"; 537 | }; 538 | name = Debug; 539 | }; 540 | A145D5412058C0AD00370BF0 /* Release */ = { 541 | isa = XCBuildConfiguration; 542 | buildSettings = { 543 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 544 | CODE_SIGN_STYLE = Automatic; 545 | INFOPLIST_FILE = IMXEventBus/Info.plist; 546 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 547 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBus"; 548 | PRODUCT_NAME = "$(TARGET_NAME)"; 549 | TARGETED_DEVICE_FAMILY = "1,2"; 550 | }; 551 | name = Release; 552 | }; 553 | A145D5432058C0AD00370BF0 /* Debug */ = { 554 | isa = XCBuildConfiguration; 555 | buildSettings = { 556 | BUNDLE_LOADER = "$(TEST_HOST)"; 557 | CODE_SIGN_STYLE = Automatic; 558 | INFOPLIST_FILE = IMXEventBusTests/Info.plist; 559 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 560 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBusTests"; 561 | PRODUCT_NAME = "$(TARGET_NAME)"; 562 | TARGETED_DEVICE_FAMILY = "1,2"; 563 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/IMXEventBus.app/IMXEventBus"; 564 | }; 565 | name = Debug; 566 | }; 567 | A145D5442058C0AD00370BF0 /* Release */ = { 568 | isa = XCBuildConfiguration; 569 | buildSettings = { 570 | BUNDLE_LOADER = "$(TEST_HOST)"; 571 | CODE_SIGN_STYLE = Automatic; 572 | INFOPLIST_FILE = IMXEventBusTests/Info.plist; 573 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 574 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBusTests"; 575 | PRODUCT_NAME = "$(TARGET_NAME)"; 576 | TARGETED_DEVICE_FAMILY = "1,2"; 577 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/IMXEventBus.app/IMXEventBus"; 578 | }; 579 | name = Release; 580 | }; 581 | A145D5462058C0AD00370BF0 /* Debug */ = { 582 | isa = XCBuildConfiguration; 583 | buildSettings = { 584 | CODE_SIGN_STYLE = Automatic; 585 | INFOPLIST_FILE = IMXEventBusUITests/Info.plist; 586 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 587 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBusUITests"; 588 | PRODUCT_NAME = "$(TARGET_NAME)"; 589 | TARGETED_DEVICE_FAMILY = "1,2"; 590 | TEST_TARGET_NAME = IMXEventBus; 591 | }; 592 | name = Debug; 593 | }; 594 | A145D5472058C0AD00370BF0 /* Release */ = { 595 | isa = XCBuildConfiguration; 596 | buildSettings = { 597 | CODE_SIGN_STYLE = Automatic; 598 | INFOPLIST_FILE = IMXEventBusUITests/Info.plist; 599 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 600 | PRODUCT_BUNDLE_IDENTIFIER = "com.--.--.IMXEventBusUITests"; 601 | PRODUCT_NAME = "$(TARGET_NAME)"; 602 | TARGETED_DEVICE_FAMILY = "1,2"; 603 | TEST_TARGET_NAME = IMXEventBus; 604 | }; 605 | name = Release; 606 | }; 607 | /* End XCBuildConfiguration section */ 608 | 609 | /* Begin XCConfigurationList section */ 610 | A145D50E2058C0AC00370BF0 /* Build configuration list for PBXProject "IMXEventBus" */ = { 611 | isa = XCConfigurationList; 612 | buildConfigurations = ( 613 | A145D53D2058C0AD00370BF0 /* Debug */, 614 | A145D53E2058C0AD00370BF0 /* Release */, 615 | ); 616 | defaultConfigurationIsVisible = 0; 617 | defaultConfigurationName = Release; 618 | }; 619 | A145D53F2058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBus" */ = { 620 | isa = XCConfigurationList; 621 | buildConfigurations = ( 622 | A145D5402058C0AD00370BF0 /* Debug */, 623 | A145D5412058C0AD00370BF0 /* Release */, 624 | ); 625 | defaultConfigurationIsVisible = 0; 626 | defaultConfigurationName = Release; 627 | }; 628 | A145D5422058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBusTests" */ = { 629 | isa = XCConfigurationList; 630 | buildConfigurations = ( 631 | A145D5432058C0AD00370BF0 /* Debug */, 632 | A145D5442058C0AD00370BF0 /* Release */, 633 | ); 634 | defaultConfigurationIsVisible = 0; 635 | defaultConfigurationName = Release; 636 | }; 637 | A145D5452058C0AD00370BF0 /* Build configuration list for PBXNativeTarget "IMXEventBusUITests" */ = { 638 | isa = XCConfigurationList; 639 | buildConfigurations = ( 640 | A145D5462058C0AD00370BF0 /* Debug */, 641 | A145D5472058C0AD00370BF0 /* Release */, 642 | ); 643 | defaultConfigurationIsVisible = 0; 644 | defaultConfigurationName = Release; 645 | }; 646 | /* End XCConfigurationList section */ 647 | }; 648 | rootObject = A145D50B2058C0AC00370BF0 /* Project object */; 649 | } 650 | -------------------------------------------------------------------------------- /IMXEventBus.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /IMXEventBus/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /IMXEventBus/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | @interface AppDelegate () 12 | 13 | @end 14 | 15 | @implementation AppDelegate 16 | 17 | 18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 19 | // Override point for customization after application launch. 20 | 21 | return YES; 22 | } 23 | 24 | 25 | - (void)applicationWillResignActive:(UIApplication *)application { 26 | // 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. 27 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 28 | } 29 | 30 | 31 | - (void)applicationDidEnterBackground:(UIApplication *)application { 32 | // 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. 33 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 34 | } 35 | 36 | 37 | - (void)applicationWillEnterForeground:(UIApplication *)application { 38 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 39 | } 40 | 41 | 42 | - (void)applicationDidBecomeActive:(UIApplication *)application { 43 | // 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. 44 | } 45 | 46 | 47 | - (void)applicationWillTerminate:(UIApplication *)application { 48 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 49 | } 50 | 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /IMXEventBus/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /IMXEventBus/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 | -------------------------------------------------------------------------------- /IMXEventBus/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 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Action/IMXEventPoster.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventPoster.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/28. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IMXEventPoster : NSObject 12 | /** 13 | post an event 14 | 15 | actionInMain:NO 16 | 17 | @param name eventName 18 | @param object delivery data 19 | */ 20 | + (void)postEventName:(NSString *)name object:(id)object; 21 | /** 22 | post an event 23 | 24 | @param name eventName 25 | @param object delivery data 26 | @param actionInMain all blocks action in main thread or not 27 | */ 28 | + (void)postEventName:(NSString *)name object:(id)object forceMain:(BOOL)actionInMain; 29 | @end 30 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Action/IMXEventPoster.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventPoster.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/28. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventPoster.h" 10 | #import "IMXEventBus.h" 11 | #import "IMXEventUserInfo.h" 12 | @interface IMXEventPoster() 13 | 14 | @end 15 | 16 | @implementation IMXEventPoster 17 | - (void)dealloc{ 18 | } 19 | #pragma mark ====== public ====== 20 | + (void)postEventName:(NSString *)name object:(id)object{ 21 | [self postEventName:name object:object forceMain:NO]; 22 | } 23 | + (void)postEventName:(NSString *)name object:(id)object forceMain:(BOOL)actionInMain{ 24 | IMXEventUserInfo *userInfo = nil; 25 | if(object){ 26 | userInfo = [IMXEventUserInfo new]; 27 | if([object isKindOfClass:[NSDictionary class]]){ 28 | userInfo.userInfo = object; 29 | }else{ 30 | userInfo.extObj = object; 31 | } 32 | } 33 | [[IMXEventBus sharedInstance] publishEvent:name delivery:userInfo isFromMainTread:actionInMain]; 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Action/IMXEventSubscriber.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventSubscriber.h 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IMXEventDefinition.h" 11 | 12 | @interface IMXEventSubscriber : NSObject 13 | /** 14 | Regist an event 15 | default value: 16 | priority:IMXEventSubscriberPriorityDefault 17 | isMainThread:NO 18 | 19 | @param target key 20 | @param name eventName 21 | @param action action 22 | */ 23 | + (void)addTarget:(id _Nonnull)target name:(NSString * _Nonnull)name action:(IMXEventSubscriberActionBlock _Nonnull)action; 24 | 25 | /** 26 | Regist an event 27 | 28 | @param target key 29 | @param name eventName 30 | @param priority priority 31 | @param isMain action in mainthread or not 32 | @param action action 33 | */ 34 | + (void)addTarget:(id _Nonnull)target name:(NSString * _Nonnull)name priority:(IMXEventSubscriberPriority)priority inMainTread:(BOOL)isMain action:(IMXEventSubscriberActionBlock _Nonnull)action; 35 | /** 36 | remove target subscribers 37 | 38 | @param target target 39 | */ 40 | + (void)removeTarget:(id _Nonnull)target; 41 | /** 42 | remove an event 43 | 44 | @param eventName eventName 45 | */ 46 | + (void)removeEvent:(NSString *_Nonnull)eventName; 47 | @end 48 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Action/IMXEventSubscriber.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventSubscriber.m 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventSubscriber.h" 10 | #import "IMXEventBus.h" 11 | 12 | @interface IMXEventSubscriber() 13 | @end 14 | 15 | @implementation IMXEventSubscriber 16 | - (void)dealloc{ 17 | } 18 | #pragma mark ====== public ====== 19 | //优先级:Default 20 | //线程:非主线程 21 | + (void)addTarget:(id _Nonnull)target name:(NSString * _Nonnull)name action:(IMXEventSubscriberActionBlock _Nonnull)action{ 22 | [self addTarget:target name:name priority:IMXEventSubscriberPriorityDefault inMainTread:NO action:action]; 23 | } 24 | + (void)addTarget:(id _Nonnull)target name:(NSString * _Nonnull)name priority:(IMXEventSubscriberPriority)priority inMainTread:(BOOL)isMain action:(IMXEventSubscriberActionBlock _Nonnull)action{ 25 | [[IMXEventBus sharedInstance] registSubscribModel:target markEvent:name priority:priority inMainTread:isMain action:action]; 26 | } 27 | + (void)removeTarget:(id _Nonnull)target{ 28 | [[IMXEventBus sharedInstance] unregistSubscribModelFromTarget:target]; 29 | } 30 | + (void)removeEvent:(NSString *_Nonnull)eventName{ 31 | [[IMXEventBus sharedInstance] removeEvent:eventName]; 32 | } 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Debug/IMXEventDebug.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventDebug.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/29. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define IMXEventDebug_multiple_registration_err @"!multiple_registration!\nName:%@\nTarget:%@" 12 | #define IMXEventDebug_post_to_no_exist_err @"!post_to_no_exist_event!\nName:%@" 13 | typedef NS_ENUM(NSInteger, IMXEventDebugType) { 14 | IMXEventDebugTypeLog, 15 | IMXEventDebugTypeAlert, 16 | }; 17 | #define IMXEventDebug_share [IMXEventDebug sharedInstance] 18 | @interface IMXEventDebug : NSObject 19 | @property (nonatomic,assign)IMXEventDebugType debugType; 20 | 21 | + (IMXEventDebug *)sharedInstance; 22 | - (void)enableDebug:(BOOL)isEnableDebug; 23 | - (void)showDebugMsg:(NSString *)msg; 24 | 25 | - (void)showAllRegistEventDetail; 26 | - (void)sizeOfEventBus; 27 | @end 28 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Debug/IMXEventDebug.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventDebug.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/29. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventDebug.h" 10 | #import 11 | #import "IMXEventBus.h" 12 | #import "IMXEvent.h" 13 | #import "IMXEventSubscribModel.h" 14 | #ifdef DEBUG 15 | #import 16 | #endif 17 | 18 | 19 | @interface IMXEventDebug() 20 | @property (nonatomic,assign,getter=isEnableDebug)BOOL enableDebug; 21 | @end 22 | @implementation IMXEventDebug 23 | - (void)dealloc{ 24 | } 25 | #pragma mark ====== public ====== 26 | + (IMXEventDebug *)sharedInstance 27 | { 28 | static IMXEventDebug *instance=nil; 29 | static dispatch_once_t onceToken; 30 | dispatch_once(&onceToken, ^{ 31 | instance = [[IMXEventDebug alloc] init]; 32 | }); 33 | return instance; 34 | } 35 | - (void)enableDebug:(BOOL)isEnableDebug{ 36 | #ifdef DEBUG 37 | self.enableDebug = isEnableDebug; 38 | #else 39 | self.enableDebug = NO; 40 | #endif 41 | } 42 | - (void)showDebugMsg:(NSString *)msg{ 43 | if(!self.isEnableDebug) { return; } 44 | if(!msg) { return; } 45 | 46 | if(self.debugType == IMXEventDebugTypeLog){ 47 | [self showLog:msg]; 48 | }else{ 49 | [self showAlert:msg]; 50 | } 51 | } 52 | - (void)showAllRegistEventDetail{ 53 | #ifdef DEBUG 54 | NSDictionary *events = [[IMXEventBus sharedInstance] valueForKey:@"events"]; 55 | NSMutableString *mString = [[NSMutableString alloc] initWithString:@""]; 56 | [events enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, IMXEvent * _Nonnull event, BOOL * _Nonnull stop) { 57 | BOOL isNoSubs = [event isEmptyMap]; 58 | if(isNoSubs){ 59 | [mString appendFormat:@"%@", [NSString stringWithFormat:@"=====Attention=====eventName:%@,triggerCount:%ld\n===========subscribeModel:high~0,default~0,low~0",key,(long)event.triggerCount]]; 60 | }else{ 61 | NSMapTable *high = [event valueForKey:@"mapHigh"]; 62 | NSInteger highCount = high.keyEnumerator.allObjects.count; 63 | NSMapTable *defaultMap = [event valueForKey:@"mapDefault"]; 64 | NSInteger defaultCount = defaultMap.keyEnumerator.allObjects.count; 65 | NSMapTable *low = [event valueForKey:@"mapLow"]; 66 | NSInteger lowCount = low.keyEnumerator.allObjects.count; 67 | [mString appendFormat:@"%@", [NSString stringWithFormat:@"eventName:%@,triggerCount:%ld\nsubscribeModel:high~%ld,default~%ld,low~%ld\n",key,(long)event.triggerCount,(long)highCount,(long)defaultCount,(long)lowCount]]; 68 | } 69 | [mString appendFormat:@"=============\n\n"]; 70 | }]; 71 | NSLog(@"%@",mString); 72 | #endif 73 | } 74 | 75 | - (void)sizeOfEventBus{ 76 | #ifdef DEBUG 77 | NSDictionary *events = [[IMXEventBus sharedInstance] valueForKey:@"events"]; 78 | __block size_t size = 0,dirty_size = 0; 79 | size = malloc_size((__bridge const void *)(events)); 80 | [events enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, IMXEvent * _Nonnull event, BOOL * _Nonnull stop) { 81 | BOOL isNoSubs = [event isEmptyMap]; 82 | 83 | NSMapTable *high = [event valueForKey:@"mapHigh"]; 84 | NSMapTable *defaultMap = [event valueForKey:@"mapDefault"]; 85 | NSMapTable *low = [event valueForKey:@"mapLow"]; 86 | 87 | if(!isNoSubs){ 88 | size += malloc_size((__bridge const void *)(high)); 89 | size += malloc_size((__bridge const void *)(defaultMap)); 90 | size += malloc_size((__bridge const void *)(low)); 91 | 92 | NSArray *tmps = [[NSArray alloc] initWithArray:high.objectEnumerator.allObjects]; 93 | [tmps enumerateObjectsUsingBlock:^(IMXEventSubscribModel * _Nonnull subscriber, NSUInteger idx, BOOL * _Nonnull stop) { 94 | size += malloc_size((__bridge const void *)(subscriber)); 95 | }]; 96 | tmps = [[NSArray alloc] initWithArray:defaultMap.objectEnumerator.allObjects]; 97 | [tmps enumerateObjectsUsingBlock:^(IMXEventSubscribModel * _Nonnull subscriber, NSUInteger idx, BOOL * _Nonnull stop) { 98 | size += malloc_size((__bridge const void *)(subscriber)); 99 | }]; 100 | tmps = [[NSArray alloc] initWithArray:low.objectEnumerator.allObjects]; 101 | [tmps enumerateObjectsUsingBlock:^(IMXEventSubscribModel * _Nonnull subscriber, NSUInteger idx, BOOL * _Nonnull stop) { 102 | size += malloc_size((__bridge const void *)(subscriber)); 103 | }]; 104 | }else{ 105 | dirty_size += malloc_size((__bridge const void *)(high)); 106 | dirty_size += malloc_size((__bridge const void *)(defaultMap)); 107 | dirty_size += malloc_size((__bridge const void *)(low)); 108 | } 109 | }]; 110 | NSString *sizeString = [NSString stringWithFormat:@"event size:~%.4f MB \nevent dirty size:~%.4f MB (more Event maps but without subscribeModels)",size/8.0/1024.0/1024.0,dirty_size/8.0/1024.0/1024.0]; 111 | NSLog(@"%@",sizeString); 112 | #endif 113 | } 114 | #pragma mark ====== life cycle ====== 115 | - (instancetype)init{ 116 | self = [super init]; 117 | if (self) { 118 | self.enableDebug = NO; 119 | self.debugType = IMXEventDebugTypeLog; 120 | } 121 | return self; 122 | } 123 | #pragma mark ====== delegate ====== 124 | 125 | #pragma mark ====== event ====== 126 | 127 | #pragma mark ====== private ====== 128 | - (void)showLog:(NSString *)msg{ 129 | NSLog(@"debug only:\n%@", msg); 130 | } 131 | - (void)showAlert:(NSString *)msg{ 132 | UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"debug only" 133 | message:msg 134 | preferredStyle:UIAlertControllerStyleAlert]; 135 | NSString *ok = NSLocalizedString(@"OK",nil); 136 | UIAlertAction *action = [UIAlertAction actionWithTitle:ok 137 | style:UIAlertActionStyleCancel 138 | handler:nil]; 139 | [alert addAction:action]; 140 | UIViewController *ctrl = [IMXEventDebug IMXEventDebug_CurrentViewCtrl]; 141 | [ctrl presentViewController:alert animated:YES completion:nil]; 142 | } 143 | + (UIViewController *)IMXEventDebug_CurrentViewCtrl{ 144 | UIWindow * window = [self IMXEventDebug_window]; 145 | 146 | UIViewController *rootViewController = window.rootViewController; 147 | UIViewController *currentVC = [self IMXEventDebug_getCurrentVCFrom:rootViewController]; 148 | 149 | return currentVC; 150 | } 151 | 152 | + (UIViewController *)IMXEventDebug_getCurrentVCFrom:(UIViewController *)rootVC 153 | { 154 | UIViewController *currentVC; 155 | if ([rootVC presentedViewController]) { 156 | rootVC = [rootVC presentedViewController]; 157 | } 158 | if ([rootVC isKindOfClass:[UITabBarController class]]) { 159 | currentVC = [self IMXEventDebug_getCurrentVCFrom:[(UITabBarController *)rootVC selectedViewController]]; 160 | 161 | } else if ([rootVC isKindOfClass:[UINavigationController class]]){ 162 | 163 | currentVC = [self IMXEventDebug_getCurrentVCFrom:[(UINavigationController *)rootVC visibleViewController]]; 164 | 165 | } else { 166 | currentVC = rootVC; 167 | } 168 | return currentVC; 169 | } 170 | + (UIWindow *)IMXEventDebug_window{ 171 | UIWindow * window = [[UIApplication sharedApplication] keyWindow]; 172 | if (window.windowLevel != UIWindowLevelNormal){ 173 | NSArray *windows = [[UIApplication sharedApplication] windows]; 174 | for(UIWindow * tmpWin in windows){ 175 | if (tmpWin.windowLevel == UIWindowLevelNormal){ 176 | window = tmpWin; 177 | break; 178 | } 179 | } 180 | } 181 | return window; 182 | } 183 | #pragma mark ====== getter & setter ====== 184 | 185 | 186 | @end 187 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Event/IMXEvent.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEvent.h 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | /** 11 | 事件对象:负责众多订阅者的派发处理等 12 | */ 13 | @class IMXEventSubscribModel,IMXEventUserInfo; 14 | @interface IMXEvent : NSObject 15 | @property (nonatomic,copy)NSString * _Nonnull eventName; 16 | 17 | #ifdef DEBUG 18 | @property (nonatomic,assign)NSInteger triggerCount; 19 | #endif 20 | 21 | /** 22 | Event 中是否包含`target-subscribModel`条目 23 | 24 | @param target key 25 | @return 包含:YES 26 | */ 27 | - (BOOL)hasContainedSubscribModelForKey:(id _Nonnull )target; 28 | /** 29 | 注册订阅者: 30 | 将订阅者条目`target-subscriber`添加至对应的优先级队列中 31 | 32 | @param subscrib 订阅者条目 33 | @param target key 34 | */ 35 | - (void)registSubscribModel:(IMXEventSubscribModel *_Nonnull)subscrib forKey:(id _Nonnull )target; 36 | /** 37 | 触发具体事件,执行其队列中的订阅者行为 38 | 39 | @param info 传输数据 40 | @param isMain 订阅者行为是否强制在主线程执行 41 | */ 42 | - (void)postEventWithDeliveryData:(IMXEventUserInfo *_Nonnull )info isInMain:(BOOL)isMain; 43 | /** 44 | 删除事件中Target对应的一条订阅者记录 45 | 46 | @param target key 47 | @return 删除target对应记录后,各队列是否全为空 48 | */ 49 | - (BOOL)deleteEntryForTarget:(id _Nonnull)target; 50 | /** 51 | 各优先级对应的队列是否全为空 52 | 53 | @return 若全为空,返回YES;反之则否。 54 | */ 55 | - (BOOL)isEmptyMap; 56 | @end 57 | 58 | 59 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Event/IMXEvent.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEvent.m 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEvent.h" 10 | #import "IMXEventSubscribModel.h" 11 | #import "IMXEventUserInfo.h" 12 | @interface IMXEvent(){ 13 | 14 | } 15 | @property (nonatomic,strong)NSMapTable *mapHigh; 16 | @property (nonatomic,strong)NSMapTable *mapDefault; 17 | @property (nonatomic,strong)NSMapTable *mapLow; 18 | @property (nonatomic,strong)dispatch_semaphore_t actionSemaphore; 19 | @end 20 | 21 | @implementation IMXEvent 22 | - (void)dealloc{ 23 | } 24 | #pragma mark ====== public ====== 25 | - (BOOL)hasContainedSubscribModelForKey:(id)target{ 26 | if(!target) return NO; 27 | 28 | if([self.mapHigh objectForKey:target]){ 29 | return YES; 30 | } 31 | if([self.mapDefault objectForKey:target]){ 32 | return YES; 33 | } 34 | if([self.mapLow objectForKey:target]){ 35 | return YES; 36 | } 37 | return NO; 38 | } 39 | - (void)registSubscribModel:(IMXEventSubscribModel *)subscrib forKey:(id)target{ 40 | if(!subscrib) {return;} 41 | if(!target) {return;} 42 | 43 | switch (subscrib.priority) { 44 | case IMXEventSubscriberPriorityHigh:{ 45 | [self addSubscribModel:subscrib forKey:target toMap:self.mapHigh]; 46 | } 47 | break; 48 | case IMXEventSubscriberPriorityDefault:{ 49 | [self addSubscribModel:subscrib forKey:target toMap:self.mapDefault]; 50 | } 51 | break; 52 | case IMXEventSubscriberPriorityLow:{ 53 | [self addSubscribModel:subscrib forKey:target toMap:self.mapLow]; 54 | } 55 | break; 56 | 57 | default:{ 58 | [self addSubscribModel:subscrib forKey:target toMap:self.mapDefault]; 59 | } 60 | break; 61 | } 62 | } 63 | - (void)postEventWithDeliveryData:(IMXEventUserInfo *)info isInMain:(BOOL)isMain{ 64 | #ifdef DEBUG 65 | self.triggerCount++; 66 | #endif 67 | [self actionMap:self.mapHigh deliveryData:info isInMain:isMain]; 68 | [self actionMap:self.mapDefault deliveryData:info isInMain:isMain]; 69 | [self actionMap:self.mapLow deliveryData:info isInMain:isMain]; 70 | } 71 | - (BOOL)deleteEntryForTarget:(id _Nonnull)target{ 72 | if(!target) {return NO;} 73 | 74 | [self deleteEntryForTarget:target in:self.mapHigh]; 75 | [self deleteEntryForTarget:target in:self.mapDefault]; 76 | [self deleteEntryForTarget:target in:self.mapLow]; 77 | 78 | BOOL isEmpty = [self isEmptyMap]; 79 | return isEmpty; 80 | } 81 | - (BOOL)isEmptyMap{ 82 | BOOL isEmptyHigh = self.mapHigh.keyEnumerator.allObjects.count <= 0; 83 | BOOL isEmptyDefault = self.mapDefault.keyEnumerator.allObjects.count <= 0; 84 | BOOL isEmptyLow = self.mapLow.keyEnumerator.allObjects.count <= 0; 85 | 86 | return isEmptyHigh && isEmptyDefault && isEmptyLow; 87 | } 88 | #pragma mark ====== life cycle ====== 89 | - (instancetype)init{ 90 | self = [super init]; 91 | if (self) { 92 | self.actionSemaphore = dispatch_semaphore_create(4); 93 | [self nestConcurrent2SerialQueue]; 94 | 95 | #ifdef DEBUG 96 | self.triggerCount = 0; 97 | #endif 98 | } 99 | return self; 100 | } 101 | #pragma mark ====== delegate ====== 102 | #pragma mark ====== event ====== 103 | 104 | #pragma mark ====== private ====== 105 | - (void)nestConcurrent2SerialQueue{ 106 | dispatch_set_target_queue(event_subscriber_dispatcher_concurrentQueue(), event_subscriber_dispatcher_serialQueue()); 107 | } 108 | - (void)actionMap:(NSMapTable *)map deliveryData:(id)info isInMain:(BOOL)isMain{ 109 | dispatch_async(event_subscriber_dispatcher_concurrentQueue(), ^{ 110 | NSArray *tmps = [[NSArray alloc] initWithArray:map.objectEnumerator.allObjects]; 111 | __weak __typeof(self)weakSelf = self; 112 | [tmps enumerateObjectsUsingBlock:^(IMXEventSubscribModel * _Nonnull subscriber, NSUInteger idx, BOOL * _Nonnull stop) { 113 | __strong __typeof(weakSelf)strongSelf = weakSelf; 114 | dispatch_semaphore_wait(strongSelf.actionSemaphore, DISPATCH_TIME_FOREVER); 115 | [subscriber actionWIthInfo:info forceMainThread:isMain]; 116 | dispatch_semaphore_signal(strongSelf.actionSemaphore); 117 | }]; 118 | }); 119 | } 120 | - (void)deleteEntryForTarget:(id)target in:(NSMapTable *)map{ 121 | [map removeObjectForKey:target]; 122 | } 123 | - (void)addSubscribModel:(IMXEventSubscribModel *)subscrib forKey:(id)target toMap:(NSMapTable *)map{ 124 | [map setObject:subscrib forKey:target]; 125 | } 126 | 127 | #pragma mark ====== c ====== 128 | static dispatch_queue_t event_subscriber_dispatcher_serialQueue() { 129 | static dispatch_queue_t imx_event_subscriber_dispatcher_serialQueue; 130 | static dispatch_once_t onceToken; 131 | dispatch_once(&onceToken, ^{ 132 | imx_event_subscriber_dispatcher_serialQueue = dispatch_queue_create("COM.IMX_EVENT.SERIAL_QUEUE", DISPATCH_QUEUE_SERIAL); 133 | 134 | dispatch_queue_t referQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); 135 | dispatch_set_target_queue(imx_event_subscriber_dispatcher_serialQueue, referQueue); 136 | 137 | }); 138 | return imx_event_subscriber_dispatcher_serialQueue; 139 | } 140 | static dispatch_queue_t event_subscriber_dispatcher_concurrentQueue() { 141 | static dispatch_queue_t imx_event_subscriber_dispatcher_concurrentQueue; 142 | static dispatch_once_t onceToken; 143 | dispatch_once(&onceToken, ^{ 144 | imx_event_subscriber_dispatcher_concurrentQueue = dispatch_queue_create("COM.IMX_EVENT.CONCURRENT_QUEUE", DISPATCH_QUEUE_CONCURRENT); 145 | 146 | dispatch_queue_t referQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); 147 | dispatch_set_target_queue(imx_event_subscriber_dispatcher_concurrentQueue, referQueue); 148 | }); 149 | return imx_event_subscriber_dispatcher_concurrentQueue; 150 | } 151 | #pragma mark ====== getter & setter ====== 152 | - (NSMapTable *)mapHigh{ 153 | if(!_mapHigh){ 154 | _mapHigh = [NSMapTable weakToStrongObjectsMapTable]; 155 | } 156 | return _mapHigh; 157 | } 158 | - (NSMapTable *)mapDefault{ 159 | if(!_mapDefault){ 160 | _mapDefault = [NSMapTable weakToStrongObjectsMapTable]; 161 | } 162 | return _mapDefault; 163 | } 164 | - (NSMapTable *)mapLow{ 165 | if(!_mapLow){ 166 | _mapLow = [NSMapTable weakToStrongObjectsMapTable]; 167 | } 168 | return _mapLow; 169 | } 170 | @end 171 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Event/IMXEventBus.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventBus.h 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IMXEventDefinition.h" 11 | /** 12 | 事件集合 13 | */ 14 | @class IMXEventUserInfo; 15 | @interface IMXEventBus : NSObject 16 | 17 | + (IMXEventBus *_Nonnull)sharedInstance; 18 | 19 | /** 20 | 注册订阅者事件(单一) 21 | 22 | @param target target 23 | @param eventName 事件名称 24 | @param priority target对应订阅者的优先级 25 | @param isMain target对应订阅者的行为触发时是否在主线程执行 26 | @param action target对应订阅者的行为 27 | */ 28 | - (void)registSubscribModel:(id _Nonnull)target markEvent:(NSString * _Nonnull)eventName priority:(IMXEventSubscriberPriority)priority inMainTread:(BOOL)isMain action:(IMXEventSubscriberActionBlock _Nonnull)action; 29 | 30 | /** 31 | 触发事件 32 | 33 | @param eventName 事件名称 34 | @param info 传输的数据 35 | @param isMain 是否强制对应的所有订阅者行为均在主线程执行 36 | */ 37 | - (void)publishEvent:(NSString * _Nonnull)eventName delivery:(IMXEventUserInfo *_Nullable)info isFromMainTread:(BOOL)isMain; 38 | /** 39 | 解注册Target对应的订阅者: 40 | 若解除后事件无相关订阅者,则移除该Event对象 41 | 42 | @param target target 43 | */ 44 | - (void)unregistSubscribModelFromTarget:(id _Nonnull)target; 45 | /** 46 | 移除事件 47 | 48 | @param eventName 事件名称 49 | */ 50 | - (void)removeEvent:(NSString *_Nonnull)eventName; 51 | @end 52 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Event/IMXEventBus.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventBus.m 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/12. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventBus.h" 10 | #import "IMXEvent.h" 11 | #import "IMXEventSubscribModel.h" 12 | #import "IMXEventUserInfo.h" 13 | #import "IMXEventDebug.h" 14 | @interface IMXEventBus() 15 | @property (nonatomic,strong)NSMutableDictionary *events; 16 | @end 17 | 18 | @implementation IMXEventBus 19 | 20 | - (void)dealloc{ 21 | } 22 | #pragma mark ====== public ====== 23 | + (IMXEventBus *)sharedInstance 24 | { 25 | static IMXEventBus *instance=nil; 26 | static dispatch_once_t onceToken; 27 | dispatch_once(&onceToken, ^{ 28 | instance = [[IMXEventBus alloc] init]; 29 | }); 30 | return instance; 31 | } 32 | - (void)registSubscribModel:(id _Nonnull)target markEvent:(NSString * _Nonnull)eventName priority:(IMXEventSubscriberPriority)priority inMainTread:(BOOL)isMain action:(IMXEventSubscriberActionBlock _Nonnull)action{ 33 | if(!target) {return;} 34 | if(!eventName) {return;} 35 | if(!action) {return;} 36 | 37 | dispatch_async(event_bus_dispatcher_serialQueue(), ^{ 38 | IMXEvent *event = self.events[eventName]; 39 | if(!event){ 40 | event = [[IMXEvent alloc] init]; 41 | event.eventName = eventName; 42 | self.events[eventName] = event; 43 | }else{ 44 | if([event hasContainedSubscribModelForKey:target]){ 45 | NSString *msg = [NSString stringWithFormat:IMXEventDebug_multiple_registration_err,eventName,target]; 46 | [IMXEventDebug_share showDebugMsg:msg]; 47 | return; 48 | } 49 | } 50 | IMXEventSubscribModel *subscribModel = [[IMXEventSubscribModel alloc] init]; 51 | subscribModel.priority = priority; 52 | subscribModel.isInMainThread = isMain; 53 | subscribModel.actionBlock = action; 54 | subscribModel.target = target; 55 | [event registSubscribModel:subscribModel forKey:target]; 56 | }); 57 | } 58 | - (void)publishEvent:(NSString * _Nonnull)eventName delivery:(IMXEventUserInfo *)info isFromMainTread:(BOOL)isMain{ 59 | if(!eventName) {return;} 60 | 61 | dispatch_async(event_bus_dispatcher_serialQueue(), ^{ 62 | IMXEvent *event = self.events[eventName]; 63 | if(!event){ 64 | NSString *msg = [NSString stringWithFormat:IMXEventDebug_post_to_no_exist_err,eventName]; 65 | [IMXEventDebug_share showDebugMsg:msg]; 66 | return; 67 | } 68 | if([event isEmptyMap]){ 69 | [self removeEvent:eventName]; 70 | NSString *msg = [NSString stringWithFormat:IMXEventDebug_post_to_no_exist_err,eventName]; 71 | [IMXEventDebug_share showDebugMsg:msg]; 72 | return; 73 | } 74 | [event postEventWithDeliveryData:info isInMain:isMain]; 75 | }); 76 | } 77 | - (void)unregistSubscribModelFromTarget:(id _Nonnull)target{ 78 | if(!target) {return;} 79 | 80 | dispatch_async(event_bus_dispatcher_serialQueue(), ^{ 81 | NSMutableArray *deleteEventNames = [NSMutableArray array]; 82 | [self.events enumerateKeysAndObjectsUsingBlock:^(id _Nonnull key, id _Nonnull obj, BOOL * _Nonnull stop) { 83 | IMXEvent *event = obj; 84 | NSString *eventName = key; 85 | BOOL hasNoSubscribers = [event deleteEntryForTarget:target]; 86 | if(hasNoSubscribers){ 87 | [deleteEventNames addObject:eventName]; 88 | } 89 | }]; 90 | [self.events removeObjectsForKeys:deleteEventNames]; 91 | }); 92 | } 93 | - (void)removeEvent:(NSString *_Nonnull)eventName{ 94 | if(!eventName) {return;} 95 | dispatch_async(event_bus_dispatcher_serialQueue(), ^{ 96 | [self.events removeObjectForKey:eventName]; 97 | }); 98 | } 99 | #pragma mark ====== life cycle ====== 100 | 101 | #pragma mark ====== delegate ====== 102 | 103 | #pragma mark ====== event ====== 104 | 105 | #pragma mark ====== private ====== 106 | 107 | #pragma mark ====== c ====== 108 | static dispatch_queue_t event_bus_dispatcher_serialQueue() { 109 | static dispatch_queue_t imx_event_bus_dispatcher_serialQueue; 110 | static dispatch_once_t onceToken; 111 | dispatch_once(&onceToken, ^{ 112 | imx_event_bus_dispatcher_serialQueue = dispatch_queue_create("COM.IMX_EVENT.BUS.SERIAL_QUEUE", DISPATCH_QUEUE_SERIAL); 113 | 114 | dispatch_queue_t referQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); 115 | dispatch_set_target_queue(imx_event_bus_dispatcher_serialQueue, referQueue); 116 | 117 | }); 118 | return imx_event_bus_dispatcher_serialQueue; 119 | } 120 | #pragma mark ====== getter & setter ====== 121 | - (NSMutableDictionary *)events{ 122 | if(!_events){ 123 | _events = [[NSMutableDictionary alloc] init]; 124 | } 125 | return _events; 126 | } 127 | 128 | @end 129 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/IMXEventBusKit.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventBusKit.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/29. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #ifndef IMXEventBusKit_h 10 | #define IMXEventBusKit_h 11 | 12 | #import "IMXEventSubscriber.h" 13 | #import "IMXEventPoster.h" 14 | #import "IMXEventDebug.h" 15 | #endif /* IMXEventBusKit_h */ 16 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/IMXEventDefinition.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventDefinition.h 3 | // IMXProject 4 | // 5 | // Created by zhoupanpan on 2018/3/13. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #ifndef IMXEventDefinition_h 10 | #define IMXEventDefinition_h 11 | #import "IMXEventUserInfo.h" 12 | //订阅者优先级 13 | typedef NS_ENUM(NSInteger, IMXEventSubscriberPriority) { 14 | IMXEventSubscriberPriorityHigh, 15 | IMXEventSubscriberPriorityDefault, 16 | IMXEventSubscriberPriorityLow 17 | }; 18 | typedef void(^IMXEventSubscriberActionBlock) (IMXEventUserInfo *info); 19 | 20 | #endif /* IMXEventDefinition_h */ 21 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Objs/IMXEventSubscribModel.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventSubscribModel.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/28. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "IMXEventDefinition.h" 11 | /** 12 | 事件订阅者Model 13 | */ 14 | @class IMXEventUserInfo; 15 | @interface IMXEventSubscribModel : NSObject 16 | @property (nonatomic,copy)IMXEventSubscriberActionBlock actionBlock; 17 | @property (nonatomic,assign)IMXEventSubscriberPriority priority; 18 | @property (nonatomic,assign)BOOL isInMainThread; 19 | @property (nonatomic,weak)id target; 20 | 21 | 22 | - (void)actionWIthInfo:(IMXEventUserInfo *)info forceMainThread:(BOOL)isMain; 23 | @end 24 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Objs/IMXEventSubscribModel.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventSubscribModel.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/28. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventSubscribModel.h" 10 | #import "IMXEventUserInfo.h" 11 | 12 | @interface IMXEventSubscribModel() 13 | @end 14 | 15 | @implementation IMXEventSubscribModel 16 | - (void)dealloc{ 17 | } 18 | #pragma mark ====== public ====== 19 | - (void)actionWIthInfo:(IMXEventUserInfo *)info forceMainThread:(BOOL)isMain{ 20 | if(isMain){ 21 | [IMXEventSubscribModel mainTreadAction:^{ 22 | self.actionBlock(info); 23 | }]; 24 | }else{ 25 | if(self.isInMainThread){ 26 | [IMXEventSubscribModel mainTreadAction:^{ 27 | self.actionBlock(info); 28 | }]; 29 | }else{ 30 | self.actionBlock(info); 31 | } 32 | } 33 | } 34 | #pragma mark ====== life cycle ====== 35 | - (instancetype)init{ 36 | self = [super init]; 37 | if (self) { 38 | } 39 | return self; 40 | } 41 | #pragma mark ====== delegate ====== 42 | 43 | #pragma mark ====== event ====== 44 | 45 | #pragma mark ====== private ====== 46 | + (void)mainTreadAction:(void(^)(void))action{ 47 | if([NSThread isMainThread]){ 48 | if(action){ 49 | action(); 50 | } 51 | }else{ 52 | dispatch_async(dispatch_get_main_queue(), ^{ 53 | if(action){ 54 | action(); 55 | } 56 | }); 57 | } 58 | } 59 | #pragma mark ====== getter & setter ====== 60 | @end 61 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Objs/IMXEventUserInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventUserInfo.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/19. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IMXEventUserInfo : NSObject 12 | @property (nonatomic,copy)NSDictionary *userInfo; 13 | @property (nonatomic,strong)id extObj; 14 | @end 15 | -------------------------------------------------------------------------------- /IMXEventBus/IMXEventBus/Objs/IMXEventUserInfo.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventUserInfo.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/19. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "IMXEventUserInfo.h" 10 | 11 | @implementation IMXEventUserInfo 12 | - (NSString *)description 13 | { 14 | return [NSString stringWithFormat:@"<%p> - userInfo: %@, extobj: %@", self, [self.userInfo description],[self.extObj description]]; 15 | } 16 | @end 17 | -------------------------------------------------------------------------------- /IMXEventBus/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /IMXEventBus/SecondViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface SecondViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IMXEventBus/SecondViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // SecondViewController.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "SecondViewController.h" 10 | #import "IMXEventBusKit.h" 11 | static NSInteger highSuffix = 0,defaultSuffix = 0,lowSuffix = 0; 12 | 13 | @interface SecondViewController () 14 | 15 | @end 16 | 17 | @implementation SecondViewController 18 | 19 | - (void)dealloc{ 20 | } 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view. 24 | 25 | self.title = @"second page"; 26 | self.view.backgroundColor = [UIColor lightGrayColor]; 27 | 28 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 29 | [btn setTitle:@"Regist High Btn" forState:UIControlStateNormal]; 30 | [btn addTarget:self action:@selector(highPage:) forControlEvents:UIControlEventTouchUpInside]; 31 | btn.frame = CGRectMake(80, 180, 200, 60); 32 | [self.view addSubview:btn]; 33 | 34 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 35 | [btn setTitle:@"Regist Default Btn" forState:UIControlStateNormal]; 36 | [btn addTarget:self action:@selector(defaultPage:) forControlEvents:UIControlEventTouchUpInside]; 37 | btn.frame = CGRectMake(80, 250, 200, 60); 38 | [self.view addSubview:btn]; 39 | 40 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 41 | [btn setTitle:@"Regist Low Btn" forState:UIControlStateNormal]; 42 | [btn addTarget:self action:@selector(lowPage:) forControlEvents:UIControlEventTouchUpInside]; 43 | btn.frame = CGRectMake(80, 320, 200, 60); 44 | [self.view addSubview:btn]; 45 | 46 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 47 | [btn setTitle:@"Reset Btn" forState:UIControlStateNormal]; 48 | [btn addTarget:self action:@selector(resetBtn:) forControlEvents:UIControlEventTouchUpInside]; 49 | btn.frame = CGRectMake(80, 390, 200, 60); 50 | [self.view addSubview:btn]; 51 | } 52 | - (void)highPage:(UIButton *)btn{ 53 | NSString *eventName = [NSString stringWithFormat:@"event_high_%ld",(long)highSuffix++]; 54 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityHigh inMainTread:NO action:^(IMXEventUserInfo *info) { 55 | NSLog(@"high :%@ thread:%@",[info description],[NSThread currentThread]); 56 | }]; 57 | } 58 | - (void)defaultPage:(UIButton *)btn{ 59 | NSString *eventName = [NSString stringWithFormat:@"event_default_%ld",(long)defaultSuffix++]; 60 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityDefault inMainTread:YES action:^(IMXEventUserInfo *info) { 61 | NSLog(@"default :%@ thread:%@",[info description],[NSThread currentThread]); 62 | }]; 63 | } 64 | - (void)lowPage:(UIButton *)btn{ 65 | NSString *eventName = [NSString stringWithFormat:@"event_low_%ld",(long)lowSuffix++]; 66 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityLow inMainTread:YES action:^(IMXEventUserInfo *info) { 67 | NSLog(@"low :%@ thread:%@",[info description],[NSThread currentThread]); 68 | }]; 69 | } 70 | - (void)resetBtn:(UIButton *)btn{ 71 | highSuffix = 0; 72 | defaultSuffix = 0; 73 | lowSuffix = 0; 74 | } 75 | - (void)didReceiveMemoryWarning { 76 | [super didReceiveMemoryWarning]; 77 | // Dispose of any resources that can be recreated. 78 | } 79 | 80 | /* 81 | #pragma mark - Navigation 82 | 83 | // In a storyboard-based application, you will often want to do a little preparation before navigation 84 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 85 | // Get the new view controller using [segue destinationViewController]. 86 | // Pass the selected object to the new view controller. 87 | } 88 | */ 89 | 90 | @end 91 | -------------------------------------------------------------------------------- /IMXEventBus/ThirdViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ThirdViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /IMXEventBus/ThirdViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ThirdViewController.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "ThirdViewController.h" 10 | #import "IMXEventBusKit.h" 11 | 12 | static NSInteger highSuffix = 0,defaultSuffix = 0,lowSuffix = 0; 13 | @interface ThirdViewController () 14 | 15 | @end 16 | 17 | @implementation ThirdViewController 18 | 19 | - (void)dealloc{ 20 | } 21 | - (void)viewDidLoad { 22 | [super viewDidLoad]; 23 | // Do any additional setup after loading the view, typically from a nib. 24 | self.title = @"third page"; 25 | self.view.backgroundColor = [UIColor lightGrayColor]; 26 | 27 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 28 | [btn setTitle:@"publish High Btn" forState:UIControlStateNormal]; 29 | [btn addTarget:self action:@selector(publishHigh:) forControlEvents:UIControlEventTouchUpInside]; 30 | btn.frame = CGRectMake(80, 320, 200, 60); 31 | [self.view addSubview:btn]; 32 | 33 | 34 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 35 | [btn setTitle:@"publish Default Btn" forState:UIControlStateNormal]; 36 | [btn addTarget:self action:@selector(publishDefault:) forControlEvents:UIControlEventTouchUpInside]; 37 | btn.frame = CGRectMake(80, 390, 200, 60); 38 | [self.view addSubview:btn]; 39 | 40 | 41 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 42 | [btn setTitle:@"publish Low Btn" forState:UIControlStateNormal]; 43 | [btn addTarget:self action:@selector(publishLow:) forControlEvents:UIControlEventTouchUpInside]; 44 | btn.frame = CGRectMake(80, 460, 200, 60); 45 | [self.view addSubview:btn]; 46 | 47 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 48 | [btn setTitle:@"Reset Publish Suffix" forState:UIControlStateNormal]; 49 | [btn addTarget:self action:@selector(reset:) forControlEvents:UIControlEventTouchUpInside]; 50 | btn.frame = CGRectMake(80, 530, 200, 30); 51 | [self.view addSubview:btn]; 52 | } 53 | 54 | - (void)publishHigh:(UIButton *)btn{ 55 | NSString *eventName = [NSString stringWithFormat:@"event_high_%ld",(long)highSuffix++]; 56 | [IMXEventPoster postEventName:eventName object:nil forceMain:YES]; 57 | } 58 | - (void)publishDefault:(UIButton *)btn{ 59 | NSString *eventName = [NSString stringWithFormat:@"event_default_%ld",(long)defaultSuffix++]; 60 | [IMXEventPoster postEventName:eventName object:@{@"yes":@"wef"} forceMain:NO]; 61 | } 62 | - (void)publishLow:(UIButton *)btn{ 63 | [IMXEventDebug_share showAllRegistEventDetail]; 64 | [IMXEventDebug_share sizeOfEventBus]; 65 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 66 | NSString *eventName = [NSString stringWithFormat:@"event_low_%ld",(long)lowSuffix++]; 67 | [IMXEventPoster postEventName:eventName object:nil forceMain:YES]; 68 | }); 69 | } 70 | - (void)reset:(UIButton *)btn{ 71 | highSuffix = 0; 72 | defaultSuffix = 0; 73 | lowSuffix = 0; 74 | 75 | 76 | } 77 | - (void)didReceiveMemoryWarning { 78 | [super didReceiveMemoryWarning]; 79 | // Dispose of any resources that can be recreated. 80 | } 81 | 82 | /* 83 | #pragma mark - Navigation 84 | 85 | // In a storyboard-based application, you will often want to do a little preparation before navigation 86 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 87 | // Get the new view controller using [segue destinationViewController]. 88 | // Pass the selected object to the new view controller. 89 | } 90 | */ 91 | 92 | @end 93 | -------------------------------------------------------------------------------- /IMXEventBus/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /IMXEventBus/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "SecondViewController.h" 11 | #import "ThirdViewController.h" 12 | #import "IMXEventBusKit.h" 13 | static NSInteger highSuffix = 0,defaultSuffix = 0,lowSuffix = 0; 14 | @interface ViewController () 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)dealloc{ 21 | } 22 | - (void)viewDidLoad { 23 | [super viewDidLoad]; 24 | // Do any additional setup after loading the view. 25 | [IMXEventDebug_share enableDebug:YES]; 26 | IMXEventDebug_share.debugType = IMXEventDebugTypeAlert; 27 | 28 | self.title = @"main page"; 29 | self.view.backgroundColor = [UIColor lightGrayColor]; 30 | 31 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom]; 32 | [btn setTitle:@"Second" forState:UIControlStateNormal]; 33 | [btn addTarget:self action:@selector(secondPage:) forControlEvents:UIControlEventTouchUpInside]; 34 | btn.frame = CGRectMake(80, 80, 80, 60); 35 | [self.view addSubview:btn]; 36 | 37 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 38 | [btn setTitle:@"Third Page" forState:UIControlStateNormal]; 39 | [btn addTarget:self action:@selector(thirdPage:) forControlEvents:UIControlEventTouchUpInside]; 40 | btn.frame = CGRectMake(180, 80, 120, 60); 41 | [self.view addSubview:btn]; 42 | 43 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 44 | [btn setTitle:@"Regist High Btn" forState:UIControlStateNormal]; 45 | [btn addTarget:self action:@selector(highPage:) forControlEvents:UIControlEventTouchUpInside]; 46 | btn.frame = CGRectMake(80, 180, 200, 60); 47 | [self.view addSubview:btn]; 48 | 49 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 50 | [btn setTitle:@"Regist Default Btn" forState:UIControlStateNormal]; 51 | [btn addTarget:self action:@selector(defaultPage:) forControlEvents:UIControlEventTouchUpInside]; 52 | btn.frame = CGRectMake(80, 250, 200, 60); 53 | [self.view addSubview:btn]; 54 | 55 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 56 | [btn setTitle:@"Regist Low Btn" forState:UIControlStateNormal]; 57 | [btn addTarget:self action:@selector(lowPage:) forControlEvents:UIControlEventTouchUpInside]; 58 | btn.frame = CGRectMake(80, 320, 200, 60); 59 | [self.view addSubview:btn]; 60 | 61 | btn = [UIButton buttonWithType:UIButtonTypeCustom]; 62 | [btn setTitle:@"Reset Btn" forState:UIControlStateNormal]; 63 | [btn addTarget:self action:@selector(resetBtn:) forControlEvents:UIControlEventTouchUpInside]; 64 | btn.frame = CGRectMake(80, 390, 200, 60); 65 | [self.view addSubview:btn]; 66 | } 67 | - (void)secondPage:(UIButton *)btn{ 68 | SecondViewController *ctrl = [SecondViewController new]; 69 | [self.navigationController pushViewController:ctrl animated:YES]; 70 | } 71 | - (void)thirdPage:(UIButton *)btn{ 72 | ThirdViewController *ctrl = [ThirdViewController new]; 73 | [self.navigationController pushViewController:ctrl animated:YES]; 74 | } 75 | 76 | - (void)highPage:(UIButton *)btn{ 77 | NSString *eventName = [NSString stringWithFormat:@"event_high_%ld",(long)highSuffix++]; 78 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityHigh inMainTread:NO action:^(IMXEventUserInfo *info) { 79 | NSLog(@"high :%@ thread:%@",[info description],[NSThread currentThread]); 80 | }]; 81 | } 82 | - (void)defaultPage:(UIButton *)btn{ 83 | dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ 84 | NSString *eventName = [NSString stringWithFormat:@"event_default_%ld",(long)defaultSuffix++]; 85 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityDefault inMainTread:YES action:^(IMXEventUserInfo *info) { 86 | NSLog(@"default :%@ thread:%@",[info description],[NSThread currentThread]); 87 | }]; 88 | }); 89 | 90 | } 91 | - (void)lowPage:(UIButton *)btn{ 92 | for(int i=0;i<1000;i++){ 93 | NSString *eventName = [NSString stringWithFormat:@"event_low_%ld",(long)lowSuffix++]; 94 | [IMXEventSubscriber addTarget:self name:eventName priority:IMXEventSubscriberPriorityLow inMainTread:YES action:^(IMXEventUserInfo *info) { 95 | NSLog(@"low :%@ thread:%@",[info description],[NSThread currentThread]); 96 | }]; 97 | } 98 | 99 | } 100 | - (void)resetBtn:(UIButton *)btn{ 101 | highSuffix = 0; 102 | defaultSuffix = 0; 103 | lowSuffix = 0; 104 | } 105 | - (void)didReceiveMemoryWarning { 106 | [super didReceiveMemoryWarning]; 107 | // Dispose of any resources that can be recreated. 108 | } 109 | 110 | 111 | @end 112 | -------------------------------------------------------------------------------- /IMXEventBus/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // IMXEventBus 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /IMXEventBusTests/IMXEventBusTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventBusTests.m 3 | // IMXEventBusTests 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IMXEventBusTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation IMXEventBusTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /IMXEventBusTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /IMXEventBusUITests/IMXEventBusUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // IMXEventBusUITests.m 3 | // IMXEventBusUITests 4 | // 5 | // Created by zhoupanpan on 2018/3/14. 6 | // Copyright © 2018年 panzhow. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface IMXEventBusUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation IMXEventBusUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /IMXEventBusUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 PanZhow 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # IMXEventBus 2 | 3 | 4 | 5 | ## #功能列表: 6 | * 以订阅/发布的模式实现跨组件通信,也即通信模块。类似`NSNotification `的通信功能。 7 | * 生命周期管理:注册的事件订阅者可自动释放,也可手动管理其释放时机。 8 | * 优先级处理:触发事件时,通过预设值的优先级,决定执行订阅者回调的先后顺序。 9 | * 订阅者回调在主线程/非主线程执行的控制。 10 | * Debug模式下:增加输出所有Event信息。 11 | 12 | 13 | ## #如何使用: 14 | 15 | ### 1.)导入: 16 | 1. Cocoapods:pod 'IMXEventBus', '~> 1.0.0' 17 | 18 | 2. 手动导入:本库无依赖其它三方库,直接将`IMXEventBus`文件夹拖入项目即可。 19 | 20 | ### 2.)头文件引入: 21 | 22 | ``` 23 | #import "IMXEventBusKit.h" 24 | ``` 25 | 26 | ### 3.)功能使用: 27 | ###### 1. 注册: 28 | 29 | 1. 简略模式: 30 | 31 | 32 | ``` 33 | //默认值: 34 | //优先级:Default;回调执行:非主线程 35 | [IMXEventSubscriber addTarget:self name:@"login_eventName" action:^(IMXEventUserInfo *info) { 36 | NSLog(@"callback info:%@ thread:%@",[info description],[NSThread currentThread]); 37 | }]; 38 | 39 | ``` 40 | 41 | 2. 全参模式: 42 | 43 | 44 | ``` 45 | [IMXEventSubscriber addTarget:self name:@"login_eventName" priority:IMXEventSubscriberPriorityDefault inMainTread:YES action:^(IMXEventUserInfo *info) { 46 | NSLog(@"callback info:%@ thread:%@",[info description],[NSThread currentThread]); 47 | }]; 48 | 49 | ``` 50 | 51 | 52 | * **默认情况下,优先级是default,回调均是在非主线程下执行。** 53 | 54 | ###### 2. 触发事件: 55 | 56 | 1. 简略模式: 57 | 58 | 59 | ``` 60 | //默认值: 61 | //被触发的事件:不强制在主线程中执行回调 62 | [IMXEventPoster postEventName:@"login_eventName" object:@{@"userName":@"demo"}]; 63 | 64 | ``` 65 | 66 | 2. 全参模式: 67 | 68 | ``` 69 | [IMXEventPoster postEventName:@"login_eventName" object:nil forceMain:YES]; 70 | 71 | ``` 72 | 73 | * **默认情况下,firceMain:NO。即所有被触发的监听对象,其回调执行均参考自身属性`isInMainThread `;否则均强制在主线程执行。** 74 | 75 | ###### 3. Debug: 76 | 77 | 1. 功能汇总(仅在Debug模式下,log处理): 78 | 79 | 1. 重复添加target对应的同一事件时,会打印或者弹出log提示。 80 | 2. post时,无对应的监听者存在,会打印或者弹出log提示。 81 | 3. Debug模式下:输出所有Event信息。(便于检测当前无订阅者的僵尸事件以及未被触发的事件) 82 | 83 | > 注:仅输出之前的Event调用情况,无法检测输出之后的log,故输出的数目不代表最终数据。 84 | 85 | 2. 开启Debug功能:默认不开启。 86 | 87 | ``` 88 | 89 | [IMXEventDebug_share enableDebug:YES]; 90 | IMXEventDebug_share.debugType = IMXEventDebugTypeAlert; 91 | 92 | ``` 93 | 94 | * **无论如何设置,Debug功能仅在Debug模式下起作用。** 95 | 96 | 97 | ## #要点及图谱: 98 | * 注册事件、触发事件、移除事件等操作均针对同一队列操作:所有操作均嵌入异步串行队列之中,保证了资源存取的线程安全。 99 | * 事件监听者对象分别由3个不同优先级的NSMapTable队列存储:以`Target:Model`方式存储,对应Target由于生命周期问题释放后,那么事件队列中相关条目会被自动释放。但无法实时检测到,故发布事件时均需巡检一次。 100 | * 触发事件时:轮询3个不同优先级对类,执行每个监听者对象的回调:执行操作均放在并行队列中,并创建信号量控制线程的数量。且并行队列嵌入在串行队列中,保证3个对类按其优先级顺序执行。 101 | 102 | 图谱1:类图结构 103 | 104 | ![img](docs/imgs/IMXEventBus类图.png) 105 | 106 | 图谱2:事件注册流程图 107 | 108 | ![img](docs/imgs/IMXEventBus注册监听.png) 109 | 110 | 图谱3:事件触发流程图 111 | 112 | ![img](docs/imgs/IMXEventBus触发.png) 113 | 114 | ## #结构描述: 115 | 116 | #### 一、数据: 117 | ###### 1. IMXEventSubscribModel:订阅者对象 118 | 119 | * 数据 120 | 1. actionBlock:post触发时执行该回调 121 | 2. priority:优先级,决定订阅者对象预置入哪个队列以及后续执行序列。(在IMXEventBus中使用) 122 | 3. isInMainThread:是否在主线程/非主线程执行actionBlock 123 | 4. target:弱引用形式,暂未使用场景 124 | * 行为: 125 | 126 | 1. ``actionWIthInfo:forceMainThread: ``:回调执行最终实现 127 | 128 | 129 | ###### 2. IMXEventUserInfo:poster传输数据 130 | 131 | * 数据 132 | 133 | 1. userInfo:字典对象 134 | 2. 待扩展 135 | 136 | 137 | #### 二、逻辑处理: 138 | 139 | ###### 1. IMXEvent:事件 140 | 141 | * 功能:单一事件对象。 142 | 143 | 1. 注册订阅者对象 144 | 2. 响应poster触发事件 145 | 3. 即管理和调度订阅者队列 146 | 147 | * 数据: 148 | 149 | 1. eventName:事件名称,唯一标识一个事件。 150 | 2. mapHigh、mapDefault、mapLow:私有属性。订阅者队列。NSMaptable定制,target释放,对应记录也自动释放的特性。 151 | 152 | * 行为: 153 | 154 | 1. ``hasContainedSubscribModelForKey:``:检查各队列中是否包含Key对应的订阅者。 155 | 2. ``registSubscribModel:forKey:``:注册订阅者至对应队列。 156 | 3. ``postEventWithDeliveryData:isInMain``:事件出发,逐个执行事件中各队列的订阅者行为。 157 | 158 | 1. 并行队列嵌入至串行队列:保证3个优先级队列顺序执行。 159 | 2. 并行队列:保证单个事件队列中各订阅者行为并行执行。 160 | 3. 信号量处理:控制线程数量,并行数。 161 | 162 | 4. ``deleteEntryForTarget:``:删除事件中Target对应的一条订阅者记录。 163 | 5. ``isEmptyMap``:各优先级对应的队列是否全为空 164 | 165 | 166 | ###### 2. IMXEventBus:单例模式,事件集合。 167 | * 数据: 168 | 169 | 1. events:事件集合。所有针对该集合的处理均在异步线程中串行执行,非阻塞主线程行为。 170 | 171 | * 行为: 172 | 173 | 1. ``registSubscribModel:markEvent:priority:inMainTread:action:``:注册订阅者 174 | 2. ``publishEvent:delivery:isFromMainTread:``:触发事件 175 | 3. ``unregistSubscribModelFromTarget:``: 解注册Target对应的订阅者:若解除后事件无相关订阅者,则移除该Event对象。 176 | 4. ``removeEvent:``: 移除事件 177 | 178 | 179 | #### 三、public文件: 180 | 181 | ###### 1. IMXEventSubscriber:注册订阅者 182 | 183 | 主要是针对`IMXEventBus`注册接口的封装。如将`优先级`和`是否主线程执行回调`统一置常用值为默认值。 184 | 185 | ###### 2. IMXEventPoster:post触发事件 186 | 187 | 主要是针对`IMXEventBus`发布接口的封装。将`是否主线程执行回调`统一置常用值为默认值。 188 | 189 | 190 | ## #待完善: 191 | 192 | 1. Target子类化对象中与Target本身存在有同名事件处理问题(过滤去重功能)。 193 | 2. 延时触发事件。 194 | 3. 条件触发。 195 | 4. 其它 196 | 197 | ## #参考: 198 | * [GCD](https://github.com/ming1016/study/wiki/%E7%BB%86%E8%AF%B4GCD%EF%BC%88Grand-Central-Dispatch%EF%BC%89%E5%A6%82%E4%BD%95%E7%94%A8) 199 | * [线程安全](https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Multithreading/ThreadSafetySummary/ThreadSafetySummary.html) 200 | * [http://www.cocoachina.com/ios/20160225/15422.html](http://www.cocoachina.com/ios/20160225/15422.html) 201 | * [Java EventBus](https://github.com/greenrobot/EventBus) 202 | * [https://github.com/lyeah/EventBus/tree/master/EventBus](https://github.com/lyeah/EventBus/tree/master/EventBus) 203 | * [https://github.com/AKACoder/ABCEventBus](https://github.com/AKACoder/ABCEventBus) 204 | * [https://github.com/benjamincombes/EventBus](https://github.com/benjamincombes/EventBus) 205 | * [https://github.com/kouky/EventBus](https://github.com/kouky/EventBus) 206 | * [https://github.com/ShezHsky/EventBus](https://github.com/ShezHsky/EventBus) 207 | * [https://github.com/chausson/XEBEventBus](https://github.com/chausson/XEBEventBus) 208 | * [https://github.com/favret/Magic-Swift-Bus](https://github.com/favret/Magic-Swift-Bus) 209 | * [https://github.com/l9y/SwiftEvent](https://github.com/l9y/SwiftEvent) 210 | * [https://github.com/cesarferreira/SwiftEventBus](https://github.com/cesarferreira/SwiftEventBus) 211 | * [https://github.com/aixinyunchou/OCEventBus](https://github.com/aixinyunchou/OCEventBus) 212 | * [https://github.com/goodow/GDChannel](https://github.com/goodow/GDChannel) 213 | 214 | ## #更新Pods开源库 215 | 216 | 1. 提交code至github,或改version或保持不变(更改版本时不需要第3步骤)。 217 | 2. pod trunk register '' --description='' 218 | 3. pod trunk delete IMXEventBus 1.0.0 219 | 4. pod trunk push --allow-warnings 220 | 5. 使用时:pod setup更新 221 | 222 | 参考链接:[https://www.jianshu.com/p/d6beddcce8bb](https://www.jianshu.com/p/d6beddcce8bb) 223 | -------------------------------------------------------------------------------- /docs/IMXEventBus注册监听.gliffy: -------------------------------------------------------------------------------- 1 | {"contentType":"application/gliffy+json","version":"1.1","metadata":{"title":"untitled","revision":0,"exportBorder":false},"embeddedResources":{"index":0,"resources":[]},"stage":{"objects":[{"x":255,"y":381,"rotation":0,"id":63,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":63,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,8.0","startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[10,4],[80,4]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":24,"px":0,"py":0.5}}},"linkMap":[]},{"x":766,"y":811,"rotation":0,"id":61,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":61,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[14,19],[14,84],[-177,84],[-177,149]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":42,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":45,"px":0.5,"py":0}}},"linkMap":[]},{"x":781,"y":731,"rotation":0,"id":59,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":59,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[-1,49]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":60,"uid":null,"width":33,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

否/NO

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":42,"px":0.5,"py":0}}},"linkMap":[]},{"x":586,"y":631,"rotation":0,"id":57,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":57,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,174],[144,174]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":42,"px":0,"py":0.5}}},"linkMap":[]},{"x":756,"y":708,"rotation":0,"id":55,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":55,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[49,-8],[89,-8],[89,278],[-141,278]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":58,"uid":null,"width":46,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

[是/YES]

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":38,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":45,"px":1,"py":0.5}}},"linkMap":[]},{"x":780,"y":633,"rotation":0,"id":54,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":54,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,37]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":38,"px":0.5,"py":0}}},"linkMap":[]},{"x":590,"y":553,"rotation":0,"id":52,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":52,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,27]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":53,"uid":null,"width":33,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

否/NO

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":35,"px":0.5,"py":0}}},"linkMap":[]},{"x":621,"y":519,"rotation":0,"id":50,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":50,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[159,0],[159,61]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":51,"uid":null,"width":39,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

是/YES

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":39,"px":0.5,"py":0}}},"linkMap":[]},{"x":591,"y":463,"rotation":0,"id":49,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":49,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[-1,27]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":470,"y":387,"rotation":0,"id":48,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":48,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[120,0],[120,23]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":30,"px":0.5,"py":0}}},"linkMap":[]},{"x":402,"y":324,"rotation":0,"id":47,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":47,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,32.38826948140331]],"lockSegments":{}}},"children":[],"linkMap":[]},{"x":563,"y":960,"rotation":0,"id":45,"uid":"com.gliffy.shape.bpmn.bpmn_v1.events.terminate","width":52,"height":52,"lockAspectRatio":true,"lockShape":false,"order":45,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.terminate.bpmn_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":730,"y":780,"rotation":0,"id":42,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":42,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":44,"uid":null,"width":96,"height":40,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

向Event对应优先级队列添加监听对象,即完成注册

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":730,"y":580,"rotation":0,"id":39,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":39,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":41,"uid":null,"width":96,"height":30,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

Event中是否已存在该Target的监听对象

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":540,"y":580,"rotation":0,"id":35,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":17,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":37,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

创建Event并添加至EventBus

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":565,"y":490,"rotation":0,"id":33,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.decision","width":50,"height":60,"lockAspectRatio":false,"lockShape":false,"order":16,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.diamond.basic_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":540,"y":410,"rotation":0,"id":30,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":14,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":32,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

是否存在对应Event?

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":160,"y":347,"rotation":0,"id":27,"uid":"com.gliffy.shape.uml.uml_v1.default.note","width":100,"height":63,"lockAspectRatio":false,"lockShape":false,"order":12,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.note.uml_v1","strokeWidth":1,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":29,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

移除Target、移除事件与之类似

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":335,"y":360,"rotation":0,"id":24,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":130,"height":50,"lockAspectRatio":false,"lockShape":false,"order":10,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2.5999999999999996,"y":0,"rotation":0,"id":26,"uid":null,"width":124.8,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

注册事件/regist Event

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":380,"y":280,"rotation":0,"id":20,"uid":"com.gliffy.shape.uml.uml_v1.default.interface","width":40,"height":40,"lockAspectRatio":true,"lockShape":false,"order":9,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ellipse.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#000000","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":319,"y":200,"rotation":0,"id":11,"uid":"com.gliffy.shape.swimlanes.swimlanes_v1.default.vertical_triple_lane_pool","width":540,"height":993,"lockAspectRatio":false,"lockShape":false,"order":0,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":12,"uid":null,"width":540,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":13,"uid":null,"width":540,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

EventBus Subscriber

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":13,"magnitude":1}],"growParent":false,"padding":0}}]}},{"x":0,"y":26,"rotation":0,"id":14,"uid":null,"width":180,"height":967,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":15,"uid":null,"width":180,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventSubscriber

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":12,"magnitude":-1},{"id":11,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":12,"px":0,"py":1}}]}},{"x":179.99982,"y":26,"rotation":0,"id":16,"uid":null,"width":180,"height":967,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":17,"uid":null,"width":180,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventBus

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":12,"magnitude":-1},{"id":11,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":12,"px":0.333333,"py":1}}]}},{"x":359.99964,"y":26,"rotation":0,"id":18,"uid":null,"width":180,"height":967,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":19,"uid":null,"width":180,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEvent

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":12,"magnitude":-1},{"id":11,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":12,"px":0.666666,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":12,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":755,"y":670,"rotation":0,"id":38,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.decision","width":50,"height":60,"lockAspectRatio":false,"lockShape":false,"order":19,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.diamond.basic_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":540,"y":249.5,"rotation":0,"id":64,"uid":"com.gliffy.shape.uml.uml_v1.default.note","width":125,"height":63.00000000000001,"lockAspectRatio":false,"lockShape":false,"order":64,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.note.uml_v1","strokeWidth":1,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2.5,"y":0,"rotation":0,"id":67,"uid":null,"width":120,"height":30,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

针对EventBus的操作均在定制的异步串行队列中进行

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":619,"y":333.5,"rotation":0,"id":66,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":66,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,8.0","startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,53]],"lockSegments":{}}},"children":null,"linkMap":[]}],"background":"#FFFFFF","width":868,"height":1193,"maxWidth":5000,"maxHeight":5000,"nodeIndex":69,"autoFit":true,"exportBorder":false,"gridOn":true,"snapToGrid":true,"drawingGuidesOn":true,"pageBreaksOn":false,"printGridOn":false,"printPaper":"LETTER","printShrinkToFit":false,"printPortrait":true,"shapeStyles":{"com.gliffy.shape.flowchart.flowchart_v1.default":{"fill":"#FFFFFF","stroke":"#333333","strokeWidth":2},"com.gliffy.shape.bpmn.bpmn_v1.events":{"fill":"#FFFFFF","stroke":"#000000"}},"lineStyles":{},"textStyles":{},"themeData":null}} -------------------------------------------------------------------------------- /docs/IMXEventBus类图.gliffy: -------------------------------------------------------------------------------- 1 | {"contentType":"application/gliffy+json","version":"1.1","metadata":{"title":"untitled","revision":0,"exportBorder":false},"embeddedResources":{"index":0,"resources":[]},"stage":{"objects":[{"x":850,"y":430,"rotation":0,"id":114,"uid":"com.gliffy.shape.uml.uml_v1.default.note","width":230,"height":80,"lockAspectRatio":false,"lockShape":false,"order":54,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.note.uml_v1","strokeWidth":1,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2.555555555555556,"y":0,"rotation":0,"id":116,"uid":null,"width":224.8888888888889,"height":42,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

1. IMXEventUserInfo:在IMXEventPoster中有具体的操作,在其它类中均是透传。(其它类:IMXEventBus,IMXEvent)

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":533,"y":657,"rotation":0,"id":60,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":2,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":5,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-184,-66],[-184,-129]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":225,"y":1032,"rotation":0,"id":56,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":0,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,8.0","startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[50,-7],[50,-89.0243866176395]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":580,"y":430,"rotation":0,"id":64,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":189,"height":96,"lockAspectRatio":false,"lockShape":false,"order":5,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":65,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":66,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventUserInfo

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":66,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":67,"uid":null,"width":189,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":68,"uid":null,"width":189,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

userInfo\n

extObj

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":65,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":68,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":50,"rotation":0,"id":69,"uid":null,"width":189,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":70,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

None

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":64,"magnitude":1},{"id":65,"magnitude":-1},{"id":67,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":67,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":65,"magnitude":1},{"id":67,"magnitude":1},{"id":70,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":255,"y":430,"rotation":0,"id":71,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":189,"height":96,"lockAspectRatio":false,"lockShape":false,"order":12,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":72,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":73,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventSubscribModel

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":73,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":74,"uid":null,"width":189,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":75,"uid":null,"width":189,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

actionBlock\n

priority\n

isInMainThread\n

target

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":72,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":75,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":78,"rotation":0,"id":76,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":77,"uid":null,"width":189,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

actionWIthInfo:forceMainThread:

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":71,"magnitude":1},{"id":72,"magnitude":-1},{"id":74,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":74,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":72,"magnitude":1},{"id":74,"magnitude":1},{"id":77,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":204.5,"y":590,"rotation":0,"id":78,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":290,"height":166,"lockAspectRatio":false,"lockShape":false,"order":19,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":79,"uid":null,"width":290,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":80,"uid":null,"width":290,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEvent

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":80,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":81,"uid":null,"width":290,"height":74,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":82,"uid":null,"width":290,"height":74,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

eventName\n

\n

mapHigh\n

mapDefault\n

mapLow

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":79,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":82,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":92,"rotation":0,"id":83,"uid":null,"width":290,"height":74,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":84,"uid":null,"width":290,"height":74,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

hasContainedSubscribModelForKey:\n

registSubscribModel:forKey:\n

postEventWithDeliveryData:isInMain:\n

deleteEntryForTarget:\n

isEmptyMap

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":78,"magnitude":1},{"id":79,"magnitude":-1},{"id":81,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":81,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":79,"magnitude":1},{"id":81,"magnitude":1},{"id":84,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":187.5,"y":810,"rotation":0,"id":86,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":324,"height":130,"lockAspectRatio":false,"lockShape":false,"order":26,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":87,"uid":null,"width":324,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":88,"uid":null,"width":324,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventBus

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":88,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":89,"uid":null,"width":324,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":90,"uid":null,"width":324,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

events

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":87,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":90,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":91,"uid":null,"width":324,"height":94,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":92,"uid":null,"width":324,"height":74,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

sharedInstance\n

registSubscribModel:markEvent:priority:inMainTread:action:\n

publishEvent:delivery:isFromMainTread:\n

unregistSubscribModelFromTarget:\n

removeEvent:

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":86,"magnitude":1},{"id":87,"magnitude":-1},{"id":89,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":89,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":87,"magnitude":1},{"id":89,"magnitude":1},{"id":92,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":580,"y":669.6533333333333,"rotation":0,"id":93,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":140,"height":88.34666666666666,"lockAspectRatio":false,"lockShape":false,"order":33,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":94,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":95,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventDebug

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":95,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":96,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":97,"uid":null,"width":140,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

debugType

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":94,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":97,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":98,"uid":null,"width":140,"height":52.346666666666664,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":99,"uid":null,"width":140,"height":46,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

sharedInstance\n

enableDebug:\n

showDebugMsg

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":93,"magnitude":1},{"id":94,"magnitude":-1},{"id":96,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":96,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":94,"magnitude":1},{"id":96,"magnitude":1},{"id":99,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":98.5,"y":1020,"rotation":0,"id":100,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":250,"height":96,"lockAspectRatio":false,"lockShape":false,"order":40,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":101,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":102,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventSubscriber

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":102,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":103,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":104,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

None

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":101,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":104,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":105,"uid":null,"width":250,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":106,"uid":null,"width":250,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

addTarget:name:action:\n

addTarget:name:priority:inMainTread:action:\n

removeTarget:\n

removeEvent:

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":100,"magnitude":1},{"id":101,"magnitude":-1},{"id":103,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":103,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":101,"magnitude":1},{"id":103,"magnitude":1},{"id":106,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":387.5,"y":1020,"rotation":0,"id":107,"uid":"com.gliffy.shape.uml.uml_v1.default.class","width":250,"height":96,"lockAspectRatio":false,"lockShape":false,"order":47,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":108,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":109,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventPoster

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":109,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":18,"rotation":0,"id":110,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":111,"uid":null,"width":250,"height":18,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

None

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"PositionConstraint","PositionConstraint":{"nodeId":108,"px":0,"py":1}},{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":111,"magnitude":1}],"growParent":true,"padding":0}}]}},{"x":0,"y":36,"rotation":0,"id":112,"uid":null,"width":250,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":true,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":113,"uid":null,"width":250,"height":32,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

postEventName:object:\n

postEventName:object:forceMain:\n

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":107,"magnitude":1},{"id":108,"magnitude":-1},{"id":110,"magnitude":-1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":110,"px":0,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":108,"magnitude":1},{"id":110,"magnitude":1},{"id":113,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":571,"y":918,"rotation":0,"id":62,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":4,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,8.0","startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-59.5,-43],[79,-43],[79,-160]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":86,"px":1,"py":0.5}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":93,"px":0.5,"py":1}}},"linkMap":[]},{"x":350,"y":810,"rotation":0,"id":61,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":3,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":5,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,-50.08991914547278]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":235,"y":1042,"rotation":0,"id":118,"uid":"com.gliffy.shape.uml.uml_v1.default.message","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":56,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,8.0","startArrow":0,"endArrow":1,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":false,"interpolationType":"linear","cornerRadius":null,"controlPath":[[205,-18.94232901245391],[205,-97]],"lockSegments":{}}},"children":null,"linkMap":[]}],"background":"#FFFFFF","width":1080,"height":1118,"maxWidth":5000,"maxHeight":5000,"nodeIndex":119,"autoFit":true,"exportBorder":false,"gridOn":true,"snapToGrid":true,"drawingGuidesOn":true,"pageBreaksOn":false,"printGridOn":false,"printPaper":"LETTER","printShrinkToFit":false,"printPortrait":true,"shapeStyles":{"com.gliffy.shape.basic.basic_v1.default":{"fill":"#FFFFFF","stroke":"#333333","strokeWidth":2}},"lineStyles":{},"textStyles":{},"themeData":null}} -------------------------------------------------------------------------------- /docs/IMXEventBus触发.gliffy: -------------------------------------------------------------------------------- 1 | {"contentType":"application/gliffy+json","version":"1.1","metadata":{"title":"untitled","revision":0,"exportBorder":false},"embeddedResources":{"index":0,"resources":[]},"stage":{"objects":[{"x":644,"y":1158,"rotation":0,"id":76,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":76,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,2.0","startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-10,-13],[69.93398282201792,-13],[69.93398282201792,-68]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":73,"px":0.29289321881345254,"py":0.9999999999999998}}},"linkMap":[]},{"x":670,"y":1030,"rotation":0,"id":73,"uid":"com.gliffy.shape.uml.uml_v1.default.note","width":150,"height":60,"lockAspectRatio":false,"lockShape":false,"order":73,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.note.uml_v1","strokeWidth":1,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2.999999999999999,"y":0,"rotation":0,"id":75,"uid":null,"width":143.99999999999997,"height":60,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

轮询操作:\n

1. 串行队列嵌入并行队列:队列之间顺序执行,队列内部并行执行\n

2. 添加信号量:控制并行执行产生的线程数

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":644,"y":1175,"rotation":0,"id":72,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":72,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[25.33333333333337,0],[50.66666666666663,0],[76,0]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":46,"px":0,"py":0.5}}},"linkMap":[]},{"x":590,"y":1236,"rotation":0,"id":71,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":71,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[1,0],[1,80],[-164,80]],"lockSegments":{"1":true}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":26,"px":1,"py":0.5}}},"linkMap":[]},{"x":588,"y":1122,"rotation":0,"id":69,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":56,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[2,-1],[2,13.5],[2,13.5],[2,28]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":41,"px":0.5,"py":0}}},"linkMap":[]},{"x":589,"y":1091,"rotation":0,"id":68,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":55,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[1,-1],[1,12],[1,12],[1,25]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":37,"px":0.5,"py":1}}},"linkMap":[]},{"x":402,"y":1091,"rotation":0,"id":67,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":54,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-2,-1],[-2,65.66666666666674],[-2,132.33333333333326],[-2,199]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":34,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":26,"px":0.5,"py":0}}},"linkMap":[]},{"x":562,"y":983,"rotation":0,"id":65,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":52,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[-162,0],[-162,57]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":66,"uid":null,"width":33,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

否/NO

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":34,"px":0.5,"py":0}}},"linkMap":[]},{"x":591,"y":1011,"rotation":0,"id":63,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":50,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-1,-1],[-1,9],[-1,19],[-1,29]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":64,"uid":null,"width":39,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

是/YES

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":33,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":37,"px":0.5,"py":0}}},"linkMap":[]},{"x":590,"y":931,"rotation":0,"id":62,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":49,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,9.5],[0,9.5],[0,19]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":33,"px":0.5,"py":0}}},"linkMap":[]},{"x":430,"y":819,"rotation":0,"id":60,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":47,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[160,0],[160,61]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":61,"uid":null,"width":39,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

是/YES

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":30,"px":0.5,"py":0}}},"linkMap":[]},{"x":374,"y":822,"rotation":0,"id":58,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":45,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[-40,0],[-40,494],[0,494]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":59,"uid":null,"width":33,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

否/NO

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":26,"px":0,"py":0.5}}},"linkMap":[]},{"x":401,"y":761,"rotation":0,"id":57,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":44,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-1,-1],[-1,9],[-1,19],[-1,29]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":23,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":29,"px":0.5,"py":0}}},"linkMap":[]},{"x":262,"y":663,"rotation":0,"id":56,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":43,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-52,27],[-52,72],[88,72]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":20,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":23,"px":0,"py":0.5}}},"linkMap":[]},{"x":239,"y":561,"rotation":0,"id":54,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":41,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[161,0],[161,149]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":55,"uid":null,"width":33,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

否/NO

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":23,"px":0.5,"py":0}}},"linkMap":[]},{"x":210,"y":590,"rotation":0,"id":52,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":39,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,25],[0,25],[0,50]],"lockSegments":{}}},"children":[{"x":0,"y":0,"rotation":0,"id":53,"uid":null,"width":39,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"both","vposition":"none","hposition":"none","html":"

是/YES

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":20,"px":0.5,"py":0}}},"linkMap":[]},{"x":209,"y":492,"rotation":0,"id":51,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":38,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[1,-2],[1,11.333333333333314],[1,24.66666666666663],[1,38]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":17,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":15,"px":0.5,"py":0}}},"linkMap":[]},{"x":212,"y":393,"rotation":0,"id":50,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":37,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-2,-3],[-2,13.666666666666686],[-2,30.333333333333314],[-2,47]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":12,"px":0.5,"py":1}},"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":17,"px":0.5,"py":0}}},"linkMap":[]},{"x":210,"y":299,"rotation":0,"id":49,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":36,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[0,0],[0,20.5],[0,20.5],[0,41]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"endConstraint":{"type":"EndPositionConstraint","EndPositionConstraint":{"nodeId":12,"px":0.5,"py":0}}},"linkMap":[]},{"x":720,"y":1150,"rotation":0,"id":46,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":34,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":48,"uid":null,"width":96,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

执行回调

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":540,"y":1150,"rotation":0,"id":41,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":31,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":43,"uid":null,"width":96,"height":40,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

轮询high、default、low队列,获取监听对象

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":548,"y":1118,"rotation":0,"id":40,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":30,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-25,0],[37.5,0],[37.5,0],[100,0]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":540,"y":1040,"rotation":0,"id":37,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":28,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":39,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

触发监听对象集合

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":350,"y":1040,"rotation":0,"id":34,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":26,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":36,"uid":null,"width":96,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

移除该Event

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":540,"y":880,"rotation":0,"id":30,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":23,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":32,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

Event中是否有监听对象

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":350,"y":710,"rotation":0,"id":23,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":19,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":25,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

是否存在对应Event?

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":160,"y":640,"rotation":0,"id":20,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":17,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":22,"uid":null,"width":96,"height":10,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

创建透传数据

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":160,"y":440,"rotation":0,"id":17,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":15,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":19,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

是否存在透传数据info?

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":182.5,"y":530,"rotation":0,"id":15,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.decision","width":55,"height":60,"lockAspectRatio":false,"lockShape":false,"order":14,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.diamond.basic_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":160,"y":340,"rotation":0,"id":12,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.start_end","width":100,"height":50,"lockAspectRatio":false,"lockShape":false,"order":12,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.start_end.flowchart_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[{"x":2,"y":0,"rotation":0,"id":14,"uid":null,"width":96,"height":20,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"middle","overflow":"none","vposition":"none","hposition":"none","html":"

触发事件/Post Event

","paddingLeft":2,"paddingRight":2,"paddingBottom":2,"paddingTop":2}},"children":null}],"linkMap":[]},{"x":110,"y":150,"rotation":0,"id":0,"uid":"com.gliffy.shape.swimlanes.swimlanes_v1.default.vertical_four_lane_pool","width":760,"height":1220,"lockAspectRatio":false,"lockShape":false,"order":0,"graphic":null,"children":[{"x":0,"y":0,"rotation":0,"id":1,"uid":null,"width":760,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#ffffff","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":2,"uid":null,"width":760,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventBus Poster

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":2,"magnitude":1}],"growParent":false,"padding":0}}]}},{"x":0,"y":26,"rotation":0,"id":3,"uid":null,"width":205,"height":1194,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":4,"uid":null,"width":205,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventSubscriber

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":1,"magnitude":-1},{"id":0,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":1,"px":0,"py":1}}]}},{"x":205,"y":26,"rotation":0,"id":5,"uid":null,"width":175,"height":1194,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":6,"uid":null,"width":175,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventBus

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":1,"magnitude":-1},{"id":0,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":1,"px":0.26973684210526316,"py":1}}]}},{"x":380,"y":26,"rotation":0,"id":7,"uid":null,"width":175,"height":1194,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":8,"uid":null,"width":175,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEvent

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":1,"magnitude":-1},{"id":0,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":1,"px":0.5,"py":1}}]}},{"x":555,"y":26,"rotation":0,"id":9,"uid":null,"width":205,"height":1194,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.rectangle.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"none","gradient":false,"dropShadow":false,"state":0,"shadowX":4,"shadowY":4,"opacity":1}},"children":[{"x":0,"y":0,"rotation":0,"id":10,"uid":null,"width":205,"height":26,"lockAspectRatio":false,"lockShape":false,"order":"auto","graphic":{"type":"Text","Text":{"tid":null,"valign":"top","overflow":"none","vposition":"none","hposition":"none","html":"

IMXEventSubscribModel

","paddingLeft":2,"paddingRight":2,"paddingBottom":3,"paddingTop":3}},"children":null}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":false,"heightInfo":[{"id":1,"magnitude":-1},{"id":0,"magnitude":1}],"growParent":false,"padding":0}},{"type":"PositionConstraint","PositionConstraint":{"nodeId":1,"px":0.7302631578947368,"py":1}}]}}],"constraints":{"constraints":[{"type":"HeightConstraint","HeightConstraint":{"isMin":true,"heightInfo":[{"id":1,"magnitude":1}],"growParent":false,"padding":0}}]},"linkMap":[]},{"x":190,"y":260,"rotation":0,"id":11,"uid":"com.gliffy.shape.uml.uml_v1.default.interface","width":40,"height":40,"lockAspectRatio":true,"lockShape":false,"order":11,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.ellipse.basic_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#000000","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":374,"y":1290,"rotation":0,"id":26,"uid":"com.gliffy.shape.bpmn.bpmn_v1.events.terminate","width":52,"height":52,"lockAspectRatio":true,"lockShape":false,"order":21,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.terminate.bpmn_v1","strokeWidth":2,"strokeColor":"#000000","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":372.5,"y":790,"rotation":0,"id":29,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.decision","width":55,"height":60,"lockAspectRatio":false,"lockShape":false,"order":22,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.diamond.basic_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":562.5,"y":950,"rotation":0,"id":33,"uid":"com.gliffy.shape.flowchart.flowchart_v1.default.decision","width":55,"height":60,"lockAspectRatio":false,"lockShape":false,"order":25,"graphic":{"type":"Shape","Shape":{"tid":"com.gliffy.stencil.diamond.basic_v1","strokeWidth":2,"strokeColor":"#333333","fillColor":"#FFFFFF","gradient":false,"dropShadow":false,"state":0,"shadowX":0,"shadowY":0,"opacity":1}},"children":[],"linkMap":[]},{"x":547,"y":1231,"rotation":0,"id":45,"uid":"com.gliffy.shape.uml.uml_v1.default.association","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":33,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":null,"startArrow":0,"endArrow":0,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[-25,0],[37.5,0],[37.5,0],[100,0]],"lockSegments":{}}},"children":null,"linkMap":[]},{"x":543,"y":1168,"rotation":0,"id":70,"uid":"com.gliffy.shape.uml.uml_v1.default.dependency","width":100,"height":100,"lockAspectRatio":false,"lockShape":false,"order":57,"graphic":{"type":"Line","Line":{"strokeWidth":1,"strokeColor":"#000000","fillColor":"none","dashStyle":"8.0,2.0","startArrow":0,"endArrow":6,"startArrowRotation":"auto","endArrowRotation":"auto","ortho":true,"interpolationType":"linear","cornerRadius":null,"controlPath":[[47,32],[47,47],[47,47],[47,62]],"lockSegments":{}}},"children":null,"constraints":{"constraints":[],"startConstraint":{"type":"StartPositionConstraint","StartPositionConstraint":{"nodeId":41,"px":0.5,"py":1}}},"linkMap":[]}],"background":"#FFFFFF","width":872,"height":1370,"maxWidth":5000,"maxHeight":5000,"nodeIndex":77,"autoFit":true,"exportBorder":false,"gridOn":true,"snapToGrid":true,"drawingGuidesOn":true,"pageBreaksOn":false,"printGridOn":false,"printPaper":"LETTER","printShrinkToFit":false,"printPortrait":true,"shapeStyles":{"com.gliffy.shape.flowchart.flowchart_v1.default":{"fill":"#FFFFFF","stroke":"#333333","strokeWidth":2}},"lineStyles":{},"textStyles":{},"themeData":null}} -------------------------------------------------------------------------------- /docs/imgs/IMXEventBus注册监听.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanZhou0B1B/IMXEventBus/b267c5d45deee5d4220805d9246014bf2764f41d/docs/imgs/IMXEventBus注册监听.png -------------------------------------------------------------------------------- /docs/imgs/IMXEventBus类图.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanZhou0B1B/IMXEventBus/b267c5d45deee5d4220805d9246014bf2764f41d/docs/imgs/IMXEventBus类图.png -------------------------------------------------------------------------------- /docs/imgs/IMXEventBus触发.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PanZhou0B1B/IMXEventBus/b267c5d45deee5d4220805d9246014bf2764f41d/docs/imgs/IMXEventBus触发.png --------------------------------------------------------------------------------