Browse Source

【广告Framework】- 初版

lizhe 2 years ago
commit
f17ae90efe
100 changed files with 10345 additions and 0 deletions
  1. 11 0
      KMAdvertisement-iOS-Info.plist
  2. 1986 0
      KMAdvertisement.xcodeproj/project.pbxproj
  3. 7 0
      KMAdvertisement.xcodeproj/project.xcworkspace/contents.xcworkspacedata
  4. 8 0
      KMAdvertisement.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist
  5. 78 0
      KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisement.xcscheme
  6. 100 0
      KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisementDemo_Mac.xcscheme
  7. 111 0
      KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisementDemo_iOS.xcscheme
  8. 177 0
      KMAdvertisement.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
  9. 62 0
      KMAdvertisement/Extension/Color/KMAdvertisementColorConversion.swift
  10. 106 0
      KMAdvertisement/Extension/Date/KMAdvertisementTimeStampConversion.swift
  11. 11 0
      KMAdvertisement/Info.plist
  12. BIN
      KMAdvertisement/KMAdvertisement.bundle/1.jpg
  13. BIN
      KMAdvertisement/KMAdvertisement.bundle/2.png
  14. BIN
      KMAdvertisement/KMAdvertisement.bundle/3.png
  15. BIN
      KMAdvertisement/KMAdvertisement.bundle/ad_cancel_button00@2x.png
  16. BIN
      KMAdvertisement/KMAdvertisement.bundle/dark_brower_delect.pdf
  17. BIN
      KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.29.51.png
  18. BIN
      KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.47.11.png
  19. BIN
      KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.47.15.png
  20. BIN
      KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 23.03.47.png
  21. 883 0
      KMAdvertisement/KMAdvertisement.docc/接入文档.md
  22. BIN
      KMAdvertisement/KMAdvertisement.docc/流程图.png
  23. BIN
      KMAdvertisement/KMAdvertisement.docc/添加方法一.png
  24. BIN
      KMAdvertisement/KMAdvertisement.docc/添加方法二.png
  25. 20 0
      KMAdvertisement/KMAdvertisement.h
  26. 39 0
      KMAdvertisement/KMAdvertisementCache/KMAdvertisementCache.swift
  27. 170 0
      KMAdvertisement/KMAdvertisementConfig.swift
  28. 295 0
      KMAdvertisement/KMAdvertisementManager.swift
  29. 155 0
      KMAdvertisement/KMAdvertisementRequest/KMAdvertisementRequestServer.swift
  30. 101 0
      KMAdvertisement/Model/KMAdvertisementModel.swift
  31. 97 0
      KMAdvertisement/Model/KMAdvertisementModelTransition.swift
  32. 17 0
      KMAdvertisement/UI/Base/KMAdvertisementBaseView.swift
  33. 46 0
      KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionHeadView.swift
  34. 32 0
      KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionHeadView.xib
  35. 59 0
      KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionViewItem.swift
  36. 62 0
      KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionViewItem.xib
  37. 161 0
      KMAdvertisement/UI/List/KMAdvertisementTableView.swift
  38. 57 0
      KMAdvertisement/UI/List/KMAdvertisementTableView.xib
  39. 62 0
      KMAdvertisement/UI/List/Presenter/KMAdvertisementTableViewPresenter.swift
  40. 124 0
      KMAdvertisement/UI/Scroll/iOS/KMAdvertisementFlowLayout.swift
  41. 84 0
      KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScrollCell_iOS.swift
  42. 84 0
      KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScrollCell_iOS.xib
  43. 136 0
      KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScroll_iOS.swift
  44. 51 0
      KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScroll_iOS.xib
  45. 106 0
      KMAdvertisement/UI/View/Mac/KMAdvertisementShowView.swift
  46. 55 0
      KMAdvertisement/UI/View/Mac/KMAdvertisementShowView.xib
  47. 90 0
      KMAdvertisement/UI/View/iOS/KMAdvertisementShowView_iOS.swift
  48. 44 0
      KMAdvertisement/UI/View/iOS/KMAdvertisementShowView_iOS.xib
  49. 11 0
      KMAdvertisementDemo-Mac-Info.plist
  50. 1 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/AFNetworking
  51. 1 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Headers
  52. 1 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Modules
  53. 1 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Resources
  54. BIN
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/AFNetworking
  55. 49 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFCompatibilityMacros.h
  56. 285 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFHTTPSessionManager.h
  57. 216 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFNetworkReachabilityManager.h
  58. 66 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFNetworking.h
  59. 161 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFSecurityPolicy.h
  60. 479 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLRequestSerialization.h
  61. 313 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLResponseSerialization.h
  62. 516 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLSessionManager.h
  63. 5 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Modules/module.modulemap
  64. 48 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Resources/Info.plist
  65. 1 0
      KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/Current
  66. 30 0
      KMAdvertisementDemo_Mac/AppDelegate.swift
  67. 11 0
      KMAdvertisementDemo_Mac/Assets.xcassets/AccentColor.colorset/Contents.json
  68. 58 0
      KMAdvertisementDemo_Mac/Assets.xcassets/AppIcon.appiconset/Contents.json
  69. 6 0
      KMAdvertisementDemo_Mac/Assets.xcassets/Contents.json
  70. 742 0
      KMAdvertisementDemo_Mac/Base.lproj/Main.storyboard
  71. 5 0
      KMAdvertisementDemo_Mac/KMAdvertisementDemo_Mac.entitlements
  72. 1 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Kingfisher
  73. 1 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Modules
  74. 1 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Resources
  75. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Kingfisher
  76. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo
  77. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo
  78. 9 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.abi.json
  79. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftdoc
  80. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftmodule
  81. 9 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.abi.json
  82. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftdoc
  83. BIN
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftmodule
  84. 48 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Resources/Info.plist
  85. 184 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/_CodeSignature/CodeResources
  86. 1 0
      KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/Current
  87. 78 0
      KMAdvertisementDemo_Mac/ViewController.swift
  88. 36 0
      KMAdvertisementDemo_MacTests/KMAdvertisementDemo_MacTests.swift
  89. 41 0
      KMAdvertisementDemo_MacUITests/KMAdvertisementDemo_MacUITests.swift
  90. 32 0
      KMAdvertisementDemo_MacUITests/KMAdvertisementDemo_MacUITestsLaunchTests.swift
  91. BIN
      KMAdvertisementDemo_iOS/AFNetworking.framework/AFNetworking
  92. 160 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFAutoPurgingImageCache.h
  93. 49 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFCompatibilityMacros.h
  94. 285 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFHTTPSessionManager.h
  95. 171 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFImageDownloader.h
  96. 103 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworkActivityIndicatorManager.h
  97. 216 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworkReachabilityManager.h
  98. 66 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworking.h
  99. 161 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFSecurityPolicy.h
  100. 0 0
      KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFURLRequestSerialization.h

+ 11 - 0
KMAdvertisement-iOS-Info.plist

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+</dict>
+</plist>

File diff suppressed because it is too large
+ 1986 - 0
KMAdvertisement.xcodeproj/project.pbxproj


+ 7 - 0
KMAdvertisement.xcodeproj/project.xcworkspace/contents.xcworkspacedata

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Workspace
+   version = "1.0">
+   <FileRef
+      location = "self:">
+   </FileRef>
+</Workspace>

+ 8 - 0
KMAdvertisement.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>IDEDidComputeMac32BitWarning</key>
+	<true/>
+</dict>
+</plist>

+ 78 - 0
KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisement.xcscheme

@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1410"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD2B46C8292DCA1700C3D62F"
+               BuildableName = "KMAdvertisement.framework"
+               BlueprintName = "KMAdvertisement"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD2B46D2292DCA1700C3D62F"
+               BuildableName = "KMAdvertisementTests.xctest"
+               BlueprintName = "KMAdvertisementTests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Release"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <MacroExpansion>
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "AD2B46C8292DCA1700C3D62F"
+            BuildableName = "KMAdvertisement.framework"
+            BlueprintName = "KMAdvertisement"
+            ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+         </BuildableReference>
+      </MacroExpansion>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 100 - 0
KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisementDemo_Mac.xcscheme

@@ -0,0 +1,100 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1410"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB7C2292DE9DB00D7C3FB"
+               BuildableName = "KMAdvertisementDemo_Mac.app"
+               BlueprintName = "KMAdvertisementDemo_Mac"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB7D2292DE9DC00D7C3FB"
+               BuildableName = "KMAdvertisementDemo_MacTests.xctest"
+               BlueprintName = "KMAdvertisementDemo_MacTests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB7DC292DE9DD00D7C3FB"
+               BuildableName = "KMAdvertisementDemo_MacUITests.xctest"
+               BlueprintName = "KMAdvertisementDemo_MacUITests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "AD7BB7C2292DE9DB00D7C3FB"
+            BuildableName = "KMAdvertisementDemo_Mac.app"
+            BlueprintName = "KMAdvertisementDemo_Mac"
+            ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "AD7BB7C2292DE9DB00D7C3FB"
+            BuildableName = "KMAdvertisementDemo_Mac.app"
+            BlueprintName = "KMAdvertisementDemo_Mac"
+            ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 111 - 0
KMAdvertisement.xcodeproj/xcshareddata/xcschemes/KMAdvertisementDemo_iOS.xcscheme

@@ -0,0 +1,111 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Scheme
+   LastUpgradeVersion = "1410"
+   version = "1.3">
+   <BuildAction
+      parallelizeBuildables = "YES"
+      buildImplicitDependencies = "YES">
+      <BuildActionEntries>
+         <BuildActionEntry
+            buildForTesting = "YES"
+            buildForRunning = "YES"
+            buildForProfiling = "YES"
+            buildForArchiving = "YES"
+            buildForAnalyzing = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB7FB292E131100D7C3FB"
+               BuildableName = "KMAdvertisementDemo_iOS.app"
+               BlueprintName = "KMAdvertisementDemo_iOS"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </BuildActionEntry>
+      </BuildActionEntries>
+   </BuildAction>
+   <TestAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      shouldUseLaunchSchemeArgsEnv = "YES">
+      <Testables>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB810292E131200D7C3FB"
+               BuildableName = "KMAdvertisementDemo_iOSTests.xctest"
+               BlueprintName = "KMAdvertisementDemo_iOSTests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "AD7BB81A292E131200D7C3FB"
+               BuildableName = "KMAdvertisementDemo_iOSUITests.xctest"
+               BlueprintName = "KMAdvertisementDemo_iOSUITests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+         <TestableReference
+            skipped = "NO"
+            parallelizable = "YES">
+            <BuildableReference
+               BuildableIdentifier = "primary"
+               BlueprintIdentifier = "ADB09A9729359C8600A2C756"
+               BuildableName = "KMAdvertisement_iOSTests.xctest"
+               BlueprintName = "KMAdvertisement_iOSTests"
+               ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+            </BuildableReference>
+         </TestableReference>
+      </Testables>
+   </TestAction>
+   <LaunchAction
+      buildConfiguration = "Debug"
+      selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
+      selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
+      launchStyle = "0"
+      useCustomWorkingDirectory = "NO"
+      ignoresPersistentStateOnLaunch = "NO"
+      debugDocumentVersioning = "YES"
+      debugServiceExtension = "internal"
+      allowLocationSimulation = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "AD7BB7FB292E131100D7C3FB"
+            BuildableName = "KMAdvertisementDemo_iOS.app"
+            BlueprintName = "KMAdvertisementDemo_iOS"
+            ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </LaunchAction>
+   <ProfileAction
+      buildConfiguration = "Release"
+      shouldUseLaunchSchemeArgsEnv = "YES"
+      savedToolIdentifier = ""
+      useCustomWorkingDirectory = "NO"
+      debugDocumentVersioning = "YES">
+      <BuildableProductRunnable
+         runnableDebuggingMode = "0">
+         <BuildableReference
+            BuildableIdentifier = "primary"
+            BlueprintIdentifier = "AD7BB7FB292E131100D7C3FB"
+            BuildableName = "KMAdvertisementDemo_iOS.app"
+            BlueprintName = "KMAdvertisementDemo_iOS"
+            ReferencedContainer = "container:KMAdvertisement.xcodeproj">
+         </BuildableReference>
+      </BuildableProductRunnable>
+   </ProfileAction>
+   <AnalyzeAction
+      buildConfiguration = "Debug">
+   </AnalyzeAction>
+   <ArchiveAction
+      buildConfiguration = "Release"
+      revealArchiveInOrganizer = "YES">
+   </ArchiveAction>
+</Scheme>

+ 177 - 0
KMAdvertisement.xcodeproj/xcuserdata/lizhe.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist

@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<Bucket
+   uuid = "28D524EE-F1C0-447F-A713-EF844A30F62C"
+   type = "1"
+   version = "2.0">
+   <Breakpoints>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "3F5CDD8E-7341-4E82-82B7-BABA6F0EB163"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/KMAdvertisementRequest/KMAdvertisementRequestServer.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "79"
+            endingLineNumber = "79"
+            landmarkName = "request(urlString:method:params:requestSerializer:body:completion:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "6F17EA6C-BEE3-4F2B-BA34-998B1182C0D4"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/KMAdvertisementRequest/KMAdvertisementRequestServer.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "84"
+            endingLineNumber = "84"
+            landmarkName = "request(urlString:method:params:requestSerializer:body:completion:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "EB6DD5E3-FE36-4F11-92C9-5485C18FEB7A"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/UI/List/Cell/KMAdvertisementTableCell.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "49"
+            endingLineNumber = "49"
+            landmarkName = "reloadData()"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
+         <BreakpointContent
+            uuid = "96BC228F-7E23-4C1C-98D4-CB20CB057229"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            breakpointStackSelectionBehavior = "1"
+            scope = "1"
+            stopOnStyle = "0">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.SymbolicBreakpoint">
+         <BreakpointContent
+            uuid = "ACF22F97-611E-4ACB-AA85-FAC1B2FDAF62"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            symbolName = ""
+            moduleName = "">
+            <Locations>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "2B37DA6A-F9A2-44A1-8445-81489D37DEBA"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/Model/KMAdvertisementModelTansition.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "63"
+            endingLineNumber = "63"
+            landmarkName = "transitionLanguage(langeuage:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "E9F94588-9A07-4BF4-ABD1-A162DCFEFC83"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/KMAdvertisementManager.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "232"
+            endingLineNumber = "232"
+            landmarkName = "allowLoadContentData(data:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "03A3D017-D4A9-4AA6-8227-2FC39187B9F6"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisementDemo_Mac/ViewController.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "41"
+            endingLineNumber = "41"
+            landmarkName = "viewDidLoad()"
+            landmarkType = "7">
+            <Locations>
+               <Location
+                  uuid = "03A3D017-D4A9-4AA6-8227-2FC39187B9F6 - c66968c578c268c9"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "closure #1 (Swift.Optional&lt;Swift.Array&lt;KMAdvertisement.KMAdvertisementModel&gt;&gt;, Swift.Optional&lt;Swift.Error&gt;) -&gt; () in KMAdvertisementDemo_Mac.ViewController.viewDidLoad() -&gt; ()"
+                  moduleName = "KMAdvertisementDemo_Mac"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/lizhe/Desktop/KMAdvertisement/KMAdvertisementDemo_Mac/ViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "41"
+                  endingLineNumber = "41"
+                  offsetFromSymbolStart = "1040">
+               </Location>
+               <Location
+                  uuid = "03A3D017-D4A9-4AA6-8227-2FC39187B9F6 - a9244419763fac1f"
+                  shouldBeEnabled = "Yes"
+                  ignoreCount = "0"
+                  continueAfterRunningActions = "No"
+                  symbolName = "closure #1 (KMAdvertisement.KMAdvertisementModel.Section.Conent) -&gt; () in closure #1 (Swift.Optional&lt;Swift.Array&lt;KMAdvertisement.KMAdvertisementModel&gt;&gt;, Swift.Optional&lt;Swift.Error&gt;) -&gt; () in KMAdvertisementDemo_Mac.ViewController.viewDidLoad() -&gt; ()"
+                  moduleName = "KMAdvertisementDemo_Mac"
+                  usesParentBreakpointCondition = "Yes"
+                  urlString = "file:///Users/lizhe/Desktop/KMAdvertisement/KMAdvertisementDemo_Mac/ViewController.swift"
+                  startingColumnNumber = "9223372036854775807"
+                  endingColumnNumber = "9223372036854775807"
+                  startingLineNumber = "42"
+                  endingLineNumber = "42"
+                  offsetFromSymbolStart = "44">
+               </Location>
+            </Locations>
+         </BreakpointContent>
+      </BreakpointProxy>
+      <BreakpointProxy
+         BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
+         <BreakpointContent
+            uuid = "F88AE53E-0275-4CC0-AF2B-FBD6890DCBC5"
+            shouldBeEnabled = "Yes"
+            ignoreCount = "0"
+            continueAfterRunningActions = "No"
+            filePath = "KMAdvertisement/KMAdvertisementManager.swift"
+            startingColumnNumber = "9223372036854775807"
+            endingColumnNumber = "9223372036854775807"
+            startingLineNumber = "255"
+            endingLineNumber = "255"
+            landmarkName = "compareVersion(nowVersion:newVersion:)"
+            landmarkType = "7">
+         </BreakpointContent>
+      </BreakpointProxy>
+   </Breakpoints>
+</Bucket>

+ 62 - 0
KMAdvertisement/Extension/Color/KMAdvertisementColorConversion.swift

