ZLPhotoConfiguration.swift 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580
  1. //
  2. // ZLPhotoConfiguration.swift
  3. // ZLPhotoBrowser
  4. //
  5. // Created by long on 2020/8/11.
  6. //
  7. // Copyright (c) 2020 Long Zhang <495181165@qq.com>
  8. //
  9. // Permission is hereby granted, free of charge, to any person obtaining a copy
  10. // of this software and associated documentation files (the "Software"), to deal
  11. // in the Software without restriction, including without limitation the rights
  12. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  13. // copies of the Software, and to permit persons to whom the Software is
  14. // furnished to do so, subject to the following conditions:
  15. //
  16. // The above copyright notice and this permission notice shall be included in
  17. // all copies or substantial portions of the Software.
  18. //
  19. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  20. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  21. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  22. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  23. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  24. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  25. // THE SOFTWARE.
  26. import UIKit
  27. import Photos
  28. public typealias Second = Int
  29. public class ZLPhotoConfiguration: NSObject {
  30. private static var single = ZLPhotoConfiguration()
  31. @objc public class func `default`() -> ZLPhotoConfiguration {
  32. return ZLPhotoConfiguration.single
  33. }
  34. @objc public class func resetConfiguration() {
  35. ZLPhotoConfiguration.single = ZLPhotoConfiguration()
  36. }
  37. /// Framework style.
  38. @objc public var style: ZLPhotoBrowserStyle = .embedAlbumList
  39. @objc public var statusBarStyle: UIStatusBarStyle = .lightContent
  40. /// Photo sorting method, the preview interface is not affected by this parameter. Defaults to true.
  41. @objc public var sortAscending = true
  42. private var pri_maxSelectCount = 9
  43. /// Anything superior than 1 will enable the multiple selection feature. Defaults to 9.
  44. @objc public var maxSelectCount: Int {
  45. set {
  46. pri_maxSelectCount = max(1, newValue)
  47. }
  48. get {
  49. return pri_maxSelectCount
  50. }
  51. }
  52. private var pri_maxVideoSelectCount = 0
  53. /// A count for video max selection. Defaults to 0.
  54. /// - warning: Only valid in mix selection mode. (i.e. allowMixSelect = true)
  55. @objc public var maxVideoSelectCount: Int {
  56. set {
  57. pri_maxVideoSelectCount = newValue
  58. }
  59. get {
  60. if pri_maxVideoSelectCount <= 0 {
  61. return maxSelectCount
  62. } else {
  63. return max(minVideoSelectCount, min(pri_maxVideoSelectCount, maxSelectCount))
  64. }
  65. }
  66. }
  67. private var pri_minVideoSelectCount = 0
  68. /// A count for video min selection. Defaults to 0.
  69. /// - warning: Only valid in mix selection mode. (i.e. allowMixSelect = true)
  70. @objc public var minVideoSelectCount: Int {
  71. set {
  72. pri_minVideoSelectCount = newValue
  73. }
  74. get {
  75. return min(maxSelectCount, max(pri_minVideoSelectCount, 0))
  76. }
  77. }
  78. /// Whether photos and videos can be selected together. Default is true.
  79. /// If set to false, only one video can be selected. Defaults to true.
  80. @objc public var allowMixSelect = true
  81. /// Preview selection max preview count, if the value is zero, only show `Camera`, `Album`, `Cancel` buttons. Defaults to 20.
  82. @objc public var maxPreviewCount = 20
  83. @objc public var cellCornerRadio: CGFloat = 0
  84. /// If set to false, gif and livephoto cannot be selected either. Defaults to true.
  85. @objc public var allowSelectImage = true
  86. @objc public var allowSelectVideo = true
  87. /// Allow select Gif, it only controls whether it is displayed in Gif form.
  88. /// If value is false, the Gif logo is not displayed. Defaults to true.
  89. @objc public var allowSelectGif = true
  90. /// Allow select LivePhoto, it only controls whether it is displayed in LivePhoto form.
  91. /// If value is false, the LivePhoto logo is not displayed. Defaults to false.
  92. @objc public var allowSelectLivePhoto = false
  93. private var pri_allowTakePhotoInLibrary = true
  94. /// Allow take photos in the album. Defaults to true.
  95. /// - warning: If allowTakePhoto and allowRecordVideo are both false, it will not be displayed.
  96. @objc public var allowTakePhotoInLibrary: Bool {
  97. set {
  98. pri_allowTakePhotoInLibrary = newValue
  99. }
  100. get {
  101. return pri_allowTakePhotoInLibrary && (allowTakePhoto || allowRecordVideo)
  102. }
  103. }
  104. @objc public var allowEditImage = true
  105. /// - warning: The video can only be edited when no photos are selected, or only one video is selected, and the selection callback is executed immediately after editing is completed.
  106. @objc public var allowEditVideo = false
  107. /// Animation duration for select button
  108. @objc public var selectBtnAnimationDuration: CFTimeInterval = 0.4
  109. /// After selecting a image/video in the thumbnail interface, enter the editing interface directly. Defaults to false.
  110. /// - discussion: Editing image is only valid when allowEditImage is true and maxSelectCount is 1.
  111. /// Editing video is only valid when allowEditVideo is true and maxSelectCount is 1.
  112. @objc public var editAfterSelectThumbnailImage = false
  113. /// Only valid when allowMixSelect is false and allowEditVideo is true. Defaults to true.
  114. /// Just like the Wechat-Timeline selection style. If you want to crop the video after select thumbnail under allowMixSelect = true, please use **editAfterSelectThumbnailImage**.
  115. @objc public var cropVideoAfterSelectThumbnail = true
  116. /// If image edit tools only has clip and this property is true. When you click edit, the cropping interface (i.e. ZLClipImageViewController) will be displayed. Defaults to false.
  117. @objc public var showClipDirectlyIfOnlyHasClipTool = false
  118. /// Save the edited image to the album after editing. Defaults to true.
  119. @objc public var saveNewImageAfterEdit = true
  120. /// If true, you can slide select photos in album. Defaults to true.
  121. @objc public var allowSlideSelect = true
  122. /// When slide select is active, will auto scroll to top or bottom when your finger at the top or bottom. Defaults to true.
  123. @objc public var autoScrollWhenSlideSelectIsActive = true
  124. /// The max speed (pt/s) of auto scroll. Defaults to 600.
  125. @objc public var autoScrollMaxSpeed: CGFloat = 600
  126. /// If true, you can drag select photo when preview selection style. Defaults to false.
  127. @objc public var allowDragSelect = false
  128. /// Allow select full image. Defaults to true.
  129. @objc public var allowSelectOriginal = true
  130. /// Allow access to the preview large image interface (That is, whether to allow access to the large image interface after clicking the thumbnail image). Defaults to true.
  131. @objc public var allowPreviewPhotos = true
  132. /// Whether to show the status bar when previewing photos. Defaults to false.
  133. @objc public var showStatusBarInPreviewInterface = false
  134. /// Whether to show the preview button (i.e. the preview button in the lower left corner of the thumbnail interface). Defaults to true.
  135. @objc public var showPreviewButtonInAlbum = true
  136. private var pri_columnCount: Int = 4
  137. /// The column count when iPhone is in portait mode. Minimum is 2, maximum is 6. Defaults to 4.
  138. /// ```
  139. /// iPhone landscape mode: columnCount += 2.
  140. /// iPad portait mode: columnCount += 2.
  141. /// iPad landscape mode: columnCount += 4.
  142. /// ```
  143. @objc public var columnCount: Int {
  144. set {
  145. pri_columnCount = min(6, max(newValue, 2))
  146. }
  147. get {
  148. return pri_columnCount
  149. }
  150. }
  151. /// Maximum cropping time when editing video, unit: second. Defaults to 10.
  152. @objc public var maxEditVideoTime: Second = 10
  153. /// Allow to choose the maximum duration of the video. Defaults to 120.
  154. @objc public var maxSelectVideoDuration: Second = 120
  155. /// Allow to choose the minimum duration of the video. Defaults to 0.
  156. @objc public var minSelectVideoDuration: Second = 0
  157. private var pri_editImageTools: [ZLEditImageViewController.EditImageTool] = [.draw, .clip, .imageSticker, .textSticker, .mosaic, .filter]
  158. /// Edit image tools. (Default order is draw, clip, imageSticker, textSticker, mosaic, filtter)
  159. /// Because Objective-C Array can't contain Enum styles, so this property is invalid in Objective-C.
  160. /// - warning: If you want to use the image sticker feature, you must provide a view that implements ZLImageStickerContainerDelegate.
  161. public var editImageTools: [ZLEditImageViewController.EditImageTool] {
  162. set {
  163. pri_editImageTools = newValue
  164. }
  165. get {
  166. if pri_editImageTools.isEmpty {
  167. return [.draw, .clip, .imageSticker, .textSticker, .mosaic, .filter]
  168. } else {
  169. return pri_editImageTools
  170. }
  171. }
  172. }
  173. private var pri_editImageDrawColors: [UIColor] = [.white, .black, zlRGB(241, 79, 79), zlRGB(243, 170, 78), zlRGB(80, 169, 56), zlRGB(30, 183, 243), zlRGB(139, 105, 234)]
  174. /// Draw colors for image editor.
  175. @objc public var editImageDrawColors: [UIColor] {
  176. set {
  177. pri_editImageDrawColors = newValue
  178. }
  179. get {
  180. if pri_editImageDrawColors.isEmpty {
  181. return [.white, .black, zlRGB(241, 79, 79), zlRGB(243, 170, 78), zlRGB(80, 169, 56), zlRGB(30, 183, 243), zlRGB(139, 105, 234)]
  182. } else {
  183. return pri_editImageDrawColors
  184. }
  185. }
  186. }
  187. /// The default draw color. If this color not in editImageDrawColors, will pick the first color in editImageDrawColors as the default.
  188. @objc public var editImageDefaultDrawColor = zlRGB(241, 79, 79)
  189. private var pri_editImageClipRatios: [ZLImageClipRatio] = [.custom]
  190. /// Edit ratios for image editor.
  191. @objc public var editImageClipRatios: [ZLImageClipRatio] {
  192. set {
  193. pri_editImageClipRatios = newValue
  194. }
  195. get {
  196. if pri_editImageClipRatios.isEmpty {
  197. return [.custom]
  198. } else {
  199. return pri_editImageClipRatios
  200. }
  201. }
  202. }
  203. private var pri_textStickerTextColors: [UIColor] = [.white, .black, zlRGB(241, 79, 79), zlRGB(243, 170, 78), zlRGB(80, 169, 56), zlRGB(30, 183, 243), zlRGB(139, 105, 234)]
  204. /// Text sticker colors for image editor.
  205. @objc public var textStickerTextColors: [UIColor] {
  206. set {
  207. pri_textStickerTextColors = newValue
  208. }
  209. get {
  210. if pri_textStickerTextColors.isEmpty {
  211. return [.white, .black, zlRGB(241, 79, 79), zlRGB(243, 170, 78), zlRGB(80, 169, 56), zlRGB(30, 183, 243), zlRGB(139, 105, 234)]
  212. } else {
  213. return pri_textStickerTextColors
  214. }
  215. }
  216. }
  217. /// The default text sticker color. If this color not in textStickerTextColors, will pick the first color in textStickerTextColors as the default.
  218. @objc public var textStickerDefaultTextColor = UIColor.white
  219. private var pri_filters: [ZLFilter] = ZLFilter.all
  220. /// Filters for image editor.
  221. @objc public var filters: [ZLFilter] {
  222. set {
  223. pri_filters = newValue
  224. }
  225. get {
  226. if pri_filters.isEmpty {
  227. return ZLFilter.all
  228. } else {
  229. return pri_filters
  230. }
  231. }
  232. }
  233. @objc public var imageStickerContainerView: (UIView & ZLImageStickerContainerDelegate)? = nil
  234. /// Show the image captured by the camera is displayed on the camera button inside the album. Defaults to false.
  235. @objc public var showCaptureImageOnTakePhotoBtn = false
  236. /// In single selection mode, whether to display the selection button. Defaults to false.
  237. @objc public var showSelectBtnWhenSingleSelect = false
  238. /// Overlay a mask layer on top of the selected photos. Defaults to true.
  239. @objc public var showSelectedMask = true
  240. /// Display a border on the selected photos cell. Defaults to false.
  241. @objc public var showSelectedBorder = false
  242. /// Overlay a mask layer above the cells that cannot be selected. Defaults to true.
  243. @objc public var showInvalidMask = true
  244. /// Display the index of the selected photos. Defaults to true.
  245. @objc public var showSelectedIndex = true
  246. /// Display the selected photos at the bottom of the preview large photos interface. Defaults to true.
  247. @objc public var showSelectedPhotoPreview = true
  248. /// Developers can customize images, but the name of the custom image resource must be consistent with the image name in the replaced bundle.
  249. /// - example: Developers need to replace the selected and unselected image resources, and the array that needs to be passed in is
  250. /// ["zl_btn_selected", "zl_btn_unselected"].
  251. @objc public var customImageNames: [String] = [] {
  252. didSet {
  253. ZLCustomImageDeploy.deploy = self.customImageNames
  254. }
  255. }
  256. /// Allow framework fetch photos when callback. Defaults to true.
  257. @objc public var shouldAnialysisAsset = true
  258. /// Timeout for image parsing. Defaults to 20.
  259. @objc public var timeout: TimeInterval = 20
  260. /// Language for framework.
  261. @objc public var languageType: ZLLanguageType = .system {
  262. didSet {
  263. ZLCustomLanguageDeploy.language = self.languageType
  264. Bundle.resetLanguage()
  265. }
  266. }
  267. /// Developers can customize languages (This property is only for objc).
  268. /// - example: If you needs to replace
  269. /// key: @"loading", value: @"loading, waiting please" language,
  270. /// The dictionary that needs to be passed in is @[@"loading": @"text to be replaced"].
  271. /// - warning: Please pay attention to the placeholders contained in languages when changing, such as %ld, %@.
  272. @objc public var customLanguageKeyValue_objc: [String: String] = [:] {
  273. didSet {
  274. var swiftParams: [ZLLocalLanguageKey: String] = [:]
  275. customLanguageKeyValue_objc.forEach { (key, value) in
  276. swiftParams[ZLLocalLanguageKey(rawValue: key)] = value
  277. }
  278. self.customLanguageKeyValue = swiftParams
  279. }
  280. }
  281. /// Developers can customize languages.
  282. /// - example: If you needs to replace
  283. /// key: .loading, value: "loading, waiting please" language,
  284. /// The dictionary that needs to be passed in is [.loading: "text to be replaced"].
  285. /// - warning: Please pay attention to the placeholders contained in languages when changing, such as %ld, %@.
  286. public var customLanguageKeyValue: [ZLLocalLanguageKey: String] = [:] {
  287. didSet {
  288. ZLCustomLanguageDeploy.deploy = self.customLanguageKeyValue
  289. }
  290. }
  291. /// Whether to use custom camera. Defaults to true.
  292. @objc public var useCustomCamera = true
  293. private var pri_allowTakePhoto = true
  294. /// Allow taking photos in the camera (Need allowSelectImage to be true). Defaults to true.
  295. @objc public var allowTakePhoto: Bool {
  296. set {
  297. pri_allowTakePhoto = newValue
  298. }
  299. get {
  300. return pri_allowTakePhoto && allowSelectImage
  301. }
  302. }
  303. private var pri_allowRecordVideo = true
  304. /// Allow recording in the camera (Need allowSelectVideo to be true). Defaults to true.
  305. @objc public var allowRecordVideo: Bool {
  306. set {
  307. pri_allowRecordVideo = newValue
  308. }
  309. get {
  310. return pri_allowRecordVideo && allowSelectVideo
  311. }
  312. }
  313. private var pri_minRecordDuration: Second = 0
  314. /// Minimum recording duration. Defaults to 0.
  315. @objc public var minRecordDuration: Second {
  316. set {
  317. pri_minRecordDuration = max(0, newValue)
  318. }
  319. get {
  320. return pri_minRecordDuration
  321. }
  322. }
  323. private var pri_maxRecordDuration: Second = 10
  324. /// Maximum recording duration. Defaults to 10, minimum is 1.
  325. @objc public var maxRecordDuration: Second {
  326. set {
  327. pri_maxRecordDuration = max(1, newValue)
  328. }
  329. get {
  330. return pri_maxRecordDuration
  331. }
  332. }
  333. /// Video resolution. Defaults to hd1280x720.
  334. @objc public var sessionPreset: ZLCustomCamera.CaptureSessionPreset = .hd1280x720
  335. /// Video export format for recording video and editing video. Defaults to mov.
  336. @objc public var videoExportType: ZLCustomCamera.VideoExportType = .mov
  337. /// Camera flahs mode. Default is off. Defaults to off.
  338. @objc public var cameraFlashMode: ZLCustomCamera.CameraFlashMode = .off
  339. /// Hud style. Defaults to lightBlur.
  340. @objc public var hudStyle: ZLProgressHUD.HUDStyle = .lightBlur
  341. /// Navigation bar blur effect.
  342. @objc public var navViewBlurEffect: UIBlurEffect? = UIBlurEffect(style: .dark)
  343. /// Bottom too bar blur effect.
  344. @objc public var bottomToolViewBlurEffect: UIBlurEffect? = UIBlurEffect(style: .dark)
  345. /// Color configuration for framework.
  346. @objc public var themeColorDeploy: ZLPhotoThemeColorDeploy = .default()
  347. /// Font name.
  348. @objc public var themeFontName: String? = nil {
  349. didSet {
  350. ZLCustomFontDeploy.fontName = self.themeFontName
  351. }
  352. }
  353. /// This block will be called before selecting an image, the developer can first determine whether the asset is allowed to be selected.
  354. /// Only control whether it is allowed to be selected, and will not affect the selection logic in the framework.
  355. /// - Tips: If the choice is not allowed, the developer can toast prompt the user for relevant information.
  356. @objc public var canSelectAsset: ( (PHAsset) -> Bool )?
  357. /// If user choose limited Photo mode, a button with '+' will be added to the ZLThumbnailViewController. It will call PHPhotoLibrary.shared().presentLimitedLibraryPicker(from:) to add photo. Defaults to true.
  358. /// E.g., Sina Weibo's ImagePicker
  359. @objc public var showAddPhotoButton: Bool = true
  360. /// iOS14 limited Photo mode, will show collection footer view in ZLThumbnailViewController.
  361. /// Will go to system setting if clicked. Defaults to true.
  362. @objc public var showEnterSettingTips = true
  363. /// Callback after the no authority alert dismiss.
  364. @objc public var noAuthorityCallback: ( (ZLNoAuthorityType) -> Void )?
  365. }
  366. @objc public enum ZLNoAuthorityType: Int {
  367. case library
  368. case camera
  369. case microphone
  370. }
  371. @objc public enum ZLPhotoBrowserStyle: Int {
  372. /// The album list is embedded in the navigation of the thumbnail interface, click the drop-down display.
  373. case embedAlbumList
  374. /// The display relationship between the album list and the thumbnail interface is push.
  375. case externalAlbumList
  376. }
  377. /// Color deploy
  378. public class ZLPhotoThemeColorDeploy: NSObject {
  379. @objc public class func `default`() -> ZLPhotoThemeColorDeploy {
  380. return ZLPhotoThemeColorDeploy()
  381. }
  382. /// Preview selection mode, transparent background color above.
  383. @objc public var previewBgColor = UIColor.black.withAlphaComponent(0.1)
  384. /// Preview selection mode, a background color for `Camera`, `Album`, `Cancel` buttons.
  385. @objc public var previewBtnBgColor = UIColor.white
  386. /// Preview selection mode, a text color for `Camera`, `Album`, `Cancel` buttons.
  387. @objc public var previewBtnTitleColor = UIColor.black
  388. /// Preview selection mode, cancel button title color when the selection amount is superior than 0.
  389. @objc public var previewBtnHighlightTitleColor = zlRGB(80, 169, 56)
  390. /// A color for navigation bar spinner.
  391. @objc public var navBarColor = zlRGB(160, 160, 160).withAlphaComponent(0.65)
  392. /// A color for Navigation bar text.
  393. @objc public var navTitleColor = UIColor.white
  394. /// The background color of the title view when the frame style is embedAlbumList.
  395. @objc public var navEmbedTitleViewBgColor = zlRGB(80, 80, 80)
  396. /// A color for background in album list.
  397. @objc public var albumListBgColor = zlRGB(45, 45, 45)
  398. /// A color for album list title label.
  399. @objc public var albumListTitleColor = UIColor.white
  400. /// A color for album list count label.
  401. @objc public var albumListCountColor = zlRGB(180, 180, 180)
  402. /// A color for album list separator.
  403. @objc public var separatorColor = zlRGB(60, 60, 60)
  404. /// A color for background in thumbnail interface.
  405. @objc public var thumbnailBgColor = zlRGB(50, 50, 50)
  406. /// A color for background in bottom tool view.
  407. @objc public var bottomToolViewBgColor = zlRGB(35, 35, 35).withAlphaComponent(0.3)
  408. /// The normal state title color of bottom tool view buttons.
  409. @objc public var bottomToolViewBtnNormalTitleColor = UIColor.white
  410. /// The disable state title color of bottom tool view buttons.
  411. @objc public var bottomToolViewBtnDisableTitleColor = zlRGB(168, 168, 168)
  412. /// The normal state background color of bottom tool view buttons.
  413. @objc public var bottomToolViewBtnNormalBgColor = zlRGB(80, 169, 56)
  414. /// The disable state background color of bottom tool view buttons.
  415. @objc public var bottomToolViewBtnDisableBgColor = zlRGB(50, 50, 50)
  416. /// With iOS14 limited authority, a color for select more photos at the bottom of the thumbnail interface.
  417. @objc public var selectMorePhotoWhenAuthIsLismitedTitleColor = UIColor.white
  418. /// The record progress color of custom camera.
  419. @objc public var cameraRecodeProgressColor = zlRGB(80, 169, 56)
  420. /// Mask layer color of selected cell.
  421. @objc public var selectedMaskColor = UIColor.black.withAlphaComponent(0.2)
  422. /// Border color of selected cell.
  423. @objc public var selectedBorderColor = zlRGB(80, 169, 56)
  424. /// Mask layer color of the cell that cannot be selected.
  425. @objc public var invalidMaskColor = UIColor.white.withAlphaComponent(0.5)
  426. /// The background color of selected cell index label.
  427. @objc public var indexLabelBgColor = zlRGB(80, 169, 56)
  428. /// The background color of camera cell inside album.
  429. @objc public var cameraCellBgColor = UIColor(white: 0.3, alpha: 1)
  430. }
  431. /// Font deply
  432. struct ZLCustomFontDeploy {
  433. static var fontName: String? = nil
  434. }
  435. /// Language deploy
  436. struct ZLCustomLanguageDeploy {
  437. static var language: ZLLanguageType = .system
  438. static var deploy: [ZLLocalLanguageKey: String] = [:]
  439. }
  440. /// Image source deploy
  441. struct ZLCustomImageDeploy {
  442. static var deploy: [String] = []
  443. }
  444. @objc public protocol ZLImageStickerContainerDelegate where Self: UIView {
  445. @objc var selectImageBlock: ( (UIImage) -> Void )? { get set }
  446. @objc var hideBlock: ( () -> Void )? { get set }
  447. @objc func show(in view: UIView)
  448. }