├── Podfile ├── Podfile.lock ├── Pods ├── Headers │ ├── Private │ │ ├── MBProgressHUD │ │ │ └── MBProgressHUD.h │ │ └── SDWebImage │ │ │ ├── NSButton+WebCache.h │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSImage+WebCache.h │ │ │ ├── SDAnimatedImageRep.h │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDWebImageCoder.h │ │ │ ├── SDWebImageCoderHelper.h │ │ │ ├── SDWebImageCodersManager.h │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageFrame.h │ │ │ ├── SDWebImageGIFCoder.h │ │ │ ├── SDWebImageImageIOCoder.h │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImageTransition.h │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIView+WebCache.h │ │ │ └── UIView+WebCacheOperation.h │ └── Public │ │ ├── MBProgressHUD │ │ └── MBProgressHUD.h │ │ └── SDWebImage │ │ ├── NSButton+WebCache.h │ │ ├── NSData+ImageContentType.h │ │ ├── NSImage+WebCache.h │ │ ├── SDAnimatedImageRep.h │ │ ├── SDImageCache.h │ │ ├── SDImageCacheConfig.h │ │ ├── SDWebImageCoder.h │ │ ├── SDWebImageCoderHelper.h │ │ ├── SDWebImageCodersManager.h │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageFrame.h │ │ ├── SDWebImageGIFCoder.h │ │ ├── SDWebImageImageIOCoder.h │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImageTransition.h │ │ ├── UIButton+WebCache.h │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+GIF.h │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+WebCache.h │ │ ├── UIView+WebCache.h │ │ └── UIView+WebCacheOperation.h ├── MBProgressHUD │ ├── LICENSE │ ├── MBProgressHUD.h │ ├── MBProgressHUD.m │ └── README.mdown ├── Manifest.lock ├── Pods.xcodeproj │ ├── project.pbxproj │ └── xcuserdata │ │ ├── james.xcuserdatad │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ │ └── weizhu.xcuserdatad │ │ └── xcschemes │ │ ├── MBProgressHUD.xcscheme │ │ ├── Pods-ZJCollectionViewSummary.xcscheme │ │ ├── SDWebImage.xcscheme │ │ └── xcschememanagement.plist ├── SDWebImage │ ├── LICENSE │ ├── README.md │ └── SDWebImage │ │ ├── NSButton+WebCache.h │ │ ├── NSButton+WebCache.m │ │ ├── NSData+ImageContentType.h │ │ ├── NSData+ImageContentType.m │ │ ├── NSImage+WebCache.h │ │ ├── NSImage+WebCache.m │ │ ├── SDAnimatedImageRep.h │ │ ├── SDAnimatedImageRep.m │ │ ├── SDImageCache.h │ │ ├── SDImageCache.m │ │ ├── SDImageCacheConfig.h │ │ ├── SDImageCacheConfig.m │ │ ├── SDWebImageCoder.h │ │ ├── SDWebImageCoder.m │ │ ├── SDWebImageCoderHelper.h │ │ ├── SDWebImageCoderHelper.m │ │ ├── SDWebImageCodersManager.h │ │ ├── SDWebImageCodersManager.m │ │ ├── SDWebImageCompat.h │ │ ├── SDWebImageCompat.m │ │ ├── SDWebImageDownloader.h │ │ ├── SDWebImageDownloader.m │ │ ├── SDWebImageDownloaderOperation.h │ │ ├── SDWebImageDownloaderOperation.m │ │ ├── SDWebImageFrame.h │ │ ├── SDWebImageFrame.m │ │ ├── SDWebImageGIFCoder.h │ │ ├── SDWebImageGIFCoder.m │ │ ├── SDWebImageImageIOCoder.h │ │ ├── SDWebImageImageIOCoder.m │ │ ├── SDWebImageManager.h │ │ ├── SDWebImageManager.m │ │ ├── SDWebImageOperation.h │ │ ├── SDWebImagePrefetcher.h │ │ ├── SDWebImagePrefetcher.m │ │ ├── SDWebImageTransition.h │ │ ├── SDWebImageTransition.m │ │ ├── UIButton+WebCache.h │ │ ├── UIButton+WebCache.m │ │ ├── UIImage+ForceDecode.h │ │ ├── UIImage+ForceDecode.m │ │ ├── UIImage+GIF.h │ │ ├── UIImage+GIF.m │ │ ├── UIImage+MultiFormat.h │ │ ├── UIImage+MultiFormat.m │ │ ├── UIImageView+HighlightedWebCache.h │ │ ├── UIImageView+HighlightedWebCache.m │ │ ├── UIImageView+WebCache.h │ │ ├── UIImageView+WebCache.m │ │ ├── UIView+WebCache.h │ │ ├── UIView+WebCache.m │ │ ├── UIView+WebCacheOperation.h │ │ └── UIView+WebCacheOperation.m └── Target Support Files │ ├── MBProgressHUD │ ├── MBProgressHUD-dummy.m │ ├── MBProgressHUD-prefix.pch │ └── MBProgressHUD.xcconfig │ ├── Pods-ZJCollectionViewSummary │ ├── Pods-ZJCollectionViewSummary-acknowledgements.markdown │ ├── Pods-ZJCollectionViewSummary-acknowledgements.plist │ ├── Pods-ZJCollectionViewSummary-dummy.m │ ├── Pods-ZJCollectionViewSummary-frameworks.sh │ ├── Pods-ZJCollectionViewSummary-resources.sh │ ├── Pods-ZJCollectionViewSummary.debug.xcconfig │ └── Pods-ZJCollectionViewSummary.release.xcconfig │ └── SDWebImage │ ├── SDWebImage-dummy.m │ ├── SDWebImage-prefix.pch │ └── SDWebImage.xcconfig ├── README.md ├── ZJCollectionViewSummary.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ ├── contents.xcworkspacedata │ ├── xcshareddata │ │ └── IDEWorkspaceChecks.plist │ └── xcuserdata │ │ └── weizhu.xcuserdatad │ │ └── UserInterfaceState.xcuserstate └── xcuserdata │ ├── james.xcuserdatad │ └── xcschemes │ │ └── xcschememanagement.plist │ └── weizhu.xcuserdatad │ └── xcschemes │ └── xcschememanagement.plist ├── ZJCollectionViewSummary.xcworkspace ├── contents.xcworkspacedata ├── xcshareddata │ └── IDEWorkspaceChecks.plist └── xcuserdata │ ├── james.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ │ └── Breakpoints_v2.xcbkptlist │ └── weizhu.xcuserdatad │ ├── UserInterfaceState.xcuserstate │ └── xcdebugger │ └── Breakpoints_v2.xcbkptlist ├── ZJCollectionViewSummary ├── AddCollectionViewCell(添加cell) │ ├── ZJAddSectionOrCellViewController.h │ └── ZJAddSectionOrCellViewController.m ├── AddHeaderView(添加headerView) │ ├── ZJAddHeaderForCollectionReusableView.h │ ├── ZJAddHeaderForCollectionReusableView.m │ ├── ZJAddHeaderForCollectionReusableView.xib │ ├── ZJAddHeaderViewViewController.h │ └── ZJAddHeaderViewViewController.m ├── AddIndex(添加索引) │ ├── ZJGroupingCollectionViewCell.h │ ├── ZJGroupingCollectionViewCell.m │ ├── ZJGroupingCollectionViewController.h │ ├── ZJGroupingCollectionViewController.m │ ├── ZJGroupingCollectionViewFlowLayout.h │ └── ZJGroupingCollectionViewFlowLayout.m ├── Assets.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ ├── Contents.json │ ├── James.imageset │ │ ├── Contents.json │ │ └── James@2x.png │ ├── add_icon.imageset │ │ ├── Contents.json │ │ ├── add_icon.png │ │ ├── add_icon@2x.png │ │ └── add_icon@3x.png │ ├── check.imageset │ │ ├── Contents.json │ │ └── check@2x.png │ ├── check1.imageset │ │ ├── Contents.json │ │ └── check1@2x.png │ ├── delete_image.imageset │ │ ├── Contents.json │ │ ├── delete_image.png │ │ ├── delete_image@2x.png │ │ └── delete_image@3x.png │ ├── placeholder.imageset │ │ ├── Contents.json │ │ └── placeholder@2x.png │ ├── select_Icon.imageset │ │ ├── Contents.json │ │ └── select_Icon@3x.png │ └── unselected_icon.imageset │ │ ├── Contents.json │ │ └── unselected_icon@3x.png ├── Base.lproj │ ├── LaunchScreen.storyboard │ └── Main.storyboard ├── CellReorder(长安拖动) │ ├── ZJReorderViewController.h │ └── ZJReorderViewController.m ├── CycleCollectionView(无线循环) │ ├── ZJCycleViewController.h │ ├── ZJCycleViewController.m │ └── image │ │ ├── 0.jpg │ │ ├── 1.jpg │ │ ├── 10.jpg │ │ ├── 11.jpg │ │ ├── 12.jpg │ │ ├── 13.jpg │ │ ├── 14.jpg │ │ ├── 15.jpg │ │ ├── 16.jpg │ │ ├── 17.jpg │ │ ├── 18.jpg │ │ ├── 19.jpg │ │ ├── 2.jpg │ │ ├── 20.jpg │ │ ├── 21.jpg │ │ ├── 22.jpg │ │ ├── 23.jpg │ │ ├── 24.jpg │ │ ├── 25.jpg │ │ ├── 26.jpg │ │ ├── 27.jpg │ │ ├── 28.jpg │ │ ├── 29.jpg │ │ ├── 3.jpg │ │ ├── 30.jpg │ │ ├── 4.jpg │ │ ├── 5.jpg │ │ ├── 6.jpg │ │ ├── 7.jpg │ │ ├── 8.jpg │ │ └── 9.jpg ├── LayoutWater(常见的几种布局) │ ├── CircleLayout(环形布局) │ │ ├── ZJCirleLayoutViewController.h │ │ └── ZJCirleLayoutViewController.m │ ├── LineLayout(线性布局) │ │ ├── ZJLineLayoutViewController.h │ │ └── ZJLineLayoutViewController.m │ ├── WaterLayout(流水布局) │ │ ├── ZJWaterLayoutViewController.h │ │ └── ZJWaterLayoutViewController.m │ ├── ZJBlurEffect.h │ ├── ZJBlurEffect.m │ ├── ZJGridLayout(网格布局) │ │ ├── ZJGridLayoutViewController.h │ │ └── ZJGridLayoutViewController.m │ ├── ZJWaterLayoutCollectionViewCell.h │ ├── ZJWaterLayoutCollectionViewCell.m │ ├── ZJWaterLayoutListTableViewController.h │ └── ZJWaterLayoutListTableViewController.m ├── Main │ └── Controller │ │ ├── ZJFunctionListController.h │ │ ├── ZJFunctionListController.m │ │ ├── ZJNavigationController.h │ │ └── ZJNavigationController.m ├── MultiSelectCell(多选) │ ├── FigurePhoto(300x180) │ │ ├── figurePhoto.plist │ │ ├── figurePhoto01.png │ │ ├── figurePhoto02.png │ │ ├── figurePhoto03.png │ │ ├── figurePhoto04.png │ │ ├── figurePhoto05.png │ │ ├── figurePhoto06.png │ │ ├── figurePhoto07.png │ │ ├── figurePhoto08.png │ │ ├── figurePhoto09.png │ │ ├── figurePhoto10.png │ │ ├── figurePhoto11.png │ │ ├── figurePhoto12.png │ │ ├── figurePhoto13.png │ │ ├── figurePhoto14.png │ │ ├── figurePhoto15.png │ │ ├── figurePhoto16.png │ │ ├── figurePhoto17.png │ │ ├── figurePhoto18.png │ │ ├── figurePhoto19.png │ │ ├── figurePhoto20.png │ │ ├── figurePhoto_normal@2x.png │ │ └── figurePhoto_select@2x.png │ ├── ZJMultiSelectCellViewController.h │ ├── ZJMultiSelectCellViewController.m │ ├── ZJMultiSelectCollectionViewCell.h │ ├── ZJMultiSelectCollectionViewCell.m │ └── ZJMultiSelectCollectionViewCell.xib ├── Other │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Info.plist │ ├── PrefixHeader.pch │ ├── adidasBrand.plist │ ├── allBrand.plist │ └── main.m └── ZJCollectionViewSummary │ ├── ZJAddIndex │ ├── ZJCollectionViewRightIndex.h │ └── ZJCollectionViewRightIndex.m │ ├── ZJCycleView │ ├── UIView+ZJExtension.h │ ├── UIView+ZJExtension.m │ ├── ZJCycleView.h │ ├── ZJCycleView.m │ ├── ZJCycleViewCell.h │ ├── ZJCycleViewCell.m │ ├── ZJPageControl.h │ └── ZJPageControl.m │ └── ZJLayout │ ├── ZJCirleLayout.h │ ├── ZJCirleLayout.m │ ├── ZJGridLayout.h │ ├── ZJGridLayout.m │ ├── ZJLineScaleFlowLayout.h │ ├── ZJLineScaleFlowLayout.m │ ├── ZJReorderFlowLayout.h │ ├── ZJReorderFlowLayout.m │ ├── ZJWaterLayout.h │ └── ZJWaterLayout.m ├── ZJCollectionViewSummaryTests ├── Info.plist └── ZJCollectionViewSummaryTests.m └── ZJCollectionViewSummaryUITests ├── Info.plist └── ZJCollectionViewSummaryUITests.m /Podfile: -------------------------------------------------------------------------------- 1 | platform :ios, '8.0' 2 | target 'ZJCollectionViewSummary' do 3 | 4 | pod 'MBProgressHUD' 5 | pod 'SDWebImage' 6 | 7 | end 8 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MBProgressHUD (1.1.0) 3 | - SDWebImage (4.3.3): 4 | - SDWebImage/Core (= 4.3.3) 5 | - SDWebImage/Core (4.3.3) 6 | 7 | DEPENDENCIES: 8 | - MBProgressHUD 9 | - SDWebImage 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - MBProgressHUD 14 | - SDWebImage 15 | 16 | SPEC CHECKSUMS: 17 | MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9 18 | SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5 19 | 20 | PODFILE CHECKSUM: 76ca157fb21a14aa202ea8831f37f3c88e17802f 21 | 22 | COCOAPODS: 1.5.3 23 | -------------------------------------------------------------------------------- /Pods/Headers/Private/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageTransition.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Private/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/MBProgressHUD/MBProgressHUD.h: -------------------------------------------------------------------------------- 1 | ../../../MBProgressHUD/MBProgressHUD.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSData+ImageContentType.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/NSImage+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDAnimatedImageRep.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDImageCacheConfig.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCoderHelper.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCodersManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageCompat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloader.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloader.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageDownloaderOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageDownloaderOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageFrame.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageGIFCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageImageIOCoder.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageManager.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageManager.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageOperation.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImagePrefetcher.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/SDWebImageTransition.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIButton+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIButton+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+ForceDecode.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+GIF.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImage+MultiFormat.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIImageView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIImageView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCache.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCache.h -------------------------------------------------------------------------------- /Pods/Headers/Public/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | ../../../SDWebImage/SDWebImage/UIView+WebCacheOperation.h -------------------------------------------------------------------------------- /Pods/MBProgressHUD/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright © 2009-2016 Matej Bukovinski 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MBProgressHUD (1.1.0) 3 | - SDWebImage (4.3.3): 4 | - SDWebImage/Core (= 4.3.3) 5 | - SDWebImage/Core (4.3.3) 6 | 7 | DEPENDENCIES: 8 | - MBProgressHUD 9 | - SDWebImage 10 | 11 | SPEC REPOS: 12 | https://github.com/cocoapods/specs.git: 13 | - MBProgressHUD 14 | - SDWebImage 15 | 16 | SPEC CHECKSUMS: 17 | MBProgressHUD: e7baa36a220447d8aeb12769bf0585582f3866d9 18 | SDWebImage: de4d90b5bff3571eae7bd16202b1f43135409fa5 19 | 20 | PODFILE CHECKSUM: 76ca157fb21a14aa202ea8831f37f3c88e17802f 21 | 22 | COCOAPODS: 1.5.3 23 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/james.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MBProgressHUD.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | Pods-ZJCollectionViewSummary.xcscheme 13 | 14 | orderHint 15 | 2 16 | 17 | SDWebImage.xcscheme 18 | 19 | orderHint 20 | 3 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/weizhu.xcuserdatad/xcschemes/MBProgressHUD.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/weizhu.xcuserdatad/xcschemes/Pods-ZJCollectionViewSummary.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/weizhu.xcuserdatad/xcschemes/SDWebImage.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 32 | 33 | 43 | 44 | 45 | 46 | 52 | 53 | 55 | 56 | 59 | 60 | 61 | -------------------------------------------------------------------------------- /Pods/Pods.xcodeproj/xcuserdata/weizhu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | MBProgressHUD.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-ZJCollectionViewSummary.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | SDWebImage.xcscheme 22 | 23 | isShown 24 | 25 | orderHint 26 | 2 27 | 28 | 29 | SuppressBuildableAutocreation 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP, 20 | SDImageFormatHEIC 21 | }; 22 | 23 | @interface NSData (ImageContentType) 24 | 25 | /** 26 | * Return image format 27 | * 28 | * @param data the input image data 29 | * 30 | * @return the image format as `SDImageFormat` (enum) 31 | */ 32 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 33 | 34 | /** 35 | Convert SDImageFormat to UTType 36 | 37 | @param format Format as SDImageFormat 38 | @return The UTType as CFStringRef 39 | */ 40 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSData+ImageContentType.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "NSData+ImageContentType.h" 11 | #if SD_MAC 12 | #import 13 | #else 14 | #import 15 | #endif 16 | 17 | // Currently Image/IO does not support WebP 18 | #define kSDUTTypeWebP ((__bridge CFStringRef)@"public.webp") 19 | // AVFileTypeHEIC is defined in AVFoundation via iOS 11, we use this without import AVFoundation 20 | #define kSDUTTypeHEIC ((__bridge CFStringRef)@"public.heic") 21 | 22 | @implementation NSData (ImageContentType) 23 | 24 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data { 25 | if (!data) { 26 | return SDImageFormatUndefined; 27 | } 28 | 29 | // File signatures table: http://www.garykessler.net/library/file_sigs.html 30 | uint8_t c; 31 | [data getBytes:&c length:1]; 32 | switch (c) { 33 | case 0xFF: 34 | return SDImageFormatJPEG; 35 | case 0x89: 36 | return SDImageFormatPNG; 37 | case 0x47: 38 | return SDImageFormatGIF; 39 | case 0x49: 40 | case 0x4D: 41 | return SDImageFormatTIFF; 42 | case 0x52: { 43 | if (data.length >= 12) { 44 | //RIFF....WEBP 45 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(0, 12)] encoding:NSASCIIStringEncoding]; 46 | if ([testString hasPrefix:@"RIFF"] && [testString hasSuffix:@"WEBP"]) { 47 | return SDImageFormatWebP; 48 | } 49 | } 50 | break; 51 | } 52 | case 0x00: { 53 | if (data.length >= 12) { 54 | //....ftypheic ....ftypheix ....ftyphevc ....ftyphevx 55 | NSString *testString = [[NSString alloc] initWithData:[data subdataWithRange:NSMakeRange(4, 8)] encoding:NSASCIIStringEncoding]; 56 | if ([testString isEqualToString:@"ftypheic"] 57 | || [testString isEqualToString:@"ftypheix"] 58 | || [testString isEqualToString:@"ftyphevc"] 59 | || [testString isEqualToString:@"ftyphevx"]) { 60 | return SDImageFormatHEIC; 61 | } 62 | } 63 | break; 64 | } 65 | } 66 | return SDImageFormatUndefined; 67 | } 68 | 69 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format { 70 | CFStringRef UTType; 71 | switch (format) { 72 | case SDImageFormatJPEG: 73 | UTType = kUTTypeJPEG; 74 | break; 75 | case SDImageFormatPNG: 76 | UTType = kUTTypePNG; 77 | break; 78 | case SDImageFormatGIF: 79 | UTType = kUTTypeGIF; 80 | break; 81 | case SDImageFormatTIFF: 82 | UTType = kUTTypeTIFF; 83 | break; 84 | case SDImageFormatWebP: 85 | UTType = kSDUTTypeWebP; 86 | break; 87 | case SDImageFormatHEIC: 88 | UTType = kSDUTTypeHEIC; 89 | break; 90 | default: 91 | // default is kUTTypePNG 92 | UTType = kUTTypePNG; 93 | break; 94 | } 95 | return UTType; 96 | } 97 | 98 | @end 99 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | BOOL isGIF = NO; 27 | for (NSImageRep *rep in self.representations) { 28 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 29 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 30 | NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; 31 | isGIF = frameCount > 1 ? YES : NO; 32 | break; 33 | } 34 | } 35 | return isGIF; 36 | } 37 | 38 | @end 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | // A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 14 | // Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDWebImageImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 15 | 16 | @interface SDAnimatedImageRep : NSBitmapImageRep 17 | 18 | @end 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDAnimatedImageRep.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDAnimatedImageRep.h" 10 | 11 | #if SD_MAC 12 | 13 | #import "SDWebImageGIFCoder.h" 14 | 15 | @interface SDWebImageGIFCoder () 16 | 17 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source; 18 | 19 | @end 20 | 21 | @interface SDAnimatedImageRep () 22 | 23 | @property (nonatomic, assign, readonly, nullable) CGImageSourceRef imageSource; 24 | 25 | @end 26 | 27 | @implementation SDAnimatedImageRep 28 | 29 | // `NSBitmapImageRep` will use `kCGImagePropertyGIFDelayTime` whenever you call `setProperty:withValue:` with `NSImageCurrentFrame` to change the current frame. We override it and use the actual `kCGImagePropertyGIFUnclampedDelayTime` if need. 30 | - (void)setProperty:(NSBitmapImageRepPropertyKey)property withValue:(id)value { 31 | [super setProperty:property withValue:value]; 32 | if ([property isEqualToString:NSImageCurrentFrame]) { 33 | // Access the image source 34 | CGImageSourceRef imageSource = self.imageSource; 35 | if (!imageSource) { 36 | return; 37 | } 38 | // Check format type 39 | CFStringRef type = CGImageSourceGetType(imageSource); 40 | if (!type) { 41 | return; 42 | } 43 | NSUInteger index = [value unsignedIntegerValue]; 44 | float frameDuration = 0; 45 | // Through we currently process GIF only, in the 5.x we support APNG so we keep the extensibility 46 | if (CFStringCompare(type, kUTTypeGIF, 0) == kCFCompareEqualTo) { 47 | frameDuration = [[SDWebImageGIFCoder sharedCoder] sd_frameDurationAtIndex:index source:imageSource]; 48 | } 49 | if (!frameDuration) { 50 | return; 51 | } 52 | // Reset super frame duration with the actual frame duration 53 | [super setProperty:NSImageCurrentFrameDuration withValue:@(frameDuration)]; 54 | } 55 | } 56 | 57 | - (CGImageSourceRef)imageSource { 58 | if (_tiffData) { 59 | return (__bridge CGImageSourceRef)(_tiffData); 60 | } 61 | return NULL; 62 | } 63 | 64 | @end 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The reading options while reading cache from disk. 32 | * Defaults to 0. You can set this to `NSDataReadingMappedIfSafe` to improve performance. 33 | */ 34 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; 35 | 36 | /** 37 | * The writing options while writing cache to disk. 38 | * Defaults to `NSDataWritingAtomic`. You can set this to `NSDataWritingWithoutOverwriting` to prevent overwriting an existing file. 39 | */ 40 | @property (assign, nonatomic) NSDataWritingOptions diskCacheWritingOptions; 41 | 42 | /** 43 | * The maximum length of time to keep an image in the cache, in seconds. 44 | */ 45 | @property (assign, nonatomic) NSInteger maxCacheAge; 46 | 47 | /** 48 | * The maximum size of the cache, in bytes. 49 | */ 50 | @property (assign, nonatomic) NSUInteger maxCacheSize; 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _diskCacheReadingOptions = 0; 21 | _diskCacheWritingOptions = NSDataWritingAtomic; 22 | _maxCacheAge = kDefaultCacheMaxCacheAge; 23 | _maxCacheSize = 0; 24 | } 25 | return self; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "NSData+ImageContentType.h" 12 | 13 | /** 14 | A Boolean value indicating whether to scale down large images during decompressing. (NSNumber) 15 | */ 16 | FOUNDATION_EXPORT NSString * _Nonnull const SDWebImageCoderScaleDownLargeImagesKey; 17 | 18 | /** 19 | Return the shared device-dependent RGB color space created with CGColorSpaceCreateDeviceRGB. 20 | 21 | @return The device-dependent RGB color space 22 | */ 23 | CG_EXTERN CGColorSpaceRef _Nonnull SDCGColorSpaceGetDeviceRGB(void); 24 | 25 | /** 26 | Check whether CGImageRef contains alpha channel. 27 | 28 | @param imageRef The CGImageRef 29 | @return Return YES if CGImageRef contains alpha channel, otherwise return NO 30 | */ 31 | CG_EXTERN BOOL SDCGImageRefContainsAlpha(_Nullable CGImageRef imageRef); 32 | 33 | 34 | /** 35 | This is the image coder protocol to provide custom image decoding/encoding. 36 | These methods are all required to implement. 37 | @note Pay attention that these methods are not called from main queue. 38 | */ 39 | @protocol SDWebImageCoder 40 | 41 | @required 42 | #pragma mark - Decoding 43 | /** 44 | Returns YES if this coder can decode some data. Otherwise, the data should be passed to another coder. 45 | 46 | @param data The image data so we can look at it 47 | @return YES if this coder can decode the data, NO otherwise 48 | */ 49 | - (BOOL)canDecodeFromData:(nullable NSData *)data; 50 | 51 | /** 52 | Decode the image data to image. 53 | 54 | @param data The image data to be decoded 55 | @return The decoded image from data 56 | */ 57 | - (nullable UIImage *)decodedImageWithData:(nullable NSData *)data; 58 | 59 | /** 60 | Decompress the image with original image and image data. 61 | 62 | @param image The original image to be decompressed 63 | @param data The pointer to original image data. The pointer itself is nonnull but image data can be null. This data will set to cache if needed. If you do not need to modify data at the sametime, ignore this param. 64 | @param optionsDict A dictionary containing any decompressing options. Pass {SDWebImageCoderScaleDownLargeImagesKey: @(YES)} to scale down large images 65 | @return The decompressed image 66 | */ 67 | - (nullable UIImage *)decompressedImageWithImage:(nullable UIImage *)image 68 | data:(NSData * _Nullable * _Nonnull)data 69 | options:(nullable NSDictionary*)optionsDict; 70 | 71 | #pragma mark - Encoding 72 | 73 | /** 74 | Returns YES if this coder can encode some image. Otherwise, it should be passed to another coder. 75 | 76 | @param format The image format 77 | @return YES if this coder can encode the image, NO otherwise 78 | */ 79 | - (BOOL)canEncodeToFormat:(SDImageFormat)format; 80 | 81 | /** 82 | Encode the image to image data. 83 | 84 | @param image The image to be encoded 85 | @param format The image format to encode, you should note `SDImageFormatUndefined` format is also possible 86 | @return The encoded image data 87 | */ 88 | - (nullable NSData *)encodedDataWithImage:(nullable UIImage *)image format:(SDImageFormat)format; 89 | 90 | @end 91 | 92 | 93 | /** 94 | This is the image coder protocol to provide custom progressive image decoding. 95 | These methods are all required to implement. 96 | @note Pay attention that these methods are not called from main queue. 97 | */ 98 | @protocol SDWebImageProgressiveCoder 99 | 100 | @required 101 | /** 102 | Returns YES if this coder can incremental decode some data. Otherwise, it should be passed to another coder. 103 | 104 | @param data The image data so we can look at it 105 | @return YES if this coder can decode the data, NO otherwise 106 | */ 107 | - (BOOL)canIncrementallyDecodeFromData:(nullable NSData *)data; 108 | 109 | /** 110 | Incremental decode the image data to image. 111 | 112 | @param data The image data has been downloaded so far 113 | @param finished Whether the download has finished 114 | @warning because incremental decoding need to keep the decoded context, we will alloc a new instance with the same class for each download operation to avoid conflicts 115 | @return The decoded image from data 116 | */ 117 | - (nullable UIImage *)incrementallyDecodedImageWithData:(nullable NSData *)data finished:(BOOL)finished; 118 | 119 | @end 120 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCoder.h" 10 | 11 | NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages"; 12 | 13 | CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) { 14 | static CGColorSpaceRef colorSpace; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | colorSpace = CGColorSpaceCreateDeviceRGB(); 18 | }); 19 | return colorSpace; 20 | } 21 | 22 | BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) { 23 | if (!imageRef) { 24 | return NO; 25 | } 26 | CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); 27 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || 28 | alphaInfo == kCGImageAlphaNoneSkipFirst || 29 | alphaInfo == kCGImageAlphaNoneSkipLast); 30 | return hasAlpha; 31 | } 32 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCoderHelper.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | #import "SDWebImageFrame.h" 12 | 13 | @interface SDWebImageCoderHelper : NSObject 14 | 15 | /** 16 | Return an animated image with frames array. 17 | For UIKit, this will apply the patch and then create animated UIImage. The patch is because that `+[UIImage animatedImageWithImages:duration:]` just use the average of duration for each image. So it will not work if different frame has different duration. Therefore we repeat the specify frame for specify times to let it work. 18 | For AppKit, NSImage does not support animates other than GIF. This will try to encode the frames to GIF format and then create an animated NSImage for rendering. Attention the animated image may loss some detail if the input frames contain full alpha channel because GIF only supports 1 bit alpha channel. (For 1 pixel, either transparent or not) 19 | 20 | @param frames The frames array. If no frames or frames is empty, return nil 21 | @return A animated image for rendering on UIImageView(UIKit) or NSImageView(AppKit) 22 | */ 23 | + (UIImage * _Nullable)animatedImageWithFrames:(NSArray * _Nullable)frames; 24 | 25 | /** 26 | Return frames array from an animated image. 27 | For UIKit, this will unapply the patch for the description above and then create frames array. This will also work for normal animated UIImage. 28 | For AppKit, NSImage does not support animates other than GIF. This will try to decode the GIF imageRep and then create frames array. 29 | 30 | @param animatedImage A animated image. If it's not animated, return nil 31 | @return The frames array 32 | */ 33 | + (NSArray * _Nullable)framesFromAnimatedImage:(UIImage * _Nullable)animatedImage; 34 | 35 | #if SD_UIKIT || SD_WATCH 36 | /** 37 | Convert an EXIF image orientation to an iOS one. 38 | 39 | @param exifOrientation EXIF orientation 40 | @return iOS orientation 41 | */ 42 | + (UIImageOrientation)imageOrientationFromEXIFOrientation:(NSInteger)exifOrientation; 43 | /** 44 | Convert an iOS orientation to an EXIF image orientation. 45 | 46 | @param imageOrientation iOS orientation 47 | @return EXIF orientation 48 | */ 49 | + (NSInteger)exifOrientationFromImageOrientation:(UIImageOrientation)imageOrientation; 50 | #endif 51 | 52 | @end 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Global object holding the array of coders, so that we avoid passing them from object to object. 14 | Uses a priority queue behind scenes, which means the latest added coders have the highest priority. 15 | This is done so when encoding/decoding something, we go through the list and ask each coder if they can handle the current data. 16 | That way, users can add their custom coders while preserving our existing prebuilt ones 17 | 18 | Note: the `coders` getter will return the coders in their reversed order 19 | Example: 20 | - by default we internally set coders = `IOCoder`, `WebPCoder`. (`GIFCoder` is not recommended to add only if you want to get GIF support without `FLAnimatedImage`) 21 | - calling `coders` will return `@[WebPCoder, IOCoder]` 22 | - call `[addCoder:[MyCrazyCoder new]]` 23 | - calling `coders` now returns `@[MyCrazyCoder, WebPCoder, IOCoder]` 24 | 25 | Coders 26 | ------ 27 | A coder must conform to the `SDWebImageCoder` protocol or even to `SDWebImageProgressiveCoder` if it supports progressive decoding 28 | Conformance is important because that way, they will implement `canDecodeFromData` or `canEncodeToFormat` 29 | Those methods are called on each coder in the array (using the priority order) until one of them returns YES. 30 | That means that coder can decode that data / encode to that format 31 | */ 32 | @interface SDWebImageCodersManager : NSObject 33 | 34 | /** 35 | Shared reusable instance 36 | */ 37 | + (nonnull instancetype)sharedInstance; 38 | 39 | /** 40 | All coders in coders manager. The coders array is a priority queue, which means the later added coder will have the highest priority 41 | */ 42 | @property (nonatomic, strong, readwrite, nullable) NSArray* coders; 43 | 44 | /** 45 | Add a new coder to the end of coders array. Which has the highest priority. 46 | 47 | @param coder coder 48 | */ 49 | - (void)addCoder:(nonnull id)coder; 50 | 51 | /** 52 | Remove a coder in the coders array. 53 | 54 | @param coder coder 55 | */ 56 | - (void)removeCoder:(nonnull id)coder; 57 | 58 | @end 59 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCodersManager.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCodersManager.h" 10 | #import "SDWebImageImageIOCoder.h" 11 | #import "SDWebImageGIFCoder.h" 12 | #ifdef SD_WEBP 13 | #import "SDWebImageWebPCoder.h" 14 | #endif 15 | 16 | @interface SDWebImageCodersManager () 17 | 18 | @property (strong, nonatomic, nonnull) NSMutableArray* mutableCoders; 19 | @property (strong, nonatomic, nullable) dispatch_queue_t mutableCodersAccessQueue; 20 | 21 | @end 22 | 23 | @implementation SDWebImageCodersManager 24 | 25 | + (nonnull instancetype)sharedInstance { 26 | static dispatch_once_t once; 27 | static id instance; 28 | dispatch_once(&once, ^{ 29 | instance = [self new]; 30 | }); 31 | return instance; 32 | } 33 | 34 | - (instancetype)init { 35 | if (self = [super init]) { 36 | // initialize with default coders 37 | _mutableCoders = [@[[SDWebImageImageIOCoder sharedCoder]] mutableCopy]; 38 | #ifdef SD_WEBP 39 | [_mutableCoders addObject:[SDWebImageWebPCoder sharedCoder]]; 40 | #endif 41 | _mutableCodersAccessQueue = dispatch_queue_create("com.hackemist.SDWebImageCodersManager", DISPATCH_QUEUE_CONCURRENT); 42 | } 43 | return self; 44 | } 45 | 46 | #pragma mark - Coder IO operations 47 | 48 | - (void)addCoder:(nonnull id)coder { 49 | if ([coder conformsToProtocol:@protocol(SDWebImageCoder)]) { 50 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 51 | [self.mutableCoders addObject:coder]; 52 | }); 53 | } 54 | } 55 | 56 | - (void)removeCoder:(nonnull id)coder { 57 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 58 | [self.mutableCoders removeObject:coder]; 59 | }); 60 | } 61 | 62 | - (NSArray *)coders { 63 | __block NSArray *sortedCoders = nil; 64 | dispatch_sync(self.mutableCodersAccessQueue, ^{ 65 | sortedCoders = (NSArray *)[[[self.mutableCoders copy] reverseObjectEnumerator] allObjects]; 66 | }); 67 | return sortedCoders; 68 | } 69 | 70 | - (void)setCoders:(NSArray *)coders { 71 | dispatch_barrier_sync(self.mutableCodersAccessQueue, ^{ 72 | self.mutableCoders = [coders mutableCopy]; 73 | }); 74 | } 75 | 76 | #pragma mark - SDWebImageCoder 77 | - (BOOL)canDecodeFromData:(NSData *)data { 78 | for (id coder in self.coders) { 79 | if ([coder canDecodeFromData:data]) { 80 | return YES; 81 | } 82 | } 83 | return NO; 84 | } 85 | 86 | - (BOOL)canEncodeToFormat:(SDImageFormat)format { 87 | for (id coder in self.coders) { 88 | if ([coder canEncodeToFormat:format]) { 89 | return YES; 90 | } 91 | } 92 | return NO; 93 | } 94 | 95 | - (UIImage *)decodedImageWithData:(NSData *)data { 96 | if (!data) { 97 | return nil; 98 | } 99 | for (id coder in self.coders) { 100 | if ([coder canDecodeFromData:data]) { 101 | return [coder decodedImageWithData:data]; 102 | } 103 | } 104 | return nil; 105 | } 106 | 107 | - (UIImage *)decompressedImageWithImage:(UIImage *)image 108 | data:(NSData *__autoreleasing _Nullable *)data 109 | options:(nullable NSDictionary*)optionsDict { 110 | if (!image) { 111 | return nil; 112 | } 113 | for (id coder in self.coders) { 114 | if ([coder canDecodeFromData:*data]) { 115 | return [coder decompressedImageWithImage:image data:data options:optionsDict]; 116 | } 117 | } 118 | return nil; 119 | } 120 | 121 | - (NSData *)encodedDataWithImage:(UIImage *)image format:(SDImageFormat)format { 122 | if (!image) { 123 | return nil; 124 | } 125 | for (id coder in self.coders) { 126 | if ([coder canEncodeToFormat:format]) { 127 | return [coder encodedDataWithImage:image format:format]; 128 | } 129 | } 130 | return nil; 131 | } 132 | 133 | @end 134 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | 12 | #ifdef __OBJC_GC__ 13 | #error SDWebImage does not support Objective-C Garbage Collection 14 | #endif 15 | 16 | // Apple's defines from TargetConditionals.h are a bit weird. 17 | // Seems like TARGET_OS_MAC is always defined (on all platforms). 18 | // To determine if we are running on OSX, we can only rely on TARGET_OS_IPHONE=0 and all the other platforms 19 | #if !TARGET_OS_IPHONE && !TARGET_OS_IOS && !TARGET_OS_TV && !TARGET_OS_WATCH 20 | #define SD_MAC 1 21 | #else 22 | #define SD_MAC 0 23 | #endif 24 | 25 | // iOS and tvOS are very similar, UIKit exists on both platforms 26 | // Note: watchOS also has UIKit, but it's very limited 27 | #if TARGET_OS_IOS || TARGET_OS_TV 28 | #define SD_UIKIT 1 29 | #else 30 | #define SD_UIKIT 0 31 | #endif 32 | 33 | #if TARGET_OS_IOS 34 | #define SD_IOS 1 35 | #else 36 | #define SD_IOS 0 37 | #endif 38 | 39 | #if TARGET_OS_TV 40 | #define SD_TV 1 41 | #else 42 | #define SD_TV 0 43 | #endif 44 | 45 | #if TARGET_OS_WATCH 46 | #define SD_WATCH 1 47 | #else 48 | #define SD_WATCH 0 49 | #endif 50 | 51 | 52 | #if SD_MAC 53 | #import 54 | #ifndef UIImage 55 | #define UIImage NSImage 56 | #endif 57 | #ifndef UIImageView 58 | #define UIImageView NSImageView 59 | #endif 60 | #ifndef UIView 61 | #define UIView NSView 62 | #endif 63 | #else 64 | #if __IPHONE_OS_VERSION_MIN_REQUIRED != 20000 && __IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_5_0 65 | #error SDWebImage doesn't support Deployment Target version < 5.0 66 | #endif 67 | 68 | #if SD_UIKIT 69 | #import 70 | #endif 71 | #if SD_WATCH 72 | #import 73 | #endif 74 | #endif 75 | 76 | #ifndef NS_ENUM 77 | #define NS_ENUM(_type, _name) enum _name : _type _name; enum _name : _type 78 | #endif 79 | 80 | #ifndef NS_OPTIONS 81 | #define NS_OPTIONS(_type, _name) enum _name : _type _name; enum _name : _type 82 | #endif 83 | 84 | FOUNDATION_EXPORT UIImage *SDScaledImageForKey(NSString *key, UIImage *image); 85 | 86 | typedef void(^SDWebImageNoParamsBlock)(void); 87 | 88 | FOUNDATION_EXPORT NSString *const SDWebImageErrorDomain; 89 | 90 | #ifndef dispatch_queue_async_safe 91 | #define dispatch_queue_async_safe(queue, block)\ 92 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ 93 | block();\ 94 | } else {\ 95 | dispatch_async(queue, block);\ 96 | } 97 | #endif 98 | 99 | #ifndef dispatch_main_async_safe 100 | #define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) 101 | #endif 102 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "UIImage+MultiFormat.h" 11 | 12 | #if !__has_feature(objc_arc) 13 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 14 | #endif 15 | 16 | #if !OS_OBJECT_USE_OBJC 17 | #error SDWebImage need ARC for dispatch object 18 | #endif 19 | 20 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 21 | if (!image) { 22 | return nil; 23 | } 24 | 25 | #if SD_MAC 26 | return image; 27 | #elif SD_UIKIT || SD_WATCH 28 | if ((image.images).count > 0) { 29 | NSMutableArray *scaledImages = [NSMutableArray array]; 30 | 31 | for (UIImage *tempImage in image.images) { 32 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 33 | } 34 | 35 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 36 | if (animatedImage) { 37 | animatedImage.sd_imageLoopCount = image.sd_imageLoopCount; 38 | } 39 | return animatedImage; 40 | } else { 41 | #if SD_WATCH 42 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 43 | #elif SD_UIKIT 44 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 45 | #endif 46 | CGFloat scale = 1; 47 | if (key.length >= 8) { 48 | NSRange range = [key rangeOfString:@"@2x."]; 49 | if (range.location != NSNotFound) { 50 | scale = 2.0; 51 | } 52 | 53 | range = [key rangeOfString:@"@3x."]; 54 | if (range.location != NSNotFound) { 55 | scale = 3.0; 56 | } 57 | } 58 | 59 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 60 | image = scaledImage; 61 | } 62 | return image; 63 | } 64 | #endif 65 | } 66 | 67 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 68 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWebImageFrame : NSObject 13 | 14 | // This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attention if you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat`. 15 | 16 | /** 17 | The image of current frame. You should not set an animated image. 18 | */ 19 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 20 | /** 21 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 22 | */ 23 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 24 | 25 | /** 26 | Create a frame instance with specify image and duration 27 | 28 | @param image current frame's image 29 | @param duration current frame's duration 30 | @return frame instance 31 | */ 32 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageFrame.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageFrame.h" 10 | 11 | @interface SDWebImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDWebImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDWebImageFrame *frame = [[SDWebImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports GIF encoding/decoding 14 | @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` 16 | @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` 17 | @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying 18 | */ 19 | @interface SDWebImageGIFCoder : NSObject 20 | 21 | + (nonnull instancetype)sharedCoder; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDWebImageImageIOCoder : NSObject 27 | 28 | + (nonnull instancetype)sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImagePrefetcher.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageManager.h" 11 | 12 | @class SDWebImagePrefetcher; 13 | 14 | @protocol SDWebImagePrefetcherDelegate 15 | 16 | @optional 17 | 18 | /** 19 | * Called when an image was prefetched. 20 | * 21 | * @param imagePrefetcher The current image prefetcher 22 | * @param imageURL The image url that was prefetched 23 | * @param finishedCount The total number of images that were prefetched (successful or not) 24 | * @param totalCount The total number of images that were to be prefetched 25 | */ 26 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didPrefetchURL:(nullable NSURL *)imageURL finishedCount:(NSUInteger)finishedCount totalCount:(NSUInteger)totalCount; 27 | 28 | /** 29 | * Called when all images are prefetched. 30 | * @param imagePrefetcher The current image prefetcher 31 | * @param totalCount The total number of images that were prefetched (whether successful or not) 32 | * @param skippedCount The total number of images that were skipped 33 | */ 34 | - (void)imagePrefetcher:(nonnull SDWebImagePrefetcher *)imagePrefetcher didFinishWithTotalCount:(NSUInteger)totalCount skippedCount:(NSUInteger)skippedCount; 35 | 36 | @end 37 | 38 | typedef void(^SDWebImagePrefetcherProgressBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfTotalUrls); 39 | typedef void(^SDWebImagePrefetcherCompletionBlock)(NSUInteger noOfFinishedUrls, NSUInteger noOfSkippedUrls); 40 | 41 | /** 42 | * Prefetch some URLs in the cache for future use. Images are downloaded in low priority. 43 | */ 44 | @interface SDWebImagePrefetcher : NSObject 45 | 46 | /** 47 | * The web image manager 48 | */ 49 | @property (strong, nonatomic, readonly, nonnull) SDWebImageManager *manager; 50 | 51 | /** 52 | * Maximum number of URLs to prefetch at the same time. Defaults to 3. 53 | */ 54 | @property (nonatomic, assign) NSUInteger maxConcurrentDownloads; 55 | 56 | /** 57 | * SDWebImageOptions for prefetcher. Defaults to SDWebImageLowPriority. 58 | */ 59 | @property (nonatomic, assign) SDWebImageOptions options; 60 | 61 | /** 62 | * Queue options for Prefetcher. Defaults to Main Queue. 63 | */ 64 | @property (strong, nonatomic, nonnull) dispatch_queue_t prefetcherQueue; 65 | 66 | @property (weak, nonatomic, nullable) id delegate; 67 | 68 | /** 69 | * Return the global image prefetcher instance. 70 | */ 71 | + (nonnull instancetype)sharedImagePrefetcher; 72 | 73 | /** 74 | * Allows you to instantiate a prefetcher with any arbitrary image manager. 75 | */ 76 | - (nonnull instancetype)initWithImageManager:(nonnull SDWebImageManager *)manager NS_DESIGNATED_INITIALIZER; 77 | 78 | /** 79 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 80 | * currently one image is downloaded at a time, 81 | * and skips images for failed downloads and proceed to the next image in the list. 82 | * Any previously-running prefetch operations are canceled. 83 | * 84 | * @param urls list of URLs to prefetch 85 | */ 86 | - (void)prefetchURLs:(nullable NSArray *)urls; 87 | 88 | /** 89 | * Assign list of URLs to let SDWebImagePrefetcher to queue the prefetching, 90 | * currently one image is downloaded at a time, 91 | * and skips images for failed downloads and proceed to the next image in the list. 92 | * Any previously-running prefetch operations are canceled. 93 | * 94 | * @param urls list of URLs to prefetch 95 | * @param progressBlock block to be called when progress updates; 96 | * first parameter is the number of completed (successful or not) requests, 97 | * second parameter is the total number of images originally requested to be prefetched 98 | * @param completionBlock block to be called when prefetching is completed 99 | * first param is the number of completed (successful or not) requests, 100 | * second parameter is the number of skipped requests 101 | */ 102 | - (void)prefetchURLs:(nullable NSArray *)urls 103 | progress:(nullable SDWebImagePrefetcherProgressBlock)progressBlock 104 | completed:(nullable SDWebImagePrefetcherCompletionBlock)completionBlock; 105 | 106 | /** 107 | * Remove and cancel queued list 108 | */ 109 | - (void)cancelPrefetching; 110 | 111 | 112 | @end 113 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/SDWebImageTransition.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | #import "SDImageCache.h" 13 | 14 | // This class is used to provide a transition animation after the view category load image finished. Use this on `sd_imageTransition` in UIView+WebCache.h 15 | // for UIKit(iOS & tvOS), we use `+[UIView transitionWithView:duration:options:animations:completion]` for transition animation. 16 | // for AppKit(macOS), we use `+[NSAnimationContext runAnimationGroup:completionHandler:]` for transition animation. You can call `+[NSAnimationContext currentContext]` to grab the context during animations block. 17 | // These transition are provided for basic usage. If you need complicated animation, consider to directly use Core Animation or use `SDWebImageAvoidAutoSetImage` and implement your own after image load finished. 18 | 19 | #if SD_UIKIT 20 | typedef UIViewAnimationOptions SDWebImageAnimationOptions; 21 | #else 22 | typedef NS_OPTIONS(NSUInteger, SDWebImageAnimationOptions) { 23 | SDWebImageAnimationOptionAllowsImplicitAnimation = 1 << 0, // specify `allowsImplicitAnimation` for the `NSAnimationContext` 24 | }; 25 | #endif 26 | 27 | typedef void (^SDWebImageTransitionPreparesBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image, NSData * _Nullable imageData, SDImageCacheType cacheType, NSURL * _Nullable imageURL); 28 | typedef void (^SDWebImageTransitionAnimationsBlock)(__kindof UIView * _Nonnull view, UIImage * _Nullable image); 29 | typedef void (^SDWebImageTransitionCompletionBlock)(BOOL finished); 30 | 31 | @interface SDWebImageTransition : NSObject 32 | 33 | /** 34 | By default, we set the image to the view at the beginning of the animtions. You can disable this and provide custom set image process 35 | */ 36 | @property (nonatomic, assign) BOOL avoidAutoSetImage; 37 | /** 38 | The duration of the transition animation, measured in seconds. Defaults to 0.5. 39 | */ 40 | @property (nonatomic, assign) NSTimeInterval duration; 41 | /** 42 | The timing function used for all animations within this transition animation (macOS). 43 | */ 44 | @property (nonatomic, strong, nullable) CAMediaTimingFunction *timingFunction NS_AVAILABLE_MAC(10_7); 45 | /** 46 | A mask of options indicating how you want to perform the animations. 47 | */ 48 | @property (nonatomic, assign) SDWebImageAnimationOptions animationOptions; 49 | /** 50 | A block object to be executed before the animation sequence starts. 51 | */ 52 | @property (nonatomic, copy, nullable) SDWebImageTransitionPreparesBlock prepares; 53 | /** 54 | A block object that contains the changes you want to make to the specified view. 55 | */ 56 | @property (nonatomic, copy, nullable) SDWebImageTransitionAnimationsBlock animations; 57 | /** 58 | A block object to be executed when the animation sequence ends. 59 | */ 60 | @property (nonatomic, copy, nullable) SDWebImageTransitionCompletionBlock completion; 61 | 62 | @end 63 | 64 | // Convenience way to create transition. Remember to specify the duration if needed. 65 | // for UIKit, these transition just use the correspond `animationOptions` 66 | // for AppKit, these transition use Core Animation in `animations`. So your view must be layer-backed. Set `wantsLayer = YES` before you apply it. 67 | 68 | @interface SDWebImageTransition (Conveniences) 69 | 70 | // class property is available in Xcode 8. We will drop the Xcode 7.3 support in 5.x 71 | #if __has_feature(objc_class_property) 72 | /// Fade transition. 73 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *fadeTransition; 74 | /// Flip from left transition. 75 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromLeftTransition; 76 | /// Flip from right transition. 77 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromRightTransition; 78 | /// Flip from top transition. 79 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromTopTransition; 80 | /// Flip from bottom transition. 81 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *flipFromBottomTransition; 82 | /// Curl up transition. 83 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlUpTransition; 84 | /// Curl down transition. 85 | @property (nonatomic, class, nonnull, readonly) SDWebImageTransition *curlDownTransition; 86 | #else 87 | + (nonnull instancetype)fadeTransition; 88 | + (nonnull instancetype)flipFromLeftTransition; 89 | + (nonnull instancetype)flipFromRightTransition; 90 | + (nonnull instancetype)flipFromTopTransition; 91 | + (nonnull instancetype)flipFromBottomTransition; 92 | + (nonnull instancetype)curlUpTransition; 93 | + (nonnull instancetype)curlDownTransition; 94 | #endif 95 | 96 | @end 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIImage (ForceDecode) 12 | 13 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 14 | 15 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDWebImageCodersManager.h" 11 | 12 | @implementation UIImage (ForceDecode) 13 | 14 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 15 | if (!image) { 16 | return nil; 17 | } 18 | NSData *tempData; 19 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; 20 | } 21 | 22 | + (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image { 23 | if (!image) { 24 | return nil; 25 | } 26 | NSData *tempData; 27 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Creates an animated UIImage from an NSData. 16 | * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. 17 | */ 18 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 19 | 20 | /** 21 | * Checks if an UIImage instance is a GIF. Will use the `images` array. 22 | */ 23 | - (BOOL)isGIF; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import "SDWebImageGIFCoder.h" 12 | #import "NSImage+WebCache.h" 13 | 14 | @implementation UIImage (GIF) 15 | 16 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 17 | if (!data) { 18 | return nil; 19 | } 20 | return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data]; 21 | } 22 | 23 | - (BOOL)isGIF { 24 | return (self.images != nil); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | /** 15 | * UIKit: 16 | * For static image format, this value is always 0. 17 | * For animated image format, 0 means infinite looping. 18 | * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 19 | * AppKit: 20 | * NSImage currently only support animated via GIF imageRep unlike UIImage. 21 | * The getter of this property will get the loop count from GIF imageRep 22 | * The setter of this property will set the loop count from GIF imageRep 23 | */ 24 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount; 25 | 26 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 27 | - (nullable NSData *)sd_imageData; 28 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MultiFormat.h" 10 | 11 | #import "objc/runtime.h" 12 | #import "SDWebImageCodersManager.h" 13 | 14 | @implementation UIImage (MultiFormat) 15 | 16 | #if SD_MAC 17 | - (NSUInteger)sd_imageLoopCount { 18 | NSUInteger imageLoopCount = 0; 19 | for (NSImageRep *rep in self.representations) { 20 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 21 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 22 | imageLoopCount = [[bitmapRep valueForProperty:NSImageLoopCount] unsignedIntegerValue]; 23 | break; 24 | } 25 | } 26 | return imageLoopCount; 27 | } 28 | 29 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { 30 | for (NSImageRep *rep in self.representations) { 31 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 32 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 33 | [bitmapRep setProperty:NSImageLoopCount withValue:@(sd_imageLoopCount)]; 34 | break; 35 | } 36 | } 37 | } 38 | 39 | #else 40 | 41 | - (NSUInteger)sd_imageLoopCount { 42 | NSUInteger imageLoopCount = 0; 43 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_imageLoopCount)); 44 | if ([value isKindOfClass:[NSNumber class]]) { 45 | imageLoopCount = value.unsignedIntegerValue; 46 | } 47 | return imageLoopCount; 48 | } 49 | 50 | - (void)setSd_imageLoopCount:(NSUInteger)sd_imageLoopCount { 51 | NSNumber *value = @(sd_imageLoopCount); 52 | objc_setAssociatedObject(self, @selector(sd_imageLoopCount), value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 53 | } 54 | #endif 55 | 56 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data { 57 | return [[SDWebImageCodersManager sharedInstance] decodedImageWithData:data]; 58 | } 59 | 60 | - (nullable NSData *)sd_imageData { 61 | return [self sd_imageDataAsFormat:SDImageFormatUndefined]; 62 | } 63 | 64 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat { 65 | NSData *imageData = nil; 66 | if (self) { 67 | imageData = [[SDWebImageCodersManager sharedInstance] encodedDataWithImage:self format:imageFormat]; 68 | } 69 | return imageData; 70 | } 71 | 72 | 73 | @end 74 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | /** 16 | * Integrates SDWebImage async downloading and caching of remote images with UIImageView for highlighted state. 17 | */ 18 | @interface UIImageView (HighlightedWebCache) 19 | 20 | /** 21 | * Set the imageView `highlightedImage` with an `url`. 22 | * 23 | * The download is asynchronous and cached. 24 | * 25 | * @param url The url for the image. 26 | */ 27 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url NS_REFINED_FOR_SWIFT; 28 | 29 | /** 30 | * Set the imageView `highlightedImage` with an `url` and custom options. 31 | * 32 | * The download is asynchronous and cached. 33 | * 34 | * @param url The url for the image. 35 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 36 | */ 37 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 38 | options:(SDWebImageOptions)options NS_REFINED_FOR_SWIFT; 39 | 40 | /** 41 | * Set the imageView `highlightedImage` with an `url`. 42 | * 43 | * The download is asynchronous and cached. 44 | * 45 | * @param url The url for the image. 46 | * @param completedBlock A block called when operation has been completed. This block has no return value 47 | * and takes the requested UIImage as first parameter. In case of error the image parameter 48 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 49 | * indicating if the image was retrieved from the local cache or from the network. 50 | * The fourth parameter is the original image url. 51 | */ 52 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 53 | completed:(nullable SDExternalCompletionBlock)completedBlock NS_REFINED_FOR_SWIFT; 54 | 55 | /** 56 | * Set the imageView `highlightedImage` with an `url` and custom options. 57 | * 58 | * The download is asynchronous and cached. 59 | * 60 | * @param url The url for the image. 61 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 62 | * @param completedBlock A block called when operation has been completed. This block has no return value 63 | * and takes the requested UIImage as first parameter. In case of error the image parameter 64 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 65 | * indicating if the image was retrieved from the local cache or from the network. 66 | * The fourth parameter is the original image url. 67 | */ 68 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 69 | options:(SDWebImageOptions)options 70 | completed:(nullable SDExternalCompletionBlock)completedBlock; 71 | 72 | /** 73 | * Set the imageView `highlightedImage` with an `url` and custom options. 74 | * 75 | * The download is asynchronous and cached. 76 | * 77 | * @param url The url for the image. 78 | * @param options The options to use when downloading the image. @see SDWebImageOptions for the possible values. 79 | * @param progressBlock A block called while image is downloading 80 | * @note the progress block is executed on a background queue 81 | * @param completedBlock A block called when operation has been completed. This block has no return value 82 | * and takes the requested UIImage as first parameter. In case of error the image parameter 83 | * is nil and the second parameter may contain an NSError. The third parameter is a Boolean 84 | * indicating if the image was retrieved from the local cache or from the network. 85 | * The fourth parameter is the original image url. 86 | */ 87 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 88 | options:(SDWebImageOptions)options 89 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 90 | completed:(nullable SDExternalCompletionBlock)completedBlock; 91 | 92 | @end 93 | 94 | #endif 95 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | // These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 16 | // All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 17 | @interface UIView (WebCacheOperation) 18 | 19 | /** 20 | * Set the image load operation (storage in a UIView based weak map table) 21 | * 22 | * @param operation the operation 23 | * @param key key for storing the operation 24 | */ 25 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 26 | 27 | /** 28 | * Cancel all operations for the current UIView and key 29 | * 30 | * @param key key for identifying the operations 31 | */ 32 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 33 | 34 | /** 35 | * Just remove the operations corresponding to the current UIView and key without cancelling them 36 | * 37 | * @param key key for identifying the operations 38 | */ 39 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 40 | 41 | @end 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIView+WebCacheOperation.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "objc/runtime.h" 14 | 15 | static char loadOperationKey; 16 | 17 | // key is copy, value is weak because operation instance is retained by SDWebImageManager's runningOperations property 18 | // we should use lock to keep thread-safe because these method may not be acessed from main queue 19 | typedef NSMapTable> SDOperationsDictionary; 20 | 21 | @implementation UIView (WebCacheOperation) 22 | 23 | - (SDOperationsDictionary *)sd_operationDictionary { 24 | @synchronized(self) { 25 | SDOperationsDictionary *operations = objc_getAssociatedObject(self, &loadOperationKey); 26 | if (operations) { 27 | return operations; 28 | } 29 | operations = [[NSMapTable alloc] initWithKeyOptions:NSPointerFunctionsStrongMemory valueOptions:NSPointerFunctionsWeakMemory capacity:0]; 30 | objc_setAssociatedObject(self, &loadOperationKey, operations, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 31 | return operations; 32 | } 33 | } 34 | 35 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key { 36 | if (key) { 37 | [self sd_cancelImageLoadOperationWithKey:key]; 38 | if (operation) { 39 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 40 | @synchronized (self) { 41 | [operationDictionary setObject:operation forKey:key]; 42 | } 43 | } 44 | } 45 | } 46 | 47 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key { 48 | // Cancel in progress downloader from queue 49 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 50 | id operation; 51 | @synchronized (self) { 52 | operation = [operationDictionary objectForKey:key]; 53 | } 54 | if (operation) { 55 | if ([operation conformsToProtocol:@protocol(SDWebImageOperation)]){ 56 | [operation cancel]; 57 | } 58 | @synchronized (self) { 59 | [operationDictionary removeObjectForKey:key]; 60 | } 61 | } 62 | } 63 | 64 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key { 65 | if (key) { 66 | SDOperationsDictionary *operationDictionary = [self sd_operationDictionary]; 67 | @synchronized (self) { 68 | [operationDictionary removeObjectForKey:key]; 69 | } 70 | } 71 | } 72 | 73 | @end 74 | 75 | #endif 76 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MBProgressHUD : NSObject 3 | @end 4 | @implementation PodsDummy_MBProgressHUD 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/MBProgressHUD/MBProgressHUD.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/MBProgressHUD" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" 4 | OTHER_LDFLAGS = -framework "CoreGraphics" -framework "QuartzCore" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/MBProgressHUD 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZJCollectionViewSummary/Pods-ZJCollectionViewSummary-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## MBProgressHUD 5 | 6 | Copyright © 2009-2016 Matej Bukovinski 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy 9 | of this software and associated documentation files (the "Software"), to deal 10 | in the Software without restriction, including without limitation the rights 11 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 | copies of the Software, and to permit persons to whom the Software is 13 | furnished to do so, subject to the following conditions: 14 | 15 | The above copyright notice and this permission notice shall be included in 16 | all copies or substantial portions of the Software. 17 | 18 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 | THE SOFTWARE. 25 | 26 | ## SDWebImage 27 | 28 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 29 | 30 | Permission is hereby granted, free of charge, to any person obtaining a copy 31 | of this software and associated documentation files (the "Software"), to deal 32 | in the Software without restriction, including without limitation the rights 33 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 34 | copies of the Software, and to permit persons to whom the Software is furnished 35 | to do so, subject to the following conditions: 36 | 37 | The above copyright notice and this permission notice shall be included in all 38 | copies or substantial portions of the Software. 39 | 40 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 41 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 42 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 43 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 44 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 45 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 46 | THE SOFTWARE. 47 | 48 | 49 | Generated by CocoaPods - https://cocoapods.org 50 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZJCollectionViewSummary/Pods-ZJCollectionViewSummary-acknowledgements.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | PreferenceSpecifiers 6 | 7 | 8 | FooterText 9 | This application makes use of the following third party libraries: 10 | Title 11 | Acknowledgements 12 | Type 13 | PSGroupSpecifier 14 | 15 | 16 | FooterText 17 | Copyright © 2009-2016 Matej Bukovinski 18 | 19 | Permission is hereby granted, free of charge, to any person obtaining a copy 20 | of this software and associated documentation files (the "Software"), to deal 21 | in the Software without restriction, including without limitation the rights 22 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 23 | copies of the Software, and to permit persons to whom the Software is 24 | furnished to do so, subject to the following conditions: 25 | 26 | The above copyright notice and this permission notice shall be included in 27 | all copies or substantial portions of the Software. 28 | 29 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 30 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 31 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 32 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 33 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 34 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 35 | THE SOFTWARE. 36 | License 37 | MIT 38 | Title 39 | MBProgressHUD 40 | Type 41 | PSGroupSpecifier 42 | 43 | 44 | FooterText 45 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 46 | 47 | Permission is hereby granted, free of charge, to any person obtaining a copy 48 | of this software and associated documentation files (the "Software"), to deal 49 | in the Software without restriction, including without limitation the rights 50 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 51 | copies of the Software, and to permit persons to whom the Software is furnished 52 | to do so, subject to the following conditions: 53 | 54 | The above copyright notice and this permission notice shall be included in all 55 | copies or substantial portions of the Software. 56 | 57 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 58 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 59 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 60 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 61 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 62 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 63 | THE SOFTWARE. 64 | 65 | 66 | License 67 | MIT 68 | Title 69 | SDWebImage 70 | Type 71 | PSGroupSpecifier 72 | 73 | 74 | FooterText 75 | Generated by CocoaPods - https://cocoapods.org 76 | Title 77 | 78 | Type 79 | PSGroupSpecifier 80 | 81 | 82 | StringsTable 83 | Acknowledgements 84 | Title 85 | Acknowledgements 86 | 87 | 88 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZJCollectionViewSummary/Pods-ZJCollectionViewSummary-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_ZJCollectionViewSummary : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_ZJCollectionViewSummary 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZJCollectionViewSummary/Pods-ZJCollectionViewSummary.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MBProgressHUD" -l"SDWebImage" -framework "CoreGraphics" -framework "ImageIO" -framework "QuartzCore" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/Pods-ZJCollectionViewSummary/Pods-ZJCollectionViewSummary.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/MBProgressHUD" "${PODS_ROOT}/Headers/Public/SDWebImage" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/MBProgressHUD" "${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage" 4 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/MBProgressHUD" -isystem "${PODS_ROOT}/Headers/Public/SDWebImage" 5 | OTHER_LDFLAGS = $(inherited) -ObjC -l"MBProgressHUD" -l"SDWebImage" -framework "CoreGraphics" -framework "ImageIO" -framework "QuartzCore" 6 | PODS_BUILD_DIR = ${BUILD_DIR} 7 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 8 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 9 | PODS_ROOT = ${SRCROOT}/Pods 10 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/SDWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/SDWebImage" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/SDWebImage" 4 | OTHER_LDFLAGS = -framework "ImageIO" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcodeproj/project.xcworkspace/xcuserdata/weizhu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary.xcodeproj/project.xcworkspace/xcuserdata/weizhu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcodeproj/xcuserdata/james.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZJCollectionViewSummary.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcodeproj/xcuserdata/weizhu.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | ZJCollectionViewSummary.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/xcuserdata/james.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary.xcworkspace/xcuserdata/james.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/xcuserdata/james.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/xcuserdata/weizhu.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary.xcworkspace/xcuserdata/weizhu.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /ZJCollectionViewSummary.xcworkspace/xcuserdata/weizhu.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddCollectionViewCell(添加cell)/ZJAddSectionOrCellViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJAddSectionOrCellViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/29. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJAddSectionOrCellViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddHeaderView(添加headerView)/ZJAddHeaderForCollectionReusableView.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJAddHeaderForCollectionReusableView.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/7. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJAddHeaderForCollectionReusableView : UICollectionReusableView 12 | 13 | @property (weak, nonatomic) IBOutlet UIImageView *imageV; 14 | @property (weak, nonatomic) IBOutlet UILabel *titleL; 15 | @property (weak, nonatomic) IBOutlet UILabel *detailL; 16 | 17 | @property (nonatomic,strong) NSDictionary *dict; 18 | @end 19 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddHeaderView(添加headerView)/ZJAddHeaderForCollectionReusableView.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJAddHeaderForCollectionReusableView.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/7. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJAddHeaderForCollectionReusableView.h" 10 | 11 | @implementation ZJAddHeaderForCollectionReusableView 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | 16 | self.imageV.layer.borderColor = [UIColor lightGrayColor].CGColor; 17 | self.imageV.layer.borderWidth = 1.0; 18 | self.imageV.layer.cornerRadius = 5.0; 19 | self.imageV.layer.masksToBounds = YES; 20 | } 21 | 22 | - (void)setDict:(NSDictionary *)dict 23 | { 24 | _dict = dict; 25 | 26 | self.titleL.text = dict[@"title"]; 27 | [self.imageV sd_setImageWithURL:[NSURL URLWithString:dict[@"picUrl"]] placeholderImage:[UIImage imageNamed:@"name"]]; 28 | self.detailL.text = dict[@"detail"]; 29 | } 30 | 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddHeaderView(添加headerView)/ZJAddHeaderViewViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJAddHeaderViewViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/7. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJAddHeaderViewViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddHeaderView(添加headerView)/ZJAddHeaderViewViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJAddHeaderViewViewController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/7. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import "ZJAddHeaderViewViewController.h" 21 | 22 | #import "ZJGroupingCollectionViewFlowLayout.h" 23 | #import "ZJGroupingCollectionViewCell.h" 24 | #import "ZJAddHeaderForCollectionReusableView.h" 25 | 26 | @interface ZJAddHeaderViewViewController () 27 | 28 | @property (nonatomic,strong) UICollectionView *collectionView; 29 | 30 | @property (nonatomic,strong) NSArray *listArray; 31 | 32 | @property (nonatomic, strong) ZJAddHeaderForCollectionReusableView *headerView; 33 | @end 34 | 35 | @implementation ZJAddHeaderViewViewController 36 | 37 | static NSString *ItemIdentifier = @"ItemIdentifier"; 38 | 39 | static NSString *groupingCollectionViewHeadID = @"ZJAddHeaderViewViewHeadID"; 40 | 41 | - (void)viewDidLoad { 42 | [super viewDidLoad]; 43 | self.view.backgroundColor = [UIColor whiteColor]; 44 | self.title = @"分组及添加索引"; 45 | [self.view addSubview:self.collectionView]; 46 | [self setDataArrayAndListArray]; 47 | 48 | if (@available(iOS 11.0, *)) { 49 | self.collectionView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever; 50 | }else{ 51 | self.automaticallyAdjustsScrollViewInsets = NO; 52 | } 53 | } 54 | 55 | 56 | - (void)setDataArrayAndListArray 57 | { 58 | NSString *path = [[NSBundle mainBundle] pathForResource:@"adidasBrand" ofType:@"plist"]; 59 | self.listArray = [NSArray arrayWithContentsOfFile:path]; 60 | } 61 | 62 | - (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView{ 63 | return 1; 64 | } 65 | 66 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section{ 67 | return self.listArray.count; 68 | } 69 | 70 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 71 | { 72 | ZJGroupingCollectionViewCell *cell; 73 | 74 | if (cell == nil) { 75 | 76 | cell = [collectionView dequeueReusableCellWithReuseIdentifier:ItemIdentifier forIndexPath:indexPath]; 77 | } 78 | NSDictionary *dict = self.listArray[indexPath.row]; 79 | NSString *urlStr = dict[@"picpath"]; 80 | [cell.imageV sd_setImageWithURL:[NSURL URLWithString:urlStr] placeholderImage:[UIImage imageNamed:@"name"]]; 81 | cell.imageV.backgroundColor = randomColor; 82 | cell.nameLabel.text = dict[@"goodsprice"]; 83 | 84 | return cell; 85 | } 86 | 87 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath{ 88 | [self.navigationController popViewControllerAnimated:YES]; 89 | } 90 | 91 | #pragma mark - lazy 92 | - (UICollectionView *)collectionView 93 | { 94 | if (_collectionView == nil) { 95 | CGRect size = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64); 96 | ZJGroupingCollectionViewFlowLayout *layout = [[ZJGroupingCollectionViewFlowLayout alloc] init]; 97 | layout.headerReferenceSize = CGSizeMake(SCREEN_WIDTH, 120); 98 | _collectionView = [[UICollectionView alloc] initWithFrame:size collectionViewLayout:layout]; 99 | [_collectionView registerClass:[ZJGroupingCollectionViewCell class] forCellWithReuseIdentifier:ItemIdentifier]; 100 | _collectionView.showsHorizontalScrollIndicator=NO; 101 | _collectionView.showsVerticalScrollIndicator=NO; 102 | _collectionView.backgroundColor=[UIColor whiteColor]; 103 | _collectionView.delegate = self; 104 | _collectionView.dataSource = self; 105 | [_collectionView addSubview:self.headerView]; 106 | [_collectionView registerClass:[UICollectionReusableView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:groupingCollectionViewHeadID]; 107 | } 108 | return _collectionView; 109 | } 110 | 111 | - (ZJAddHeaderForCollectionReusableView *)headerView 112 | { 113 | if (_headerView == nil) { 114 | _headerView = [[NSBundle mainBundle] loadNibNamed:@"ZJAddHeaderForCollectionReusableView" owner:nil options:nil].lastObject; 115 | _headerView.frame = CGRectMake(0, 0, SCREEN_WIDTH, 120); 116 | _headerView.dict = @{@"title":@"adidas",@"picUrl":@"https://juedui010.oss-cn-beijing.aliyuncs.com/201608/31/1472578383MH28ZbXeA8.png",@"detail":@"adidas是来自德国的体育用品品牌,自1949年创立以来,每一年都为众多运动爱好者带来了优质的商品,今年来更是和潮流品牌推出联名单品同样也是大受好评。"}; 117 | } 118 | return _headerView; 119 | } 120 | 121 | @end 122 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddIndex(添加索引)/ZJGroupingCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGroupingCollectionViewCell.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJGroupingCollectionViewCell : UICollectionViewCell 12 | 13 | @property (nonatomic, strong) UIImageView *imageV; 14 | 15 | @property (nonatomic, strong) UILabel *nameLabel; 16 | 17 | @property(nonatomic,strong)UIButton *deleteButton; 18 | @end 19 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddIndex(添加索引)/ZJGroupingCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGroupingCollectionViewCell.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJGroupingCollectionViewCell.h" 10 | 11 | @implementation ZJGroupingCollectionViewCell 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame{ 14 | 15 | if (self == [super initWithFrame:frame]) { 16 | 17 | self.contentView.backgroundColor = [UIColor whiteColor]; 18 | 19 | CGFloat spaWidth = frame.size.width; 20 | CGFloat spaHeight = 50; 21 | 22 | _imageV = [[UIImageView alloc] initWithFrame:CGRectMake(0, 10, spaWidth, spaHeight)]; 23 | _imageV.contentMode = UIViewContentModeScaleAspectFit; 24 | _imageV.backgroundColor = [UIColor whiteColor]; 25 | [self.contentView addSubview:_imageV]; 26 | 27 | _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, spaHeight+15, spaWidth, 20)]; 28 | _nameLabel.textAlignment = NSTextAlignmentCenter; 29 | _nameLabel.textColor = [UIColor lightGrayColor]; 30 | [self.contentView addSubview:_nameLabel]; 31 | 32 | self.deleteButton = [[UIButton alloc] initWithFrame:CGRectMake(spaWidth - 30, 5, 30, 30)]; 33 | [self.deleteButton setImage:[UIImage imageNamed:@"delete_image"] forState:UIControlStateNormal]; 34 | self.deleteButton.hidden = YES; 35 | [self.contentView addSubview:self.deleteButton]; 36 | } 37 | return self; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddIndex(添加索引)/ZJGroupingCollectionViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGroupingCollectionViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJGroupingCollectionViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddIndex(添加索引)/ZJGroupingCollectionViewFlowLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGroupingCollectionViewFlowLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJGroupingCollectionViewFlowLayout : UICollectionViewFlowLayout 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/AddIndex(添加索引)/ZJGroupingCollectionViewFlowLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGroupingCollectionViewFlowLayout.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJGroupingCollectionViewFlowLayout.h" 10 | 11 | @implementation ZJGroupingCollectionViewFlowLayout 12 | 13 | - (instancetype)init 14 | { 15 | if (!(self = [super init])) return nil; 16 | 17 | CGSize size = [[UIScreen mainScreen] bounds].size; 18 | 19 | CGFloat cellSpace = 3.0; 20 | CGFloat cellWidth = (SCREEN_WIDTH - 20) / 3.0; 21 | 22 | self.itemSize = CGSizeMake(cellWidth, cellWidth * 0.8); 23 | self.minimumInteritemSpacing = cellSpace; 24 | self.minimumLineSpacing = cellSpace; 25 | // self.sectionHeadersPinToVisibleBounds = YES;//header 悬浮 26 | self.sectionInset = UIEdgeInsetsMake(cellSpace, cellSpace, cellSpace, cellSpace); 27 | self.headerReferenceSize = CGSizeMake(size.width, 40); 28 | 29 | return self; 30 | } 31 | @end 32 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | }, 88 | { 89 | "idiom" : "ios-marketing", 90 | "size" : "1024x1024", 91 | "scale" : "1x" 92 | } 93 | ], 94 | "info" : { 95 | "version" : 1, 96 | "author" : "xcode" 97 | } 98 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/James.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "James@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/James.imageset/James@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/James.imageset/James@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "add_icon.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "add_icon@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "add_icon@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/add_icon.imageset/add_icon@3x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/check.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "check@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/check.imageset/check@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/check.imageset/check@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/check1.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "check1@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/check1.imageset/check1@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/check1.imageset/check1@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "filename" : "delete_image.png", 6 | "scale" : "1x" 7 | }, 8 | { 9 | "idiom" : "universal", 10 | "filename" : "delete_image@2x.png", 11 | "scale" : "2x" 12 | }, 13 | { 14 | "idiom" : "universal", 15 | "filename" : "delete_image@3x.png", 16 | "scale" : "3x" 17 | } 18 | ], 19 | "info" : { 20 | "version" : 1, 21 | "author" : "xcode" 22 | } 23 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/delete_image.imageset/delete_image@3x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/placeholder.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "filename" : "placeholder@2x.png", 10 | "scale" : "2x" 11 | }, 12 | { 13 | "idiom" : "universal", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/placeholder.imageset/placeholder@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/placeholder.imageset/placeholder@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/select_Icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "select_Icon@3x.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/select_Icon.imageset/select_Icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/select_Icon.imageset/select_Icon@3x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/unselected_icon.imageset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "universal", 5 | "scale" : "1x" 6 | }, 7 | { 8 | "idiom" : "universal", 9 | "scale" : "2x" 10 | }, 11 | { 12 | "idiom" : "universal", 13 | "filename" : "unselected_icon@3x.png", 14 | "scale" : "3x" 15 | } 16 | ], 17 | "info" : { 18 | "version" : 1, 19 | "author" : "xcode" 20 | } 21 | } -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Assets.xcassets/unselected_icon.imageset/unselected_icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/Assets.xcassets/unselected_icon.imageset/unselected_icon@3x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CellReorder(长安拖动)/ZJReorderViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJReorderViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJReorderViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/ZJCycleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCycleViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/9. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJCycleViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/0.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/1.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/10.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/10.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/11.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/11.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/12.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/12.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/13.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/13.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/14.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/14.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/15.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/15.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/16.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/16.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/17.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/17.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/18.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/18.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/19.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/19.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/2.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/20.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/20.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/21.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/21.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/22.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/22.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/23.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/23.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/24.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/24.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/25.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/25.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/26.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/26.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/27.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/27.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/28.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/28.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/29.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/29.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/3.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/30.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/30.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/4.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/5.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/6.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/7.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/7.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/8.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/CycleCollectionView(无线循环)/image/9.jpg -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/CircleLayout(环形布局)/ZJCirleLayoutViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCirleLayoutViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJCirleLayoutViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/CircleLayout(环形布局)/ZJCirleLayoutViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCirleLayoutViewController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import "ZJCirleLayoutViewController.h" 21 | #import "ZJCirleLayout.h" 22 | #import "ZJGridLayout.h" 23 | #import "ZJWaterLayoutCollectionViewCell.h" 24 | 25 | @interface ZJCirleLayoutViewController () 26 | 27 | /** collectionView */ 28 | @property (nonatomic, strong) UICollectionView *collectionView; 29 | /** 数据 */ 30 | @property (nonatomic, strong) NSMutableArray *images; 31 | 32 | @end 33 | 34 | @implementation ZJCirleLayoutViewController 35 | static NSString *ItemIdentifier = @"ItemIdentifier"; 36 | 37 | - (void)viewDidLoad { 38 | [super viewDidLoad]; 39 | self.title = @"环形布局"; 40 | [self.view addSubview:self.collectionView]; 41 | 42 | } 43 | 44 | #pragma mark - 45 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 46 | { 47 | return self.images.count; 48 | } 49 | 50 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 51 | { 52 | ZJWaterLayoutCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ItemIdentifier forIndexPath:indexPath]; 53 | 54 | cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",self.images[indexPath.row]]]; 55 | 56 | return cell; 57 | } 58 | 59 | #pragma mark - 60 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 61 | { 62 | [self.images removeObjectAtIndex:indexPath.item]; 63 | [self.collectionView deleteItemsAtIndexPaths:@[indexPath]]; 64 | } 65 | 66 | - (UICollectionView *)collectionView 67 | { 68 | if (_collectionView == nil) { 69 | CGRect size = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 160); 70 | ZJCirleLayout *layout = [[ZJCirleLayout alloc] init]; 71 | 72 | _collectionView = [[UICollectionView alloc] initWithFrame:size collectionViewLayout:layout]; 73 | [_collectionView registerClass:[ZJWaterLayoutCollectionViewCell class] forCellWithReuseIdentifier:ItemIdentifier]; 74 | _collectionView.showsHorizontalScrollIndicator = NO; 75 | _collectionView.showsVerticalScrollIndicator = NO; 76 | _collectionView.backgroundColor = [UIColor blackColor]; 77 | 78 | _collectionView.delegate = self; 79 | _collectionView.dataSource = self; 80 | } 81 | return _collectionView; 82 | } 83 | 84 | - (NSMutableArray *)images 85 | { 86 | if (!_images) { 87 | _images = [NSMutableArray array]; 88 | for (int i = 0; i < 20; i++) { 89 | [_images addObject:[NSString stringWithFormat:@"%d.jpg", i + 1]]; 90 | } 91 | } 92 | return _images; 93 | } 94 | @end 95 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/LineLayout(线性布局)/ZJLineLayoutViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJLineLayoutViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJLineLayoutViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/WaterLayout(流水布局)/ZJWaterLayoutViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayoutViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJWaterLayoutViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJBlurEffect.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJBlurEffect.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJBlurEffect : NSObject 12 | 13 | + (void)blurEffect:(UIView *)view; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJBlurEffect.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJBlurEffect.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJBlurEffect.h" 10 | 11 | @implementation ZJBlurEffect 12 | 13 | //设置毛玻璃效果 14 | + (void)blurEffect:(UIView *)view{ 15 | 16 | UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleLight]; 17 | UIVisualEffectView *effectVIew = [[UIVisualEffectView alloc]initWithEffect:effect]; 18 | effectVIew.frame = view.bounds; 19 | [view addSubview:effectVIew]; 20 | 21 | } 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJGridLayout(网格布局)/ZJGridLayoutViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGridLayoutViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJGridLayoutViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJGridLayout(网格布局)/ZJGridLayoutViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGridLayoutViewController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import "ZJGridLayoutViewController.h" 21 | #import "ZJWaterLayoutCollectionViewCell.h" 22 | #import "ZJGridLayout.h" 23 | 24 | @interface ZJGridLayoutViewController () 25 | 26 | 27 | /** collectionView */ 28 | @property (nonatomic, strong) UICollectionView *collectionView; 29 | /** 数据 */ 30 | @property (nonatomic, strong) NSMutableArray *imageNames; 31 | 32 | @end 33 | 34 | @implementation ZJGridLayoutViewController 35 | static NSString *ItemIdentifier = @"ItemIdentifier"; 36 | 37 | - (void)viewDidLoad { 38 | [super viewDidLoad]; 39 | self.title = @"网格布局"; 40 | [self.view addSubview:self.collectionView]; 41 | 42 | } 43 | 44 | #pragma mark - 45 | - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section 46 | { 47 | return self.imageNames.count; 48 | } 49 | 50 | - (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath 51 | { 52 | ZJWaterLayoutCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:ItemIdentifier forIndexPath:indexPath]; 53 | 54 | cell.imageView.image = [UIImage imageNamed:[NSString stringWithFormat:@"%@",self.imageNames[indexPath.row]]]; 55 | cell.backgroundColor = [UIColor blueColor]; 56 | return cell; 57 | } 58 | 59 | #pragma mark - 60 | - (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath 61 | { 62 | 63 | } 64 | 65 | - (UICollectionView *)collectionView 66 | { 67 | if (_collectionView == nil) { 68 | CGRect size = CGRectMake(0, 64, SCREEN_WIDTH, SCREEN_HEIGHT - 64); 69 | ZJGridLayout *layout = [[ZJGridLayout alloc] init]; 70 | 71 | _collectionView = [[UICollectionView alloc] initWithFrame:size collectionViewLayout:layout]; 72 | 73 | [_collectionView registerClass:[ZJWaterLayoutCollectionViewCell class] forCellWithReuseIdentifier:ItemIdentifier]; 74 | _collectionView.showsHorizontalScrollIndicator = NO; 75 | _collectionView.showsVerticalScrollIndicator = NO; 76 | _collectionView.backgroundColor = [UIColor whiteColor]; 77 | 78 | _collectionView.delegate = self; 79 | _collectionView.dataSource = self; 80 | } 81 | return _collectionView; 82 | } 83 | 84 | - (NSMutableArray *)imageNames 85 | { 86 | if (!_imageNames) { 87 | _imageNames = [NSMutableArray array]; 88 | for (int i = 0; i < 30; i++) { 89 | [_imageNames addObject:[NSString stringWithFormat:@"%d.jpg", i + 1]]; 90 | } 91 | } 92 | return _imageNames; 93 | } 94 | @end 95 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJWaterLayoutCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayoutCollectionViewCell.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJWaterLayoutCollectionViewCell : UICollectionViewCell 12 | 13 | /** 图片 */ 14 | @property (weak, nonatomic) UIImageView *imageView; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJWaterLayoutCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayoutCollectionViewCell.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJWaterLayoutCollectionViewCell.h" 10 | 11 | @implementation ZJWaterLayoutCollectionViewCell 12 | 13 | - (instancetype)initWithFrame:(CGRect)frame 14 | { 15 | self = [super initWithFrame:frame]; 16 | if (self) { 17 | 18 | UIImageView *imageView = [[UIImageView alloc] init]; 19 | imageView.layer.borderColor = [UIColor whiteColor].CGColor; 20 | imageView.layer.borderWidth = 5; 21 | 22 | [self.contentView addSubview:imageView]; 23 | self.imageView = imageView; 24 | // self.imageView.contentMode = UIViewContentModeScaleAspectFit; 25 | } 26 | return self; 27 | } 28 | 29 | - (void)layoutSubviews 30 | { 31 | [super layoutSubviews]; 32 | self.imageView.frame = self.bounds; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJWaterLayoutListTableViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayoutListTableViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJWaterLayoutListTableViewController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/LayoutWater(常见的几种布局)/ZJWaterLayoutListTableViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayoutListTableViewController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJWaterLayoutListTableViewController.h" 10 | #import "ZJCirleLayoutViewController.h" 11 | #import "ZJGridLayoutViewController.h" 12 | #import "ZJWaterLayoutViewController.h" 13 | #import "ZJLineLayoutViewController.h" 14 | 15 | @interface ZJWaterLayoutListTableViewController () 16 | @property (nonatomic, strong) NSArray *array; 17 | @property (nonatomic, strong) NSArray *classNameA; 18 | 19 | @end 20 | 21 | @implementation ZJWaterLayoutListTableViewController 22 | 23 | - (void)viewDidLoad { 24 | [super viewDidLoad]; 25 | self.title = @"流水布局常见形式"; 26 | self.tableView.backgroundColor = [UIColor whiteColor]; 27 | self.tableView.rowHeight = 60; 28 | self.tableView.tableFooterView = [[UIView alloc] init]; 29 | 30 | self.array = @[@"水平/竖直流水布局",@"水平/竖直线性布局",@"环形布局",@"网格布局"]; 31 | 32 | self.classNameA = @[@"ZJWaterLayoutViewController",@"ZJLineLayoutViewController",@"ZJCirleLayoutViewController",@"ZJGridLayoutViewController"]; 33 | } 34 | 35 | #pragma mark - Table view data source 36 | 37 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 38 | return 1; 39 | } 40 | 41 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 42 | return self.array.count; 43 | } 44 | 45 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 46 | 47 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 48 | if (cell == nil) { 49 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 50 | } 51 | 52 | cell.textLabel.text = self.array[indexPath.row]; 53 | return cell; 54 | } 55 | 56 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 57 | { 58 | NSString *className = self.classNameA[indexPath.row]; 59 | id objectVC = [[NSClassFromString(className) alloc] init]; 60 | [self.navigationController pushViewController:objectVC animated:YES]; 61 | } 62 | 63 | @end 64 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Main/Controller/ZJFunctionListController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJFunctionListController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJFunctionListController : UITableViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Main/Controller/ZJFunctionListController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJFunctionListController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJFunctionListController.h" 10 | 11 | #import "ZJGroupingCollectionViewController.h" 12 | #import "ZJAddSectionOrCellViewController.h" 13 | #import "ZJAddHeaderViewViewController.h" 14 | #import "ZJCycleViewController.h" 15 | #import "ZJMultiSelectCellViewController.h" 16 | #import "ZJWaterLayoutListTableViewController.h" 17 | #import "ZJReorderViewController.h" 18 | 19 | @interface ZJFunctionListController () 20 | 21 | @property (nonatomic, strong) NSArray *array; 22 | @property (nonatomic, strong) NSArray *classNameA; 23 | 24 | @end 25 | 26 | @implementation ZJFunctionListController 27 | 28 | - (void)viewDidLoad { 29 | [super viewDidLoad]; 30 | self.title = @"CollectionView 使用总结"; 31 | self.tableView.backgroundColor = [UIColor whiteColor]; 32 | self.tableView.rowHeight = 60; 33 | self.tableView.tableFooterView = [[UIView alloc] init]; 34 | 35 | self.array = @[@"分组及添加索引",@"添加/删除cell或section",@"添加headerView",@"循环轮播",@"cell多选",@"流水布局常见形式",@"长按拖动排序"]; 36 | 37 | self.classNameA = @[@"ZJGroupingCollectionViewController",@"ZJAddSectionOrCellViewController",@"ZJAddHeaderViewViewController",@"ZJCycleViewController",@"ZJMultiSelectCellViewController",@"ZJWaterLayoutListTableViewController",@"ZJReorderViewController"]; 38 | } 39 | 40 | #pragma mark - Table view data source 41 | 42 | - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 43 | return 1; 44 | } 45 | 46 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 47 | return self.array.count; 48 | } 49 | 50 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 51 | 52 | UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"]; 53 | if (cell == nil) { 54 | cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"cell"]; 55 | } 56 | 57 | cell.textLabel.text = self.array[indexPath.row]; 58 | return cell; 59 | } 60 | 61 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 62 | { 63 | NSString *className = self.classNameA[indexPath.row]; 64 | id objectVC = [[NSClassFromString(className) alloc] init]; 65 | [self.navigationController pushViewController:objectVC animated:YES]; 66 | } 67 | 68 | @end 69 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Main/Controller/ZJNavigationController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJNavigationController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJNavigationController : UINavigationController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Main/Controller/ZJNavigationController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJNavigationController.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJNavigationController.h" 10 | 11 | @interface ZJNavigationController () 12 | 13 | @end 14 | 15 | @implementation ZJNavigationController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | 20 | if (@available(iOS 11.0, *)) { 21 | 22 | [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(-1000,0) forBarMetrics:UIBarMetricsDefault]; 23 | 24 | }else { 25 | [[UIBarButtonItem appearance] setBackButtonTitlePositionAdjustment:UIOffsetMake(0, -60)forBarMetrics:UIBarMetricsDefault]; 26 | } 27 | } 28 | 29 | - (void)didReceiveMemoryWarning { 30 | [super didReceiveMemoryWarning]; 31 | // Dispose of any resources that can be recreated. 32 | } 33 | 34 | /* 35 | #pragma mark - Navigation 36 | 37 | // In a storyboard-based application, you will often want to do a little preparation before navigation 38 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 39 | // Get the new view controller using [segue destinationViewController]. 40 | // Pass the selected object to the new view controller. 41 | } 42 | */ 43 | 44 | @end 45 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | imageInfo 7 | 人物写真01 8 | imageName 9 | figurePhoto01.png 10 | 11 | 12 | imageInfo 13 | 人物写真02 14 | imageName 15 | figurePhoto02.png 16 | 17 | 18 | imageInfo 19 | 人物写真03 20 | imageName 21 | figurePhoto03.png 22 | 23 | 24 | imageInfo 25 | 人物写真04 26 | imageName 27 | figurePhoto04.png 28 | 29 | 30 | imageInfo 31 | 人物写真05 32 | imageName 33 | figurePhoto05.png 34 | 35 | 36 | imageInfo 37 | 人物写真06 38 | imageName 39 | figurePhoto06.png 40 | 41 | 42 | imageInfo 43 | 人物写真07 44 | imageName 45 | figurePhoto07.png 46 | 47 | 48 | imageInfo 49 | 人物写真08 50 | imageName 51 | figurePhoto08.png 52 | 53 | 54 | imageInfo 55 | 人物写真09 56 | imageName 57 | figurePhoto09.png 58 | 59 | 60 | imageInfo 61 | 人物写真10 62 | imageName 63 | figurePhoto10.png 64 | 65 | 66 | imageInfo 67 | 人物写真11 68 | imageName 69 | figurePhoto11.png 70 | 71 | 72 | imageInfo 73 | 人物写真12 74 | imageName 75 | figurePhoto12.png 76 | 77 | 78 | imageInfo 79 | 人物写真13 80 | imageName 81 | figurePhoto13.png 82 | 83 | 84 | imageInfo 85 | 人物写真14 86 | imageName 87 | figurePhoto14.png 88 | 89 | 90 | imageInfo 91 | 人物写真15 92 | imageName 93 | figurePhoto15.png 94 | 95 | 96 | imageInfo 97 | 人物写真16 98 | imageName 99 | figurePhoto16.png 100 | 101 | 102 | imageInfo 103 | 人物写真17 104 | imageName 105 | figurePhoto17.png 106 | 107 | 108 | imageInfo 109 | 人物写真18 110 | imageName 111 | figurePhoto18.png 112 | 113 | 114 | imageInfo 115 | 人物写真19 116 | imageName 117 | figurePhoto19.png 118 | 119 | 120 | imageInfo 121 | 人物写真20 122 | imageName 123 | figurePhoto20.png 124 | 125 | 126 | 127 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto01.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto02.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto03.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto04.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto05.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto06.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto07.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto08.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto09.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto10.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto10.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto11.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto11.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto12.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto12.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto13.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto13.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto14.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto14.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto15.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto15.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto16.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto17.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto17.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto18.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto18.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto19.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto19.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto20.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto20.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto_normal@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto_normal@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto_select@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhijiaxin/ZJCollectionViewSummary/5c05351ed03a41ca26baae7121e540f673cf4fee/ZJCollectionViewSummary/MultiSelectCell(多选)/FigurePhoto(300x180)/figurePhoto_select@2x.png -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/ZJMultiSelectCellViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJMultiSelectCellViewController.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJMultiSelectCellViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/ZJMultiSelectCollectionViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJMultiSelectCollectionViewCell.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJMultiSelectCollectionViewCell : UICollectionViewCell 12 | @property (weak, nonatomic) IBOutlet UIImageView *markV; 13 | 14 | @property (weak, nonatomic) IBOutlet UIImageView *imageV; 15 | 16 | @property (weak, nonatomic) IBOutlet UILabel *titleL; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/MultiSelectCell(多选)/ZJMultiSelectCollectionViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJMultiSelectCollectionViewCell.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJMultiSelectCollectionViewCell.h" 10 | 11 | @implementation ZJMultiSelectCollectionViewCell 12 | 13 | - (void)awakeFromNib { 14 | [super awakeFromNib]; 15 | self.imageV.contentMode = UIViewContentModeScaleAspectFit; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Other/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Other/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ZJNavigationController.h" 11 | #import "ZJFunctionListController.h" 12 | 13 | @interface AppDelegate () 14 | 15 | @end 16 | 17 | @implementation AppDelegate 18 | 19 | 20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 21 | 22 | self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds]; 23 | self.window.backgroundColor = [UIColor whiteColor]; 24 | ZJFunctionListController *funtionLiatVC = [[ZJFunctionListController alloc] init]; 25 | ZJNavigationController *navigationVC = [[ZJNavigationController alloc] initWithRootViewController:funtionLiatVC]; 26 | self.window.rootViewController = navigationVC; 27 | [self.window makeKeyAndVisible]; 28 | 29 | return YES; 30 | } 31 | 32 | 33 | - (void)applicationWillResignActive:(UIApplication *)application { 34 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 35 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 36 | } 37 | 38 | 39 | - (void)applicationDidEnterBackground:(UIApplication *)application { 40 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 41 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 42 | } 43 | 44 | 45 | - (void)applicationWillEnterForeground:(UIApplication *)application { 46 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 47 | } 48 | 49 | 50 | - (void)applicationDidBecomeActive:(UIApplication *)application { 51 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 52 | } 53 | 54 | 55 | - (void)applicationWillTerminate:(UIApplication *)application { 56 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 57 | } 58 | 59 | 60 | @end 61 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Other/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Other/PrefixHeader.pch: -------------------------------------------------------------------------------- 1 | // 2 | // PrefixHeader.pch 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #ifndef PrefixHeader_pch 10 | #define PrefixHeader_pch 11 | 12 | #import 13 | 14 | //屏幕宽度 15 | #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width 16 | //屏幕高度 17 | #define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height 18 | 19 | //RGB颜色 20 | #define random(r, g, b, a) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:(a)/255.0] 21 | //随机色 22 | #define randomColor random(arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256), arc4random_uniform(256)) 23 | 24 | #endif /* PrefixHeader_pch */ 25 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/Other/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJAddIndex/ZJCollectionViewRightIndex.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCollectionViewRightIndex.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import 21 | 22 | @class ZJCollectionViewRightIndex; 23 | 24 | @protocol ZJCollectionViewRightIndexDelegate 25 | 26 | /** 27 | * 触摸到索引时的反应 28 | * 29 | * @param collectionViewIndex 触发的对象 30 | * @param index 触发的索引的下标 31 | * @param title 触发的索引的文字 32 | */ 33 | -(void)collectionViewIndex:(ZJCollectionViewRightIndex *)collectionViewIndex didselectionAtIndex:(NSInteger)index withTitle:(NSString *)title; 34 | 35 | @optional 36 | /** 37 | * 开始触摸索引 38 | * 39 | * @param collectionViewIndex 触发collectionViewIndexTouchesBegan对象 40 | */ 41 | - (void)collectionViewIndexTouchesBegan:(ZJCollectionViewRightIndex *)collectionViewIndex; 42 | 43 | 44 | /** 45 | * 触摸索引结束 46 | * 47 | * @param collectionViewIndex 48 | */ 49 | - (void)collectionViewIndexTouchesEnd:(ZJCollectionViewRightIndex *)collectionViewIndex; 50 | 51 | @end 52 | 53 | @interface ZJCollectionViewRightIndex : UIView 54 | 55 | /** 56 | * 索引内容数组 57 | */ 58 | @property (nonatomic, strong)NSArray *titleIndexes; 59 | 60 | /** 61 | 设置索引字母的颜色 62 | */ 63 | @property (nonatomic, strong) UIColor *color; 64 | /** 65 | 选中索引之后是否在屏幕中显示所选的值 66 | YES显示,NO不显示 67 | */ 68 | @property (nonatomic, assign) BOOL isSelectVisible; 69 | 70 | @property (nonatomic, weak)idcollectionDelegate; 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/UIView+ZJExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ZJExtension.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (ZJExtension) 12 | 13 | @property (nonatomic, assign) CGFloat zj_height; 14 | @property (nonatomic, assign) CGFloat zj_width; 15 | 16 | @property (nonatomic, assign) CGFloat zj_y; 17 | @property (nonatomic, assign) CGFloat zj_x; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/UIView+ZJExtension.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+ZJExtension.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "UIView+ZJExtension.h" 10 | 11 | @implementation UIView (ZJExtension) 12 | 13 | - (CGFloat)zj_height 14 | { 15 | return self.frame.size.height; 16 | } 17 | 18 | - (void)setZj_height:(CGFloat)zj_height 19 | { 20 | CGRect temp = self.frame; 21 | temp.size.height = zj_height; 22 | self.frame = temp; 23 | } 24 | 25 | - (CGFloat)zj_width 26 | { 27 | return self.frame.size.width; 28 | } 29 | 30 | - (void)setZj_width:(CGFloat)zj_width 31 | { 32 | CGRect temp = self.frame; 33 | temp.size.width = zj_width; 34 | self.frame = temp; 35 | } 36 | 37 | 38 | - (CGFloat)zj_y 39 | { 40 | return self.frame.origin.y; 41 | } 42 | 43 | - (void)setZj_y:(CGFloat)zj_y 44 | { 45 | CGRect temp = self.frame; 46 | temp.origin.y = zj_y; 47 | self.frame = temp; 48 | } 49 | 50 | - (CGFloat)zj_x 51 | { 52 | return self.frame.origin.x; 53 | } 54 | 55 | - (void)setZj_x:(CGFloat)zj_x 56 | { 57 | CGRect temp = self.frame; 58 | temp.origin.x = zj_x; 59 | self.frame = temp; 60 | } 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/ZJCycleViewCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCycleViewCell.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/9. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJCycleViewCell : UICollectionViewCell 12 | 13 | @property (strong, nonatomic) UIImageView *imageView; 14 | 15 | @property (strong, nonatomic) UILabel *titleL; 16 | 17 | @property (strong, nonatomic) UILabel *currentPageL; 18 | 19 | @property (nonatomic, strong) UIView *titleBackgroundView; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/ZJCycleViewCell.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCycleViewCell.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/9. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJCycleViewCell.h" 10 | #import "UIView+ZJExtension.h" 11 | 12 | @interface ZJCycleViewCell () 13 | 14 | 15 | @end 16 | 17 | @implementation ZJCycleViewCell 18 | 19 | - (void)awakeFromNib { 20 | [super awakeFromNib]; 21 | // Initialization code 22 | } 23 | 24 | - (instancetype)initWithFrame:(CGRect)frame 25 | { 26 | self = [super initWithFrame:frame]; 27 | if (self) { 28 | 29 | [self.contentView addSubview:self.imageView]; 30 | [self.contentView addSubview:self.titleBackgroundView]; 31 | [self.titleBackgroundView addSubview:self.titleL]; 32 | [self.titleBackgroundView addSubview:self.currentPageL]; 33 | 34 | } 35 | return self; 36 | } 37 | 38 | - (void)layoutSubviews 39 | { 40 | [super layoutSubviews]; 41 | self.imageView.frame = self.bounds; 42 | self.titleBackgroundView.frame = CGRectMake(0, self.zj_height - 30, self.zj_width, 30); 43 | } 44 | 45 | - (UIImageView *)imageView 46 | { 47 | if (_imageView == nil) { 48 | _imageView = [[UIImageView alloc] init]; 49 | } 50 | return _imageView; 51 | } 52 | 53 | - (UILabel *)titleL 54 | { 55 | if (_titleL == nil) { 56 | _titleL = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, self.zj_width - 80, 30)]; 57 | _titleL.textColor = [UIColor whiteColor]; 58 | } 59 | return _titleL; 60 | } 61 | 62 | - (UILabel *)currentPageL 63 | { 64 | if (_currentPageL == nil) { 65 | _currentPageL = [[UILabel alloc] initWithFrame:CGRectMake(self.zj_width - 80, 0, 70, 30)]; 66 | _currentPageL.textAlignment = NSTextAlignmentRight; 67 | _currentPageL.textColor = [UIColor whiteColor]; 68 | } 69 | return _currentPageL; 70 | } 71 | 72 | - (UIView *)titleBackgroundView 73 | { 74 | if (_titleBackgroundView == nil) { 75 | _titleBackgroundView = [[UIView alloc] init]; 76 | _titleBackgroundView.backgroundColor = [UIColor colorWithWhite:0.0 alpha:0.3]; 77 | } 78 | return _titleBackgroundView; 79 | } 80 | 81 | @end 82 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/ZJPageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJPageControl.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJPageControl : UIPageControl 12 | 13 | @property (nonatomic,strong)UIImage *currentImage; //选中图片 14 | @property (nonatomic,strong)UIImage *pageImage; //默认图片 15 | @property (nonatomic,assign)CGSize pointSize; //图标大小 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJCycleView/ZJPageControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJPageControl.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJPageControl.h" 10 | 11 | @implementation ZJPageControl 12 | 13 | - (instancetype)init 14 | { 15 | self = [super init]; 16 | if (self) { 17 | 18 | } 19 | return self; 20 | } 21 | 22 | //从写setCurrentPage方法,可以修改 点的间距 和 点的图片 23 | -(void)setCurrentPage:(NSInteger)page{ 24 | 25 | [super setCurrentPage:page]; 26 | 27 | for (int i = 0; i < [self.subviews count]; i++) { 28 | 29 | UIView *point = [self.subviews objectAtIndex:i]; 30 | 31 | [point setFrame:CGRectMake(point.frame.origin.x, point.frame.origin.y, self.pointSize.width, self.pointSize.height)]; 32 | if ([point.subviews count] == 0) { 33 | UIImageView *view = [[UIImageView alloc]initWithFrame:point.bounds]; 34 | [point addSubview:view]; 35 | }; 36 | UIImageView *view = point.subviews[0]; 37 | 38 | if (i == self.currentPage) { 39 | if (self.currentImage) { 40 | view.image = self.currentImage; 41 | point.backgroundColor = [UIColor clearColor]; 42 | }else { 43 | view.image = nil; 44 | point.backgroundColor = self.currentPageIndicatorTintColor; 45 | } 46 | }else if (self.pageImage) { 47 | view.image = self.pageImage; 48 | point.backgroundColor = [UIColor clearColor]; 49 | }else { 50 | view.image = nil; 51 | point.backgroundColor = self.pageIndicatorTintColor; 52 | } 53 | } 54 | } 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJCirleLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCirleLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import 21 | 22 | @interface ZJCirleLayout : UICollectionViewLayout 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJCirleLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCirleLayout.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJCirleLayout.h" 10 | 11 | @interface ZJCirleLayout() 12 | /** 布局属性 */ 13 | @property (nonatomic, strong) NSMutableArray *attrsArray; 14 | @end 15 | 16 | @implementation ZJCirleLayout 17 | - (NSMutableArray *)attrsArray 18 | { 19 | if (!_attrsArray) { 20 | _attrsArray = [NSMutableArray array]; 21 | } 22 | return _attrsArray; 23 | } 24 | 25 | - (void)prepareLayout 26 | { 27 | [super prepareLayout]; 28 | 29 | [self.attrsArray removeAllObjects]; 30 | 31 | NSInteger count = [self.collectionView numberOfItemsInSection:0]; 32 | for (int i = 0; i < count; i++) { 33 | NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0]; 34 | UICollectionViewLayoutAttributes *attrs = [self layoutAttributesForItemAtIndexPath:indexPath]; 35 | [self.attrsArray addObject:attrs]; 36 | } 37 | } 38 | 39 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 40 | { 41 | return self.attrsArray; 42 | } 43 | 44 | /** 45 | * 这个方法需要返回indexPath位置对应cell的布局属性 46 | */ 47 | - (UICollectionViewLayoutAttributes *)layoutAttributesForItemAtIndexPath:(NSIndexPath *)indexPath 48 | { 49 | NSInteger count = [self.collectionView numberOfItemsInSection:0]; 50 | CGFloat radius = 70; 51 | // 圆心的位置 52 | CGFloat oX = self.collectionView.frame.size.width * 0.5; 53 | CGFloat oY = self.collectionView.frame.size.height * 0.5; 54 | 55 | UICollectionViewLayoutAttributes *attrs = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; 56 | 57 | attrs.size = CGSizeMake(60, 60); 58 | if (count == 1) { 59 | attrs.center = CGPointMake(oX, oY); 60 | } else { 61 | CGFloat angle = (2 * M_PI / count) * indexPath.item; 62 | CGFloat centerX = oX + radius * sin(angle); 63 | CGFloat centerY = oY + radius * cos(angle); 64 | attrs.center = CGPointMake(centerX, centerY); 65 | } 66 | 67 | return attrs; 68 | } 69 | @end 70 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJGridLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGridLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import 21 | 22 | @interface ZJGridLayout : UICollectionViewLayout 23 | 24 | @end 25 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJGridLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJGridLayout.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/11. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJGridLayout.h" 10 | 11 | @interface ZJGridLayout() 12 | /** 所有的布局属性 */ 13 | @property (nonatomic, strong) NSMutableArray *attrsArray; 14 | @end 15 | 16 | @implementation ZJGridLayout 17 | 18 | - (NSMutableArray *)attrsArray 19 | { 20 | if (!_attrsArray) { 21 | _attrsArray = [NSMutableArray array]; 22 | } 23 | return _attrsArray; 24 | } 25 | 26 | - (void)prepareLayout 27 | { 28 | [super prepareLayout]; 29 | 30 | [self.attrsArray removeAllObjects]; 31 | 32 | NSInteger count = [self.collectionView numberOfItemsInSection:0]; 33 | for (int i = 0; i < count; i++) { 34 | // 创建UICollectionViewLayoutAttributes 35 | NSIndexPath *indexPath = [NSIndexPath indexPathForItem:i inSection:0]; 36 | UICollectionViewLayoutAttributes *attrs = [UICollectionViewLayoutAttributes layoutAttributesForCellWithIndexPath:indexPath]; 37 | 38 | // 设置布局属性 39 | CGFloat width = self.collectionView.frame.size.width * 0.5; 40 | if (i == 0) { 41 | CGFloat height = width; 42 | CGFloat x = 0; 43 | CGFloat y = 0; 44 | attrs.frame = CGRectMake(x, y, width, height); 45 | } else if (i == 1) { 46 | CGFloat height = width * 0.5; 47 | CGFloat x = width; 48 | CGFloat y = 0; 49 | attrs.frame = CGRectMake(x, y, width, height); 50 | } else if (i == 2) { 51 | CGFloat height = width * 0.5; 52 | CGFloat x = width; 53 | CGFloat y = height; 54 | attrs.frame = CGRectMake(x, y, width, height); 55 | } else if (i == 3) { 56 | CGFloat height = width * 0.5; 57 | CGFloat x = 0; 58 | CGFloat y = width; 59 | attrs.frame = CGRectMake(x, y, width, height); 60 | } else if (i == 4) { 61 | CGFloat height = width * 0.5; 62 | CGFloat x = 0; 63 | CGFloat y = width + height; 64 | attrs.frame = CGRectMake(x, y, width, height); 65 | } else if (i == 5) { 66 | CGFloat height = width; 67 | CGFloat x = width; 68 | CGFloat y = width; 69 | attrs.frame = CGRectMake(x, y, width, height); 70 | } else { 71 | UICollectionViewLayoutAttributes *lastAttrs = self.attrsArray[i - 6]; 72 | CGRect lastFrame = lastAttrs.frame; 73 | lastFrame.origin.y += 2 * width; 74 | attrs.frame = lastFrame; 75 | } 76 | 77 | // 添加UICollectionViewLayoutAttributes 78 | [self.attrsArray addObject:attrs]; 79 | } 80 | } 81 | 82 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect 83 | { 84 | 85 | return self.attrsArray; 86 | } 87 | 88 | /** 89 | * 返回collectionView的内容大小 90 | */ 91 | - (CGSize)collectionViewContentSize 92 | { 93 | int count = (int)[self.collectionView numberOfItemsInSection:0]; 94 | int rows = (count + 3 - 1) / 3; 95 | CGFloat rowH = self.collectionView.frame.size.width * 0.5; 96 | return CGSizeMake(0, rows * rowH); 97 | } 98 | 99 | @end 100 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJLineScaleFlowLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJLineScaleFlowLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import 21 | typedef NS_ENUM(NSInteger, ZJWaterDirection) { 22 | ZJWaterVertical,//竖直方向布局 23 | ZJWaterHorizontal//水平方向布局 24 | }; 25 | 26 | @interface ZJLineScaleFlowLayout : UICollectionViewFlowLayout 27 | 28 | @property (nonatomic, assign) ZJWaterDirection lineDirection; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJLineScaleFlowLayout.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJLineScaleFlowLayout.m 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/13. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import "ZJLineScaleFlowLayout.h" 10 | 11 | #define ITEMW 300 12 | #define ITENH 400 13 | 14 | @implementation ZJLineScaleFlowLayout 15 | 16 | /** 17 | * 当collectionView的显示范围发生改变的时候,是否需要重新刷新布局 18 | * 一旦重新刷新布局,就会重新调用下面的方法: 19 | 1.prepareLayout 20 | 2.layoutAttributesForElementsInRect:方法 21 | */ 22 | - (BOOL)shouldInvalidateLayoutForBoundsChange:(CGRect)newBounds 23 | { 24 | return YES; 25 | } 26 | 27 | /** 28 | * 用来做布局的初始化操作(不建议在init方法中进行布局的初始化操作) 29 | */ 30 | - (void)prepareLayout 31 | { 32 | [super prepareLayout]; 33 | 34 | //设置item的大小 35 | if (self.lineDirection == ZJWaterVertical) { 36 | self.itemSize = CGSizeMake(ITEMW, ITENH); 37 | self.scrollDirection = UICollectionViewScrollDirectionHorizontal; 38 | self.sectionInset = UIEdgeInsetsMake(0, SCREEN_WIDTH * 0.5 - ITEMW * 0.5, 0, SCREEN_WIDTH * 0.5 - ITEMW * 0.5); 39 | self.minimumLineSpacing = (SCREEN_WIDTH - ITEMW) * 0.25; 40 | }else{ 41 | self.itemSize = CGSizeMake(ITEMW, ITENH); 42 | self.scrollDirection = UICollectionViewScrollDirectionVertical; 43 | self.sectionInset = UIEdgeInsetsMake(SCREEN_HEIGHT * 0.5 - ITENH * 0.5, 0, SCREEN_HEIGHT * 0.5 - ITENH * 0.5, 0); 44 | self.minimumLineSpacing = (SCREEN_HEIGHT - ITENH) * 0.1; 45 | } 46 | } 47 | 48 | /** 49 | UICollectionViewLayoutAttributes *attrs; 50 | 1.一个cell对应一个UICollectionViewLayoutAttributes对象 51 | 2.UICollectionViewLayoutAttributes对象决定了cell的frame 52 | */ 53 | /** 54 | * 这个方法的返回值是一个数组(数组里面存放着rect范围内所有元素的布局属性) 55 | * 这个方法的返回值决定了rect范围内所有元素的排布(frame) 56 | */ 57 | - (NSArray *)layoutAttributesForElementsInRect:(CGRect)rect{ 58 | //屏幕X中间线 59 | CGFloat centerX = self.collectionView.contentOffset.x + self.collectionView.bounds.size.width /2.0f; 60 | //屏幕Y中间线 61 | CGFloat centerY = self.collectionView.contentOffset.y + self.collectionView.bounds.size.height * 0.5; 62 | if (self.lineDirection == ZJWaterVertical) { 63 | return [self calculateDistanceWithElementsInRect:rect direction:ZJWaterVertical Center:centerX dividend:self.collectionView.bounds.size.width]; 64 | }else{ 65 | return [self calculateDistanceWithElementsInRect:rect direction:ZJWaterHorizontal Center:centerY dividend:self.collectionView.bounds.size.height]; 66 | } 67 | } 68 | 69 | - (NSArray *)copyAttributes:(NSArray *)arr{ 70 | NSMutableArray *copyArr = [NSMutableArray new]; 71 | for (UICollectionViewLayoutAttributes *attribute in arr) { 72 | [copyArr addObject:[attribute copy]]; 73 | } 74 | return copyArr; 75 | } 76 | 77 | - (NSArray *)calculateDistanceWithElementsInRect:(CGRect)rect direction:(ZJWaterDirection)direction Center:(CGFloat)center dividend:(CGFloat)dividend 78 | { 79 | NSArray *array = [self copyAttributes: [super layoutAttributesForElementsInRect:rect]]; 80 | //刷新cell缩放 81 | for (UICollectionViewLayoutAttributes *attribute in array) { 82 | CGFloat distance = 0; 83 | if (direction == ZJWaterVertical) { 84 | distance = fabs(attribute.center.x - center); 85 | }else{ 86 | distance = fabs(attribute.center.y - center); 87 | } 88 | 89 | //移动的距离和屏幕宽的比例 90 | CGFloat screenScale = distance /dividend; 91 | //卡片移动到固定范围内 -π/4 到 π/4 92 | CGFloat scale = fabs(cos(screenScale * M_PI/4)); 93 | //设置cell的缩放 按照余弦函数曲线 越居中越接近于1 94 | if (direction == ZJWaterVertical) { 95 | attribute.transform = CGAffineTransformMakeScale(1.0,scale); 96 | }else{ 97 | attribute.transform = CGAffineTransformMakeScale(scale, 1.0); 98 | } 99 | //透明度 100 | attribute.alpha = scale; 101 | } 102 | return array; 103 | } 104 | @end 105 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJReorderFlowLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJReorderFlowLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 12 | 13 | 也可以到博客下看看相关介绍 14 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 15 | 16 | 有什么错误或使用不便的地方可以留言或加我QQ 17 | 18 | QQ:1224740397 19 | */ 20 | 21 | #import 22 | 23 | @interface ZJReorderFlowLayout : UICollectionViewFlowLayout 24 | @property (assign, nonatomic) CGFloat scrollingSpeed; 25 | @property (assign, nonatomic) UIEdgeInsets scrollingTriggerEdgeInsets; 26 | @property (strong, nonatomic, readonly) UILongPressGestureRecognizer *longPressGestureRecognizer; 27 | @property (strong, nonatomic, readonly) UIPanGestureRecognizer *panGestureRecognizer; 28 | 29 | - (void)setUpGestureRecognizersOnCollectionView __attribute__((deprecated("Calls to setUpGestureRecognizersOnCollectionView method are not longer needed as setup are done automatically through KVO."))); 30 | 31 | @end 32 | 33 | @protocol ZJReorderCollectionViewDataSource 34 | 35 | @optional 36 | 37 | - (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath willMoveToIndexPath:(NSIndexPath *)toIndexPath; 38 | - (void)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath didMoveToIndexPath:(NSIndexPath *)toIndexPath; 39 | 40 | - (BOOL)collectionView:(UICollectionView *)collectionView canMoveItemAtIndexPath:(NSIndexPath *)indexPath; 41 | - (BOOL)collectionView:(UICollectionView *)collectionView itemAtIndexPath:(NSIndexPath *)fromIndexPath canMoveToIndexPath:(NSIndexPath *)toIndexPath; 42 | 43 | @end 44 | 45 | @protocol ZJReorderCollectionViewDelegateFlowLayout 46 | @optional 47 | 48 | - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 49 | - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didBeginDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 50 | - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout willEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 51 | - (void)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout didEndDraggingItemAtIndexPath:(NSIndexPath *)indexPath; 52 | 53 | @end 54 | 55 | -------------------------------------------------------------------------------- /ZJCollectionViewSummary/ZJCollectionViewSummary/ZJLayout/ZJWaterLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // ZJWaterLayout.h 3 | // ZJCollectionViewSummary 4 | // 5 | // Created by James on 2018/6/12. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | /** 10 | 项目地址:https://github.com/zhijiaxin/ZJCollectionViewSummary.git 11 | 12 | 也可以到博客下看看相关介绍 13 | 博客地址:https://www.jianshu.com/p/ff7089782d6c 14 | 15 | 有什么错误或使用不便的地方可以留言或加我QQ 16 | 17 | QQ:1224740397 18 | */ 19 | 20 | #import 21 | 22 | @class ZJWaterLayout; 23 | 24 | typedef NS_ENUM(NSInteger, ZJWaterDirection) { 25 | ZJWaterVertical,//竖直方向布局 26 | ZJWaterHorizontal//水平方向布局 27 | }; 28 | 29 | @protocol ZJWaterLayoutDelegate 30 | 31 | @required 32 | /** 宽高转换:ZJWaterVertical根据宽算高,ZJWaterHorizontal根据高算宽 */ 33 | - (CGFloat)waterFlowLayout:(ZJWaterLayout *)layout hieghtForItemAtIndex:(NSUInteger)index itemwidth:(CGFloat)itemwidth; 34 | 35 | @optional 36 | /** 列数 */ 37 | - (NSInteger)waterFlowLayoutColumnCount:(ZJWaterLayout *)layout; 38 | /** 列间距 */ 39 | - (CGFloat)waterFlowLayoutColumnSpacing:(ZJWaterLayout *)layout; 40 | /** 行间距 */ 41 | - (CGFloat)waterFlowLayoutRowSpacing:(ZJWaterLayout *)layout; 42 | /** 边距 */ 43 | - (UIEdgeInsets)waterFlowLayoutEdgeInsets:(ZJWaterLayout *)layout; 44 | 45 | @end 46 | 47 | @interface ZJWaterLayout : UICollectionViewLayout 48 | /** 代理 */ 49 | @property (nonatomic,weak) id delegate; 50 | /** 布局方向 */ 51 | @property (nonatomic, assign) ZJWaterDirection waterDirection; 52 | 53 | @end 54 | -------------------------------------------------------------------------------- /ZJCollectionViewSummaryTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZJCollectionViewSummaryTests/ZJCollectionViewSummaryTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCollectionViewSummaryTests.m 3 | // ZJCollectionViewSummaryTests 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJCollectionViewSummaryTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZJCollectionViewSummaryTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /ZJCollectionViewSummaryUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /ZJCollectionViewSummaryUITests/ZJCollectionViewSummaryUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // ZJCollectionViewSummaryUITests.m 3 | // ZJCollectionViewSummaryUITests 4 | // 5 | // Created by James on 2018/5/28. 6 | // Copyright © 2018年 James. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ZJCollectionViewSummaryUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation ZJCollectionViewSummaryUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | --------------------------------------------------------------------------------