@@ -0,0 +1,62 @@
+//
+//  KMAdvertisementColorConversion.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/30.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+
+
+extension NSColor {
+    
+    convenience init(hex: String) {
+        var hexString = hex
+        if hex.starts(with: "#") {
+            hexString = String(hex.dropFirst())
+        }
+        if let ui64 = UInt64(hexString, radix: 16) {
+            self.init(hex: Int(ui64))
+        } else {
+            self.init(hex: 0)  // <--- black
+        }
+        // or using ternaries as requested
+        // let hexString = hex.starts(with: "#") ? String(hex.dropFirst()) : hex
+        // let ui64 = UInt64(hexString, radix: 16)
+        // self.init(hex: ui64 != nil ? Int(ui64!) : 0)
+    }
+        
+        convenience init(hex: Int) {
+            let components = (
+                R: CGFloat((hex >> 16) & 0xff) / 255,
+                G: CGFloat((hex >> 08) & 0xff) / 255,
+                B: CGFloat((hex >> 00) & 0xff) / 255
+            )
+            self.init(red: components.R, green: components.G, blue: components.B, alpha: 1)
+        }
+
+    func toHex(alpha: Bool = false) -> String? {
+        guard let components = cgColor.components, components.count >= 3 else {
+            return nil
+        }
+        
+        let r = Float(components[0])
+        let g = Float(components[1])
+        let b = Float(components[2])
+        var a = Float(1.0)
+        
+        if components.count >= 4 {
+            a = Float(components[3])
+        }
+        
+        if alpha {
+            return String(format: "%02lX%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255), lroundf(a * 255))
+        } else {
+            return String(format: "%02lX%02lX%02lX", lroundf(r * 255), lroundf(g * 255), lroundf(b * 255))
+        }
+    }
+}

+ 106 - 0
KMAdvertisement/Extension/Date/KMAdvertisementTimeStampConversion.swift

@@ -0,0 +1,106 @@
+//
+//  KMAdvertisementTimeStampConversion.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/29.
+//
+
+public class KMAdvertisementTimeStampConversion: NSObject {
+    
+    /**
+     @abstract 时间string转时间戳
+     @param dateString 时间戳字符串
+     @return 时间
+      */
+    static func stringDateToTimestamp(dateString: String) -> TimeInterval{
+        let formatter = DateFormatter()
+        formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+        let date = formatter.date(from: dateString)
+        let time = date!.timeIntervalSince1970 * 1000
+        return time
+    }
+
+    /**
+     @abstract 时间戳转换成时间(HH:mm)
+     @param timeString 时间戳字符串(毫秒)
+     @return 时间string
+      */
+    static func timeStringToTimeSecond(timeString: String) -> String {
+        let interval: TimeInterval = Double(timeString)! / 1000.0
+        let date: Date = Date.init(timeIntervalSince1970: interval)
+        let formatter = DateFormatter()
+        formatter.dateFormat = "HH:mm"
+        let dateString = formatter.string(from: date)
+        return dateString
+    }
+
+    /**
+     @abstract 时间string转date
+     @param string 时间
+     @return Date 时间
+      */
+    static func stringChangeToDate(string: String) -> Date {
+        let formatter = DateFormatter()
+        formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+        formatter.timeZone = NSTimeZone(abbreviation: "UTC") as TimeZone?
+        return formatter.date(from: string)!
+    }
+
+    /**
+     @abstract date转时间string
+     @param date 时间
+     @return NSString 时间
+      */
+    static func dateChangeToString(date: Date) -> String {
+        let formatter = DateFormatter()
+        formatter.dateFormat = "yyyy-MM-dd"
+        return formatter.string(from: date)
+    }
+    
+    /**
+     @abstract 获取当前的时间string
+     @return NSString 时间
+      */
+    public static func getCurrentCompainedDateString() -> String {
+        let date: Date = NSDate() as Date
+        let formatter = DateFormatter()
+        formatter.dateFormat = "yyyy-MM-dd HH:mm:ss"
+        let timeString = formatter.string(from: date)
+        return timeString
+    }
+    
+    /**
+      @abstract 获取当前时间时间戳
+      */
+    public static func getCurrentTimeInterval () -> String {
+        let date = NSDate.init()
+        let timeSp: String = String(CLong(date.timeIntervalSince1970 * 1000))
+        return timeSp
+    }
+    
+    /**
+     @abstract 判断是否是24小时之内
+     @param timeStamp 时间
+     @return bool
+      */
+    static func isInaDayWithTimestamp(timeStamp: TimeInterval) -> Bool {
+        let currentTimeInterval:TimeInterval = Double(KMAdvertisementTimeStampConversion.getCurrentTimeInterval())!
+        if (currentTimeInterval - timeStamp < 24 * 60 * 60) {
+            return true
+        } else {
+            return false
+        }
+    }
+
+    /**
+     @abstract 获取当前的时间(年月日)
+     @param timeStamp 时间
+     @return bool
+      */
+    static func getCurrentTimeWithYMD() -> String{
+        let date = NSDate()
+        let formatter = DateFormatter()
+        formatter.dateFormat = "yyyy-MM-dd"
+        return formatter.string(from: date as Date)
+    }
+}

+ 11 - 0
KMAdvertisement/Info.plist

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+</dict>
+</plist>

BIN
KMAdvertisement/KMAdvertisement.bundle/1.jpg


BIN
KMAdvertisement/KMAdvertisement.bundle/2.png


BIN
KMAdvertisement/KMAdvertisement.bundle/3.png


BIN
KMAdvertisement/KMAdvertisement.bundle/ad_cancel_button00@2x.png


BIN
KMAdvertisement/KMAdvertisement.bundle/dark_brower_delect.pdf


BIN
KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.29.51.png


BIN
KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.47.11.png


BIN
KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 22.47.15.png


BIN
KMAdvertisement/KMAdvertisement.docc/截屏2022-12-04 23.03.47.png


+ 883 - 0
KMAdvertisement/KMAdvertisement.docc/接入文档.md

@@ -0,0 +1,883 @@
+# ``KMAdvertisement``
+广告Framework,远程控制广告显示,可通过以下参数控制
+* 显示状态
+* 开始结束时间
+* APP名称
+* 订阅情况
+* 平台
+* 支持版本
+
+
+## 如何接入
+* 导入KMAdvertisement.framework
+* 导入AFNetworking.framework
+* <a href="#接入示例"> 按照接入示例</a>
+
+## 功能
+* 视图显示模式
+  * <a href="#List">List</a>
+    * ![](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638caf19f0f171670164249.png)
+  * <a href="#View">View</a>
+    * ![](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638cb6f268c291670166258.png)
+    * ![](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638cb31fbdfc41670165279.png)
+  * <a href="#Scroll">Scroll</a>
+    * ![](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638cb31fbf94b1670165279.png)
+  * <a href="#Pop">Pop(暂未实现)</a>
+  
+  
+* 物件支持
+  * 多语
+  * 黑暗模式
+  * 视图圆角,边框
+  * 选中与非选中状态
+  * 背景色
+  * 跳转指定URL
+  * tips
+
+## <a id="接入示例">接入示例</a>
+#### 视图加载方法
+##### 1.绑定视图
+![添加方法一](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638ca544dc92c1670161732.png)
+
+##### 2.指定视图
+![添加方法二](https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638ca570776ea1670161776.png)
+
+```swift
+//设置基础参数
+KMAdvertisementManager.manager.initConfig(appID: .PDFReaderProIOS,
+                                          subscribeType: .unsubscribed,
+                                          platform: .iOS)
+//测试模式,默认false
+KMAdvertisementManager.manager.debug = true
+
+unowned let weakSelf = self
+//获取广告数据
+KMAdvertisementManager.manager.fetchData { data, error in
+    if data != nil {
+        for model in data! {
+            if model.showType == .scroll {
+                //视图加载方法一
+                let view = KMAdvertisementManager.manager.show(type: .scroll, data: model, superView: weakSelf.showScrollView) { actionType in
+                    print("点击了 scroll 1")
+                }
+                //视图加载方法二
+                weakSelf.advertisementScroll.inputData = model
+                weakSelf.advertisementScroll.actionCompletion = { actionItem in
+                    print("点击了 scroll 2")
+                }
+            }
+            
+            if model.showType == .view {
+                //视图加载方法一
+                let view =  KMAdvertisementManager.manager.show(type: .view, data: model, superView: weakSelf.showView) { actionItem in
+                    print("点击了 view 1")
+                }
+                
+                //视图加载方法二
+                weakSelf.advertisementView.inputData = model
+                weakSelf.advertisementView.actionCompletion = { actionItem in
+                    print("点击了 view 2")
+                }
+            }
+        }
+    }
+}
+```
+
+### 数据格式
+##### KMAdvertisementModel
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| appName   | <a href="#AppNameType"> AppNameType</a>   | appName: FilmageEditorMac |  APP名称
+| platform  | <a href="#PlatformType"> PlatformType</a> | platform: iOS             |  平台
+| showType  | <a href="#ShowType"> ShowType</a>         | showType: "List"          |  APP名称
+| subscribeType | <a href="#SubscribeType"> SubscribeType</a> | subscribeType: "subscribed" |  显示类型
+| startTime | String 时间戳                              | startTime: "1669709056569"|  APP名称
+| endTime   | String 时间戳                              | endTime: "1709709056569 " |  结束时间
+| version   | String                                    | appName: "1.3.5"          | 版本
+| content   | <a href="#Section"> Section</a>           | content: [Section]         |  内容
+
+
+###### <a id="Section">Section</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| sectionTitle | <a href="#Text"> Text</a>              | sectionTitle: <a href="#Text"> Text</a> | setion标题 |
+| content  | <a href="#Conent"> Conent</a> | content: [<a href="#Conent"> Conent</a>] | 详情 | 
+
+###### <a id="Content">Content</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| index     | Int                                       | index: 0                  |  下标
+| title     | <a href="#Text"> Text</a>                 | title: <a href="#Text"> Text</a> | 标题 |
+| imageURL  | <a href="#Image"> Image</a>               | imageURL: <a href="#Image"> Image</a> | 图片链接 |
+| ipadImageURL | <a href="#Image"> Image</a>            | ipadImageURL: <a href="#Image"> Image</a> | ipad图片链接 |
+| linkURL   | <a href="#Language"> Language</a>         | linkURL: <a href="#Language"> Language</a> | 点击链接 |
+| tips      | <a href="#Language"> Language</a>         | tips: <a href="#Language"> Language</a> | tips |
+| button    | <a href="#Text"> Text</a>                 | button: <a href="#Text"> Text</a> | 按钮样式 |
+| actionType| <a href="#ActionType"> ActionType</a>     | actionType: "URL"         |  响应类型 |
+
+###### <a id="Text">Text</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| font      | <a href="#Font"> Font</a>                 | font: <a href="#Font"> Font</a>  | 字体 |
+| color     | <a href="#Color"> Color</a>               | color: <a href="#Color"> Color</a> | 颜色 |
+| background | <a href="#Background"> Background</a>    | background: <a href="#Background"> Background</a> | 背景 |
+| language  | <a href="#Language"> Language</a>         | language: <a href="#Language"> Language</a> | 多语 |
+
+###### <a id="Image">Image</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| height | <a href="#Language"> Language</a>            | height: <a href="#Language"> Language</a> | 高亮 |
+| normal | <a href="#Language"> Language</a>            | normal: <a href="#Language"> Language</a> | 正常 |
+| background | <a href="#Background"> Background</a>    | background: <a href="#Background"> Background</a> | 背景颜色 |
+
+###### <a id="Language">Language</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| en        | String                                    | en: "en"                  |  英文
+| zh_TW     | String                                    | zhTW: "繁中"               |  繁中
+| zh_CN     | String                                    | zhCN: "简中"               |  简中
+
+###### <a id="Background">Background</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| color     | <a href="#Color"> Color</a>               | color:<a href="#Color"> Color</a> |  颜色  |
+| layer     | <a href="#Layer"> Layer</a>               | layer:<a href="#Color"> Color</a> |  图层  |
+
+###### <a id="Color">Color</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| height | <a href="#AppNameType"> AppNameType</a>   | appName: FilmageEditorMac |  APP名称
+| normal  | <a href="#Conent"> Conent</a> | platform: iOS             |  平台
+
+###### <a id="ColorState">ColorState</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| dark      | <a href="#ColorInfo"> ColorInfo</a>       | dark:{"hex":"#C7C8CC","alpha":1} | 黑暗模式 |
+| universal | <a href="#ColorInfo"> ColorInfo</a>       | universal:{"hex":"#C7C8CC","alpha":1} | 正常模式 |
+
+##### <a id="ColorInfo">ColorInfo</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| hex       | String                                    | hex: "#FFFFFF"            | 颜色16进制     |
+| alpha     | Float                                     | alpha: 1.0                |  透明度
+
+###### <a id="Font">Text</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| name      | String                                    | name: "AppleSystemUIFont" | 字体名称       |
+| size      | Int                                       | size: 13                  | 字体大小       |
+
+###### <a id="Layer">Layer</a>
+|     key   |                    type                   |          example          |  description  |
+| --------- | ----------------------------------------- | ------------------------- | ------------- |
+| cornerRadius | Float                                  | cornerRadius: 15          |  圆角          |
+| borderWidth | Float                                   | borderWidth: 1            |  边框宽度       |
+| borderColor | <a href="#Color"> Color</a>             | borderColor: <a href="#Color"> Color</a> |  颜色 |
+
+##### <a id="List">List</a>
+
+###### json示例
+```json
+{
+    "appName":"FilmageEditorMac",
+    "platform":"Mac",
+    "showType":"list",
+    "version":"1.3.5",
+    "startTime":"1669709056569",
+    "endTime":"1689709056569",
+    "subscribeType":"unsubscribed",
+    "content":[
+        {
+            "sectionTitle":{
+                "font":{
+                    "name":"AppleSystemUIFont",
+                    "size":13
+                },
+                "color":{
+                    "height":{
+                        "dark":{
+                            "hex":"#C7C8CC",
+                            "alpha":1
+                        },
+                        "universal":{
+                            "hex":"#42464D",
+                            "alpha":1
+                        }
+                    },
+                    "normal":{
+                        "dark":{
+                            "hex":"#C7C8CC",
+                            "alpha":1
+                        },
+                        "universal":{
+                            "hex":"#42464D",
+                            "alpha":1
+                        }
+                    }
+                },
+                "language":{
+                    "en":"PDF Pro系列",
+                    "zh_TW":"PDF Pro系列",
+                    "zh_CN":"PDF Pro系列"
+                }
+            },
+            "content":[
+                {
+                    "title":{
+                        "font":{
+                            "name":"AppleSystemUIFont",
+                            "size":13
+                        },
+                        "color":{
+                            "height":{
+                                "dark":{
+                                    "hex":"#4E7EDB",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#273B61",
+                                    "alpha":1
+                                }
+                            },
+                            "normal":{
+                                "dark":{
+                                    "hex":"#C7C8CC",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#42464D",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "tips":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "background":{
+                            "color":{
+                                "height":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":0.05
+                                    },
+                                    "universal":{
+                                        "hex":"#000000",
+                                        "alpha":0.05
+                                    }
+                                },
+                                "normal":{
+                                    "dark":{
+                                        "hex":"#25282B",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FBFCFF",
+                                        "alpha":0.05
+                                    }
+                                }
+                            },
+                            "layer":{
+                                "cornerRadius":6
+                            }
+                        }
+                    },
+                    "imageURL":{
+"height":{
+                            "en":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_TW":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_CN":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png"
+                        },
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                },
+                {
+                    "title":{
+                        "font":{
+                            "name":"AppleSystemUIFont",
+                            "size":13
+                        },
+                        "color":{
+                            "height":{
+                                "dark":{
+                                    "hex":"#4E7EDB",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#273B61",
+                                    "alpha":1
+                                }
+                            },
+                            "normal":{
+                                "dark":{
+                                    "hex":"#C7C8CC",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#42464D",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "tips":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "background":{
+                            "color":{
+                                "height":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":0.05
+                                    },
+                                    "universal":{
+                                        "hex":"#000000",
+                                        "alpha":0.05
+                                    }
+                                },
+                                "normal":{
+                                    "dark":{
+                                        "hex":"#25282B",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FBFCFF",
+                                        "alpha":0.05
+                                    }
+                                }
+                            },
+                            "layer":{
+                                "cornerRadius":6
+                            }
+                        }
+                    },
+                    "imageURL":{
+"height":{
+                            "en":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_TW":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_CN":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png"
+                        },
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                }
+            ]
+        },
+{
+            "sectionTitle":{
+                "font":{
+                    "name":"AppleSystemUIFont",
+                    "size":13
+                },
+                "color":{
+                    "height":{
+                        "dark":{
+                            "hex":"#C7C8CC",
+                            "alpha":1
+                        },
+                        "universal":{
+                            "hex":"#42464D",
+                            "alpha":1
+                        }
+                    },
+                    "normal":{
+                        "dark":{
+                            "hex":"#C7C8CC",
+                            "alpha":1
+                        },
+                        "universal":{
+                            "hex":"#42464D",
+                            "alpha":1
+                        }
+                    }
+                },
+                "language":{
+                    "en":"Filmage 系列",
+                    "zh_TW":"Filmage 系列",
+                    "zh_CN":"Filmage 系列"
+                }
+            },
+            "content":[
+                {
+                    "title":{
+                        "font":{
+                            "name":"AppleSystemUIFont",
+                            "size":13
+                        },
+                        "color":{
+                            "height":{
+                                "dark":{
+                                    "hex":"#4E7EDB",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#273B61",
+                                    "alpha":1
+                                }
+                            },
+                            "normal":{
+                                "dark":{
+                                    "hex":"#C7C8CC",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#42464D",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "tips":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "background":{
+                            "color":{
+                                "height":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":0.05
+                                    },
+                                    "universal":{
+                                        "hex":"#000000",
+                                        "alpha":0.05
+                                    }
+                                },
+                                "normal":{
+                                    "dark":{
+                                        "hex":"#25282B",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FBFCFF",
+                                        "alpha":0.05
+                                    }
+                                }
+                            },
+                            "layer":{
+                                "cornerRadius":6
+                            }
+                        }
+                    },
+                    "imageURL":{
+"height":{
+                            "en":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_TW":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_CN":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png"
+                        },
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                },
+                {
+                    "title":{
+                        "font":{
+                            "name":"AppleSystemUIFont",
+                            "size":13
+                        },
+                        "color":{
+                            "height":{
+                                "dark":{
+                                    "hex":"#4E7EDB",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#273B61",
+                                    "alpha":1
+                                }
+                            },
+                            "normal":{
+                                "dark":{
+                                    "hex":"#C7C8CC",
+                                    "alpha":1
+                                },
+                                "universal":{
+                                    "hex":"#42464D",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "tips":{
+                            "en":"The Warmest Black Friday Deal!",
+                            "zh_TW":"老闆哭了~趁黑色星期五升級Write-on Video Pro最划算!",
+                            "zh_CN":"老板哭了~趁黑色星期五升级V视频Pro最划算!"
+                        },
+                        "background":{
+                            "color":{
+                                "height":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":0.05
+                                    },
+                                    "universal":{
+                                        "hex":"#000000",
+                                        "alpha":0.05
+                                    }
+                                },
+                                "normal":{
+                                    "dark":{
+                                        "hex":"#25282B",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FBFCFF",
+                                        "alpha":0.05
+                                    }
+                                }
+                            },
+                            "layer":{
+                                "cornerRadius":6
+                            }
+                        }
+                    },
+                    "imageURL":{
+"height":{
+                            "en":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_TW":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png",
+                            "zh_CN":"https://iap-s3.kdanmobile.com/resource/ff29cfce-b64a-46ca-b260-f57c9e3240b8/blackFriday20211020_2x.png"
+                        },
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638858600d7471669879904.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                }
+            ]
+        }
+    ]
+}
+```
+
+#####  <a id="View">View</a>
+###### json示例
+```json
+{
+    "appName":"PDFReaderProIOS",
+    "platform":"iOS",
+    "showType":"view",
+    "version":"1.3.5",
+    "startTime":"1669709056569",
+    "endTime":"1709709056569",
+    "subscribeType":"unsubscribed",
+    "content":[
+        {
+            "content":[
+                {
+"actionType":"URL",
+                    "imageURL":{
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b23df050501670063071.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b23df050501670063071.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b23df050501670063071.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    },
+"actionType":"comparative"
+                }
+            ]
+        }
+    ]
+}
+```
+
+#####  <a id="Scroll">Scroll</a>
+###### json示例
+```json
+{
+    "appName":"PDFReaderProIOS",
+    "platform":"iOS",
+    "showType":"scroll",
+    "version":"1.3.5",
+    "startTime":"1669709056569",
+    "endTime":"1700709056569",
+    "subscribeType":"unsubscribed",
+    "content":[
+        {
+            "content":[
+                {
+                    "actionType":"URL",
+                    "imageURL":{
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b1bb019111669968315.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b1bb019111669968315.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b1baed2f41669968314.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                },
+                {
+                    "actionType":"URL",
+                    "imageURL":{
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b04d197d561670055121.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b04d197d561670055121.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/638b04d197ff01670055121.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/store",
+                        "zh_TW":"https://www.pdfreaderpro.com/store",
+                        "zh_CN":"https://www.pdfreaderpro.com/store"
+                    }
+                },
+                {
+                    "actionType":"URL",
+                    "title":{
+                        "font":{
+                            "name":"Helvetica-Bold",
+                            "size":20
+                        },
+                        "color":{
+                            "normal":{
+                                "universal":{
+                                    "hex":"#FFFFFF",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"All-New PDF Reader Pro Windows Released!",
+                            "zh_TW":"PDF Reader Pro Windows版全新發佈!",
+                            "zh_CN":"PDF Reader Pro Windows版全新发布!"
+                        }
+                    },
+                    "button":{
+                        "font":{
+                            "name":"PingFangSC-Semibold",
+                            "size":13
+                        },
+                        "color":{
+                            "normal":{
+                                "universal":{
+                                    "hex":"#FFFFFF",
+                                    "alpha":1
+                                }
+                            }
+                        },
+                        "language":{
+                            "en":"Learn More",
+                            "zh_TW":"更多資訊",
+                            "zh_CN":"了解更多"
+                        },
+                        "background":{
+                            "color":{
+                                "height":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":1
+                                    }
+                                },
+                                "normal":{
+                                    "dark":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":1
+                                    },
+                                    "universal":{
+                                        "hex":"#FFFFFF",
+                                        "alpha":1
+                                    }
+                                }
+                            },
+                            "layer":{
+                                "cornerRadius":15,
+                                "borderWidth":1,
+                                "borderColor":{
+                                    "color":{
+                                        "height":{
+                                            "dark":{
+                                                "hex":"#FFFFFF",
+                                                "alpha":1
+                                            },
+                                            "universal":{
+                                                "hex":"#FFFFFF",
+                                                "alpha":1
+                                            }
+                                        },
+                                        "normal":{
+                                            "dark":{
+                                                "hex":"#FFFFFF",
+                                                "alpha":1
+                                            },
+                                            "universal":{
+                                                "hex":"#FFFFFF",
+                                                "alpha":1
+                                            }
+                                        }
+                                    }
+                                }
+                            }
+                        }
+                    },
+                    "imageURL":{
+                        "normal":{
+                            "en":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b82d63b181669969965.png",
+                            "zh_TW":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b82d63b181669969965.png",
+                            "zh_CN":"https://pdfreader-dev.oss-cn-shanghai.aliyuncs.com/advertise/6389b82d63b181669969965.png"
+                        }
+                    },
+                    "linkURL":{
+                        "en":"https://www.pdfreaderpro.com/windows?utm_source=iOSApp&amp;utm_campaign=PDFiOS&amp;utm_medium=pdfios_promo",
+                        "zh_TW":"https://www.pdfreaderpro.com/windows?utm_source=iOSApp&amp;utm_campaign=PDFiOS&amp;utm_medium=pdfios_promo",
+                        "zh_CN":"https://www.pdfreaderpro.com/windows?utm_source=iOSApp&amp;utm_campaign=PDFiOS&amp;utm_medium=pdfios_promo"
+                    }
+                }
+            ]
+        }
+    ]
+}
+```
+
+#####  <a id="Pop">Pop</a>
+###### json示例
+```
+```
+
+#### 代码块
+* <a id="AppNameType">KMAdvertisementAppNameType</a>
+```swift
+//APP类型
+public enum KMAdvertisementAppNameType: String, Codable {
+    case RecordIt = "RecordIt"
+    case RecordItPro = "RecordItPro"
+    case RecordItDMG = "RecordItDMG"
+    case FilmageScreen = "FilmageScreen"
+    case FilmageScreenPro = "FilmageScreenPro"
+    case FilmageScreenDMG = "FilmageScreenDMG"
+    case FilmageEditorMac = "FilmageEditorMac"
+    case FilmageEditorMacPro = "FilmageEditorMacPro"
+    case FilmageEditorMacDMG = "FilmageEditorMacDMG"
+    case FilmageConverterMac = "FilmageConverterMac"
+    case FilmageConverterMacPro = "FilmageConverterMacPro"
+    case FilmageConverterMacDMG = "FilmageConverterMacDMG"
+    case FilmagePlayerMac = "FilmagePlayerMac"
+    case FilmagePlayerMacPro = "FilmagePlayerMacPro"
+    case FilmagePlayerMacDMG = "FilmagePlayerMacDMG"
+    case PDFReaderProMac = "PDFReaderProMac"
+    case PDFReaderProMacPro = "PDFReaderProMacPro"
+    case PDFReaderProMacDMG = "PDFReaderProMacDMG"
+    case PDFReaderProIOS = "PDFReaderProIOS"
+    case PDFReaderProIOSPro = "PDFReaderProIOSPro"
+}
+```
+
+* <a id="PlatformType">KMAdvertisementPlatformType</a>
+```swift
+//平台
+public enum KMAdvertisementPlatformType: String, Codable {
+    case unknow = "unknow"
+    case Mac = "Mac" //
+    case iOS = "iOS" //
+}
+```
+
+* <a id="ShowType">KMAdvertisementShowType</a>
+```swift
+//显示样式
+public enum KMAdvertisementShowType: String, Codable {
+    case unknow = "unknow"
+    case list = "list" //列表
+    case pop = "pop"//弹窗
+    case scroll = "scroll"//循环
+    case view = "view" //视图显示
+}
+```
+
+
+* <a id="SubscribeType">KMAdvertisementSubscribeType</a>
+```swift
+//订阅状态
+public enum KMAdvertisementSubscribeType: String, Codable {
+    case unknow = "unknow"
+    case unsubscribed = "unsubscribed"//未订阅
+    case subscribed = "subscribed"//已订阅
+}
+
+```
+
+* <a id="ActionType">KMAdvertisementActionType</a>
+```swift
+//点击视图后跳转选项
+public enum KMAdvertisementActionType: String, Codable {
+    case unknow = "unknow"
+    case URL = "URL"//链接
+    case comparative = "comparative"//比价表
+}
+```
+
+* <a id="LanguageType">KMAdvertisementLanguageType</a>
+```swift
+//多语
+public enum KMAdvertisementLanguageType: String {
+    case unknow = "unknow"
+    case en = "en"//
+    case zhCN = "zhCN"//
+    case zhTW = "zhTW"//
+}
+
+```

BIN
KMAdvertisement/KMAdvertisement.docc/流程图.png


BIN
KMAdvertisement/KMAdvertisement.docc/添加方法一.png


BIN
KMAdvertisement/KMAdvertisement.docc/添加方法二.png


+ 20 - 0
KMAdvertisement/KMAdvertisement.h

@@ -0,0 +1,20 @@
+//
+//  KMAdvertisement.h
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+#import <Foundation/Foundation.h>
+
+//! Project version number for KMAdvertisement.
+FOUNDATION_EXPORT double KMAdvertisementVersionNumber;
+
+//! Project version string for KMAdvertisement.
+FOUNDATION_EXPORT const unsigned char KMAdvertisementVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <KMAdvertisement/PublicHeader.h>
+//#import <KMAdvertisement/KMAdvertisementModel.swift>
+//#import <KMAdvertisement/KMAdvertisementManager.swift>
+//#import <KMAdvertisement/KMAdvertisementRequestServer.swift>
+//#import <KMAdvertisement/KMAdvertisementConfig.swift>

+ 39 - 0
KMAdvertisement/KMAdvertisementCache/KMAdvertisementCache.swift

@@ -0,0 +1,39 @@
+//
+//  KMAdvertisementCache.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/25.
+//
+
+class KMAdvertisementCache: NSObject {
+    
+    let kFilePath: NSString = (NSSearchPathForDirectoriesInDomains(FileManager.SearchPathDirectory.documentDirectory, FileManager.SearchPathDomainMask.userDomainMask, false).first?.appending("/advertisement.plist"))! as NSString
+    
+    //单例
+    public static let `default` = KMAdvertisementCache()
+    //存储
+    func saveData(data: [NSDictionary]) {
+        if (FileManager.default.fileExists(atPath: kFilePath as String)) {
+            FileManager.default.createFile(atPath: kFilePath as String, contents: nil);
+        }
+        
+        let saveData: NSArray = data as NSArray
+        let success = saveData.write(toFile: kFilePath.expandingTildeInPath as String, atomically: true)
+
+        if (success == true) {
+            print("成功 -" + (kFilePath.expandingTildeInPath as String))
+        } else {
+            print("失败 -" + (kFilePath.expandingTildeInPath as String))
+        }
+    }
+
+   //读取
+    func readData() -> [NSDictionary] {
+        let data =  NSArray.init(contentsOfFile: kFilePath.expandingTildeInPath as String)
+        return data as! [NSDictionary]
+    }
+
+//2.利用NSSearchPathForDirectoriesInDomains获取路径
+//
+//
+}

+ 170 - 0
KMAdvertisement/KMAdvertisementConfig.swift

@@ -0,0 +1,170 @@
+//
+//  KMAdvertisementConfig.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/24.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+
+//APP类型
+public enum KMAdvertisementAppNameType: String, Codable {
+    case RecordIt = "RecordIt"
+    case RecordItPro = "RecordItPro"
+    case RecordItDMG = "RecordItDMG"
+    case FilmageScreen = "FilmageScreen"
+    case FilmageScreenPro = "FilmageScreenPro"
+    case FilmageScreenDMG = "FilmageScreenDMG"
+    case FilmageEditorMac = "FilmageEditorMac"
+    case FilmageEditorMacPro = "FilmageEditorMacPro"
+    case FilmageEditorMacDMG = "FilmageEditorMacDMG"
+    case FilmageConverterMac = "FilmageConverterMac"
+    case FilmageConverterMacPro = "FilmageConverterMacPro"
+    case FilmageConverterMacDMG = "FilmageConverterMacDMG"
+    case FilmagePlayerMac = "FilmagePlayerMac"
+    case FilmagePlayerMacPro = "FilmagePlayerMacPro"
+    case FilmagePlayerMacDMG = "FilmagePlayerMacDMG"
+    case PDFReaderProMac = "PDFReaderProMac"
+    case PDFReaderProMacPro = "PDFReaderProMacPro"
+    case PDFReaderProMacDMG = "PDFReaderProMacDMG"
+    case PDFReaderProIOS = "PDFReaderProIOS"
+    case PDFReaderProIOSPro = "PDFReaderProIOSPro"
+}
+
+//显示样式
+public enum KMAdvertisementShowType: String, Codable {
+    case unknow = "unknow"
+    case list = "list" //列表
+    case pop = "pop"//弹窗
+    case scroll = "scroll"//循环
+    case view = "view" //视图显示
+}
+
+//平台
+public enum KMAdvertisementPlatformType: String, Codable {
+    case unknow = "unknow"
+    case Mac = "Mac" //
+    case iOS = "iOS" //
+}
+
+//订阅状态
+public enum KMAdvertisementSubscribeType: String, Codable {
+    case unknow = "unknow"
+    case unsubscribed = "unsubscribed"//未订阅
+    case subscribed = "subscribed"//已订阅
+}
+
+//点击视图后跳转选项
+public enum KMAdvertisementActionType: String, Codable {
+    case unknow = "unknow"
+    case URL = "URL"//链接
+    case comparative = "comparative"//比价表
+}
+
+//多语
+public enum KMAdvertisementLanguageType: String {
+    case unknow = "unknow"
+    case en = "en"//
+    case zhCN = "zhCN"//
+    case zhTW = "zhTW"//
+}
+
+open class KMAdvertisementConfig: NSObject {
+    var appName: KMAdvertisementAppNameType = .FilmageEditorMac
+    var platform: KMAdvertisementPlatformType = .Mac
+    var subscribeType: KMAdvertisementSubscribeType = .unsubscribed
+    var language: KMAdvertisementLanguageType = .unknow
+    
+    func activityBaseURL() -> String {
+        if (KMAdvertisementManager.manager.debug) {
+            // 测试 服务器
+            return "http://test-store.kdan.cn:3019"
+        } else {
+            //正式版 服务器
+            return "https://content.filmagepro.com"
+        }
+    }
+    
+//    [AdvertNetworkTool configInfoWithAppID:@"FE" appType:AdvertNetworkAppTypeGetValue() platform:@"Mac"];
+//    [AdvertNetworkTool loadDataWithcompletion:^(NSDictionary * _Nonnull info, NSError * _Nonnull error) {
+//        if (!error) {
+//            NSTimeInterval currentTime = [[NSDate date] timeIntervalSince1970];
+//            if ([info isKindOfClass:[NSDictionary class]]) {
+//                NSMutableArray *arr = [[NSMutableArray alloc] init];
+//                for (NSDictionary *dict in info[@"data"]) {
+//                    NSDateFormatter *formatter= [[NSDateFormatter alloc] init];
+//                    [formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
+//                    NSDate *startDate  = [formatter dateFromString:dict[@"start_at"]];
+//                    NSDate *endDate  = [formatter dateFromString:dict[@"end_at"]];
+//                    NSTimeInterval startTime = [startDate timeIntervalSince1970];
+//                    NSTimeInterval endTime = [endDate timeIntervalSince1970];
+//                    BOOL isTimeValid = NO;
+//                    if (currentTime > startTime &&
+//                        currentTime < endTime) {
+//                        isTimeValid = YES;
+//                    }
+//                    if (startTime == 0 ||
+//                        endTime == 0) {
+//                        isTimeValid = YES;
+//                    }
+//                    if ([dict[@"status"] boolValue] && isTimeValid) {
+//                        if (dict[@"style_name"] &&
+//                            [dict[@"style_name"] isEqualToString:@"Editor_banner_style"]) {
+//
+//                            [arr addObject:dict];
+//
+//                        }
+//                    }
+//                }
+//            }
+//        }
+//    }];
+    
+    public func initParameters(appName: KMAdvertisementAppNameType, subscribeType:KMAdvertisementSubscribeType, platform: KMAdvertisementPlatformType) {
+        self.appName = appName
+        self.subscribeType = subscribeType
+        self.platform = platform
+    }
+    
+    static func adapterDark(light: UIColor, dark: UIColor) -> UIColor {
+#if os(iOS)
+        if #available(iOS 13.0, *) {
+            let color = UIColor.init { trainCollection -> UIColor in
+                if trainCollection.userInterfaceStyle == UIUserInterfaceStyle.dark {
+                    return dark
+                } else {
+                    return light
+                }
+            }
+            return color
+        }
+#elseif os(OSX)
+        if #available(macOS 10.14, *) {
+            let dict = UserDefaults.standard.persistentDomain(forName: UserDefaults.globalDomain) ?? nil
+            guard let dicts: Dictionary = dict else {
+                print("不是字典类型")
+                return light
+            }
+            
+            guard let style = dicts["AppleInterfaceStyle"] as? String else {
+                print("style is not string")
+                return light
+            }
+            
+            let isDarkMode : Bool = style.compare("Dark").rawValue == 0
+            
+            if isDarkMode {
+                print("暗黑模式\(style)")
+                return dark
+            } else {
+                print("正常模式\(style)")
+                return light
+            }
+        }
+#endif
+    }
+}

+ 295 - 0
KMAdvertisement/KMAdvertisementManager.swift

@@ -0,0 +1,295 @@
+//
+//  KMAdvertisementManager.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/23.
+// 广告管理
+
+#if os(OSX)
+    import AppKit
+    public typealias UIImage = NSImage
+    public typealias UIView = NSView
+    public typealias UIButton = NSButton
+    public typealias UIScrollView = NSScrollView
+    public typealias UIColor = NSColor
+    public typealias UIFont = NSFont
+    public typealias UITextView = NSTextView
+    public typealias UIImageView = NSImageView
+    public typealias UIEvent = NSEvent
+    public typealias UIBezierPath = NSBezierPath
+    public typealias UITextField = NSTextField
+    public typealias UIEdgeInsets = NSEdgeInsets
+#elseif os(iOS)
+    import UIKit
+    public typealias NSImage = UIImage
+    public typealias NSView = UIView
+    public typealias NSButton = UIButton
+    public typealias NSScrollView = UIScrollView
+    public typealias NSColor = UIColor
+    public typealias NSFont = UIFont
+    public typealias NSTextView = UITextView
+    public typealias NSImageView = UIImageView
+    public typealias NSEvent = UIEvent
+    public typealias NSBezierPath = UIBezierPath
+    public typealias NSTextField = UILabel
+    public typealias NSEdgeInsets = UIEdgeInsets
+#endif
+
+open class KMAdvertisementManager {
+    //单例
+    public static let manager = KMAdvertisementManager()
+    public var configuration: KMAdvertisementConfig = KMAdvertisementConfig()
+    
+    /**
+     @abstract 测试模式,默认为false
+      */
+    public var debug: Bool = false
+    
+    /**
+     @abstract 初始化数据
+     @param appID 产品名称
+     @param subscribeType 订阅状态,可单独在configuration设置
+     @param platform 平台
+     @return
+      */
+    public func initConfig(appName: KMAdvertisementAppNameType,
+                           subscribeType:KMAdvertisementSubscribeType,
+                           platform: KMAdvertisementPlatformType) {
+        configuration.initParameters(appName: appName, subscribeType: subscribeType, platform: platform)
+    }
+}
+
+extension KMAdvertisementManager {
+    //MARK: request
+    /**
+     @abstract 获取数据
+     @param data 传入参数 类型为KMAdvertisementModel
+     @return
+      */
+    public func fetchData(completion:@escaping (_ data: [KMAdvertisementModel]?, _ error:Error?) -> Void) -> Void {
+        var version: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString").debugDescription
+        if (version.count == 0) {
+            version = Bundle.main.object(forInfoDictionaryKey: "CFBundleVersion").debugDescription
+            version = version.replacingOccurrences(of: ".", with: "")
+        }
+        
+        let urlString = configuration.activityBaseURL() + "/api/advertise"
+        let params: [String:Any] = ["app_name": configuration.appName.rawValue,
+                                    "app_version": version]
+        
+        unowned let weakSelf = self
+        KMAdvertisementRequestServer.requestServer.request(urlString: urlString, method: "GET", params: params) { task, responseObject, error in
+            if (error == nil && responseObject != nil) {
+                let array = responseObject?["list"] ?? []
+                //保存数据
+                KMAdvertisementCache.default.saveData(data: array as! [NSDictionary])
+                //解析数据
+                weakSelf.parseData(data: array as! [NSDictionary]) { data in
+                    completion(data, nil)
+                }
+            } else {
+                //获取缓存数据
+                let cacheData = KMAdvertisementCache.default.readData()
+                if cacheData.count != 0 {
+                    weakSelf.parseData(data: cacheData) { data in
+                        completion(data, nil)
+                    }
+                } else {
+                    completion(nil, error!)
+                }
+            }
+        }
+    }
+}
+
+extension KMAdvertisementManager {
+    //MARK: show
+    /**
+     @abstract 显示视图
+     @param type 显示类型 <KMAdvertisementShowType>
+     @param data 显示数据 <KMAdvertisementModel>
+     @param superView 父视图 <NSView>
+     @return KMAdvertisementModel
+      */
+    public func show(type: KMAdvertisementShowType?, data: KMAdvertisementModel?, superView: NSView?, _ action: KMAdvertisementActionCompletion?) -> NSView {
+        var view = KMAdvertisementBaseView()
+#if os(OSX)
+        if data != nil {
+            if type == .list {
+                view = KMAdvertisementTableView.init(data: data!, superView: superView!)
+            } else if type == .view {
+                view = KMAdvertisementShowView.init(data: data!, superView: superView!)
+            }
+        }
+#else
+        if data != nil {
+            if type == .scroll {
+                view = KMAdvertisementShowScroll_iOS.init(data: data!, superView: superView!)
+            } else if type == .view {
+                view = KMAdvertisementShowView_iOS.init(data: data!, superView: superView!)
+            }
+        }
+#endif
+        if action == nil {
+            view.actionCompletion = { content in
+                self.transitionAction(item: content)
+            }
+        } else {
+            view.actionCompletion = action
+        }
+        return view
+    }
+    
+    func transitionAction(item: KMAdvertisementModel.Section.Content) {
+        if (item.actionType == .URL) {
+            let string = item.linkURL?.en ?? ""
+
+#if os(iOS)
+            if UIApplication.shared.canOpenURL(URL(string: string )!) {
+                UIApplication.shared.open(URL(string: string )!, options: [:])
+            }
+#elseif os(OSX)
+            if NSWorkspace.shared.open(URL.init(string: string)!) {
+                NSWorkspace.shared.open(URL.init(string: string)!)
+            }
+#endif
+            print("链接" + string)
+        } else if (item.actionType == .comparative) {
+            print("比较表")
+        }
+    }
+}
+
+
+extension KMAdvertisementManager {
+    //MARK: data
+    /**
+     @abstract 解析数据
+     @param data 传入参数 NSDictionary
+     @return KMAdvertisementModel
+      */
+    public func parseData(data: [NSDictionary], completion:(_ result: [KMAdvertisementModel]) -> Void) -> Void {
+        if (data.count != 0) {
+            KMAdvertisementCache.default.saveData(data: data)
+        }
+        
+        for model in data {
+            var resultArray:[KMAdvertisementModel] = []
+            if (self.allowLoadData(data: model)) {
+                let jsonString: String = (model["detail"] as? String) ?? ""
+                let jsonData: Data = jsonString.data(using: .utf8)!
+                
+                let decoder = JSONDecoder()
+//                decoder.dataDecodingStrategy = .base64
+//                decoder.keyDecodingStrategy = .convertFromSnakeCase //带下划线命名
+
+                decoder.nonConformingFloatDecodingStrategy = .convertFromString(positiveInfinity: "+∞", negativeInfinity: "-∞", nan: "NaN")
+#if DEBUG
+                //MARK: 测试使用
+                let advertisementModel = try! decoder.decode(KMAdvertisementModel.self, from: jsonData)
+                if (self.allowLoadContentData(data: advertisementModel)) {
+                    resultArray.append(advertisementModel)
+                }
+#else
+//            MARK: 此处try 使用 ? ,如果数据出问题 advertisementModel将无参数, 测试时使用!
+                let advertisementModel = try? decoder.decode(KMAdvertisementModel.self, from: jsonData)
+                if (advertisementModel != nil) {
+                    if (self.allowLoadContentData(data: advertisementModel)) {
+                        resultArray.append(advertisementModel!)
+                    }
+                }
+#endif
+            }
+            completion(resultArray)
+        }
+    }
+    
+    func allowLoadData(data: NSDictionary) -> Bool {
+        var result = false
+        
+        let status = (data["status"] as? Int) ?? 0
+        let app_name: String = data["app_name"] as? String ?? ""
+        
+        if (status == 1 &&
+            app_name == configuration.appName.rawValue) {
+            result = true
+        }
+        return result
+        
+    }
+    
+    func allowLoadContentData(data: KMAdvertisementModel) -> Bool {
+        var result = false
+        
+        let time: NSInteger = NSInteger(KMAdvertisementTimeStampConversion.getCurrentTimeInterval())!
+        let startTime: NSInteger = NSInteger(data.startTime!)!
+        let endTime: NSInteger = NSInteger(data.endTime!)!
+        let platform = configuration.platform
+        let subscribeType = configuration.subscribeType
+        let version = data.version ?? "1.0"
+        let localVersion = self.getLocalVersion()
+        
+        if (time >= startTime &&
+            time <= endTime &&
+            platform == data.platform &&
+            self.compareVersion(nowVersion:localVersion, newVersion: version) &&
+            subscribeType == data.subscribeType) {
+            result = true
+        }
+        return result
+    }
+    
+    //获取本地版本号
+    func getLocalVersion() -> String {
+        var localVersion = ""
+        if let v: String = Bundle.main.object(forInfoDictionaryKey: "CFBundleShortVersionString") as? String {
+            localVersion = v
+        }
+        return localVersion
+    }
+    
+    func compareVersion(nowVersion: String, newVersion: String) -> Bool {
+        let nowArray = nowVersion.split(separator: ".")
+        let newArray = newVersion.split(separator: ".")
+        let big = nowArray.count > newArray.count ? newArray.count : nowArray.count
+        for index in 0...big - 1 {
+            let first = nowArray[index]
+            let second = newArray[index]
+            if Int(first)! <= Int(second)!  {
+                return true
+            }
+        }
+        return false
+    }
+}
+
+extension KMAdvertisementManager {
+//    //MARK: image
+//    public func dynamic_sdkBundle_image()-> NSImage? {
+//        // class: 库里 任意class, dynamic bundle 和 mainBundle 不是同一个
+//        let bundle = Bundle(for: KMAdvertisementManager.self)
+////        let mainBundle = Bundle.main
+//        let path = bundle.path(forResource: "KMAdvertisement", ofType: "bundle")
+//        if let path = path {
+//            let sdkBundle = Bundle(path: path)
+//            let filePath = sdkBundle?.pathForImageResource("1")
+//            let image = NSImage.init(contentsOfFile: filePath!)
+////            let image = NSImage(named: "1", in: sdkBundle, compatibleWith: nil)
+//            return image
+//        }
+//        return nil
+//    }
+//
+//    public func staticSdk_image() -> NSImage? {
+//            // class: 库里 任意class
+//            let bundle = Bundle(for: KMAdvertisementManager.self)
+//            let path = bundle.path(forResource: "KMAdvertisement", ofType: "framework")
+//            if let path = path {
+//                let sdkBundle = Bundle(path: path)
+//                let filePath = sdkBundle?.pathForImageResource("1")
+//                let image = NSImage.init(contentsOfFile: filePath!)
+//                return image
+//            }
+//            return nil
+//    }
+}

+ 155 - 0
KMAdvertisement/KMAdvertisementRequest/KMAdvertisementRequestServer.swift

@@ -0,0 +1,155 @@
+//
+//  KMAdvertisementRequestServer.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import AFNetworking
+typealias KMAdvertisementRequestServerCompletion = (_ task: URLSessionDataTask?, _ responseObject: AnyObject?, _ error: Error?) -> Void
+class KMAdvertisementRequestServer {
+    var sessionManager: AFHTTPSessionManager!
+    static let requestServer = KMAdvertisementRequestServer()
+    
+    init() {
+        let configuration: URLSessionConfiguration = URLSessionConfiguration.default
+        sessionManager = AFHTTPSessionManager.init(sessionConfiguration: configuration)
+        sessionManager.securityPolicy = AFSecurityPolicy.default()
+    }
+    
+    func request(urlString: String,
+                 method:String,
+                 params: Dictionary<String, Any>?,
+                 completion: KMAdvertisementRequestServerCompletion?) -> Void {
+        self.request(urlString: urlString,
+                     method: method,
+                     params: params,
+                     requestSerializer: nil,
+                     completion: completion)
+    }
+    
+    func request(urlString: String,
+                 method:String,
+                 params: Dictionary<String, Any>?,
+                 requestSerializer: ((_ requestSerializer:AFHTTPRequestSerializer) -> Void)?,
+                 completion: KMAdvertisementRequestServerCompletion?) -> Void {
+        self.request(urlString: urlString,
+                     method: method,
+                     params: params,
+                     requestSerializer: requestSerializer,
+                     body: nil,
+                     completion: completion)
+    }
+    
+    func request(urlString: String,
+                 method:String,
+                 params: Dictionary<String, Any>?,
+                 requestSerializer: ((_ requestSerializer:AFHTTPRequestSerializer) -> Void)?,
+                 body: ((_ formData:AFMultipartFormData) -> Void)?,
+                 completion: KMAdvertisementRequestServerCompletion?) -> Void {
+        //每次请求需要重新创建
+        sessionManager.requestSerializer = AFJSONRequestSerializer()
+        sessionManager.responseSerializer = AFJSONResponseSerializer()
+        sessionManager.responseSerializer.acceptableContentTypes = ["application/json","text/html","text/json","text/javascript","text/plain","image/gif"]
+        sessionManager.requestSerializer.timeoutInterval = 20
+        if (requestSerializer != nil) {
+            requestSerializer!(sessionManager.requestSerializer);
+        }
+        
+        if (method == "POST") {
+            if (body != nil) {
+                sessionManager.post(urlString, parameters: params, headers: nil) { formData in
+                    body!(formData)
+                } progress: { progress in
+                    
+                } success: { task, responseObject in
+                    let responseObject = responseObject as AnyObject
+                    if (completion != nil) {
+                        completion!(task,responseObject,nil);
+                    }
+                } failure: { task, error in
+                    if (completion != nil) {
+                        completion!(task,nil,error);
+                    }
+                }
+            } else {
+                sessionManager.post(urlString, parameters: params, headers: nil) { progress in
+                
+                } success: { task, responseObject in
+                    if (completion != nil) {
+                        let responseObject = responseObject as AnyObject
+                        completion!(task,responseObject,nil);
+                    }
+                } failure: { task, error in
+                    if (completion != nil) {
+                        completion!(task,nil,error);
+                    }
+                }
+
+            }
+        } else if (method == "GET") {
+            sessionManager.get(urlString, parameters: params, headers: nil) { progress in
+                
+            } success: { task, responseObject in
+                if (completion != nil) {
+                    let responseObject = responseObject as AnyObject
+                    completion!(task,responseObject,nil);
+                }
+            } failure: { task, error in
+                if (completion != nil) {
+                    completion!(task,nil,error);
+                }
+            }
+        }
+    }
+    
+    /**
+     下载
+     */
+    func downLoad(urlString: String,
+                  filePath: String,
+                  progress: @escaping(_ progress: Progress) -> Void,
+                  completion: KMAdvertisementRequestServerCompletion) {
+//        /* 下载地址 */
+//        NSURL *url = [NSURL URLWithString:urlString];
+//        NSURLRequest *request = [NSURLRequest requestWithURL:url];
+//        /* 开始请求下载 */
+//        NSProgress *tProgress;
+//        NSURLSessionDownloadTask *downloadTask = [_sessionManager downloadTaskWithRequest:request progress:&tProgress destination:^NSURL * _Nonnull(NSURL * _Nonnull targetPath, NSURLResponse * _Nonnull response) {
+//            dispatch_async(dispatch_get_main_queue(), ^{
+//                //如果需要进行UI操作,需要获取主线程进行操作
+//            });
+//            /* 设定下载到的位置 */
+//            return [NSURL fileURLWithPath:filePath];
+//
+//        } completionHandler:^(NSURLResponse *response, NSURL *filePath, NSError *error) {
+//            if (completion) {
+//                completion(response,filePath,error);
+//            }
+//        }];
+//
+//        if (progress) {
+//            progress(tProgress);
+//        }
+//
+//        [downloadTask resume];
+    }
+    
+    /*
+     status
+     AFNetworkReachabilityStatusUnknown          = -1, 不知道监测的是什么
+     AFNetworkReachabilityStatusNotReachable     = 0,  没有检测到网络
+     AFNetworkReachabilityStatusReachableViaWWAN = 1,  蜂窝网
+     AFNetworkReachabilityStatusReachableViaWiFi = 2,  WIFI
+     */
+    func reachabilityStatusChange(block: @escaping(AFNetworkReachabilityStatus) ->Void) {
+        // 1.创建网络监测单例
+        let manager = AFNetworkReachabilityManager.shared()
+        manager.setReachabilityStatusChange({ status in
+            // 2.实现网络监测的回调
+            block(status)
+        })
+        // 3.开始监测
+        manager.startMonitoring()
+    }
+}

+ 101 - 0
KMAdvertisement/Model/KMAdvertisementModel.swift

@@ -0,0 +1,101 @@
+//
+//  KMAdvertisementModel.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/30.
+//
+
+//参考链接 https://www.jianshu.com/p/a24cf8f37860
+//func encode<T>(of model: T) throws where T: Codable {
+//    let encoder = JSONEncoder()
+//    encoder.outputFormatting = .prettyPrinted
+//    let encodedData = try encoder.encode(model)
+//    print(String(data: encodedData, encoding: .utf8)!)
+//}
+//func decode<T>(of jsonString: String, type: T.Type) throws -> T where T: Codable {
+//    let data = jsonString.data(using: .utf8)!
+//    let decoder = JSONDecoder()
+//    let model = try! decoder.decode(T.self, from: data)
+//    return model
+//}
+
+/**
+ 
+ */
+public struct KMAdvertisementModel: Codable {
+    public let appName: KMAdvertisementAppNameType? //产品名
+    public let platform: KMAdvertisementPlatformType? //平台
+    public let showType: KMAdvertisementShowType? //显示类型
+    public let startTime: String? //开始时间 时间戳
+    public let endTime: String? //结束时间 时间戳
+    public let subscribeType: KMAdvertisementSubscribeType? //是否订阅
+    public let version: String? //小于等于此版本生效
+    let content:[Section]
+    
+    
+    public struct Section: Codable {
+        let sectionTitle: Text?
+        let content: [Content]
+        
+        public struct Content: Codable {
+            var index: Int?
+            let title: Text?
+            let imageURL: Image?
+            let ipadImageURL: Image?
+            let linkURL: Language?
+            let tips: Language?
+            let button: Text?
+            let actionType: KMAdvertisementActionType?
+        }
+    }
+    
+    struct Text: Codable {
+        let font: Font?
+        let color: Color?
+        let background: Background?
+        let language: Language?
+    }
+    
+    struct Font: Codable {
+        let name: String?
+        let size: Int?
+    }
+    
+    struct Color: Codable {
+        let height: ColorState?
+        let normal: ColorState?
+        
+        struct ColorState: Codable {
+            let dark: ColorInfo?
+            let universal: ColorInfo?
+            
+            struct ColorInfo: Codable {
+                var hex: String?
+                var alpha: Float?
+            }
+        }
+    }
+
+    struct Background: Codable {
+        let color: Color?
+        let layer: Layer?
+        
+        struct Layer: Codable {
+            let cornerRadius: CGFloat?
+            let borderWidth: CGFloat?
+            let borderColor: Color?
+        }
+    }
+    
+    struct Image: Codable {
+        let height: Language?
+        let normal: Language?
+        let background: Background?
+    }
+    
+    struct Language: Codable {
+        let en: String?
+        let zh_TW: String?
+        let zh_CN: String?
+    }
+}

+ 97 - 0
KMAdvertisement/Model/KMAdvertisementModelTransition.swift

@@ -0,0 +1,97 @@
+//
+//  KMAdvertisementModelTansition.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/12/2.
+//
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+
+open class KMAdvertisementModelTransition: NSObject {
+    //MARK: 模型转换
+    //颜色模型转换
+    static func transitionColor(color: KMAdvertisementModel.Color, highlight:Bool) -> UIColor {
+        var result = UIColor.clear
+        
+        if highlight {
+            let darkHex = color.height?.dark?.hex
+            let darkAlpha = color.height?.dark?.alpha
+            let universalHex = color.height?.universal?.hex
+            let universalAlpha = color.height?.universal?.alpha
+            let light = NSColor.init(hex: universalHex ?? "").withAlphaComponent(CGFloat(universalAlpha ?? 1))
+            let dark = NSColor.init(hex: darkHex ?? universalHex ?? "").withAlphaComponent(CGFloat(darkAlpha ?? universalAlpha ?? 1))
+            
+            result = KMAdvertisementConfig.adapterDark(light: light , dark: dark)
+        } else {
+            let darkHex = color.normal?.dark?.hex
+            let darkAlpha = color.normal?.dark?.alpha
+            let universalHex = color.normal?.universal?.hex
+            let universalAlpha = color.normal?.universal?.alpha
+            
+            let light = NSColor.init(hex: universalHex ?? "").withAlphaComponent(CGFloat(universalAlpha ?? 1))
+            let dark = NSColor.init(hex: darkHex ?? universalHex ?? "").withAlphaComponent(CGFloat(darkAlpha ?? universalAlpha ?? 1))
+            result = KMAdvertisementConfig.adapterDark(light: light, dark: dark)
+        }
+        
+        return result
+    }
+    
+    //图片转换
+    static func transitionImagePath(image: KMAdvertisementModel.Image, highlight:Bool) -> String {
+        var result = ""
+        
+        if highlight {
+            if image.height != nil {
+                result = transitionLanguage(langeuage: image.height!)
+            }
+        } else {
+            if image.normal != nil {
+                result = transitionLanguage(langeuage: image.normal!)
+            }
+        }
+        
+        return result
+    }
+    
+    //多语转换
+    static func transitionLanguage(langeuage: KMAdvertisementModel.Language?) -> String {
+        var result = ""
+        let languageConfig = KMAdvertisementManager.manager.configuration.language
+        if languageConfig != .unknow {
+            if languageConfig == .en {
+                result = langeuage?.en ?? ""
+            } else if languageConfig == .zhCN {
+                result = langeuage?.zh_CN ?? ""
+            } else if languageConfig == .zhTW {
+                result = langeuage?.zh_TW ?? ""
+            }
+        } else {
+            let string = KMAdvertisementModelTransition.getLanguageType()
+            if string == "zh-Hans-CN" {
+                result = langeuage?.zh_CN ?? ""
+            } else if string == "zh-Hans-TW" {
+                result = langeuage?.zh_TW ?? ""
+            } else {
+                result = langeuage?.en ?? ""
+            }
+        }
+        
+        return result
+    }
+    
+    static func getLanguageType() -> String {
+#if os(iOS)
+        let def = UserDefaults.standard
+        let allLanguages: [String] = def.object(forKey: "AppleLanguages") as! [String]
+        let chooseLanguage = allLanguages.first
+        return chooseLanguage ?? "en"
+#elseif os(OSX)
+        let locale = NSLocale.current.languageCode
+        let chooseLanguage = Locale.preferredLanguages[0]
+        return chooseLanguage
+#endif
+    }
+}

+ 17 - 0
KMAdvertisement/UI/Base/KMAdvertisementBaseView.swift

@@ -0,0 +1,17 @@
+//
+//  KMAdvertisementBaseView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/12/3.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+
+public typealias KMAdvertisementActionCompletion = (_ actionItem: KMAdvertisementModel.Section.Content) -> Void
+open class KMAdvertisementBaseView: NSView {
+    public var actionCompletion: KMAdvertisementActionCompletion?
+}

+ 46 - 0
KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionHeadView.swift

@@ -0,0 +1,46 @@
+//
+//  KMAdvertisementCollectionHeadView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+class KMAdvertisementCollectionHeadView: NSView {
+
+    lazy var titleTextField: NSTextField? = {
+        for view in self.subviews {
+            if view is NSTextField {
+                return view as? NSTextField
+            }
+        }
+        return nil
+    }()
+    
+    var model: KMAdvertisementModel.Section! {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    func reloadData() {
+        if model?.sectionTitle?.language != nil {
+            self.titleTextField?.stringValue = KMAdvertisementModelTransition.transitionLanguage(langeuage: (model?.sectionTitle?.language)!)
+        }
+        
+        if model.sectionTitle?.color != nil {
+            self.titleTextField?.textColor = KMAdvertisementModelTransition.transitionColor(color: (model.sectionTitle?.color)!, highlight: false)
+        }
+    }
+    
+    override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+}

+ 32 - 0
KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionHeadView.xib

@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner"/>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe" customClass="KMAdvertisementCollectionHeadView" customModule="KMAdvertisement" customModuleProvider="target">
+            <rect key="frame" x="0.0" y="0.0" width="480" height="30"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="DuE-Mw-GiV">
+                    <rect key="frame" x="6" y="7" width="37" height="16"/>
+                    <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="KZj-T6-HnW">
+                        <font key="font" usesAppearanceFont="YES"/>
+                        <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                        <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                    </textFieldCell>
+                </textField>
+            </subviews>
+            <constraints>
+                <constraint firstItem="DuE-Mw-GiV" firstAttribute="centerY" secondItem="c22-O7-iKe" secondAttribute="centerY" id="b12-fX-rby"/>
+                <constraint firstItem="DuE-Mw-GiV" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" constant="8" id="rGK-BD-UB7"/>
+            </constraints>
+            <point key="canvasLocation" x="0.0" y="172"/>
+        </customView>
+    </objects>
+</document>

+ 59 - 0
KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionViewItem.swift

@@ -0,0 +1,59 @@
+//
+//  KMAdvertisementCollectionViewItem.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+import Cocoa
+import Kingfisher
+class KMAdvertisementCollectionViewItem: NSCollectionViewItem {
+    @IBOutlet weak var iconImageView: NSImageView!
+    @IBOutlet weak var titleLabel: NSTextField!
+    
+    @IBOutlet weak var contentView: NSView!
+    var model: KMAdvertisementModel.Section.Content! {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        // Do view setup here.
+        self.view.addTrackingRect(self.view.bounds, owner: self, userData: nil, assumeInside: false)
+        self.contentView.wantsLayer = true
+        self.contentView.layer?.masksToBounds = true
+    }
+    
+    func reloadData() {
+        self.titleLabel.stringValue = KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.title?.language)
+        self.titleLabel.font = NSFont.init(name: model?.title?.font?.name ?? "AppleSystemUIFont", size: CGFloat(model?.title?.font?.size ?? 13))
+        self.contentView.toolTip = KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.tips)
+        self.contentView.layer?.cornerRadius = model.title?.background?.layer?.cornerRadius ?? 0
+        self.updateColor(false)
+    }
+    
+    func updateColor(_ highlight: Bool) {
+        
+        if model.title?.color != nil {
+            self.titleLabel.textColor = KMAdvertisementModelTransition.transitionColor(color: (model.title?.color)!, highlight: highlight)
+        }
+        
+        if model.title?.background?.color != nil {
+            self.iconImageView.layer?.backgroundColor = KMAdvertisementModelTransition.transitionColor(color: (model.title?.background?.color)!, highlight: highlight).cgColor
+        }
+        
+        if model.imageURL != nil {
+            self.iconImageView?.kf.setImage(with: URL(string: KMAdvertisementModelTransition.transitionImagePath(image: model.imageURL!, highlight: highlight)))
+        }
+    }
+    
+    override func mouseEntered(with event: NSEvent) {
+        self.updateColor(true)
+    }
+
+    override func mouseExited(with event: NSEvent) {
+        self.updateColor(false)
+    }
+}

+ 62 - 0
KMAdvertisement/UI/List/Cell/KMAdvertisementCollectionViewItem.xib

@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementCollectionViewItem" customModule="KMAdvertisement">
+            <connections>
+                <outlet property="contentView" destination="LdM-b2-48C" id="hxf-ZH-gmW"/>
+                <outlet property="iconImageView" destination="EPJ-sc-6wa" id="qq0-MW-YTG"/>
+                <outlet property="titleLabel" destination="8KY-8V-DxN" id="tt2-Pa-lKm"/>
+                <outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="Hz6-mo-xeY">
+            <rect key="frame" x="0.0" y="0.0" width="480" height="40"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <customView translatesAutoresizingMaskIntoConstraints="NO" id="LdM-b2-48C">
+                    <rect key="frame" x="8" y="0.0" width="464" height="40"/>
+                    <subviews>
+                        <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="EPJ-sc-6wa">
+                            <rect key="frame" x="16" y="10" width="20" height="20"/>
+                            <constraints>
+                                <constraint firstAttribute="width" constant="20" id="Ywl-Eq-mjQ"/>
+                                <constraint firstAttribute="height" constant="20" id="hZR-Bt-Rqf"/>
+                            </constraints>
+                            <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="3Et-Pz-ChQ"/>
+                        </imageView>
+                        <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="8KY-8V-DxN">
+                            <rect key="frame" x="42" y="12" width="37" height="16"/>
+                            <constraints>
+                                <constraint firstAttribute="height" constant="16" id="Uy1-J7-rZg"/>
+                            </constraints>
+                            <textFieldCell key="cell" lineBreakMode="clipping" title="Label" id="Ikm-0K-43v">
+                                <font key="font" metaFont="system"/>
+                                <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+                                <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+                            </textFieldCell>
+                        </textField>
+                    </subviews>
+                    <constraints>
+                        <constraint firstItem="8KY-8V-DxN" firstAttribute="centerY" secondItem="LdM-b2-48C" secondAttribute="centerY" id="QhX-B6-0Gz"/>
+                        <constraint firstItem="EPJ-sc-6wa" firstAttribute="centerY" secondItem="LdM-b2-48C" secondAttribute="centerY" id="S3d-gc-JcD"/>
+                        <constraint firstItem="8KY-8V-DxN" firstAttribute="leading" secondItem="EPJ-sc-6wa" secondAttribute="trailing" constant="8" id="WvN-xe-2DQ"/>
+                        <constraint firstItem="EPJ-sc-6wa" firstAttribute="leading" secondItem="LdM-b2-48C" secondAttribute="leading" constant="16" id="ySs-Bg-GIy"/>
+                    </constraints>
+                </customView>
+            </subviews>
+            <constraints>
+                <constraint firstItem="LdM-b2-48C" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="8" id="3Z0-5E-Ft2"/>
+                <constraint firstAttribute="trailing" secondItem="LdM-b2-48C" secondAttribute="trailing" constant="8" id="QxU-Q6-tXm"/>
+                <constraint firstAttribute="bottom" secondItem="LdM-b2-48C" secondAttribute="bottom" id="Yfe-zv-dSm"/>
+                <constraint firstItem="LdM-b2-48C" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="vKN-hS-h44"/>
+            </constraints>
+            <point key="canvasLocation" x="157" y="45"/>
+        </customView>
+    </objects>
+</document>

+ 161 - 0
KMAdvertisement/UI/List/KMAdvertisementTableView.swift

@@ -0,0 +1,161 @@
+//
+//  KMAdvertisementTableView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+#if os(OSX)
+    import AppKit
+#elseif os(iOS)
+    import UIKit
+#endif
+open class KMAdvertisementTableView: KMAdvertisementBaseView {
+
+    @IBOutlet var contentView: NSView!
+    
+    @IBOutlet weak var collectionView: NSCollectionView!
+    lazy var presenter: KMAdvertisementTableViewPresenter! = KMAdvertisementTableViewPresenter()
+
+    /**
+      @abstract 外部传入数据
+      @param inputData 文件路劲
+      */
+    open var inputData: KMAdvertisementModel! {
+        didSet {
+            self.presenter.initPresenter(view: self, data: inputData)
+        }
+    }
+
+    //内部使用数据
+    fileprivate var data: [KMAdvertisementModel.Section]?
+
+    open override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    convenience init (data: KMAdvertisementModel, superView: NSView) {
+        self.init(frame: superView.bounds)
+        self.presenter.initPresenter(view: self, data: data)
+        superView.addSubview(self)
+        self.autoresizingMask = [.height , .width]
+//        self.translatesAutoresizingMaskIntoConstraints = false
+//        NSLayoutConstraint.activate([
+//            self.topAnchor.constraint(equalTo: topAnchor),
+//            self.leftAnchor.constraint(equalTo: leftAnchor),
+//            self.rightAnchor.constraint(equalTo: rightAnchor),
+//            self.bottomAnchor.constraint(equalTo: bottomAnchor)])
+//        self.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    public override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        initContentView()
+        setup()
+    }
+    
+    // MARK: 初始化
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+
+    private func initContentView() {
+        //绑定xib
+        let resource = NSNib(nibNamed: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))!
+        resource.instantiate(withOwner: self, topLevelObjects: nil)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    func setup() {
+        //设置代理
+        self.collectionView.delegate = self
+        self.collectionView.dataSource = self
+        //是否可选中
+        self.collectionView.isSelectable = true
+        //注册cell
+        self.collectionView.register(KMAdvertisementCollectionViewItem.self, forItemWithIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMAdvertisementCollectionViewItem"))
+    }
+}
+
+extension KMAdvertisementTableView: KMAdvertisementTableViewPresenterDelegate {
+    func showData(presenter: KMAdvertisementTableViewPresenter, data: Array<KMAdvertisementModel.Section>) {
+        self.data = data
+        self.collectionView.reloadData()
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDelegate {
+    //当item被选中
+    public func collectionView(_ collectionView: NSCollectionView, didSelectItemsAt indexPaths: Set<IndexPath>) {
+        let view = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+        
+        var content = view.model
+        if actionCompletion != nil {
+            content?.index = indexPaths.first?.item
+            actionCompletion!(content!)
+        }
+    }
+    
+   //当item取消选中
+    public func collectionView(_ collectionView: NSCollectionView, didDeselectItemsAt indexPaths: Set<IndexPath>) {
+        let view = collectionView.item(at: indexPaths.first!) as! KMAdvertisementCollectionViewItem
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDataSource {
+    public func numberOfSections(in collectionView: NSCollectionView) -> Int {
+        return self.data?.count ?? 0
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int {
+        let model: KMAdvertisementModel.Section = (self.data?[section])!
+        return model.content.count
+    }
+    
+    //返回对应的item自定义个体
+    public func collectionView(_ collectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem {
+        let view = collectionView.makeItem(withIdentifier: NSUserInterfaceItemIdentifier(rawValue: "KMAdvertisementCollectionViewItem"), for: indexPath) as! KMAdvertisementCollectionViewItem
+        
+        let model = self.data?[indexPath.section]
+        view.model = model?.content[indexPath.item]
+        return view
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, viewForSupplementaryElementOfKind kind: NSCollectionView.SupplementaryElementKind, at indexPath: IndexPath) -> NSView {
+        var nibName: String?
+        if kind == NSCollectionView.elementKindSectionHeader {
+            nibName = "KMAdvertisementCollectionHeadView"
+        }
+        
+        let view = collectionView.makeSupplementaryView(ofKind: kind, withIdentifier: NSUserInterfaceItemIdentifier(rawValue: nibName!), for: indexPath)
+        if let view = view as? KMAdvertisementCollectionHeadView {
+            let model = self.data?[indexPath.section]
+            view.model = model
+        }
+        return view
+    }
+}
+
+extension KMAdvertisementTableView: NSCollectionViewDelegateFlowLayout {
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> NSSize {
+        return NSSize(width: self.contentView.bounds.width, height: 40)
+    }
+    
+    public func collectionView(_ collectionView: NSCollectionView, layout collectionViewLayout: NSCollectionViewLayout, referenceSizeForHeaderInSection section: Int) -> NSSize {
+        return NSSize(width: 0, height: 30)
+    }
+    
+}

+ 57 - 0
KMAdvertisement/UI/List/KMAdvertisementTableView.xib

@@ -0,0 +1,57 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementTableView" customModule="KMAdvertisement" customModuleProvider="target">
+            <connections>
+                <outlet property="collectionView" destination="DM1-E5-H8J" id="npq-W6-KFs"/>
+                <outlet property="contentView" destination="c22-O7-iKe" id="PMK-sn-xgD"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="NSObject"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="549" height="364"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <scrollView wantsLayer="YES" autohidesScrollers="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" hasHorizontalScroller="NO" usesPredominantAxisScrolling="NO" translatesAutoresizingMaskIntoConstraints="NO" id="UFo-Fd-Vqk">
+                    <rect key="frame" x="0.0" y="0.0" width="549" height="364"/>
+                    <clipView key="contentView" drawsBackground="NO" id="M51-ZI-aP5">
+                        <rect key="frame" x="1" y="1" width="547" height="362"/>
+                        <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+                        <subviews>
+                            <collectionView id="DM1-E5-H8J">
+                                <rect key="frame" x="0.0" y="0.0" width="547" height="362"/>
+                                <autoresizingMask key="autoresizingMask" widthSizable="YES"/>
+                                <collectionViewFlowLayout key="collectionViewLayout" minimumInteritemSpacing="10" minimumLineSpacing="10" id="QQ0-er-OSn">
+                                    <size key="itemSize" width="50" height="50"/>
+                                </collectionViewFlowLayout>
+                                <color key="primaryBackgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                            </collectionView>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                    </clipView>
+                    <scroller key="horizontalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="YES" id="PAQ-UO-Nz6">
+                        <rect key="frame" x="-100" y="-100" width="233" height="15"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                    <scroller key="verticalScroller" hidden="YES" wantsLayer="YES" verticalHuggingPriority="750" horizontal="NO" id="BXa-fT-rRG">
+                        <rect key="frame" x="234" y="1" width="15" height="143"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                    </scroller>
+                </scrollView>
+            </subviews>
+            <constraints>
+                <constraint firstAttribute="bottom" secondItem="UFo-Fd-Vqk" secondAttribute="bottom" id="KWL-Zf-KFW"/>
+                <constraint firstItem="UFo-Fd-Vqk" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="ShF-i8-p4g"/>
+                <constraint firstItem="UFo-Fd-Vqk" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="oVj-wf-0sg"/>
+                <constraint firstAttribute="trailing" secondItem="UFo-Fd-Vqk" secondAttribute="trailing" id="v5c-3v-n9k"/>
+            </constraints>
+            <point key="canvasLocation" x="44" y="184"/>
+        </customView>
+    </objects>
+</document>

+ 62 - 0
KMAdvertisement/UI/List/Presenter/KMAdvertisementTableViewPresenter.swift

@@ -0,0 +1,62 @@
+//
+//  KMAdvertisementTablePresenter.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/28.
+//
+
+class KMAdvertisementTableViewPresenter: NSObject {
+    lazy var modelData: [KMAdvertisementModel.Section] = []
+    var view: AnyObject?
+    fileprivate weak var delegate: KMAdvertisementTableViewPresenterDelegate?
+}
+
+extension KMAdvertisementTableViewPresenter: KMAdvertisementTableViewPresenterProtocol {
+    /**
+     初始化presenter
+     */
+    func initPresenter(view:AnyObject, data: KMAdvertisementModel) {
+        self.delegate = view as? any KMAdvertisementTableViewPresenterDelegate
+        
+        self.modelData.removeAll()
+        let array = data.content
+        
+        for item in array {
+            self.modelData.append(item)
+        }
+        self.delegate?.showData(presenter: self, data: self.modelData)
+    }
+    
+    func cleanAll() {
+        self.modelData.removeAll()
+        self.delegate?.showData(presenter: self, data: self.modelData)
+    }
+    
+    func free() {
+        view = nil
+        delegate = nil
+    }
+}
+
+
+protocol KMAdvertisementTableViewPresenterDelegate: AnyObject {
+    /**
+     @abstract 回调,返回处理后的数据<KMBatchProcessingViewModel>类型
+     @param presenter
+     @param data 返回数据
+     */
+    func showData(presenter: KMAdvertisementTableViewPresenter, data: Array<KMAdvertisementModel.Section>)
+}
+
+protocol KMAdvertisementTableViewPresenterProtocol {
+    /**
+     @abstract 绑定视图与数据
+     @param view 视图
+     @param data 资源 <KMBatchProcessingViewModel>类型
+     */
+    func initPresenter(view:AnyObject, data: KMAdvertisementModel)
+    /**
+     @abstract 解除绑定
+     */
+    func free()
+}

+ 124 - 0
KMAdvertisement/UI/Scroll/iOS/KMAdvertisementFlowLayout.swift

@@ -0,0 +1,124 @@
+//
+//  KMAdvertisementFlowLayout.swift
+//  KMAdvertisement_iOS
+//
+//  Created by lizhe on 2022/12/2.
+//
+
+import UIKit
+class KMAdvertisementFlowLayout: UICollectionViewFlowLayout {
+    
+    ///单元格的宽度
+    private let K_CELL_WIDTH: CGFloat = 260
+    
+    override init() {
+        super.init()
+        
+        itemSize = CGSize(width: K_CELL_WIDTH, height: 360) //cell的大小自定义
+        scrollDirection = .horizontal
+        minimumLineSpacing = 0
+    }
+    
+    required init?(coder aDecoder: NSCoder) {
+        fatalError("init(coder:) has not been implemented")
+    }
+    
+    override func shouldInvalidateLayout(forBoundsChange newBounds: CGRect) -> Bool {
+        return true
+    }
+    
+    /// 不想频繁去取值, 直接提出来一个属性, 然后直接计算出半宽
+    var collectionViewFrameWidth: CGFloat = 0 {
+        didSet {
+            collectionViewFrameWidthHalf = collectionViewFrameWidth / 2
+        }
+    }
+    
+    var collectionViewFrameWidthHalf: CGFloat = 0
+    
+    var collectionViewFrameHeight: CGFloat = 0
+    
+    /// 不想每次都去创建这个属性,所以提出来
+    var visibleRect = CGRect.zero
+    
+    /// 把相关属性初始化放到一起,初始化一次就可以了,在
+    func needViewInfo() {
+        
+        if collectionViewFrameWidth != collectionView?.frame.width {
+            collectionViewFrameWidth = collectionView?.frame.width ?? 0
+            let offsetXY = (collectionViewFrameWidth - K_CELL_WIDTH) / 2
+            //在滑动到左右两端的时候, 需要让头尾的cell居中显示,那就需要设置边缘距离, 这个距离就是 屏幕宽-cell宽 除以 2
+            sectionInset = UIEdgeInsets(top: 0, left: 20, bottom: 0, right: 20)
+        }
+        
+        if collectionViewFrameHeight != collectionView?.frame.height {
+            collectionViewFrameHeight = collectionView?.frame.height ?? 0
+        }
+    }
+    
+    
+    override func layoutAttributesForElements(in rect: CGRect) -> [UICollectionViewLayoutAttributes]? {
+        
+        //先做一下相关属性的初始化
+        needViewInfo()
+        
+        //可视区域
+        visibleRect.origin = collectionView?.contentOffset ?? CGPoint.zero
+        visibleRect.size = collectionView?.frame.size ?? CGSize.zero
+        
+        //屏幕中线
+        let centerX = visibleRect.midX
+        
+        ///获取到可以看见的cell的数组,看不见的cell就不要了 如果这里传入 rect, 那获取到的就是所有缓存中的cell, 并不是全部的总cell个数
+        let array = super.layoutAttributesForElements(in: visibleRect) ?? []
+        
+        for attributes in array {
+            
+            // 随着滑动, centerX 是一直都在改变的, 但是每个cell的 attributes.center.x 是不变的
+            let distance = abs(centerX - attributes.center.x)  //for循环中当前cell和可见区域的中心点的距离
+            
+            let scaleRate = distance / (collectionView?.bounds.width ?? 0)
+            
+            // 使用 cos 函数,把缩放的比值转换成一个 1 以为的数值
+            // 在 scaleRate 后面乘上一个数,就可以控制卡片缩放的剧烈程度
+            let scale = abs(cos(scaleRate * 0.4))
+            
+            //scaleRate == 0, 越是接近 centerX 的那个 attribute, 他的缩放就越接近于1(就是cell原来的大小), 可以直接使用这样的缩放,这样的缩放,卡片的大小变化不剧烈
+            //let scale = abs(cos(scaleRate))
+            
+            attributes.transform3D = CATransform3DMakeScale(scale, scale, 1)
+        }
+        return array
+    }
+    
+    override func targetContentOffset(forProposedContentOffset proposedContentOffset: CGPoint, withScrollingVelocity velocity: CGPoint) -> CGPoint {
+        
+        //被推出屏幕的长度 + 屏幕宽度的一半
+        let horizontalCenter = proposedContentOffset.x + collectionViewFrameWidthHalf
+        
+        //获取一个当前CollectionView的尺寸大小,然后这个尺寸的 X 就是滑动停止时候的偏移
+        let targetRect = CGRect(x: proposedContentOffset.x, y: 0.0, width: collectionViewFrameWidth, height: collectionViewFrameHeight)
+        
+        //用这个方法取得当前能看到的所有的cell
+        let array = super.layoutAttributesForElements(in: targetRect) ?? []
+        
+        //记录每次遍历取到的最小的距离中心的距离
+        var nearestCenterOne = CGFloat(MAXFLOAT)
+        
+        //记录距离中心最近的那个layoutitem的中心点x
+        var shouldBeX: CGFloat = 0
+        
+        //遍历当前数组里面的元素,找到里中心点最近的那个元素,把这个元素的中心位置拿到,然后返回给函数
+        for layoutAttributes in array {
+            let currentX = layoutAttributes.center.x
+            let currentDistance = abs(currentX - horizontalCenter)
+            if currentDistance < nearestCenterOne {
+                nearestCenterOne = currentDistance
+                shouldBeX = currentX
+            }
+        }
+        
+        let X = shouldBeX - collectionViewFrameWidthHalf
+        return CGPoint(x: X , y: proposedContentOffset.y)
+    }
+}

+ 84 - 0
KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScrollCell_iOS.swift

@@ -0,0 +1,84 @@
+//
+//  KMAdvertisementShowScrollCell_iOS.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/29.
+//
+
+import UIKit
+import Kingfisher
+
+class KMAdvertisementShowScrollCell_iOS: UICollectionViewCell {
+
+    @IBOutlet weak var cancelButton: UIButton!
+    @IBOutlet weak var titleLabel: UILabel!
+    @IBOutlet weak var actionButton: UIButton!
+    @IBOutlet weak var imageView: UIImageView!
+    
+    var model: KMAdvertisementModel.Section.Content! {
+        didSet {
+            self.reloadData()
+        }
+    }
+    
+    override func awakeFromNib() {
+        super.awakeFromNib()
+        // Initialization code
+//        self.backgroundColor = UIColor.init(red: CGFloat(arc4random()%255)/255.0, green: CGFloat(arc4random()%255)/255.0, blue: CGFloat(arc4random()%255)/255.0, alpha: 1)
+        
+        let bundle = Bundle(for: self.classForCoder.self)
+        let path = bundle.path(forResource: "KMAdvertisement", ofType: "bundle") ?? ""
+        let sdkBundle = Bundle(path: path)
+        let filePath = sdkBundle?.path(forResource: "ad_cancel_button00@2x", ofType: "png")
+        let image = UIImage.init(contentsOfFile: filePath!)
+        self.cancelButton.setTitle("", for: UIControl.State.normal)
+        self.cancelButton.setImage(image, for: UIControl.State.normal)
+        self.cancelButton.isHidden = true
+        
+        self.actionButton.setTitle("", for: UIControl.State.normal)
+    }
+    
+    func reloadData() {
+        if model?.title?.language != nil {
+            self.titleLabel.text = KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.title?.language)
+        }
+        
+        self.titleLabel.font = UIFont.init(name: model?.title?.font?.name ?? "AppleSystemUIFont", size: CGFloat(model?.title?.font?.size ?? 13))
+        
+        self.actionButton.clipsToBounds = true
+        self.actionButton.layer.cornerRadius = model.button?.background?.layer?.cornerRadius ?? 15
+        self.actionButton.layer.borderWidth = model.button?.background?.layer?.borderWidth ?? 0
+        self.actionButton.titleLabel?.font = UIFont.init(name: model?.button?.font?.name ?? "AppleSystemUIFont", size: CGFloat(model?.button?.font?.size ?? 13))
+        
+        if model?.button?.language != nil {
+            self.actionButton.setTitle(KMAdvertisementModelTransition.transitionLanguage(langeuage: model?.button?.language), for: UIControl.State.normal)
+        }
+        
+        self.imageView.clipsToBounds = true
+        self.imageView.layer.cornerRadius = model.imageURL?.background?.layer?.cornerRadius ?? 8
+        self.imageView.layer.borderWidth = model.imageURL?.background?.layer?.borderWidth ?? 0
+        
+
+        
+        self.updateColor(highlight: false)
+    }
+    
+    func updateColor(highlight: Bool) {
+        if model.title?.color != nil {
+            self.titleLabel.textColor = KMAdvertisementModelTransition.transitionColor(color: (model.title?.color)!, highlight: highlight)
+        }
+        
+        if model.button?.background?.color != nil {
+            self.actionButton.layer.borderColor = KMAdvertisementModelTransition.transitionColor(color: (model.button?.background?.color)!, highlight: highlight).cgColor
+        }
+        
+        if model.button?.color != nil {
+            self.actionButton.tintColor = KMAdvertisementModelTransition.transitionColor(color: (model.button?.color)!, highlight: highlight)
+        }
+        
+        if model.imageURL != nil {
+            self.imageView?.kf.setImage(with: URL(string: KMAdvertisementModelTransition.transitionImagePath(image: model.imageURL!, highlight: highlight)))
+        }
+    }
+    
+}

+ 84 - 0
KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScrollCell_iOS.xib

@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" id="gTV-IL-0wX" customClass="KMAdvertisementShowScrollCell_iOS" customModule="KMAdvertisement_iOS">
+            <rect key="frame" x="0.0" y="0.0" width="419" height="177"/>
+            <autoresizingMask key="autoresizingMask"/>
+            <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
+                <rect key="frame" x="0.0" y="0.0" width="419" height="177"/>
+                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+                <subviews>
+                    <view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="XtI-lf-3qm">
+                        <rect key="frame" x="0.0" y="0.0" width="419" height="177"/>
+                        <subviews>
+                            <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="S1l-ax-W4L">
+                                <rect key="frame" x="0.0" y="0.0" width="419" height="177"/>
+                            </imageView>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="L11-6G-kQd">
+                                <rect key="frame" x="389" y="0.0" width="30" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="width" constant="30" id="SNb-HC-Oym"/>
+                                    <constraint firstAttribute="height" constant="30" id="ddk-Iy-jBx"/>
+                                </constraints>
+                                <state key="normal" title="Button"/>
+                                <buttonConfiguration key="configuration" style="plain"/>
+                            </button>
+                            <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ABS-FS-7M4">
+                                <rect key="frame" x="16" y="8" width="365" height="0.0"/>
+                                <fontDescription key="fontDescription" type="system" pointSize="20"/>
+                                <color key="textColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                                <nil key="highlightedColor"/>
+                            </label>
+                            <button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="QBX-6W-Yi5">
+                                <rect key="frame" x="16" y="131" width="24" height="30"/>
+                                <constraints>
+                                    <constraint firstAttribute="height" constant="30" id="PrR-yQ-T9J"/>
+                                </constraints>
+                                <inset key="contentEdgeInsets" minX="12" minY="0.0" maxX="12" maxY="0.0"/>
+                                <inset key="imageEdgeInsets" minX="0.0" minY="0.0" maxX="2.2250738585072014e-308" maxY="0.0"/>
+                            </button>
+                        </subviews>
+                        <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+                        <constraints>
+                            <constraint firstItem="QBX-6W-Yi5" firstAttribute="leading" secondItem="XtI-lf-3qm" secondAttribute="leading" constant="16" id="AO7-Aw-4S1"/>
+                            <constraint firstItem="ABS-FS-7M4" firstAttribute="leading" secondItem="XtI-lf-3qm" secondAttribute="leading" constant="16" id="JFg-bF-WNQ"/>
+                            <constraint firstItem="L11-6G-kQd" firstAttribute="top" secondItem="XtI-lf-3qm" secondAttribute="top" id="KQt-bx-6lz"/>
+                            <constraint firstAttribute="bottom" secondItem="QBX-6W-Yi5" secondAttribute="bottom" constant="16" id="QZM-r9-QvC"/>
+                            <constraint firstAttribute="bottom" secondItem="S1l-ax-W4L" secondAttribute="bottom" id="Rxm-B4-fEX"/>
+                            <constraint firstItem="S1l-ax-W4L" firstAttribute="top" secondItem="XtI-lf-3qm" secondAttribute="top" id="U8n-Qj-0Ne"/>
+                            <constraint firstAttribute="trailing" secondItem="ABS-FS-7M4" secondAttribute="trailing" constant="38" id="ZxD-1H-gfE"/>
+                            <constraint firstAttribute="trailing" secondItem="L11-6G-kQd" secondAttribute="trailing" id="aTI-X8-hgk"/>
+                            <constraint firstItem="S1l-ax-W4L" firstAttribute="leading" secondItem="XtI-lf-3qm" secondAttribute="leading" id="b2S-kG-uSp"/>
+                            <constraint firstItem="ABS-FS-7M4" firstAttribute="top" secondItem="XtI-lf-3qm" secondAttribute="top" constant="8" id="oWj-Q5-WHf"/>
+                            <constraint firstAttribute="trailing" secondItem="S1l-ax-W4L" secondAttribute="trailing" id="vIh-ug-YNJ"/>
+                        </constraints>
+                    </view>
+                </subviews>
+            </view>
+            <viewLayoutGuide key="safeArea" id="ZTg-uK-7eu"/>
+            <constraints>
+                <constraint firstAttribute="trailing" secondItem="XtI-lf-3qm" secondAttribute="trailing" id="0gp-k9-BBQ"/>
+                <constraint firstAttribute="bottom" secondItem="XtI-lf-3qm" secondAttribute="bottom" id="698-Pt-PwJ"/>
+                <constraint firstItem="XtI-lf-3qm" firstAttribute="top" secondItem="gTV-IL-0wX" secondAttribute="top" id="U8T-xn-D5R"/>
+                <constraint firstItem="XtI-lf-3qm" firstAttribute="leading" secondItem="gTV-IL-0wX" secondAttribute="leading" id="dyG-Mi-96q"/>
+            </constraints>
+            <size key="customSize" width="419" height="177"/>
+            <connections>
+                <outlet property="actionButton" destination="QBX-6W-Yi5" id="41w-J6-MwA"/>
+                <outlet property="cancelButton" destination="L11-6G-kQd" id="KSI-uc-hUi"/>
+                <outlet property="imageView" destination="S1l-ax-W4L" id="YwY-A5-Zr2"/>
+                <outlet property="titleLabel" destination="ABS-FS-7M4" id="p4Y-wS-n4k"/>
+            </connections>
+            <point key="canvasLocation" x="41.984732824427482" y="63.732394366197184"/>
+        </collectionViewCell>
+    </objects>
+</document>

+ 136 - 0
KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScroll_iOS.swift

@@ -0,0 +1,136 @@
+//
+//  KMAdvertisementShowScroll_iOS.swift
+//  KMAdvertisement_iOS
+//
+//  Created by lizhe on 2022/11/29.
+//
+
+import UIKit
+
+
+open class KMAdvertisementShowScroll_iOS: KMAdvertisementBaseView {
+
+    @IBOutlet var contentView: UIView!
+    // MARK: 初始化
+    @IBOutlet weak var collectionView: UICollectionView!
+    
+    lazy var presenter: KMAdvertisementTableViewPresenter! = KMAdvertisementTableViewPresenter()
+    
+    //内部使用数据
+    fileprivate var data: [KMAdvertisementModel.Section]?
+    /**
+      @abstract 外部传入数据
+      @param inputData 文件路劲
+      */
+    open var inputData: KMAdvertisementModel! {
+        didSet {
+            self.presenter.initPresenter(view: self, data: inputData)
+        }
+    }
+    
+    convenience init (data: KMAdvertisementModel, superView: UIView) {
+        self.init(frame: superView.bounds)
+        self.presenter.initPresenter(view: self, data: data)
+        superView.addSubview(self)
+        self.autoresizingMask = [.flexibleHeight , .flexibleWidth]
+    }
+    
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+    
+    public override init(frame: CGRect) {
+        super.init(frame: frame)
+        initContentView()
+        setup()
+    }
+
+    private func initContentView() {
+        //绑定xib
+        let resource = UINib(nibName: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))
+        resource.instantiate(withOwner: self)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsIfNeeded()
+    }
+    
+    func setup() {
+        //设置代理
+        let layout = KMAdvertisementFlowLayout()
+        //设置滚动方向
+        layout.scrollDirection = .horizontal
+//        layout.minimumLineSpacing = 10
+        
+        self.collectionView.collectionViewLayout = layout
+        self.collectionView.delegate = self
+        self.collectionView.dataSource = self
+        self.collectionView.showsHorizontalScrollIndicator = false
+        self.collectionView.showsVerticalScrollIndicator = false
+//        self.collectionView.isPagingEnabled = true
+        self.collectionView.register(UINib(nibName: "KMAdvertisementShowScrollCell_iOS", bundle: nil), forCellWithReuseIdentifier: "KMAdvertisementShowScrollCell_iOS")
+        self.collectionView.reloadData()
+    }
+    
+    public func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
+         print("scrollViewDidEndDragging")
+    }
+}
+
+extension KMAdvertisementShowScroll_iOS: KMAdvertisementTableViewPresenterDelegate {
+    func showData(presenter: KMAdvertisementTableViewPresenter, data: Array<KMAdvertisementModel.Section>) {
+        self.data = data
+        self.collectionView.reloadData()
+    }
+}
+
+extension KMAdvertisementShowScroll_iOS: UICollectionViewDelegate {
+    public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
+        if self.data != nil {
+            let model = (self.data?[indexPath.section])
+            var content = model?.content[indexPath.item]
+            if actionCompletion != nil {
+                content?.index = indexPath.item
+                actionCompletion!(content!)
+            }
+        }
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, didDeselectItemAt indexPath: IndexPath) {
+        print("取消选中")
+    }
+}
+
+extension KMAdvertisementShowScroll_iOS: UICollectionViewDataSource {
+    public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
+        if self.data != nil {
+            let model: KMAdvertisementModel.Section = (self.data?[section])!
+            return model.content.count
+        } else {
+            return 0
+        }
+    }
+    
+    public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
+        let cell: KMAdvertisementShowScrollCell_iOS = collectionView.dequeueReusableCell(withReuseIdentifier: "KMAdvertisementShowScrollCell_iOS", for: indexPath) as! KMAdvertisementShowScrollCell_iOS
+        if self.data != nil {
+            let model = (self.data?[indexPath.section])
+            cell.model = model?.content[indexPath.item]
+        }
+
+        return cell
+    }
+}
+
+extension KMAdvertisementShowScroll_iOS: UICollectionViewDelegateFlowLayout {
+    public func collectionView(_ collectionView: UICollectionView, layout collectionViewLayout: UICollectionViewLayout, sizeForItemAt indexPath: IndexPath) -> CGSize {
+        return CGSizeMake(self.contentView.bounds.width - 40, self.contentView.bounds.height)
+    }
+}

+ 51 - 0
KMAdvertisement/UI/Scroll/iOS/KMAdvertisementShowScroll_iOS.xib

@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KMAdvertisementShowScroll_iOS" customModule="KMAdvertisement_iOS">
+            <connections>
+                <outlet property="collectionView" destination="fgr-8e-fgc" id="Sre-IR-1my"/>
+                <outlet property="contentView" destination="iN0-l3-epB" id="wkq-d2-mLP"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="iN0-l3-epB">
+            <rect key="frame" x="0.0" y="0.0" width="391" height="221"/>
+            <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+            <subviews>
+                <collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="none" translatesAutoresizingMaskIntoConstraints="NO" id="fgr-8e-fgc">
+                    <rect key="frame" x="0.0" y="0.0" width="391" height="221"/>
+                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                    <collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="10" minimumInteritemSpacing="10" id="qoP-II-eKq">
+                        <size key="itemSize" width="128" height="128"/>
+                        <size key="headerReferenceSize" width="0.0" height="0.0"/>
+                        <size key="footerReferenceSize" width="0.0" height="0.0"/>
+                        <inset key="sectionInset" minX="0.0" minY="0.0" maxX="0.0" maxY="0.0"/>
+                    </collectionViewFlowLayout>
+                </collectionView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="vUN-kp-3ea"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="trailing" secondItem="fgr-8e-fgc" secondAttribute="trailing" id="4rf-wT-SFF"/>
+                <constraint firstItem="fgr-8e-fgc" firstAttribute="top" secondItem="iN0-l3-epB" secondAttribute="top" id="Q4L-zX-UPG"/>
+                <constraint firstItem="vUN-kp-3ea" firstAttribute="bottom" secondItem="fgr-8e-fgc" secondAttribute="bottom" id="Tlz-dX-VlE"/>
+                <constraint firstItem="fgr-8e-fgc" firstAttribute="leading" secondItem="vUN-kp-3ea" secondAttribute="leading" id="tH4-ZK-Hyc"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="-260" y="-202"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 106 - 0
KMAdvertisement/UI/View/Mac/KMAdvertisementShowView.swift

@@ -0,0 +1,106 @@
+//
+//  KMAdvertisementShowView.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/29.
+//
+
+import Cocoa
+
+open class KMAdvertisementShowView: KMAdvertisementBaseView {
+
+    @IBOutlet var contentView: NSView!
+    
+    @IBOutlet weak var cancelButton: NSButton!
+    
+    @IBOutlet weak var imageView: NSImageView!
+    
+    lazy var presenter: KMAdvertisementTableViewPresenter! = KMAdvertisementTableViewPresenter()
+    
+    //内部使用数据
+    fileprivate var data: [KMAdvertisementModel.Section]?
+    /**
+      @abstract 外部传入数据
+      @param inputData 文件路劲
+      */
+    open var inputData: KMAdvertisementModel! {
+        didSet {
+            self.presenter.initPresenter(view: self, data: inputData)
+        }
+    }
+    
+    convenience init (data: KMAdvertisementModel, superView: NSView) {
+        self.init(frame: superView.bounds)
+        self.presenter.initPresenter(view: self, data: data)
+        superView.addSubview(self)
+        self.autoresizingMask = [.height , .width]
+    }
+    
+    // MARK: 初始化
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+    
+    public override init(frame frameRect: NSRect) {
+        super.init(frame: frameRect)
+        initContentView()
+        setup()
+    }
+    
+
+    private func initContentView() {
+        //绑定xib
+        let resource = NSNib(nibNamed: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))!
+        resource.instantiate(withOwner: self, topLevelObjects: nil)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsForSubtreeIfNeeded()
+    }
+    
+    func setup() {
+        let bundle = Bundle(for: self.classForCoder.self)
+        let path = bundle.path(forResource: "KMAdvertisement", ofType: "bundle") ?? ""
+        let sdkBundle = Bundle(path: path)
+        let filePath = sdkBundle?.pathForImageResource("ad_cancel_button00")
+        let image = NSImage.init(contentsOfFile: filePath!)
+        self.cancelButton.image = image
+    }
+    
+    public override func draw(_ dirtyRect: NSRect) {
+        super.draw(dirtyRect)
+
+        // Drawing code here.
+    }
+    
+    func reloadData() {
+     
+        let url = URL(string: self.data?.first?.content.first?.imageURL?.normal?.en ?? "")
+        self.imageView.kf.setImage(with: url)
+    }
+    
+    @IBAction func cancelAction(_ sender: Any) {
+        self.removeFromSuperview()
+    }
+    
+    open override func mouseDown(with event: NSEvent) {
+        let content = self.data?.first?.content.first
+        if actionCompletion != nil {
+            actionCompletion!(content!)
+        }
+    }
+}
+
+extension KMAdvertisementShowView: KMAdvertisementTableViewPresenterDelegate {
+    func showData(presenter: KMAdvertisementTableViewPresenter, data: Array<KMAdvertisementModel.Section>) {
+        self.data = data
+        self.reloadData()
+    }
+}

+ 55 - 0
KMAdvertisement/UI/View/Mac/KMAdvertisementShowView.xib

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+    <dependencies>
+        <deployment identifier="macosx"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <customObject id="-2" userLabel="File's Owner" customClass="KMAdvertisementShowView" customModule="KMAdvertisement" customModuleProvider="target">
+            <connections>
+                <outlet property="cancelButton" destination="ijB-Nx-rI3" id="uqF-fz-P2p"/>
+                <outlet property="contentView" destination="c22-O7-iKe" id="3av-vF-JNc"/>
+                <outlet property="imageView" destination="Et8-2q-NGR" id="qJ4-8l-pEU"/>
+            </connections>
+        </customObject>
+        <customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
+        <customObject id="-3" userLabel="Application" customClass="imag"/>
+        <customView id="c22-O7-iKe">
+            <rect key="frame" x="0.0" y="0.0" width="345" height="162"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+            <subviews>
+                <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Et8-2q-NGR">
+                    <rect key="frame" x="0.0" y="0.0" width="345" height="162"/>
+                    <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" id="SzR-S9-0nQ"/>
+                </imageView>
+                <button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ijB-Nx-rI3">
+                    <rect key="frame" x="315" y="132" width="30" height="30"/>
+                    <constraints>
+                        <constraint firstAttribute="width" constant="30" id="r4M-KH-08D"/>
+                        <constraint firstAttribute="height" constant="30" id="uHN-Qc-u30"/>
+                    </constraints>
+                    <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" image="ad_cancel_button00" imagePosition="left" inset="2" id="oiT-2w-QYq">
+                        <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+                        <font key="font" metaFont="system"/>
+                    </buttonCell>
+                    <connections>
+                        <action selector="cancelAction:" target="-2" id="iQZ-kb-AtV"/>
+                    </connections>
+                </button>
+            </subviews>
+            <constraints>
+                <constraint firstItem="Et8-2q-NGR" firstAttribute="leading" secondItem="c22-O7-iKe" secondAttribute="leading" id="9dM-64-jPD"/>
+                <constraint firstItem="Et8-2q-NGR" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="Eez-FD-jpb"/>
+                <constraint firstAttribute="trailing" secondItem="Et8-2q-NGR" secondAttribute="trailing" id="EiI-hE-5Uy"/>
+                <constraint firstAttribute="bottom" secondItem="Et8-2q-NGR" secondAttribute="bottom" id="VwW-G5-K7P"/>
+                <constraint firstItem="ijB-Nx-rI3" firstAttribute="top" secondItem="c22-O7-iKe" secondAttribute="top" id="jds-XD-wke"/>
+                <constraint firstAttribute="trailing" secondItem="ijB-Nx-rI3" secondAttribute="trailing" id="ztv-ry-8VP"/>
+            </constraints>
+            <point key="canvasLocation" x="-108.5" y="-48"/>
+        </customView>
+    </objects>
+    <resources>
+        <image name="ad_cancel_button00" width="30" height="30"/>
+    </resources>
+</document>

+ 90 - 0
KMAdvertisement/UI/View/iOS/KMAdvertisementShowView_iOS.swift

@@ -0,0 +1,90 @@
+//
+//  KMAdvertisementShowView_iOS.swift
+//  KMAdvertisement
+//
+//  Created by lizhe on 2022/11/29.
+//
+
+import UIKit
+import Kingfisher
+
+open class KMAdvertisementShowView_iOS: KMAdvertisementBaseView {
+
+    @IBOutlet var contentView: UIView!
+    
+    @IBOutlet weak var imageView: UIImageView!
+    
+    lazy var presenter: KMAdvertisementTableViewPresenter! = KMAdvertisementTableViewPresenter()
+    
+    //内部使用数据
+    fileprivate var data: [KMAdvertisementModel.Section]?
+    /**
+      @abstract 外部传入数据
+      @param inputData 文件路劲
+      */
+    open var inputData: KMAdvertisementModel! {
+        didSet {
+            self.presenter.initPresenter(view: self, data: inputData)
+        }
+    }
+    
+    convenience init (data: KMAdvertisementModel, superView: UIView) {
+        self.init(frame: superView.bounds)
+        self.presenter.initPresenter(view: self, data: data)
+        superView.addSubview(self)
+        self.autoresizingMask = [.flexibleHeight , .flexibleWidth]
+    }
+    
+    // MARK: 初始化
+    public required init?(coder decoder: NSCoder) {
+        super.init(coder: decoder)
+        initContentView()
+        setup()
+    }
+    
+    public override init(frame: CGRect) {
+        super.init(frame: frame)
+        initContentView()
+        setup()
+    }
+
+    private func initContentView() {
+        //绑定xib
+        let resource = UINib(nibName: String(describing: self.classForCoder.self),
+                             bundle: Bundle(for: self.classForCoder.self))
+        resource.instantiate(withOwner: self)
+        addSubview(contentView)
+        contentView.translatesAutoresizingMaskIntoConstraints = false
+        NSLayoutConstraint.activate([
+            contentView.topAnchor.constraint(equalTo: topAnchor),
+            contentView.leftAnchor.constraint(equalTo: leftAnchor),
+            contentView.rightAnchor.constraint(equalTo: rightAnchor),
+            contentView.bottomAnchor.constraint(equalTo: bottomAnchor)])
+        contentView.updateConstraintsIfNeeded()
+    }
+    
+    func setup() {
+        let tap = UITapGestureRecognizer(target: self, action: #selector(buttonAction))
+        self.imageView.addGestureRecognizer(tap)
+        self.imageView.isUserInteractionEnabled = true
+       }
+    
+    func reloadData() {
+        let url = URL(string: self.data?.first?.content.first?.imageURL?.normal?.en ?? "")
+        self.imageView.kf.setImage(with: url)
+    }
+    
+    @objc func buttonAction() {
+        let content = self.data?.first?.content.first
+        if actionCompletion != nil {
+            actionCompletion!(content!)
+        }
+    }
+}
+
+extension KMAdvertisementShowView_iOS: KMAdvertisementTableViewPresenterDelegate {
+    func showData(presenter: KMAdvertisementTableViewPresenter, data: Array<KMAdvertisementModel.Section>) {
+        self.data = data
+        self.reloadData()
+    }
+}

+ 44 - 0
KMAdvertisement/UI/View/iOS/KMAdvertisementShowView_iOS.xib

@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="21507" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
+    <device id="retina6_12" orientation="portrait" appearance="light"/>
+    <dependencies>
+        <deployment identifier="iOS"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="21505"/>
+        <capability name="Safe area layout guides" minToolsVersion="9.0"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <objects>
+        <placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="KMAdvertisementShowView_iOS" customModule="KMAdvertisement_iOS">
+            <connections>
+                <outlet property="contentView" destination="lh2-T5-G3l" id="n0s-TT-w30"/>
+                <outlet property="imageView" destination="xDZ-XM-pRr" id="6qi-FE-loe"/>
+            </connections>
+        </placeholder>
+        <placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
+        <view contentMode="scaleToFill" id="lh2-T5-G3l">
+            <rect key="frame" x="0.0" y="0.0" width="507" height="204"/>
+            <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
+            <subviews>
+                <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="xDZ-XM-pRr">
+                    <rect key="frame" x="0.0" y="59" width="507" height="111"/>
+                </imageView>
+            </subviews>
+            <viewLayoutGuide key="safeArea" id="juu-uM-k6R"/>
+            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+            <constraints>
+                <constraint firstItem="xDZ-XM-pRr" firstAttribute="top" secondItem="juu-uM-k6R" secondAttribute="top" id="HOk-ti-Hy7"/>
+                <constraint firstItem="xDZ-XM-pRr" firstAttribute="leading" secondItem="juu-uM-k6R" secondAttribute="leading" id="YXN-IS-m9W"/>
+                <constraint firstItem="xDZ-XM-pRr" firstAttribute="trailing" secondItem="juu-uM-k6R" secondAttribute="trailing" id="hg2-lA-QtP"/>
+                <constraint firstItem="juu-uM-k6R" firstAttribute="bottom" secondItem="xDZ-XM-pRr" secondAttribute="bottom" id="ibA-3s-h0z"/>
+            </constraints>
+            <freeformSimulatedSizeMetrics key="simulatedDestinationMetrics"/>
+            <point key="canvasLocation" x="-454.19847328244271" y="79.577464788732399"/>
+        </view>
+    </objects>
+    <resources>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+    </resources>
+</document>

+ 11 - 0
KMAdvertisementDemo-Mac-Info.plist

@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>NSAppTransportSecurity</key>
+	<dict>
+		<key>NSAllowsArbitraryLoads</key>
+		<true/>
+	</dict>
+</dict>
+</plist>

+ 1 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/AFNetworking

@@ -0,0 +1 @@
+Versions/Current/AFNetworking

+ 1 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Headers

@@ -0,0 +1 @@
+Versions/Current/Headers

+ 1 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Modules

@@ -0,0 +1 @@
+Versions/Current/Modules

+ 1 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Resources

@@ -0,0 +1 @@
+Versions/Current/Resources

BIN
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/AFNetworking


+ 49 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFCompatibilityMacros.h

@@ -0,0 +1,49 @@
+// AFCompatibilityMacros.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#ifndef AFCompatibilityMacros_h
+#define AFCompatibilityMacros_h
+
+#ifdef API_AVAILABLE
+    #define AF_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
+#else
+    #define AF_API_AVAILABLE(...)
+#endif // API_AVAILABLE
+
+#ifdef API_UNAVAILABLE
+    #define AF_API_UNAVAILABLE(...) API_UNAVAILABLE(__VA_ARGS__)
+#else
+    #define AF_API_UNAVAILABLE(...)
+#endif // API_UNAVAILABLE
+
+#if __has_warning("-Wunguarded-availability-new")
+    #define AF_CAN_USE_AT_AVAILABLE 1
+#else
+    #define AF_CAN_USE_AT_AVAILABLE 0
+#endif
+
+#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
+    #define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
+#else
+    #define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
+#endif
+
+#endif /* AFCompatibilityMacros_h */

+ 285 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFHTTPSessionManager.h

@@ -0,0 +1,285 @@
+// AFHTTPSessionManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+#endif
+#import <TargetConditionals.h>
+
+#import "AFURLSessionManager.h"
+
+/**
+ `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths.
+
+ ## Subclassing Notes
+
+ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
+
+ ## Methods to Override
+
+ To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`.
+
+ ## Serialization
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
+ Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
+
+ ## URL Construction Using Relative Paths
+
+ For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`.
+
+ Below are a few examples of how `baseURL` and relative paths interact:
+
+    NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"];
+    [NSURL URLWithString:@"foo" relativeToURL:baseURL];                  // http://example.com/v1/foo
+    [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL];          // http://example.com/v1/foo?bar=baz
+    [NSURL URLWithString:@"/foo" relativeToURL:baseURL];                 // http://example.com/foo
+    [NSURL URLWithString:@"foo/" relativeToURL:baseURL];                 // http://example.com/v1/foo
+    [NSURL URLWithString:@"/foo/" relativeToURL:baseURL];                // http://example.com/foo/
+    [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/
+
+ Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash.
+
+ @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying>
+
+/**
+ The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
+ */
+@property (readonly, nonatomic, strong, nullable) NSURL *baseURL;
+
+/**
+ Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
+
+ @warning `requestSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+///-------------------------------
+/// @name Managing Security Policy
+///-------------------------------
+
+/**
+ The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. A security policy configured with `AFSSLPinningModePublicKey` or `AFSSLPinningModeCertificate` can only be applied on a session manager initialized with a secure base URL (i.e. https). Applying a security policy with pinning enabled on an insecure session manager throws an `Invalid Security Policy` exception.
+ */
+@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns an `AFHTTPSessionManager` object.
+ */
++ (instancetype)manager;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ @param url The base URL for the HTTP client.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ This is the designated initializer.
+
+ @param url The base URL for the HTTP client.
+ @param configuration The configuration used to create the managed session.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url
+           sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+
+///---------------------------
+/// @name Making HTTP Requests
+///---------------------------
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `GET` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
+                            parameters:(nullable id)parameters
+                               headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                              progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
+                               success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                               failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                success:(nullable void (^)(NSURLSessionDataTask *task))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `POST` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+              constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
+                            parameters:(nullable id)parameters
+                               headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                               success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                               failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
+                              parameters:(nullable id)parameters
+                                 headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                 success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                 failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
+                               parameters:(nullable id)parameters
+                                  headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                  success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                  failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates an `NSURLSessionDataTask` with a custom `HTTPMethod` request.
+
+ @param method The HTTPMethod string used to create the request.
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
+                                                URLString:(NSString *)URLString
+                                               parameters:(nullable id)parameters
+                                                  headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                           uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                         downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
+                                                  success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                                  failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 216 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFNetworkReachabilityManager.h

@@ -0,0 +1,216 @@
+// AFNetworkReachabilityManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+
+typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
+    AFNetworkReachabilityStatusUnknown          = -1,
+    AFNetworkReachabilityStatusNotReachable     = 0,
+    AFNetworkReachabilityStatusReachableViaWWAN = 1,
+    AFNetworkReachabilityStatusReachableViaWiFi = 2,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+ Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
+
+ See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ )
+
+ @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
+ */
+@interface AFNetworkReachabilityManager : NSObject
+
+/**
+ The current network reachability status.
+ */
+@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+
+/**
+ Whether or not the network is currently reachable.
+ */
+@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
+
+/**
+ Whether or not the network is currently reachable via WWAN.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
+
+/**
+ Whether or not the network is currently reachable via WiFi.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Returns the shared network reachability manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Creates and returns a network reachability manager with the default socket address.
+ 
+ @return An initialized network reachability manager, actively monitoring the default socket address.
+ */
++ (instancetype)manager;
+
+/**
+ Creates and returns a network reachability manager for the specified domain.
+
+ @param domain The domain used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified domain.
+ */
++ (instancetype)managerForDomain:(NSString *)domain;
+
+/**
+ Creates and returns a network reachability manager for the socket address.
+
+ @param address The socket address (`sockaddr_in6`) used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified socket address.
+ */
++ (instancetype)managerForAddress:(const void *)address;
+
+/**
+ Initializes an instance of a network reachability manager from the specified reachability object.
+
+ @param reachability The reachability object to monitor.
+
+ @return An initialized network reachability manager, actively monitoring the specified reachability.
+ */
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
+
+/**
+ *  Unavailable initializer
+ */
++ (instancetype)new NS_UNAVAILABLE;
+
+/**
+ *  Unavailable initializer
+ */
+- (instancetype)init NS_UNAVAILABLE;
+
+///--------------------------------------------------
+/// @name Starting & Stopping Reachability Monitoring
+///--------------------------------------------------
+
+/**
+ Starts monitoring for changes in network reachability status.
+ */
+- (void)startMonitoring;
+
+/**
+ Stops monitoring for changes in network reachability status.
+ */
+- (void)stopMonitoring;
+
+///-------------------------------------------------
+/// @name Getting Localized Reachability Description
+///-------------------------------------------------
+
+/**
+ Returns a localized string representation of the current network reachability status.
+ */
+- (NSString *)localizedNetworkReachabilityStatusString;
+
+///---------------------------------------------------
+/// @name Setting Network Reachability Change Callback
+///---------------------------------------------------
+
+/**
+ Sets a callback to be executed when the network availability of the `baseURL` host changes.
+
+ @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`.
+ */
+- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Network Reachability
+
+ The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses.
+
+ enum {
+ AFNetworkReachabilityStatusUnknown,
+ AFNetworkReachabilityStatusNotReachable,
+ AFNetworkReachabilityStatusReachableViaWWAN,
+ AFNetworkReachabilityStatusReachableViaWiFi,
+ }
+
+ `AFNetworkReachabilityStatusUnknown`
+ The `baseURL` host reachability is not known.
+
+ `AFNetworkReachabilityStatusNotReachable`
+ The `baseURL` host cannot be reached.
+
+ `AFNetworkReachabilityStatusReachableViaWWAN`
+ The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS.
+
+ `AFNetworkReachabilityStatusReachableViaWiFi`
+ The `baseURL` host can be reached via a Wi-Fi connection.
+
+ ### Keys for Notification UserInfo Dictionary
+
+ Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification.
+
+ `AFNetworkingReachabilityNotificationStatusItem`
+ A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification.
+ The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status.
+ */
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when network reachability changes.
+ This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability.
+
+ @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import <SystemConfiguration/SystemConfiguration.h>` to the header prefix of the project (`Prefix.pch`).
+ */
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification;
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem;
+
+///--------------------
+/// @name Functions
+///--------------------
+
+/**
+ Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
+ */
+FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
+
+NS_ASSUME_NONNULL_END
+#endif

+ 66 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFNetworking.h

@@ -0,0 +1,66 @@
+// AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+//! Project version number for AFNetworking.
+FOUNDATION_EXPORT double AFNetworkingVersionNumber;
+
+//! Project version string for AFNetworking.
+FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <AFNetworking/PublicHeader.h>
+
+#import <Availability.h>
+#import <TargetConditionals.h>
+
+#ifndef _AFNETWORKING_
+#define _AFNETWORKING_
+
+#import <AFNetworking/AFURLRequestSerialization.h>
+#import <AFNetworking/AFURLResponseSerialization.h>
+#import <AFNetworking/AFSecurityPolicy.h>
+#import <AFNetworking/AFCompatibilityMacros.h>
+
+#if !TARGET_OS_WATCH
+#import <AFNetworking/AFNetworkReachabilityManager.h>
+#endif
+
+#import <AFNetworking/AFURLSessionManager.h>
+#import <AFNetworking/AFHTTPSessionManager.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <AFNetworking/AFAutoPurgingImageCache.h>
+#import <AFNetworking/AFImageDownloader.h>
+#import <AFNetworking/UIActivityIndicatorView+AFNetworking.h>
+#import <AFNetworking/UIButton+AFNetworking.h>
+#import <AFNetworking/UIImageView+AFNetworking.h>
+#import <AFNetworking/UIProgressView+AFNetworking.h>
+#endif
+
+#if TARGET_OS_IOS
+#import <AFNetworking/AFNetworkActivityIndicatorManager.h>
+#import <AFNetworking/UIRefreshControl+AFNetworking.h>
+#import <AFNetworking/WKWebView+AFNetworking.h>
+#endif
+
+
+#endif /* _AFNETWORKING_ */

+ 161 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFSecurityPolicy.h

@@ -0,0 +1,161 @@
+// AFSecurityPolicy.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <Security/Security.h>
+
+typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
+    AFSSLPinningModeNone,
+    AFSSLPinningModePublicKey,
+    AFSSLPinningModeCertificate,
+};
+
+/**
+ `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+ Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying>
+
+/**
+ The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
+ */
+@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+
+/**
+ The certificates used to evaluate server trust according to the SSL pinning mode. 
+ 
+ Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
+
+ @see policyWithPinningMode:withPinnedCertificates:
+ */
+@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
+
+/**
+ Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL allowInvalidCertificates;
+
+/**
+ Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`.
+ */
+@property (nonatomic, assign) BOOL validatesDomainName;
+
+///-----------------------------------------
+/// @name Getting Certificates from the Bundle
+///-----------------------------------------
+
+/**
+ Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
+
+ @return The certificates included in the given bundle.
+ */
++ (NSSet <NSData *> *)certificatesInBundle:(NSBundle *)bundle;
+
+///-----------------------------------------
+/// @name Getting Specific Security Policies
+///-----------------------------------------
+
+/**
+ Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys.
+
+ @return The default security policy.
+ */
++ (instancetype)defaultPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+ 
+ Certificates with the `.cer` extension found in the main bundle will be pinned. If you want more control over which certificates are pinned, please use `policyWithPinningMode:withPinnedCertificates:` instead.
+
+ @param pinningMode The SSL pinning mode.
+
+ @return A new security policy.
+
+ @see -policyWithPinningMode:withPinnedCertificates:
+ */
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+
+ @param pinningMode The SSL pinning mode.
+ @param pinnedCertificates The certificates to pin against.
+
+ @return A new security policy.
+
+ @see +certificatesInBundle:
+ @see -pinnedCertificates
+*/
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
+
+///------------------------------
+/// @name Evaluating Server Trust
+///------------------------------
+
+/**
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
+ This method should be used when responding to an authentication challenge from a server.
+
+ @param serverTrust The X.509 certificate trust of the server.
+ @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
+
+ @return Whether or not to trust the server.
+ */
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+                  forDomain:(nullable NSString *)domain;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## SSL Pinning Modes
+
+ The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
+
+ enum {
+ AFSSLPinningModeNone,
+ AFSSLPinningModePublicKey,
+ AFSSLPinningModeCertificate,
+ }
+
+ `AFSSLPinningModeNone`
+ Do not used pinned certificates to validate servers.
+
+ `AFSSLPinningModePublicKey`
+ Validate host certificates against public keys of pinned certificates.
+
+ `AFSSLPinningModeCertificate`
+ Validate host certificates against pinned certificates.
+*/

File diff suppressed because it is too large
+ 479 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLRequestSerialization.h


+ 313 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLResponseSerialization.h

@@ -0,0 +1,313 @@
+// AFURLResponseSerialization.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <CoreGraphics/CoreGraphics.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ Recursively removes `NSNull` values from a JSON object.
+*/
+FOUNDATION_EXPORT id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions);
+
+/**
+ The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
+
+ For example, a JSON response serializer may check for an acceptable status code (`2XX` range) and content type (`application/json`), decoding a valid JSON response into an object.
+ */
+@protocol AFURLResponseSerialization <NSObject, NSSecureCoding, NSCopying>
+
+/**
+ The response object decoded from the data associated with a specified response.
+
+ @param response The response to be processed.
+ @param data The response data to be decoded.
+ @param error The error that occurred while attempting to decode the response data.
+
+ @return The object decoded from the specified response data.
+ */
+- (nullable id)responseObjectForResponse:(nullable NSURLResponse *)response
+                           data:(nullable NSData *)data
+                          error:(NSError * _Nullable __autoreleasing *)error NS_SWIFT_NOTHROW;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFHTTPResponseSerializer` conforms to the `AFURLRequestSerialization` & `AFURLResponseSerialization` protocols, offering a concrete base implementation of query string / URL form-encoded parameter serialization and default request headers, as well as response status code and content type validation.
+
+ Any request or response serializer dealing with HTTP is encouraged to subclass `AFHTTPResponseSerializer` in order to ensure consistent default behavior.
+ */
+@interface AFHTTPResponseSerializer : NSObject <AFURLResponseSerialization>
+
+- (instancetype)init;
+
+/**
+ Creates and returns a serializer with default configuration.
+ */
++ (instancetype)serializer;
+
+///-----------------------------------------
+/// @name Configuring Response Serialization
+///-----------------------------------------
+
+/**
+ The acceptable HTTP status codes for responses. When non-`nil`, responses with status codes not contained by the set will result in an error during validation.
+
+ See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
+ */
+@property (nonatomic, copy, nullable) NSIndexSet *acceptableStatusCodes;
+
+/**
+ The acceptable MIME types for responses. When non-`nil`, responses with a `Content-Type` with MIME types that do not intersect with the set will result in an error during validation.
+ */
+@property (nonatomic, copy, nullable) NSSet <NSString *> *acceptableContentTypes;
+
+/**
+ Validates the specified response and data.
+
+ In its base implementation, this method checks for an acceptable status code and content type. Subclasses may wish to add other domain-specific checks.
+
+ @param response The response to be validated.
+ @param data The data associated with the response.
+ @param error The error that occurred while attempting to validate the response.
+
+ @return `YES` if the response is valid, otherwise `NO`.
+ */
+- (BOOL)validateResponse:(nullable NSHTTPURLResponse *)response
+                    data:(nullable NSData *)data
+                   error:(NSError * _Nullable __autoreleasing *)error;
+
+@end
+
+#pragma mark -
+
+
+/**
+ `AFJSONResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes JSON responses.
+
+ By default, `AFJSONResponseSerializer` accepts the following MIME types, which includes the official standard, `application/json`, as well as other commonly-used types:
+
+ - `application/json`
+ - `text/json`
+ - `text/javascript`
+
+ In RFC 7159 - Section 8.1, it states that JSON text is required to be encoded in UTF-8, UTF-16, or UTF-32, and the default encoding is UTF-8. NSJSONSerialization provides support for all the encodings listed in the specification, and recommends UTF-8 for efficiency. Using an unsupported encoding will result in serialization error. See the `NSJSONSerialization` documentation for more details.
+ */
+@interface AFJSONResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ Options for reading the response JSON data and creating the Foundation objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
+ */
+@property (nonatomic, assign) NSJSONReadingOptions readingOptions;
+
+/**
+ Whether to remove keys with `NSNull` values from response JSON. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL removesKeysWithNullValues;
+
+/**
+ Creates and returns a JSON serializer with specified reading and writing options.
+
+ @param readingOptions The specified JSON reading options.
+ */
++ (instancetype)serializerWithReadingOptions:(NSJSONReadingOptions)readingOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFXMLParserResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLParser` objects.
+
+ By default, `AFXMLParserResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLParserResponseSerializer : AFHTTPResponseSerializer
+
+@end
+
+#pragma mark -
+
+#ifdef __MAC_OS_X_VERSION_MIN_REQUIRED
+
+/**
+ `AFXMLDocumentResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFXMLDocumentResponseSerializer` accepts the following MIME types, which includes the official standard, `application/xml`, as well as other commonly-used types:
+
+ - `application/xml`
+ - `text/xml`
+ */
+@interface AFXMLDocumentResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSXMLDocument` documentation section "Input and Output Options". `0` by default.
+ */
+@property (nonatomic, assign) NSUInteger options;
+
+/**
+ Creates and returns an XML document serializer with the specified options.
+
+ @param mask The XML document options.
+ */
++ (instancetype)serializerWithXMLDocumentOptions:(NSUInteger)mask;
+
+@end
+
+#endif
+
+#pragma mark -
+
+/**
+ `AFPropertyListResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes XML responses as an `NSXMLDocument` objects.
+
+ By default, `AFPropertyListResponseSerializer` accepts the following MIME types:
+
+ - `application/x-plist`
+ */
+@interface AFPropertyListResponseSerializer : AFHTTPResponseSerializer
+
+- (instancetype)init;
+
+/**
+ The property list format. Possible values are described in "NSPropertyListFormat".
+ */
+@property (nonatomic, assign) NSPropertyListFormat format;
+
+/**
+ The property list reading options. Possible values are described in "NSPropertyListMutabilityOptions."
+ */
+@property (nonatomic, assign) NSPropertyListReadOptions readOptions;
+
+/**
+ Creates and returns a property list serializer with a specified format, read options, and write options.
+
+ @param format The property list format.
+ @param readOptions The property list reading options.
+ */
++ (instancetype)serializerWithFormat:(NSPropertyListFormat)format
+                         readOptions:(NSPropertyListReadOptions)readOptions;
+
+@end
+
+#pragma mark -
+
+/**
+ `AFImageResponseSerializer` is a subclass of `AFHTTPResponseSerializer` that validates and decodes image responses.
+
+ By default, `AFImageResponseSerializer` accepts the following MIME types, which correspond to the image formats supported by UIImage or NSImage:
+
+ - `image/tiff`
+ - `image/jpeg`
+ - `image/gif`
+ - `image/png`
+ - `image/ico`
+ - `image/x-icon`
+ - `image/bmp`
+ - `image/x-bmp`
+ - `image/x-xbitmap`
+ - `image/x-win-bitmap`
+ */
+@interface AFImageResponseSerializer : AFHTTPResponseSerializer
+
+#if TARGET_OS_IOS || TARGET_OS_TV || TARGET_OS_WATCH
+/**
+ The scale factor used when interpreting the image data to construct `responseImage`. Specifying a scale factor of 1.0 results in an image whose size matches the pixel-based dimensions of the image. Applying a different scale factor changes the size of the image as reported by the size property. This is set to the value of scale of the main screen by default, which automatically scales images for retina displays, for instance.
+ */
+@property (nonatomic, assign) CGFloat imageScale;
+
+/**
+ Whether to automatically inflate response image data for compressed formats (such as PNG or JPEG). Enabling this can significantly improve drawing performance on iOS when used with `setCompletionBlockWithSuccess:failure:`, as it allows a bitmap representation to be constructed in the background rather than on the main thread. `YES` by default.
+ */
+@property (nonatomic, assign) BOOL automaticallyInflatesResponseImage;
+#endif
+
+@end
+
+#pragma mark -
+
+/**
+ `AFCompoundSerializer` is a subclass of `AFHTTPResponseSerializer` that delegates the response serialization to the first `AFHTTPResponseSerializer` object that returns an object for `responseObjectForResponse:data:error:`, falling back on the default behavior of `AFHTTPResponseSerializer`. This is useful for supporting multiple potential types and structures of server responses with a single serializer.
+ */
+@interface AFCompoundResponseSerializer : AFHTTPResponseSerializer
+
+/**
+ The component response serializers.
+ */
+@property (readonly, nonatomic, copy) NSArray <id<AFURLResponseSerialization>> *responseSerializers;
+
+/**
+ Creates and returns a compound serializer comprised of the specified response serializers.
+
+ @warning Each response serializer specified must be a subclass of `AFHTTPResponseSerializer`, and response to `-validateResponse:data:error:`.
+ */
++ (instancetype)compoundSerializerWithResponseSerializers:(NSArray <id<AFURLResponseSerialization>> *)responseSerializers;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Error Domains
+
+ The following error domain is predefined.
+
+ - `NSString * const AFURLResponseSerializationErrorDomain`
+
+ ### Constants
+
+ `AFURLResponseSerializationErrorDomain`
+ AFURLResponseSerializer errors. Error codes for `AFURLResponseSerializationErrorDomain` correspond to codes in `NSURLErrorDomain`.
+ */
+FOUNDATION_EXPORT NSString * const AFURLResponseSerializationErrorDomain;
+
+/**
+ ## User info dictionary keys
+
+ These keys may exist in the user info dictionary, in addition to those defined for NSError.
+
+ - `NSString * const AFNetworkingOperationFailingURLResponseErrorKey`
+ - `NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey`
+
+ ### Constants
+
+ `AFNetworkingOperationFailingURLResponseErrorKey`
+ The corresponding value is an `NSURLResponse` containing the response of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+
+ `AFNetworkingOperationFailingURLResponseDataErrorKey`
+ The corresponding value is an `NSData` containing the original data of the operation associated with an error. This key is only present in the `AFURLResponseSerializationErrorDomain`.
+ */
+FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseErrorKey;
+
+FOUNDATION_EXPORT NSString * const AFNetworkingOperationFailingURLResponseDataErrorKey;
+
+NS_ASSUME_NONNULL_END

File diff suppressed because it is too large
+ 516 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Headers/AFURLSessionManager.h


+ 5 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Modules/module.modulemap

@@ -0,0 +1,5 @@
+framework module AFNetworking {
+    umbrella header "AFNetworking.h"
+    export *
+    module * { export * }
+}

+ 48 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/A/Resources/Info.plist

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>22C5050e</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>AFNetworking</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.alamofire.AFNetworking</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>AFNetworking</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>4.0.1</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>MacOSX</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string>4.0.1</string>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>14B47b</string>
+	<key>DTPlatformName</key>
+	<string>macosx</string>
+	<key>DTPlatformVersion</key>
+	<string>13.0</string>
+	<key>DTSDKBuild</key>
+	<string>22A372</string>
+	<key>DTSDKName</key>
+	<string>macosx13.0</string>
+	<key>DTXcode</key>
+	<string>1410</string>
+	<key>DTXcodeBuild</key>
+	<string>14B47b</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.10</string>
+</dict>
+</plist>

+ 1 - 0
KMAdvertisementDemo_Mac/AFNetworking.framework/Versions/Current

@@ -0,0 +1 @@
+A

+ 30 - 0
KMAdvertisementDemo_Mac/AppDelegate.swift

@@ -0,0 +1,30 @@
+//
+//  AppDelegate.swift
+//  KMAdvertisementDemo_Mac
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import Cocoa
+
+@main
+class AppDelegate: NSObject, NSApplicationDelegate {
+
+    
+
+
+    func applicationDidFinishLaunching(_ aNotification: Notification) {
+        // Insert code here to initialize your application
+    }
+
+    func applicationWillTerminate(_ aNotification: Notification) {
+        // Insert code here to tear down your application
+    }
+
+    func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool {
+        return true
+    }
+
+
+}
+

+ 11 - 0
KMAdvertisementDemo_Mac/Assets.xcassets/AccentColor.colorset/Contents.json

@@ -0,0 +1,11 @@
+{
+  "colors" : [
+    {
+      "idiom" : "universal"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 58 - 0
KMAdvertisementDemo_Mac/Assets.xcassets/AppIcon.appiconset/Contents.json

@@ -0,0 +1,58 @@
+{
+  "images" : [
+    {
+      "idiom" : "mac",
+      "scale" : "1x",
+      "size" : "16x16"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "2x",
+      "size" : "16x16"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "1x",
+      "size" : "32x32"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "2x",
+      "size" : "32x32"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "1x",
+      "size" : "128x128"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "2x",
+      "size" : "128x128"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "1x",
+      "size" : "256x256"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "2x",
+      "size" : "256x256"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "1x",
+      "size" : "512x512"
+    },
+    {
+      "idiom" : "mac",
+      "scale" : "2x",
+      "size" : "512x512"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 6 - 0
KMAdvertisementDemo_Mac/Assets.xcassets/Contents.json

@@ -0,0 +1,6 @@
+{
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

+ 742 - 0
KMAdvertisementDemo_Mac/Base.lproj/Main.storyboard

@@ -0,0 +1,742 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
+    <dependencies>
+        <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
+        <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
+    </dependencies>
+    <scenes>
+        <!--Application-->
+        <scene sceneID="JPo-4y-FX3">
+            <objects>
+                <application id="hnw-xV-0zn" sceneMemberID="viewController">
+                    <menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
+                        <items>
+                            <menuItem title="KMAdvertisementDemo_Mac" id="1Xt-HY-uBw">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="KMAdvertisementDemo_Mac" systemMenu="apple" id="uQy-DD-JDr">
+                                    <items>
+                                        <menuItem title="About KMAdvertisementDemo_Mac" id="5kV-Vb-QxS">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
+                                        <menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
+                                        <menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
+                                        <menuItem title="Services" id="NMo-om-nkz">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
+                                        <menuItem title="Hide KMAdvertisementDemo_Mac" keyEquivalent="h" id="Olw-nP-bQN">
+                                            <connections>
+                                                <action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Show All" id="Kd2-mp-pUS">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
+                                        <menuItem title="Quit KMAdvertisementDemo_Mac" keyEquivalent="q" id="4sb-4s-VLi">
+                                            <connections>
+                                                <action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="File" id="dMs-cI-mzQ">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="File" id="bib-Uj-vzu">
+                                    <items>
+                                        <menuItem title="New" keyEquivalent="n" id="Was-JA-tGl">
+                                            <connections>
+                                                <action selector="newDocument:" target="Ady-hI-5gd" id="4Si-XN-c54"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
+                                            <connections>
+                                                <action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Open Recent" id="tXI-mr-wws">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Open Recent" systemMenu="recentDocuments" id="oas-Oc-fiZ">
+                                                <items>
+                                                    <menuItem title="Clear Menu" id="vNY-rz-j42">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="clearRecentDocuments:" target="Ady-hI-5gd" id="Daa-9d-B3U"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="m54-Is-iLE"/>
+                                        <menuItem title="Close" keyEquivalent="w" id="DVo-aG-piG">
+                                            <connections>
+                                                <action selector="performClose:" target="Ady-hI-5gd" id="HmO-Ls-i7Q"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Save…" keyEquivalent="s" id="pxx-59-PXV">
+                                            <connections>
+                                                <action selector="saveDocument:" target="Ady-hI-5gd" id="teZ-XB-qJY"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Save As…" keyEquivalent="S" id="Bw7-FT-i3A">
+                                            <connections>
+                                                <action selector="saveDocumentAs:" target="Ady-hI-5gd" id="mDf-zr-I0C"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Revert to Saved" keyEquivalent="r" id="KaW-ft-85H">
+                                            <connections>
+                                                <action selector="revertDocumentToSaved:" target="Ady-hI-5gd" id="iJ3-Pv-kwq"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="aJh-i4-bef"/>
+                                        <menuItem title="Page Setup…" keyEquivalent="P" id="qIS-W8-SiK">
+                                            <modifierMask key="keyEquivalentModifierMask" shift="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="runPageLayout:" target="Ady-hI-5gd" id="Din-rz-gC5"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Print…" keyEquivalent="p" id="aTl-1u-JFS">
+                                            <connections>
+                                                <action selector="print:" target="Ady-hI-5gd" id="qaZ-4w-aoO"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Edit" id="5QF-Oa-p0T">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Edit" id="W48-6f-4Dl">
+                                    <items>
+                                        <menuItem title="Undo" keyEquivalent="z" id="dRJ-4n-Yzg">
+                                            <connections>
+                                                <action selector="undo:" target="Ady-hI-5gd" id="M6e-cu-g7V"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Redo" keyEquivalent="Z" id="6dh-zS-Vam">
+                                            <connections>
+                                                <action selector="redo:" target="Ady-hI-5gd" id="oIA-Rs-6OD"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="WRV-NI-Exz"/>
+                                        <menuItem title="Cut" keyEquivalent="x" id="uRl-iY-unG">
+                                            <connections>
+                                                <action selector="cut:" target="Ady-hI-5gd" id="YJe-68-I9s"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
+                                            <connections>
+                                                <action selector="copy:" target="Ady-hI-5gd" id="G1f-GL-Joy"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
+                                            <connections>
+                                                <action selector="paste:" target="Ady-hI-5gd" id="UvS-8e-Qdg"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Paste and Match Style" keyEquivalent="V" id="WeT-3V-zwk">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="pasteAsPlainText:" target="Ady-hI-5gd" id="cEh-KX-wJQ"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Delete" id="pa3-QI-u2k">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="delete:" target="Ady-hI-5gd" id="0Mk-Ml-PaM"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Select All" keyEquivalent="a" id="Ruw-6m-B2m">
+                                            <connections>
+                                                <action selector="selectAll:" target="Ady-hI-5gd" id="VNm-Mi-diN"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="uyl-h8-XO2"/>
+                                        <menuItem title="Find" id="4EN-yA-p0u">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Find" id="1b7-l0-nxx">
+                                                <items>
+                                                    <menuItem title="Find…" tag="1" keyEquivalent="f" id="Xz5-n4-O0W">
+                                                        <connections>
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="cD7-Qs-BN4"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Find and Replace…" tag="12" keyEquivalent="f" id="YEy-JH-Tfz">
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                                        <connections>
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="WD3-Gg-5AJ"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Find Next" tag="2" keyEquivalent="g" id="q09-fT-Sye">
+                                                        <connections>
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="NDo-RZ-v9R"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Find Previous" tag="3" keyEquivalent="G" id="OwM-mh-QMV">
+                                                        <connections>
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="HOh-sY-3ay"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Use Selection for Find" tag="7" keyEquivalent="e" id="buJ-ug-pKt">
+                                                        <connections>
+                                                            <action selector="performFindPanelAction:" target="Ady-hI-5gd" id="U76-nv-p5D"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Jump to Selection" keyEquivalent="j" id="S0p-oC-mLd">
+                                                        <connections>
+                                                            <action selector="centerSelectionInVisibleArea:" target="Ady-hI-5gd" id="IOG-6D-g5B"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Spelling and Grammar" id="Dv1-io-Yv7">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Spelling" id="3IN-sU-3Bg">
+                                                <items>
+                                                    <menuItem title="Show Spelling and Grammar" keyEquivalent=":" id="HFo-cy-zxI">
+                                                        <connections>
+                                                            <action selector="showGuessPanel:" target="Ady-hI-5gd" id="vFj-Ks-hy3"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Check Document Now" keyEquivalent=";" id="hz2-CU-CR7">
+                                                        <connections>
+                                                            <action selector="checkSpelling:" target="Ady-hI-5gd" id="fz7-VC-reM"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="bNw-od-mp5"/>
+                                                    <menuItem title="Check Spelling While Typing" id="rbD-Rh-wIN">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleContinuousSpellChecking:" target="Ady-hI-5gd" id="7w6-Qz-0kB"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Check Grammar With Spelling" id="mK6-2p-4JG">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleGrammarChecking:" target="Ady-hI-5gd" id="muD-Qn-j4w"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Correct Spelling Automatically" id="78Y-hA-62v">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticSpellingCorrection:" target="Ady-hI-5gd" id="2lM-Qi-WAP"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Substitutions" id="9ic-FL-obx">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Substitutions" id="FeM-D8-WVr">
+                                                <items>
+                                                    <menuItem title="Show Substitutions" id="z6F-FW-3nz">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="orderFrontSubstitutionsPanel:" target="Ady-hI-5gd" id="oku-mr-iSq"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="gPx-C9-uUO"/>
+                                                    <menuItem title="Smart Copy/Paste" id="9yt-4B-nSM">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleSmartInsertDelete:" target="Ady-hI-5gd" id="3IJ-Se-DZD"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Smart Quotes" id="hQb-2v-fYv">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticQuoteSubstitution:" target="Ady-hI-5gd" id="ptq-xd-QOA"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Smart Dashes" id="rgM-f4-ycn">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticDashSubstitution:" target="Ady-hI-5gd" id="oCt-pO-9gS"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Smart Links" id="cwL-P1-jid">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticLinkDetection:" target="Ady-hI-5gd" id="Gip-E3-Fov"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Data Detectors" id="tRr-pd-1PS">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticDataDetection:" target="Ady-hI-5gd" id="R1I-Nq-Kbl"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Text Replacement" id="HFQ-gK-NFA">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleAutomaticTextReplacement:" target="Ady-hI-5gd" id="DvP-Fe-Py6"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Transformations" id="2oI-Rn-ZJC">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Transformations" id="c8a-y6-VQd">
+                                                <items>
+                                                    <menuItem title="Make Upper Case" id="vmV-6d-7jI">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="uppercaseWord:" target="Ady-hI-5gd" id="sPh-Tk-edu"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Make Lower Case" id="d9M-CD-aMd">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="lowercaseWord:" target="Ady-hI-5gd" id="iUZ-b5-hil"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Capitalize" id="UEZ-Bs-lqG">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="capitalizeWord:" target="Ady-hI-5gd" id="26H-TL-nsh"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Speech" id="xrE-MZ-jX0">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Speech" id="3rS-ZA-NoH">
+                                                <items>
+                                                    <menuItem title="Start Speaking" id="Ynk-f8-cLZ">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="startSpeaking:" target="Ady-hI-5gd" id="654-Ng-kyl"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Stop Speaking" id="Oyz-dy-DGm">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="stopSpeaking:" target="Ady-hI-5gd" id="dX8-6p-jy9"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Format" id="jxT-CU-nIS">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Format" id="GEO-Iw-cKr">
+                                    <items>
+                                        <menuItem title="Font" id="Gi5-1S-RQB">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Font" systemMenu="font" id="aXa-aM-Jaq">
+                                                <items>
+                                                    <menuItem title="Show Fonts" keyEquivalent="t" id="Q5e-8K-NDq">
+                                                        <connections>
+                                                            <action selector="orderFrontFontPanel:" target="YLy-65-1bz" id="WHr-nq-2xA"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Bold" tag="2" keyEquivalent="b" id="GB9-OM-e27">
+                                                        <connections>
+                                                            <action selector="addFontTrait:" target="YLy-65-1bz" id="hqk-hr-sYV"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Italic" tag="1" keyEquivalent="i" id="Vjx-xi-njq">
+                                                        <connections>
+                                                            <action selector="addFontTrait:" target="YLy-65-1bz" id="IHV-OB-c03"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Underline" keyEquivalent="u" id="WRG-CD-K1S">
+                                                        <connections>
+                                                            <action selector="underline:" target="Ady-hI-5gd" id="FYS-2b-JAY"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="5gT-KC-WSO"/>
+                                                    <menuItem title="Bigger" tag="3" keyEquivalent="+" id="Ptp-SP-VEL">
+                                                        <connections>
+                                                            <action selector="modifyFont:" target="YLy-65-1bz" id="Uc7-di-UnL"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Smaller" tag="4" keyEquivalent="-" id="i1d-Er-qST">
+                                                        <connections>
+                                                            <action selector="modifyFont:" target="YLy-65-1bz" id="HcX-Lf-eNd"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="kx3-Dk-x3B"/>
+                                                    <menuItem title="Kern" id="jBQ-r6-VK2">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <menu key="submenu" title="Kern" id="tlD-Oa-oAM">
+                                                            <items>
+                                                                <menuItem title="Use Default" id="GUa-eO-cwY">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="useStandardKerning:" target="Ady-hI-5gd" id="6dk-9l-Ckg"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Use None" id="cDB-IK-hbR">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="turnOffKerning:" target="Ady-hI-5gd" id="U8a-gz-Maa"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Tighten" id="46P-cB-AYj">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="tightenKerning:" target="Ady-hI-5gd" id="hr7-Nz-8ro"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Loosen" id="ogc-rX-tC1">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="loosenKerning:" target="Ady-hI-5gd" id="8i4-f9-FKE"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                            </items>
+                                                        </menu>
+                                                    </menuItem>
+                                                    <menuItem title="Ligatures" id="o6e-r0-MWq">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <menu key="submenu" title="Ligatures" id="w0m-vy-SC9">
+                                                            <items>
+                                                                <menuItem title="Use Default" id="agt-UL-0e3">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="useStandardLigatures:" target="Ady-hI-5gd" id="7uR-wd-Dx6"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Use None" id="J7y-lM-qPV">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="turnOffLigatures:" target="Ady-hI-5gd" id="iX2-gA-Ilz"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Use All" id="xQD-1f-W4t">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="useAllLigatures:" target="Ady-hI-5gd" id="KcB-kA-TuK"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                            </items>
+                                                        </menu>
+                                                    </menuItem>
+                                                    <menuItem title="Baseline" id="OaQ-X3-Vso">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <menu key="submenu" title="Baseline" id="ijk-EB-dga">
+                                                            <items>
+                                                                <menuItem title="Use Default" id="3Om-Ey-2VK">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="unscript:" target="Ady-hI-5gd" id="0vZ-95-Ywn"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Superscript" id="Rqc-34-cIF">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="superscript:" target="Ady-hI-5gd" id="3qV-fo-wpU"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Subscript" id="I0S-gh-46l">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="subscript:" target="Ady-hI-5gd" id="Q6W-4W-IGz"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Raise" id="2h7-ER-AoG">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="raiseBaseline:" target="Ady-hI-5gd" id="4sk-31-7Q9"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem title="Lower" id="1tx-W0-xDw">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="lowerBaseline:" target="Ady-hI-5gd" id="OF1-bc-KW4"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                            </items>
+                                                        </menu>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="Ndw-q3-faq"/>
+                                                    <menuItem title="Show Colors" keyEquivalent="C" id="bgn-CT-cEk">
+                                                        <connections>
+                                                            <action selector="orderFrontColorPanel:" target="Ady-hI-5gd" id="mSX-Xz-DV3"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="iMs-zA-UFJ"/>
+                                                    <menuItem title="Copy Style" keyEquivalent="c" id="5Vv-lz-BsD">
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                                        <connections>
+                                                            <action selector="copyFont:" target="Ady-hI-5gd" id="GJO-xA-L4q"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Paste Style" keyEquivalent="v" id="vKC-jM-MkH">
+                                                        <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                                        <connections>
+                                                            <action selector="pasteFont:" target="Ady-hI-5gd" id="JfD-CL-leO"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                        <menuItem title="Text" id="Fal-I4-PZk">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <menu key="submenu" title="Text" id="d9c-me-L2H">
+                                                <items>
+                                                    <menuItem title="Align Left" keyEquivalent="{" id="ZM1-6Q-yy1">
+                                                        <connections>
+                                                            <action selector="alignLeft:" target="Ady-hI-5gd" id="zUv-R1-uAa"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Center" keyEquivalent="|" id="VIY-Ag-zcb">
+                                                        <connections>
+                                                            <action selector="alignCenter:" target="Ady-hI-5gd" id="spX-mk-kcS"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Justify" id="J5U-5w-g23">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="alignJustified:" target="Ady-hI-5gd" id="ljL-7U-jND"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Align Right" keyEquivalent="}" id="wb2-vD-lq4">
+                                                        <connections>
+                                                            <action selector="alignRight:" target="Ady-hI-5gd" id="r48-bG-YeY"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="4s2-GY-VfK"/>
+                                                    <menuItem title="Writing Direction" id="H1b-Si-o9J">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <menu key="submenu" title="Writing Direction" id="8mr-sm-Yjd">
+                                                            <items>
+                                                                <menuItem title="Paragraph" enabled="NO" id="ZvO-Gk-QUH">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                </menuItem>
+                                                                <menuItem id="YGs-j5-SAR">
+                                                                    <string key="title">	Default</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeBaseWritingDirectionNatural:" target="Ady-hI-5gd" id="qtV-5e-UBP"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem id="Lbh-J2-qVU">
+                                                                    <string key="title">	Left to Right</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeBaseWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="S0X-9S-QSf"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem id="jFq-tB-4Kx">
+                                                                    <string key="title">	Right to Left</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeBaseWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="5fk-qB-AqJ"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem isSeparatorItem="YES" id="swp-gr-a21"/>
+                                                                <menuItem title="Selection" enabled="NO" id="cqv-fj-IhA">
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                </menuItem>
+                                                                <menuItem id="Nop-cj-93Q">
+                                                                    <string key="title">	Default</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeTextWritingDirectionNatural:" target="Ady-hI-5gd" id="lPI-Se-ZHp"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem id="BgM-ve-c93">
+                                                                    <string key="title">	Left to Right</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeTextWritingDirectionLeftToRight:" target="Ady-hI-5gd" id="caW-Bv-w94"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                                <menuItem id="RB4-Sm-HuC">
+                                                                    <string key="title">	Right to Left</string>
+                                                                    <modifierMask key="keyEquivalentModifierMask"/>
+                                                                    <connections>
+                                                                        <action selector="makeTextWritingDirectionRightToLeft:" target="Ady-hI-5gd" id="EXD-6r-ZUu"/>
+                                                                    </connections>
+                                                                </menuItem>
+                                                            </items>
+                                                        </menu>
+                                                    </menuItem>
+                                                    <menuItem isSeparatorItem="YES" id="fKy-g9-1gm"/>
+                                                    <menuItem title="Show Ruler" id="vLm-3I-IUL">
+                                                        <modifierMask key="keyEquivalentModifierMask"/>
+                                                        <connections>
+                                                            <action selector="toggleRuler:" target="Ady-hI-5gd" id="FOx-HJ-KwY"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Copy Ruler" keyEquivalent="c" id="MkV-Pr-PK5">
+                                                        <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                                        <connections>
+                                                            <action selector="copyRuler:" target="Ady-hI-5gd" id="71i-fW-3W2"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                    <menuItem title="Paste Ruler" keyEquivalent="v" id="LVM-kO-fVI">
+                                                        <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                                        <connections>
+                                                            <action selector="pasteRuler:" target="Ady-hI-5gd" id="cSh-wd-qM2"/>
+                                                        </connections>
+                                                    </menuItem>
+                                                </items>
+                                            </menu>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="View" id="H8h-7b-M4v">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="View" id="HyV-fh-RgO">
+                                    <items>
+                                        <menuItem title="Show Toolbar" keyEquivalent="t" id="snW-S8-Cw5">
+                                            <modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="toggleToolbarShown:" target="Ady-hI-5gd" id="BXY-wc-z0C"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Customize Toolbar…" id="1UK-8n-QPP">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="runToolbarCustomizationPalette:" target="Ady-hI-5gd" id="pQI-g3-MTW"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="hB3-LF-h0Y"/>
+                                        <menuItem title="Show Sidebar" keyEquivalent="s" id="kIP-vf-haE">
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="toggleSidebar:" target="Ady-hI-5gd" id="iwa-gc-5KM"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Enter Full Screen" keyEquivalent="f" id="4J7-dP-txa">
+                                            <modifierMask key="keyEquivalentModifierMask" control="YES" command="YES"/>
+                                            <connections>
+                                                <action selector="toggleFullScreen:" target="Ady-hI-5gd" id="dU3-MA-1Rq"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Window" id="aUF-d1-5bR">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
+                                    <items>
+                                        <menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
+                                            <connections>
+                                                <action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem title="Zoom" id="R4o-n2-Eq4">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
+                                            </connections>
+                                        </menuItem>
+                                        <menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
+                                        <menuItem title="Bring All to Front" id="LE2-aR-0XJ">
+                                            <modifierMask key="keyEquivalentModifierMask"/>
+                                            <connections>
+                                                <action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                            <menuItem title="Help" id="wpr-3q-Mcd">
+                                <modifierMask key="keyEquivalentModifierMask"/>
+                                <menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
+                                    <items>
+                                        <menuItem title="KMAdvertisementDemo_Mac Help" keyEquivalent="?" id="FKE-Sm-Kum">
+                                            <connections>
+                                                <action selector="showHelp:" target="Ady-hI-5gd" id="y7X-2Q-9no"/>
+                                            </connections>
+                                        </menuItem>
+                                    </items>
+                                </menu>
+                            </menuItem>
+                        </items>
+                    </menu>
+                    <connections>
+                        <outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
+                    </connections>
+                </application>
+                <customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="KMAdvertisementDemo_Mac" customModuleProvider="target"/>
+                <customObject id="YLy-65-1bz" customClass="NSFontManager"/>
+                <customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="75" y="0.0"/>
+        </scene>
+        <!--Window Controller-->
+        <scene sceneID="R2V-B0-nI4">
+            <objects>
+                <windowController id="B8D-0N-5wS" sceneMemberID="viewController">
+                    <window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" visibleAtLaunch="NO" animationBehavior="default" id="IQv-IB-iLA">
+                        <windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
+                        <windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
+                        <rect key="contentRect" x="196" y="240" width="676" height="367"/>
+                        <rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
+                        <connections>
+                            <outlet property="delegate" destination="B8D-0N-5wS" id="98r-iN-zZc"/>
+                        </connections>
+                    </window>
+                    <connections>
+                        <segue destination="XfG-lQ-9wD" kind="relationship" relationship="window.shadowedContentViewController" id="cq2-FE-JQM"/>
+                    </connections>
+                </windowController>
+                <customObject id="Oky-zY-oP4" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="131" y="269.5"/>
+        </scene>
+        <!--View Controller-->
+        <scene sceneID="hIz-AP-VOD">
+            <objects>
+                <viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="KMAdvertisementDemo_Mac" customModuleProvider="target" sceneMemberID="viewController">
+                    <view key="view" id="m2S-Jp-Qdl">
+                        <rect key="frame" x="0.0" y="0.0" width="952" height="733"/>
+                        <autoresizingMask key="autoresizingMask"/>
+                        <subviews>
+                            <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="37J-os-qpy" customClass="KMAdvertisementTableView" customModule="KMAdvertisement">
+                                <rect key="frame" x="0.0" y="431" width="301" height="302"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            </customView>
+                            <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="0o5-sY-SOU">
+                                <rect key="frame" x="0.0" y="91" width="301" height="332"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            </customView>
+                            <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="yF8-z8-666">
+                                <rect key="frame" x="364" y="251" width="500" height="180"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            </customView>
+                            <customView fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="vST-E8-EuT" customClass="KMAdvertisementShowView" customModule="KMAdvertisement">
+                                <rect key="frame" x="364" y="561" width="500" height="180"/>
+                                <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
+                            </customView>
+                        </subviews>
+                    </view>
+                    <connections>
+                        <outlet property="advertisementView" destination="vST-E8-EuT" id="jto-jT-JnG"/>
+                        <outlet property="showListView" destination="0o5-sY-SOU" id="Ysb-Cj-h6G"/>
+                        <outlet property="showView" destination="yF8-z8-666" id="Pd7-ub-vHc"/>
+                        <outlet property="tableView" destination="37J-os-qpy" id="HLz-Hc-sBo"/>
+                    </connections>
+                </viewController>
+                <customObject id="rPt-NT-nkU" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
+            </objects>
+            <point key="canvasLocation" x="122" y="936.5"/>
+        </scene>
+    </scenes>
+</document>

+ 5 - 0
KMAdvertisementDemo_Mac/KMAdvertisementDemo_Mac.entitlements

@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict/>
+</plist>

+ 1 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Kingfisher

@@ -0,0 +1 @@
+Versions/Current/Kingfisher

+ 1 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Modules

@@ -0,0 +1 @@
+Versions/Current/Modules

+ 1 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Resources

@@ -0,0 +1 @@
+Versions/Current/Resources

BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Kingfisher


BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo


BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo


+ 9 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.abi.json

@@ -0,0 +1,9 @@
+{
+  "ABIRoot": {
+    "kind": "Root",
+    "name": "TopLevel",
+    "printedName": "TopLevel",
+    "json_format_version": 8
+  },
+  "ConstValues": []
+}

BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftdoc


BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftmodule


+ 9 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.abi.json

@@ -0,0 +1,9 @@
+{
+  "ABIRoot": {
+    "kind": "Root",
+    "name": "TopLevel",
+    "printedName": "TopLevel",
+    "json_format_version": 8
+  },
+  "ConstValues": []
+}

BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftdoc


BIN
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftmodule


+ 48 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/Resources/Info.plist

@@ -0,0 +1,48 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>BuildMachineOSBuild</key>
+	<string>22C5050e</string>
+	<key>CFBundleDevelopmentRegion</key>
+	<string>en</string>
+	<key>CFBundleExecutable</key>
+	<string>Kingfisher</string>
+	<key>CFBundleIdentifier</key>
+	<string>com.onevcat.Kingfisher</string>
+	<key>CFBundleInfoDictionaryVersion</key>
+	<string>6.0</string>
+	<key>CFBundleName</key>
+	<string>Kingfisher</string>
+	<key>CFBundlePackageType</key>
+	<string>FMWK</string>
+	<key>CFBundleShortVersionString</key>
+	<string>7.4.1</string>
+	<key>CFBundleSignature</key>
+	<string>????</string>
+	<key>CFBundleSupportedPlatforms</key>
+	<array>
+		<string>MacOSX</string>
+	</array>
+	<key>CFBundleVersion</key>
+	<string>2542</string>
+	<key>DTCompiler</key>
+	<string>com.apple.compilers.llvm.clang.1_0</string>
+	<key>DTPlatformBuild</key>
+	<string>14B47b</string>
+	<key>DTPlatformName</key>
+	<string>macosx</string>
+	<key>DTPlatformVersion</key>
+	<string>13.0</string>
+	<key>DTSDKBuild</key>
+	<string>22A372</string>
+	<key>DTSDKName</key>
+	<string>macosx13.0</string>
+	<key>DTXcode</key>
+	<string>1410</string>
+	<key>DTXcodeBuild</key>
+	<string>14B47b</string>
+	<key>LSMinimumSystemVersion</key>
+	<string>10.14</string>
+</dict>
+</plist>

+ 184 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/A/_CodeSignature/CodeResources

@@ -0,0 +1,184 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+	<key>files</key>
+	<dict>
+		<key>Resources/Info.plist</key>
+		<data>
+		tqOOkC5Jhv8B0hu9E6AeJanhU4s=
+		</data>
+	</dict>
+	<key>files2</key>
+	<dict>
+		<key>Modules/Kingfisher.swiftmodule/Project/arm64-apple-macos.swiftsourceinfo</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			1KEUQgpNxqmoyw57ow93TpbQlmH9teSZZx78hzszB1U=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/Project/x86_64-apple-macos.swiftsourceinfo</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			OhduU4YOXOl0JoEINjHVufkLzt8xYwfb+YcDTDUxj04=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/arm64-apple-macos.abi.json</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftdoc</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			R+GgME7lYKFGCtr2YGDpKcqOtQq7181H/1eg/zTkb5c=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/arm64-apple-macos.swiftmodule</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			QzYfBmq3hK11r4hYAB3ibUPV1+F4XzSv/5rMV+llqb8=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/x86_64-apple-macos.abi.json</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			KnRdWE4y6t4QM5zi5JDptPdHFgJy1Tku+7GLkZS2aNM=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftdoc</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			7GJhd3gdFVMk9uN41tHc6CWqkQKe0724SKfuzAmtv5U=
+			</data>
+		</dict>
+		<key>Modules/Kingfisher.swiftmodule/x86_64-apple-macos.swiftmodule</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			wF3SEs8yVMozuZDdRDicKHKlW3/9+VM6cOchKDAw61s=
+			</data>
+		</dict>
+		<key>Resources/Info.plist</key>
+		<dict>
+			<key>hash2</key>
+			<data>
+			JZlbZO5YRQ/cts58AJc45Fr+ZNAghrYW5w1Pc8pL7tQ=
+			</data>
+		</dict>
+	</dict>
+	<key>rules</key>
+	<dict>
+		<key>^Resources/</key>
+		<true/>
+		<key>^Resources/.*\.lproj/</key>
+		<dict>
+			<key>optional</key>
+			<true/>
+			<key>weight</key>
+			<real>1000</real>
+		</dict>
+		<key>^Resources/.*\.lproj/locversion.plist$</key>
+		<dict>
+			<key>omit</key>
+			<true/>
+			<key>weight</key>
+			<real>1100</real>
+		</dict>
+		<key>^Resources/Base\.lproj/</key>
+		<dict>
+			<key>weight</key>
+			<real>1010</real>
+		</dict>
+		<key>^version.plist$</key>
+		<true/>
+	</dict>
+	<key>rules2</key>
+	<dict>
+		<key>.*\.dSYM($|/)</key>
+		<dict>
+			<key>weight</key>
+			<real>11</real>
+		</dict>
+		<key>^(.*/)?\.DS_Store$</key>
+		<dict>
+			<key>omit</key>
+			<true/>
+			<key>weight</key>
+			<real>2000</real>
+		</dict>
+		<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
+		<dict>
+			<key>nested</key>
+			<true/>
+			<key>weight</key>
+			<real>10</real>
+		</dict>
+		<key>^.*</key>
+		<true/>
+		<key>^Info\.plist$</key>
+		<dict>
+			<key>omit</key>
+			<true/>
+			<key>weight</key>
+			<real>20</real>
+		</dict>
+		<key>^PkgInfo$</key>
+		<dict>
+			<key>omit</key>
+			<true/>
+			<key>weight</key>
+			<real>20</real>
+		</dict>
+		<key>^Resources/</key>
+		<dict>
+			<key>weight</key>
+			<real>20</real>
+		</dict>
+		<key>^Resources/.*\.lproj/</key>
+		<dict>
+			<key>optional</key>
+			<true/>
+			<key>weight</key>
+			<real>1000</real>
+		</dict>
+		<key>^Resources/.*\.lproj/locversion.plist$</key>
+		<dict>
+			<key>omit</key>
+			<true/>
+			<key>weight</key>
+			<real>1100</real>
+		</dict>
+		<key>^Resources/Base\.lproj/</key>
+		<dict>
+			<key>weight</key>
+			<real>1010</real>
+		</dict>
+		<key>^[^/]+$</key>
+		<dict>
+			<key>nested</key>
+			<true/>
+			<key>weight</key>
+			<real>10</real>
+		</dict>
+		<key>^embedded\.provisionprofile$</key>
+		<dict>
+			<key>weight</key>
+			<real>20</real>
+		</dict>
+		<key>^version\.plist$</key>
+		<dict>
+			<key>weight</key>
+			<real>20</real>
+		</dict>
+	</dict>
+</dict>
+</plist>

+ 1 - 0
KMAdvertisementDemo_Mac/Kingfisher.framework/Versions/Current

@@ -0,0 +1 @@
+A

+ 78 - 0
KMAdvertisementDemo_Mac/ViewController.swift

@@ -0,0 +1,78 @@
+//
+//  ViewController.swift
+//  KMAdvertisementDemo_Mac
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import Cocoa
+import KMAdvertisement
+
+class ViewController: NSViewController {
+
+    //list
+    @IBOutlet weak var showListView: NSView!
+    @IBOutlet weak var tableView: KMAdvertisementTableView!
+    
+    //view
+    @IBOutlet weak var showView: NSView!
+    @IBOutlet weak var advertisementView: KMAdvertisementShowView!
+    
+    override func viewDidLoad() {
+        super.viewDidLoad()
+        self.showListView.wantsLayer = true
+        self.showListView.layer?.backgroundColor = NSColor.black.withAlphaComponent(0.3).cgColor
+
+        // Do any additional setup after loading the view.
+        //设置基础参数
+        KMAdvertisementManager.manager.initConfig(appName: .FilmageEditorMac,
+                                                  subscribeType: .unsubscribed,
+                                                  platform: .Mac)
+        //测试模式,默认false
+        KMAdvertisementManager.manager.debug = true
+        
+        unowned let weakSelf = self
+        //获取广告数据
+        KMAdvertisementManager.manager.fetchData { data, error in
+            if data != nil {
+                for model in data! {
+                    if model.showType == .list {
+                        //视图加载方法一
+                        let view = KMAdvertisementManager.manager.show(type: KMAdvertisementShowType.list, data: model, superView: weakSelf.showListView) { actionItem in
+                            print("list 1")
+                        }
+                        
+                        //视图加载方法二
+                        weakSelf.tableView.inputData = model
+                        weakSelf.tableView.actionCompletion = { actionItem in
+                            print("list 2")
+                        }
+                    }
+                    
+                    if model.showType == .view {
+                        //视图加载方法一
+                        let view =  KMAdvertisementManager.manager.show(type: KMAdvertisementShowType.view, data: model, superView: weakSelf.showView) { actionItem in
+                            print("view 1")
+                        }
+                        
+                        //视图加载方法二
+                        weakSelf.advertisementView.inputData = model
+                        weakSelf.advertisementView.actionCompletion = { actionItem in
+                            print("view 2")
+                        }
+                    }
+                }
+            }
+        }
+        
+    }
+
+    override var representedObject: Any? {
+        didSet {
+        // Update the view, if already loaded.
+        }
+    }
+
+
+}
+

+ 36 - 0
KMAdvertisementDemo_MacTests/KMAdvertisementDemo_MacTests.swift

@@ -0,0 +1,36 @@
+//
+//  KMAdvertisementDemo_MacTests.swift
+//  KMAdvertisementDemo_MacTests
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import XCTest
+@testable import KMAdvertisementDemo_Mac
+
+final class KMAdvertisementDemo_MacTests: XCTestCase {
+
+    override func setUpWithError() throws {
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+    }
+
+    override func tearDownWithError() throws {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+    }
+
+    func testExample() throws {
+        // This is an example of a functional test case.
+        // Use XCTAssert and related functions to verify your tests produce the correct results.
+        // Any test you write for XCTest can be annotated as throws and async.
+        // Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
+        // Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
+    }
+
+    func testPerformanceExample() throws {
+        // This is an example of a performance test case.
+        self.measure {
+            // Put the code you want to measure the time of here.
+        }
+    }
+
+}

+ 41 - 0
KMAdvertisementDemo_MacUITests/KMAdvertisementDemo_MacUITests.swift

@@ -0,0 +1,41 @@
+//
+//  KMAdvertisementDemo_MacUITests.swift
+//  KMAdvertisementDemo_MacUITests
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import XCTest
+
+final class KMAdvertisementDemo_MacUITests: XCTestCase {
+
+    override func setUpWithError() throws {
+        // Put setup code here. This method is called before the invocation of each test method in the class.
+
+        // In UI tests it is usually best to stop immediately when a failure occurs.
+        continueAfterFailure = false
+
+        // 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.
+    }
+
+    override func tearDownWithError() throws {
+        // Put teardown code here. This method is called after the invocation of each test method in the class.
+    }
+
+    func testExample() throws {
+        // UI tests must launch the application that they test.
+        let app = XCUIApplication()
+        app.launch()
+
+        // Use XCTAssert and related functions to verify your tests produce the correct results.
+    }
+
+    func testLaunchPerformance() throws {
+        if #available(macOS 10.15, iOS 13.0, tvOS 13.0, watchOS 7.0, *) {
+            // This measures how long it takes to launch your application.
+            measure(metrics: [XCTApplicationLaunchMetric()]) {
+                XCUIApplication().launch()
+            }
+        }
+    }
+}

+ 32 - 0
KMAdvertisementDemo_MacUITests/KMAdvertisementDemo_MacUITestsLaunchTests.swift

@@ -0,0 +1,32 @@
+//
+//  KMAdvertisementDemo_MacUITestsLaunchTests.swift
+//  KMAdvertisementDemo_MacUITests
+//
+//  Created by lizhe on 2022/11/23.
+//
+
+import XCTest
+
+final class KMAdvertisementDemo_MacUITestsLaunchTests: XCTestCase {
+
+    override class var runsForEachTargetApplicationUIConfiguration: Bool {
+        true
+    }
+
+    override func setUpWithError() throws {
+        continueAfterFailure = false
+    }
+
+    func testLaunch() throws {
+        let app = XCUIApplication()
+        app.launch()
+
+        // Insert steps here to perform after app launch but before taking a screenshot,
+        // such as logging into a test account or navigating somewhere in the app
+
+        let attachment = XCTAttachment(screenshot: app.screenshot())
+        attachment.name = "Launch Screen"
+        attachment.lifetime = .keepAlways
+        add(attachment)
+    }
+}

BIN
KMAdvertisementDemo_iOS/AFNetworking.framework/AFNetworking


+ 160 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFAutoPurgingImageCache.h

@@ -0,0 +1,160 @@
+// AFAutoPurgingImageCache.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+#import <Foundation/Foundation.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ The `AFImageCache` protocol defines a set of APIs for adding, removing and fetching images from a cache synchronously.
+ */
+@protocol AFImageCache <NSObject>
+
+/**
+ Adds the image to the cache with the given identifier.
+
+ @param image The image to cache.
+ @param identifier The unique identifier for the image in the cache.
+ */
+- (void)addImage:(UIImage *)image withIdentifier:(NSString *)identifier;
+
+/**
+ Removes the image from the cache matching the given identifier.
+
+ @param identifier The unique identifier for the image in the cache.
+
+ @return A BOOL indicating whether or not the image was removed from the cache.
+ */
+- (BOOL)removeImageWithIdentifier:(NSString *)identifier;
+
+/**
+ Removes all images from the cache.
+
+ @return A BOOL indicating whether or not all images were removed from the cache.
+ */
+- (BOOL)removeAllImages;
+
+/**
+ Returns the image in the cache associated with the given identifier.
+
+ @param identifier The unique identifier for the image in the cache.
+
+ @return An image for the matching identifier, or nil.
+ */
+- (nullable UIImage *)imageWithIdentifier:(NSString *)identifier;
+@end
+
+
+/**
+ The `ImageRequestCache` protocol extends the `ImageCache` protocol by adding methods for adding, removing and fetching images from a cache given an `NSURLRequest` and additional identifier.
+ */
+@protocol AFImageRequestCache <AFImageCache>
+
+/**
+ Asks if the image should be cached using an identifier created from the request and additional identifier.
+ 
+ @param image The image to be cached.
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+ 
+ @return A BOOL indicating whether or not the image should be added to the cache. YES will cache, NO will prevent caching.
+ */
+- (BOOL)shouldCacheImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+/**
+ Adds the image to the cache using an identifier created from the request and additional identifier.
+
+ @param image The image to cache.
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+ */
+- (void)addImage:(UIImage *)image forRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+/**
+ Removes the image from the cache using an identifier created from the request and additional identifier.
+
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+ 
+ @return A BOOL indicating whether or not all images were removed from the cache.
+ */
+- (BOOL)removeImageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+/**
+ Returns the image from the cache associated with an identifier created from the request and additional identifier.
+
+ @param request The unique URL request identifing the image asset.
+ @param identifier The additional identifier to apply to the URL request to identify the image.
+
+ @return An image for the matching request and identifier, or nil.
+ */
+- (nullable UIImage *)imageforRequest:(NSURLRequest *)request withAdditionalIdentifier:(nullable NSString *)identifier;
+
+@end
+
+/**
+ The `AutoPurgingImageCache` in an in-memory image cache used to store images up to a given memory capacity. When the memory capacity is reached, the image cache is sorted by last access date, then the oldest image is continuously purged until the preferred memory usage after purge is met. Each time an image is accessed through the cache, the internal access date of the image is updated.
+ */
+@interface AFAutoPurgingImageCache : NSObject <AFImageRequestCache>
+
+/**
+ The total memory capacity of the cache in bytes.
+ */
+@property (nonatomic, assign) UInt64 memoryCapacity;
+
+/**
+ The preferred memory usage after purge in bytes. During a purge, images will be purged until the memory capacity drops below this limit.
+ */
+@property (nonatomic, assign) UInt64 preferredMemoryUsageAfterPurge;
+
+/**
+ The current total memory usage in bytes of all images stored within the cache.
+ */
+@property (nonatomic, assign, readonly) UInt64 memoryUsage;
+
+/**
+ Initialies the `AutoPurgingImageCache` instance with default values for memory capacity and preferred memory usage after purge limit. `memoryCapcity` defaults to `100 MB`. `preferredMemoryUsageAfterPurge` defaults to `60 MB`.
+
+ @return The new `AutoPurgingImageCache` instance.
+ */
+- (instancetype)init;
+
+/**
+ Initialies the `AutoPurgingImageCache` instance with the given memory capacity and preferred memory usage
+ after purge limit.
+
+ @param memoryCapacity The total memory capacity of the cache in bytes.
+ @param preferredMemoryCapacity The preferred memory usage after purge in bytes.
+
+ @return The new `AutoPurgingImageCache` instance.
+ */
+- (instancetype)initWithMemoryCapacity:(UInt64)memoryCapacity preferredMemoryCapacity:(UInt64)preferredMemoryCapacity;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif
+

+ 49 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFCompatibilityMacros.h

@@ -0,0 +1,49 @@
+// AFCompatibilityMacros.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#ifndef AFCompatibilityMacros_h
+#define AFCompatibilityMacros_h
+
+#ifdef API_AVAILABLE
+    #define AF_API_AVAILABLE(...) API_AVAILABLE(__VA_ARGS__)
+#else
+    #define AF_API_AVAILABLE(...)
+#endif // API_AVAILABLE
+
+#ifdef API_UNAVAILABLE
+    #define AF_API_UNAVAILABLE(...) API_UNAVAILABLE(__VA_ARGS__)
+#else
+    #define AF_API_UNAVAILABLE(...)
+#endif // API_UNAVAILABLE
+
+#if __has_warning("-Wunguarded-availability-new")
+    #define AF_CAN_USE_AT_AVAILABLE 1
+#else
+    #define AF_CAN_USE_AT_AVAILABLE 0
+#endif
+
+#if ((__IPHONE_OS_VERSION_MAX_ALLOWED && __IPHONE_OS_VERSION_MAX_ALLOWED < 100000) || (__MAC_OS_VERSION_MAX_ALLOWED && __MAC_OS_VERSION_MAX_ALLOWED < 101200) ||(__WATCH_OS_MAX_VERSION_ALLOWED && __WATCH_OS_MAX_VERSION_ALLOWED < 30000) ||(__TV_OS_MAX_VERSION_ALLOWED && __TV_OS_MAX_VERSION_ALLOWED < 100000))
+    #define AF_CAN_INCLUDE_SESSION_TASK_METRICS 0
+#else
+    #define AF_CAN_INCLUDE_SESSION_TASK_METRICS 1
+#endif
+
+#endif /* AFCompatibilityMacros_h */

+ 285 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFHTTPSessionManager.h

@@ -0,0 +1,285 @@
+// AFHTTPSessionManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+#endif
+#import <TargetConditionals.h>
+
+#import "AFURLSessionManager.h"
+
+/**
+ `AFHTTPSessionManager` is a subclass of `AFURLSessionManager` with convenience methods for making HTTP requests. When a `baseURL` is provided, requests made with the `GET` / `POST` / et al. convenience methods can be made with relative paths.
+
+ ## Subclassing Notes
+
+ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application.
+
+ ## Methods to Override
+
+ To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`.
+
+ ## Serialization
+
+ Requests created by an HTTP client will contain default headers and encode parameters according to the `requestSerializer` property, which is an object conforming to `<AFURLRequestSerialization>`.
+
+ Responses received from the server are automatically validated and serialized by the `responseSerializers` property, which is an object conforming to `<AFURLResponseSerialization>`
+
+ ## URL Construction Using Relative Paths
+
+ For HTTP convenience methods, the request serializer constructs URLs from the path relative to the `-baseURL`, using `NSURL +URLWithString:relativeToURL:`, when provided. If `baseURL` is `nil`, `path` needs to resolve to a valid `NSURL` object using `NSURL +URLWithString:`.
+
+ Below are a few examples of how `baseURL` and relative paths interact:
+
+    NSURL *baseURL = [NSURL URLWithString:@"http://example.com/v1/"];
+    [NSURL URLWithString:@"foo" relativeToURL:baseURL];                  // http://example.com/v1/foo
+    [NSURL URLWithString:@"foo?bar=baz" relativeToURL:baseURL];          // http://example.com/v1/foo?bar=baz
+    [NSURL URLWithString:@"/foo" relativeToURL:baseURL];                 // http://example.com/foo
+    [NSURL URLWithString:@"foo/" relativeToURL:baseURL];                 // http://example.com/v1/foo
+    [NSURL URLWithString:@"/foo/" relativeToURL:baseURL];                // http://example.com/foo/
+    [NSURL URLWithString:@"http://example2.com/" relativeToURL:baseURL]; // http://example2.com/
+
+ Also important to note is that a trailing slash will be added to any `baseURL` without one. This would otherwise cause unexpected behavior when constructing URLs using paths without a leading slash.
+
+ @warning Managers for background sessions must be owned for the duration of their use. This can be accomplished by creating an application-wide or shared singleton instance.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFHTTPSessionManager : AFURLSessionManager <NSSecureCoding, NSCopying>
+
+/**
+ The URL used to construct requests from relative paths in methods like `requestWithMethod:URLString:parameters:`, and the `GET` / `POST` / et al. convenience methods.
+ */
+@property (readonly, nonatomic, strong, nullable) NSURL *baseURL;
+
+/**
+ Requests created with `requestWithMethod:URLString:parameters:` & `multipartFormRequestWithMethod:URLString:parameters:constructingBodyWithBlock:` are constructed with a set of default headers using a parameter serialization specified by this property. By default, this is set to an instance of `AFHTTPRequestSerializer`, which serializes query string parameters for `GET`, `HEAD`, and `DELETE` requests, or otherwise URL-form-encodes HTTP message bodies.
+
+ @warning `requestSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPRequestSerializer <AFURLRequestSerialization> * requestSerializer;
+
+/**
+ Responses sent from the server in data tasks created with `dataTaskWithRequest:success:failure:` and run using the `GET` / `POST` / et al. convenience methods are automatically validated and serialized by the response serializer. By default, this property is set to an instance of `AFJSONResponseSerializer`.
+
+ @warning `responseSerializer` must not be `nil`.
+ */
+@property (nonatomic, strong) AFHTTPResponseSerializer <AFURLResponseSerialization> * responseSerializer;
+
+///-------------------------------
+/// @name Managing Security Policy
+///-------------------------------
+
+/**
+ The security policy used by created session to evaluate server trust for secure connections. `AFURLSessionManager` uses the `defaultPolicy` unless otherwise specified. A security policy configured with `AFSSLPinningModePublicKey` or `AFSSLPinningModeCertificate` can only be applied on a session manager initialized with a secure base URL (i.e. https). Applying a security policy with pinning enabled on an insecure session manager throws an `Invalid Security Policy` exception.
+ */
+@property (nonatomic, strong) AFSecurityPolicy *securityPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns an `AFHTTPSessionManager` object.
+ */
++ (instancetype)manager;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ @param url The base URL for the HTTP client.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url;
+
+/**
+ Initializes an `AFHTTPSessionManager` object with the specified base URL.
+
+ This is the designated initializer.
+
+ @param url The base URL for the HTTP client.
+ @param configuration The configuration used to create the managed session.
+
+ @return The newly-initialized HTTP client
+ */
+- (instancetype)initWithBaseURL:(nullable NSURL *)url
+           sessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER;
+
+///---------------------------
+/// @name Making HTTP Requests
+///---------------------------
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `GET` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString
+                            parameters:(nullable id)parameters
+                               headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                              progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
+                               success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                               failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `HEAD` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                success:(nullable void (^)(NSURLSessionDataTask *task))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `POST` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString
+                             parameters:(nullable id)parameters
+                                headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+              constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> formData))block
+                               progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PUT` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString
+                            parameters:(nullable id)parameters
+                               headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                               success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                               failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `PATCH` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString
+                              parameters:(nullable id)parameters
+                                 headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                 success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                 failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates and runs an `NSURLSessionDataTask` with a `DELETE` request.
+ 
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+ 
+ @see -dataTaskWithRequest:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString
+                               parameters:(nullable id)parameters
+                                  headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                  success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                  failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+/**
+ Creates an `NSURLSessionDataTask` with a custom `HTTPMethod` request.
+
+ @param method The HTTPMethod string used to create the request.
+ @param URLString The URL string used to create the request URL.
+ @param parameters The parameters to be encoded according to the client request serializer.
+ @param headers The headers appended to the default headers for this request.
+ @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue.
+ @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue.
+ @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer.
+ @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred.
+
+ @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:
+ */
+- (nullable NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method
+                                                URLString:(NSString *)URLString
+                                               parameters:(nullable id)parameters
+                                                  headers:(nullable NSDictionary <NSString *, NSString *> *)headers
+                                           uploadProgress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress
+                                         downloadProgress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress
+                                                  success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success
+                                                  failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 171 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFImageDownloader.h

@@ -0,0 +1,171 @@
+// AFImageDownloader.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV 
+
+#import <Foundation/Foundation.h>
+#import "AFAutoPurgingImageCache.h"
+#import "AFHTTPSessionManager.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) {
+    AFImageDownloadPrioritizationFIFO,
+    AFImageDownloadPrioritizationLIFO
+};
+
+/**
+ The `AFImageDownloadReceipt` is an object vended by the `AFImageDownloader` when starting a data task. It can be used to cancel active tasks running on the `AFImageDownloader` session. As a general rule, image data tasks should be cancelled using the `AFImageDownloadReceipt` instead of calling `cancel` directly on the `task` itself. The `AFImageDownloader` is optimized to handle duplicate task scenarios as well as pending versus active downloads.
+ */
+@interface AFImageDownloadReceipt : NSObject
+
+/**
+ The data task created by the `AFImageDownloader`.
+*/
+@property (nonatomic, strong) NSURLSessionDataTask *task;
+
+/**
+ The unique identifier for the success and failure blocks when duplicate requests are made.
+ */
+@property (nonatomic, strong) NSUUID *receiptID;
+@end
+
+/** The `AFImageDownloader` class is responsible for downloading images in parallel on a prioritized queue. Incoming downloads are added to the front or back of the queue depending on the download prioritization. Each downloaded image is cached in the underlying `NSURLCache` as well as the in-memory image cache. By default, any download request with a cached image equivalent in the image cache will automatically be served the cached image representation.
+ */
+@interface AFImageDownloader : NSObject
+
+/**
+ The image cache used to store all downloaded images in. `AFAutoPurgingImageCache` by default.
+ */
+@property (nonatomic, strong, nullable) id <AFImageRequestCache> imageCache;
+
+/**
+ The `AFHTTPSessionManager` used to download images. By default, this is configured with an `AFImageResponseSerializer`, and a shared `NSURLCache` for all image downloads.
+ */
+@property (nonatomic, strong) AFHTTPSessionManager *sessionManager;
+
+/**
+ Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default.
+ */
+@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritization;
+
+/**
+ The shared default instance of `AFImageDownloader` initialized with default values.
+ */
++ (instancetype)defaultInstance;
+
+/**
+ Creates a default `NSURLCache` with common usage parameter values.
+
+ @returns The default `NSURLCache` instance.
+ */
++ (NSURLCache *)defaultURLCache;
+
+/**
+ The default `NSURLSessionConfiguration` with common usage parameter values.
+ */
++ (NSURLSessionConfiguration *)defaultURLSessionConfiguration;
+
+/**
+ Default initializer
+
+ @return An instance of `AFImageDownloader` initialized with default values.
+ */
+- (instancetype)init;
+
+/**
+ Initializer with specific `URLSessionConfiguration`
+ 
+ @param configuration The `NSURLSessionConfiguration` to be be used
+ 
+ @return An instance of `AFImageDownloader` initialized with default values and custom `NSURLSessionConfiguration`
+ */
+- (instancetype)initWithSessionConfiguration:(NSURLSessionConfiguration *)configuration;
+
+/**
+ Initializes the `AFImageDownloader` instance with the given session manager, download prioritization, maximum active download count and image cache.
+
+ @param sessionManager The session manager to use to download images.
+ @param downloadPrioritization The download prioritization of the download queue.
+ @param maximumActiveDownloads  The maximum number of active downloads allowed at any given time. Recommend `4`.
+ @param imageCache The image cache used to store all downloaded images in.
+
+ @return The new `AFImageDownloader` instance.
+ */
+- (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager
+                downloadPrioritization:(AFImageDownloadPrioritization)downloadPrioritization
+                maximumActiveDownloads:(NSInteger)maximumActiveDownloads
+                            imageCache:(nullable id <AFImageRequestCache>)imageCache;
+
+/**
+ Creates a data task using the `sessionManager` instance for the specified URL request.
+
+ If the same data task is already in the queue or currently being downloaded, the success and failure blocks are
+ appended to the already existing task. Once the task completes, all success or failure blocks attached to the
+ task are executed in the order they were added.
+
+ @param request The URL request.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+
+ @return The image download receipt for the data task if available. `nil` if the image is stored in the cache.
+ cache and the URL request cache policy allows the cache to be used.
+ */
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                        success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse  * _Nullable response, UIImage *responseObject))success
+                                                        failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+/**
+ Creates a data task using the `sessionManager` instance for the specified URL request.
+
+ If the same data task is already in the queue or currently being downloaded, the success and failure blocks are
+ appended to the already existing task. Once the task completes, all success or failure blocks attached to the
+ task are executed in the order they were added.
+
+ @param request The URL request.
+ @param receiptID The identifier to use for the download receipt that will be created for this request. This must be a unique identifier that does not represent any other request.
+ @param success A block to be executed when the image data task finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the image created from the response data of request. If the image was returned from cache, the response parameter will be `nil`.
+ @param failure A block object to be executed when the image data task finishes unsuccessfully, or that finishes successfully. This block has no return value and takes three arguments: the request sent from the client, the response received from the server, and the error object describing the network or parsing error that occurred.
+
+ @return The image download receipt for the data task if available. `nil` if the image is stored in the cache.
+ cache and the URL request cache policy allows the cache to be used.
+ */
+- (nullable AFImageDownloadReceipt *)downloadImageForURLRequest:(NSURLRequest *)request
+                                                 withReceiptID:(NSUUID *)receiptID
+                                                        success:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse  * _Nullable response, UIImage *responseObject))success
+                                                        failure:(nullable void (^)(NSURLRequest *request, NSHTTPURLResponse * _Nullable response, NSError *error))failure;
+
+/**
+ Cancels the data task in the receipt by removing the corresponding success and failure blocks and cancelling the data task if necessary.
+
+ If the data task is pending in the queue, it will be cancelled if no other success and failure blocks are registered with the data task. If the data task is currently executing or is already completed, the success and failure blocks are removed and will not be called when the task finishes.
+
+ @param imageDownloadReceipt The image download receipt to cancel.
+ */
+- (void)cancelTaskForImageDownloadReceipt:(AFImageDownloadReceipt *)imageDownloadReceipt;
+
+@end
+
+#endif
+
+NS_ASSUME_NONNULL_END

+ 103 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworkActivityIndicatorManager.h

@@ -0,0 +1,103 @@
+// AFNetworkActivityIndicatorManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#import <TargetConditionals.h>
+
+#if TARGET_OS_IOS
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `AFNetworkActivityIndicatorManager` manages the state of the network activity indicator in the status bar. When enabled, it will listen for notifications indicating that a session task has started or finished, and start or stop animating the indicator accordingly. The number of active requests is incremented and decremented much like a stack or a semaphore, and the activity indicator will animate so long as that number is greater than zero.
+
+ You should enable the shared instance of `AFNetworkActivityIndicatorManager` when your application finishes launching. In `AppDelegate application:didFinishLaunchingWithOptions:` you can do so with the following code:
+
+    [[AFNetworkActivityIndicatorManager sharedManager] setEnabled:YES];
+
+ By setting `enabled` to `YES` for `sharedManager`, the network activity indicator will show and hide automatically as requests start and finish. You should not ever need to call `incrementActivityCount` or `decrementActivityCount` yourself.
+
+ See the Apple Human Interface Guidelines section about the Network Activity Indicator for more information:
+ http://developer.apple.com/library/iOS/#documentation/UserExperience/Conceptual/MobileHIG/UIElementGuidelines/UIElementGuidelines.html#//apple_ref/doc/uid/TP40006556-CH13-SW44
+ */
+NS_EXTENSION_UNAVAILABLE_IOS("Use view controller based solutions where appropriate instead.")
+@interface AFNetworkActivityIndicatorManager : NSObject
+
+/**
+ A Boolean value indicating whether the manager is enabled.
+
+ If YES, the manager will change status bar network activity indicator according to network operation notifications it receives. The default value is NO.
+ */
+@property (nonatomic, assign, getter = isEnabled) BOOL enabled;
+
+/**
+ A Boolean value indicating whether the network activity indicator manager is currently active.
+*/
+@property (readonly, nonatomic, assign, getter=isNetworkActivityIndicatorVisible) BOOL networkActivityIndicatorVisible;
+
+/**
+ A time interval indicating the minimum duration of networking activity that should occur before the activity indicator is displayed. The default value 1 second. If the network activity indicator should be displayed immediately when network activity occurs, this value should be set to 0 seconds.
+ 
+ Apple's HIG describes the following:
+
+ > Display the network activity indicator to provide feedback when your app accesses the network for more than a couple of seconds. If the operation finishes sooner than that, you don’t have to show the network activity indicator, because the indicator is likely to disappear before users notice its presence.
+
+ */
+@property (nonatomic, assign) NSTimeInterval activationDelay;
+
+/**
+ A time interval indicating the duration of time of no networking activity required before the activity indicator is disabled. This allows for continuous display of the network activity indicator across multiple requests. The default value is 0.17 seconds.
+ */
+
+@property (nonatomic, assign) NSTimeInterval completionDelay;
+
+/**
+ Returns the shared network activity indicator manager object for the system.
+
+ @return The systemwide network activity indicator manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Increments the number of active network requests. If this number was zero before incrementing, this will start animating the status bar network activity indicator.
+ */
+- (void)incrementActivityCount;
+
+/**
+ Decrements the number of active network requests. If this number becomes zero after decrementing, this will stop animating the status bar network activity indicator.
+ */
+- (void)decrementActivityCount;
+
+/**
+ Set the a custom method to be executed when the network activity indicator manager should be hidden/shown. By default, this is null, and the UIApplication Network Activity Indicator will be managed automatically. If this block is set, it is the responsiblity of the caller to manager the network activity indicator going forward.
+
+ @param block A block to be executed when the network activity indicator status changes.
+ */
+- (void)setNetworkingActivityActionWithBlock:(nullable void (^)(BOOL networkActivityIndicatorVisible))block;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+#endif

+ 216 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworkReachabilityManager.h

@@ -0,0 +1,216 @@
+// AFNetworkReachabilityManager.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+#if !TARGET_OS_WATCH
+#import <SystemConfiguration/SystemConfiguration.h>
+
+typedef NS_ENUM(NSInteger, AFNetworkReachabilityStatus) {
+    AFNetworkReachabilityStatusUnknown          = -1,
+    AFNetworkReachabilityStatusNotReachable     = 0,
+    AFNetworkReachabilityStatusReachableViaWWAN = 1,
+    AFNetworkReachabilityStatusReachableViaWiFi = 2,
+};
+
+NS_ASSUME_NONNULL_BEGIN
+
+/**
+ `AFNetworkReachabilityManager` monitors the reachability of domains, and addresses for both WWAN and WiFi network interfaces.
+
+ Reachability can be used to determine background information about why a network operation failed, or to trigger a network operation retrying when a connection is established. It should not be used to prevent a user from initiating a network request, as it's possible that an initial request may be required to establish reachability.
+
+ See Apple's Reachability Sample Code ( https://developer.apple.com/library/ios/samplecode/reachability/ )
+
+ @warning Instances of `AFNetworkReachabilityManager` must be started with `-startMonitoring` before reachability status can be determined.
+ */
+@interface AFNetworkReachabilityManager : NSObject
+
+/**
+ The current network reachability status.
+ */
+@property (readonly, nonatomic, assign) AFNetworkReachabilityStatus networkReachabilityStatus;
+
+/**
+ Whether or not the network is currently reachable.
+ */
+@property (readonly, nonatomic, assign, getter = isReachable) BOOL reachable;
+
+/**
+ Whether or not the network is currently reachable via WWAN.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWWAN) BOOL reachableViaWWAN;
+
+/**
+ Whether or not the network is currently reachable via WiFi.
+ */
+@property (readonly, nonatomic, assign, getter = isReachableViaWiFi) BOOL reachableViaWiFi;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Returns the shared network reachability manager.
+ */
++ (instancetype)sharedManager;
+
+/**
+ Creates and returns a network reachability manager with the default socket address.
+ 
+ @return An initialized network reachability manager, actively monitoring the default socket address.
+ */
++ (instancetype)manager;
+
+/**
+ Creates and returns a network reachability manager for the specified domain.
+
+ @param domain The domain used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified domain.
+ */
++ (instancetype)managerForDomain:(NSString *)domain;
+
+/**
+ Creates and returns a network reachability manager for the socket address.
+
+ @param address The socket address (`sockaddr_in6`) used to evaluate network reachability.
+
+ @return An initialized network reachability manager, actively monitoring the specified socket address.
+ */
++ (instancetype)managerForAddress:(const void *)address;
+
+/**
+ Initializes an instance of a network reachability manager from the specified reachability object.
+
+ @param reachability The reachability object to monitor.
+
+ @return An initialized network reachability manager, actively monitoring the specified reachability.
+ */
+- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;
+
+/**
+ *  Unavailable initializer
+ */
++ (instancetype)new NS_UNAVAILABLE;
+
+/**
+ *  Unavailable initializer
+ */
+- (instancetype)init NS_UNAVAILABLE;
+
+///--------------------------------------------------
+/// @name Starting & Stopping Reachability Monitoring
+///--------------------------------------------------
+
+/**
+ Starts monitoring for changes in network reachability status.
+ */
+- (void)startMonitoring;
+
+/**
+ Stops monitoring for changes in network reachability status.
+ */
+- (void)stopMonitoring;
+
+///-------------------------------------------------
+/// @name Getting Localized Reachability Description
+///-------------------------------------------------
+
+/**
+ Returns a localized string representation of the current network reachability status.
+ */
+- (NSString *)localizedNetworkReachabilityStatusString;
+
+///---------------------------------------------------
+/// @name Setting Network Reachability Change Callback
+///---------------------------------------------------
+
+/**
+ Sets a callback to be executed when the network availability of the `baseURL` host changes.
+
+ @param block A block object to be executed when the network availability of the `baseURL` host changes.. This block has no return value and takes a single argument which represents the various reachability states from the device to the `baseURL`.
+ */
+- (void)setReachabilityStatusChangeBlock:(nullable void (^)(AFNetworkReachabilityStatus status))block;
+
+@end
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## Network Reachability
+
+ The following constants are provided by `AFNetworkReachabilityManager` as possible network reachability statuses.
+
+ enum {
+ AFNetworkReachabilityStatusUnknown,
+ AFNetworkReachabilityStatusNotReachable,
+ AFNetworkReachabilityStatusReachableViaWWAN,
+ AFNetworkReachabilityStatusReachableViaWiFi,
+ }
+
+ `AFNetworkReachabilityStatusUnknown`
+ The `baseURL` host reachability is not known.
+
+ `AFNetworkReachabilityStatusNotReachable`
+ The `baseURL` host cannot be reached.
+
+ `AFNetworkReachabilityStatusReachableViaWWAN`
+ The `baseURL` host can be reached via a cellular connection, such as EDGE or GPRS.
+
+ `AFNetworkReachabilityStatusReachableViaWiFi`
+ The `baseURL` host can be reached via a Wi-Fi connection.
+
+ ### Keys for Notification UserInfo Dictionary
+
+ Strings that are used as keys in a `userInfo` dictionary in a network reachability status change notification.
+
+ `AFNetworkingReachabilityNotificationStatusItem`
+ A key in the userInfo dictionary in a `AFNetworkingReachabilityDidChangeNotification` notification.
+ The corresponding value is an `NSNumber` object representing the `AFNetworkReachabilityStatus` value for the current reachability status.
+ */
+
+///--------------------
+/// @name Notifications
+///--------------------
+
+/**
+ Posted when network reachability changes.
+ This notification assigns no notification object. The `userInfo` dictionary contains an `NSNumber` object under the `AFNetworkingReachabilityNotificationStatusItem` key, representing the `AFNetworkReachabilityStatus` value for the current network reachability.
+
+ @warning In order for network reachability to be monitored, include the `SystemConfiguration` framework in the active target's "Link Binary With Library" build phase, and add `#import <SystemConfiguration/SystemConfiguration.h>` to the header prefix of the project (`Prefix.pch`).
+ */
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityDidChangeNotification;
+FOUNDATION_EXPORT NSString * const AFNetworkingReachabilityNotificationStatusItem;
+
+///--------------------
+/// @name Functions
+///--------------------
+
+/**
+ Returns a localized string representation of an `AFNetworkReachabilityStatus` value.
+ */
+FOUNDATION_EXPORT NSString * AFStringFromNetworkReachabilityStatus(AFNetworkReachabilityStatus status);
+
+NS_ASSUME_NONNULL_END
+#endif

+ 66 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFNetworking.h

@@ -0,0 +1,66 @@
+// AFNetworking.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+
+//! Project version number for AFNetworking.
+FOUNDATION_EXPORT double AFNetworkingVersionNumber;
+
+//! Project version string for AFNetworking.
+FOUNDATION_EXPORT const unsigned char AFNetworkingVersionString[];
+
+// In this header, you should import all the public headers of your framework using statements like #import <AFNetworking/PublicHeader.h>
+
+#import <Availability.h>
+#import <TargetConditionals.h>
+
+#ifndef _AFNETWORKING_
+#define _AFNETWORKING_
+
+#import <AFNetworking/AFURLRequestSerialization.h>
+#import <AFNetworking/AFURLResponseSerialization.h>
+#import <AFNetworking/AFSecurityPolicy.h>
+#import <AFNetworking/AFCompatibilityMacros.h>
+
+#if !TARGET_OS_WATCH
+#import <AFNetworking/AFNetworkReachabilityManager.h>
+#endif
+
+#import <AFNetworking/AFURLSessionManager.h>
+#import <AFNetworking/AFHTTPSessionManager.h>
+
+#if TARGET_OS_IOS || TARGET_OS_TV
+#import <AFNetworking/AFAutoPurgingImageCache.h>
+#import <AFNetworking/AFImageDownloader.h>
+#import <AFNetworking/UIActivityIndicatorView+AFNetworking.h>
+#import <AFNetworking/UIButton+AFNetworking.h>
+#import <AFNetworking/UIImageView+AFNetworking.h>
+#import <AFNetworking/UIProgressView+AFNetworking.h>
+#endif
+
+#if TARGET_OS_IOS
+#import <AFNetworking/AFNetworkActivityIndicatorManager.h>
+#import <AFNetworking/UIRefreshControl+AFNetworking.h>
+#import <AFNetworking/WKWebView+AFNetworking.h>
+#endif
+
+
+#endif /* _AFNETWORKING_ */

+ 161 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFSecurityPolicy.h

@@ -0,0 +1,161 @@
+// AFSecurityPolicy.h
+// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to deal
+// in the Software without restriction, including without limitation the rights
+// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+// copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+// THE SOFTWARE.
+
+#import <Foundation/Foundation.h>
+#import <Security/Security.h>
+
+typedef NS_ENUM(NSUInteger, AFSSLPinningMode) {
+    AFSSLPinningModeNone,
+    AFSSLPinningModePublicKey,
+    AFSSLPinningModeCertificate,
+};
+
+/**
+ `AFSecurityPolicy` evaluates server trust against pinned X.509 certificates and public keys over secure connections.
+
+ Adding pinned SSL certificates to your app helps prevent man-in-the-middle attacks and other vulnerabilities. Applications dealing with sensitive customer data or financial information are strongly encouraged to route all communication over an HTTPS connection with SSL pinning configured and enabled.
+ */
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface AFSecurityPolicy : NSObject <NSSecureCoding, NSCopying>
+
+/**
+ The criteria by which server trust should be evaluated against the pinned SSL certificates. Defaults to `AFSSLPinningModeNone`.
+ */
+@property (readonly, nonatomic, assign) AFSSLPinningMode SSLPinningMode;
+
+/**
+ The certificates used to evaluate server trust according to the SSL pinning mode. 
+ 
+ Note that if pinning is enabled, `evaluateServerTrust:forDomain:` will return true if any pinned certificate matches.
+
+ @see policyWithPinningMode:withPinnedCertificates:
+ */
+@property (nonatomic, strong, nullable) NSSet <NSData *> *pinnedCertificates;
+
+/**
+ Whether or not to trust servers with an invalid or expired SSL certificates. Defaults to `NO`.
+ */
+@property (nonatomic, assign) BOOL allowInvalidCertificates;
+
+/**
+ Whether or not to validate the domain name in the certificate's CN field. Defaults to `YES`.
+ */
+@property (nonatomic, assign) BOOL validatesDomainName;
+
+///-----------------------------------------
+/// @name Getting Certificates from the Bundle
+///-----------------------------------------
+
+/**
+ Returns any certificates included in the bundle. If you are using AFNetworking as an embedded framework, you must use this method to find the certificates you have included in your app bundle, and use them when creating your security policy by calling `policyWithPinningMode:withPinnedCertificates`.
+
+ @return The certificates included in the given bundle.
+ */
++ (NSSet <NSData *> *)certificatesInBundle:(NSBundle *)bundle;
+
+///-----------------------------------------
+/// @name Getting Specific Security Policies
+///-----------------------------------------
+
+/**
+ Returns the shared default security policy, which does not allow invalid certificates, validates domain name, and does not validate against pinned certificates or public keys.
+
+ @return The default security policy.
+ */
++ (instancetype)defaultPolicy;
+
+///---------------------
+/// @name Initialization
+///---------------------
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+ 
+ Certificates with the `.cer` extension found in the main bundle will be pinned. If you want more control over which certificates are pinned, please use `policyWithPinningMode:withPinnedCertificates:` instead.
+
+ @param pinningMode The SSL pinning mode.
+
+ @return A new security policy.
+
+ @see -policyWithPinningMode:withPinnedCertificates:
+ */
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode;
+
+/**
+ Creates and returns a security policy with the specified pinning mode.
+
+ @param pinningMode The SSL pinning mode.
+ @param pinnedCertificates The certificates to pin against.
+
+ @return A new security policy.
+
+ @see +certificatesInBundle:
+ @see -pinnedCertificates
+*/
++ (instancetype)policyWithPinningMode:(AFSSLPinningMode)pinningMode withPinnedCertificates:(NSSet <NSData *> *)pinnedCertificates;
+
+///------------------------------
+/// @name Evaluating Server Trust
+///------------------------------
+
+/**
+ Whether or not the specified server trust should be accepted, based on the security policy.
+
+ This method should be used when responding to an authentication challenge from a server.
+
+ @param serverTrust The X.509 certificate trust of the server.
+ @param domain The domain of serverTrust. If `nil`, the domain will not be validated.
+
+ @return Whether or not to trust the server.
+ */
+- (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust
+                  forDomain:(nullable NSString *)domain;
+
+@end
+
+NS_ASSUME_NONNULL_END
+
+///----------------
+/// @name Constants
+///----------------
+
+/**
+ ## SSL Pinning Modes
+
+ The following constants are provided by `AFSSLPinningMode` as possible SSL pinning modes.
+
+ enum {
+ AFSSLPinningModeNone,
+ AFSSLPinningModePublicKey,
+ AFSSLPinningModeCertificate,
+ }
+
+ `AFSSLPinningModeNone`
+ Do not used pinned certificates to validate servers.
+
+ `AFSSLPinningModePublicKey`
+ Validate host certificates against public keys of pinned certificates.
+
+ `AFSSLPinningModeCertificate`
+ Validate host certificates against pinned certificates.
+*/

+ 0 - 0
KMAdvertisementDemo_iOS/AFNetworking.framework/Headers/AFURLRequestSerialization.h


Some files were not shown because too many files changed in this diff