Showing preview only (964K chars total). Download the full file or copy to clipboard to get everything.
Repository: GodzzZZZ/MFPictureBrowser
Branch: master
Commit: 965b0ce7ea2e
Files: 161
Total size: 896.3 KB
Directory structure:
gitextract_yxwgostq/
├── .gitignore
├── LICENSE
├── MFPictureBrowser.podspec
├── MFPictureBrowserDemo/
│ ├── MFPictureBrowserDemo/
│ │ ├── AppDelegate.h
│ │ ├── AppDelegate.m
│ │ ├── Base.lproj/
│ │ │ ├── LaunchScreen.storyboard
│ │ │ └── Main.storyboard
│ │ ├── Image.xcassets/
│ │ │ ├── 10.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 11.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 3.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 4.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 5.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 6.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 7.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 8.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── 9.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── Contents.json
│ │ │ ├── ic_messages_pictype_gif_30x30_.imageset/
│ │ │ │ └── Contents.json
│ │ │ ├── ic_messages_pictype_long_pic_30x30_.imageset/
│ │ │ │ └── Contents.json
│ │ │ └── placeholder.imageset/
│ │ │ └── Contents.json
│ │ ├── Info.plist
│ │ ├── ListViewController.h
│ │ ├── ListViewController.m
│ │ ├── LocalImageViewController.h
│ │ ├── LocalImageViewController.m
│ │ ├── MFDisplayPhotoCollectionViewCell.h
│ │ ├── MFDisplayPhotoCollectionViewCell.m
│ │ ├── MFPictureBrowser/
│ │ │ ├── MFPictureBrowser.h
│ │ │ ├── MFPictureBrowser.m
│ │ │ ├── MFPictureModelProtocol.h
│ │ │ ├── MFPictureView.h
│ │ │ ├── MFPictureView.m
│ │ │ ├── MFRunLoopDistribution.h
│ │ │ ├── MFRunLoopDistribution.m
│ │ │ ├── UIImage+ForceDecoded.h
│ │ │ ├── UIImage+ForceDecoded.m
│ │ │ ├── UIImageView+TransitionImage.h
│ │ │ └── UIImageView+TransitionImage.m
│ │ ├── MFPictureModel.h
│ │ ├── MFPictureModel.m
│ │ ├── RemoteImageViewController.h
│ │ ├── RemoteImageViewController.m
│ │ └── main.m
│ ├── MFPictureBrowserDemo.xcodeproj/
│ │ ├── project.pbxproj
│ │ └── project.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── MFPictureBrowserDemo.xcworkspace/
│ │ └── contents.xcworkspacedata
│ ├── Podfile
│ └── Pods/
│ ├── MFCategory/
│ │ ├── Classes/
│ │ │ ├── Manager/
│ │ │ │ ├── MFCookiesManager.h
│ │ │ │ ├── MFCookiesManager.m
│ │ │ │ ├── MFDeviceManager.h
│ │ │ │ ├── MFDeviceManager.m
│ │ │ │ ├── MFManager.h
│ │ │ │ ├── MFManager.m
│ │ │ │ ├── MFREManager.h
│ │ │ │ ├── MFREManager.m
│ │ │ │ ├── MFSavePhotoManager.h
│ │ │ │ └── MFSavePhotoManager.m
│ │ │ ├── NSArrayCategory/
│ │ │ │ ├── NSArray+Distinct.h
│ │ │ │ └── NSArray+Distinct.m
│ │ │ ├── NSDataCategory/
│ │ │ │ ├── NSData+MFHexString.h
│ │ │ │ └── NSData+MFHexString.m
│ │ │ ├── NSDateFormatterCategory/
│ │ │ │ ├── NSDateFormatter+Cache.h
│ │ │ │ └── NSDateFormatter+Cache.m
│ │ │ ├── NSStringCategory/
│ │ │ │ ├── NSString+File.h
│ │ │ │ ├── NSString+File.m
│ │ │ │ ├── NSString+MFBase64Encoder.h
│ │ │ │ ├── NSString+MFBase64Encoder.m
│ │ │ │ ├── NSString+MFMD5Encoder.h
│ │ │ │ └── NSString+MFMD5Encoder.m
│ │ │ ├── NSTimerCategory/
│ │ │ │ ├── NSTimer+MFWeakTimer.h
│ │ │ │ └── NSTimer+MFWeakTimer.m
│ │ │ ├── UIColorCategory/
│ │ │ │ ├── UIColor+MFHexColor.h
│ │ │ │ ├── UIColor+MFHexColor.m
│ │ │ │ ├── UIColor+MFLDColor.h
│ │ │ │ └── UIColor+MFLDColor.m
│ │ │ ├── UIImageCategory/
│ │ │ │ ├── UIImage+Current.h
│ │ │ │ └── UIImage+Current.m
│ │ │ └── UIViewCategory/
│ │ │ ├── UIView+MFExpandTouchSize.h
│ │ │ ├── UIView+MFExpandTouchSize.m
│ │ │ ├── UIView+MFFrame.h
│ │ │ ├── UIView+MFFrame.m
│ │ │ ├── UIView+MFSnapshot.h
│ │ │ ├── UIView+MFSnapshot.m
│ │ │ ├── UIView+Shadow.h
│ │ │ └── UIView+Shadow.m
│ │ ├── LICENSE
│ │ └── README.md
│ ├── Pods.xcodeproj/
│ │ └── project.pbxproj
│ ├── Target Support Files/
│ │ ├── MFCategory/
│ │ │ ├── MFCategory-dummy.m
│ │ │ ├── MFCategory-prefix.pch
│ │ │ └── MFCategory.xcconfig
│ │ ├── Pods-MFPictureBrowserDemo/
│ │ │ ├── Pods-MFPictureBrowserDemo-acknowledgements.markdown
│ │ │ ├── Pods-MFPictureBrowserDemo-acknowledgements.plist
│ │ │ ├── Pods-MFPictureBrowserDemo-dummy.m
│ │ │ ├── Pods-MFPictureBrowserDemo-frameworks.sh
│ │ │ ├── Pods-MFPictureBrowserDemo-resources.sh
│ │ │ ├── Pods-MFPictureBrowserDemo.debug.xcconfig
│ │ │ └── Pods-MFPictureBrowserDemo.release.xcconfig
│ │ ├── YYCache/
│ │ │ ├── YYCache-dummy.m
│ │ │ ├── YYCache-prefix.pch
│ │ │ └── YYCache.xcconfig
│ │ ├── YYImage/
│ │ │ ├── YYImage-dummy.m
│ │ │ ├── YYImage-prefix.pch
│ │ │ └── YYImage.xcconfig
│ │ └── YYWebImage/
│ │ ├── YYWebImage-dummy.m
│ │ ├── YYWebImage-prefix.pch
│ │ └── YYWebImage.xcconfig
│ ├── YYCache/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ └── YYCache/
│ │ ├── YYCache.h
│ │ ├── YYCache.m
│ │ ├── YYDiskCache.h
│ │ ├── YYDiskCache.m
│ │ ├── YYKVStorage.h
│ │ ├── YYKVStorage.m
│ │ ├── YYMemoryCache.h
│ │ └── YYMemoryCache.m
│ ├── YYImage/
│ │ ├── LICENSE
│ │ ├── README.md
│ │ ├── Vendor/
│ │ │ └── WebP.framework/
│ │ │ ├── Headers/
│ │ │ │ ├── config.h
│ │ │ │ ├── decode.h
│ │ │ │ ├── demux.h
│ │ │ │ ├── encode.h
│ │ │ │ ├── extras.h
│ │ │ │ ├── format_constants.h
│ │ │ │ ├── mux.h
│ │ │ │ ├── mux_types.h
│ │ │ │ └── types.h
│ │ │ └── WebP
│ │ └── YYImage/
│ │ ├── YYAnimatedImageView.h
│ │ ├── YYAnimatedImageView.m
│ │ ├── YYFrameImage.h
│ │ ├── YYFrameImage.m
│ │ ├── YYImage.h
│ │ ├── YYImage.m
│ │ ├── YYImageCoder.h
│ │ ├── YYImageCoder.m
│ │ ├── YYSpriteSheetImage.h
│ │ └── YYSpriteSheetImage.m
│ └── YYWebImage/
│ ├── LICENSE
│ ├── README.md
│ └── YYWebImage/
│ ├── Categories/
│ │ ├── CALayer+YYWebImage.h
│ │ ├── CALayer+YYWebImage.m
│ │ ├── MKAnnotationView+YYWebImage.h
│ │ ├── MKAnnotationView+YYWebImage.m
│ │ ├── UIButton+YYWebImage.h
│ │ ├── UIButton+YYWebImage.m
│ │ ├── UIImage+YYWebImage.h
│ │ ├── UIImage+YYWebImage.m
│ │ ├── UIImageView+YYWebImage.h
│ │ ├── UIImageView+YYWebImage.m
│ │ ├── _YYWebImageSetter.h
│ │ └── _YYWebImageSetter.m
│ ├── YYImageCache.h
│ ├── YYImageCache.m
│ ├── YYWebImage.h
│ ├── YYWebImageManager.h
│ ├── YYWebImageManager.m
│ ├── YYWebImageOperation.h
│ └── YYWebImageOperation.m
└── README.md
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitignore
================================================
# Created by https://www.gitignore.io/api/macos,objective-c
### macOS ###
*.DS_Store
.AppleDouble
.LSOverride
# Icon must end with two \r
Icon
# Thumbnails
._*
# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent
# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Objective-C ###
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
## Build generated
build/
DerivedData/
## Various settings
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata/
## Other
*.moved-aside
*.xccheckout
*.xcscmblueprint
## Obj-C/Swift specific
*.hmap
*.ipa
*.dSYM.zip
*.dSYM
# CocoaPods - Refactored to standalone file
# Carthage - Refactored to standalone file
# fastlane
#
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
# screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots
fastlane/test_output
# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode
iOSInjectionProject/
### Objective-C Patch ###
# End of https://www.gitignore.io/api/macos,objective-c
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 清风
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: MFPictureBrowser.podspec
================================================
#
# Be sure to run `pod spec lint MFPictureBrowser.podspec' to ensure this is a
# valid spec and to remove all comments including this before submitting the spec.
#
# To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
# To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
#
Pod::Spec.new do |s|
# ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.name = "MFPictureBrowser"
s.version = "0.6.2"
s.summary = "Elegant Picture Browser"
# This description is used to generate tags and improve search results.
# * Think: What does it do? Why did you write it? What is the focus?
# * Try to keep it short, snappy and to the point.
# * Write the description between the DESC delimiters below.
# * Finally, don't worry about the indent, CocoaPods strips it!
s.homepage = "https://github.com/GodzzZZZ/MFPictureBrowser"
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
# ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
s.license = "MIT"
# ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Specify the authors of the library, with email addresses. Email addresses
# of the authors are extracted from the SCM log. E.g. $ git log. CocoaPods also
# accepts just a name if you'd rather not provide an email address.
#
# Specify a social_media_url where others can refer to, for example a twitter
# profile URL.
#
s.author = { 'GodzzZZZ' => 'GodzzZZZ@qq.com' }
# ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# If this Pod runs only on iOS or OS X, then specify the platform and
# the deployment target. You can optionally include the target after the platform.
#
# s.platform = :ios
s.platform = :ios, "9.0"
# When using multiple platforms
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# s.tvos.deployment_target = "9.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
s.source = { :git => "https://github.com/GodzzZZZ/MFPictureBrowser.git", :tag => "#{s.version}" }
# ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# CocoaPods is smart about how it includes source code. For source files
# giving a folder will include any swift, h, m, mm, c & cpp files.
# For header files it will include any header in the folder.
# Not including the public_header_files will make all headers public.
#
s.source_files = "Classes", "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/*.{h,m}"
# s.public_header_files = "Classes/**/*.h"
# ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# A list of resources included with the Pod. These are copied into the
# target bundle with a build phase script. Anything else will be cleaned.
# You can preserve files from being cleaned, please don't preserve
# non-essential files like tests, examples and documentation.
#
# s.resource = "icon.png"
# s.resources = "Image/*.png"
# s.preserve_paths = "FilesToSave", "MoreFilesToSave"
# ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
#
# Link your library with frameworks, or libraries. Libraries do not include
# the lib prefix of their name.
#
# s.framework = "SomeFramework"
s.frameworks = "UIKit", "Foundation"
# s.library = "iconv"
# s.libraries = "iconv", "xml2"
# ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
s.requires_arc = true
s.dependency 'YYWebImage'
s.dependency 'YYImage/WebP'
s.dependency 'MFCategory'
# s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/AppDelegate.h
================================================
#import <UIKit/UIKit.h>
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/AppDelegate.m
================================================
#import "AppDelegate.h"
#import <YYWebImage/YYWebImage.h>
@interface AppDelegate ()
@end
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[YYImageCache sharedCache].memoryCache.costLimit = 50*1024*1024;
[YYImageCache sharedCache].memoryCache.shouldRemoveAllObjectsOnMemoryWarning = YES;
return YES;
}
- (void)applicationWillResignActive:(UIApplication *)application {
// 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.
// Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game.
}
- (void)applicationDidEnterBackground:(UIApplication *)application {
// 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.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
- (void)applicationWillEnterForeground:(UIApplication *)application {
// 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.
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
// 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.
}
- (void)applicationWillTerminate:(UIApplication *)application {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Base.lproj/LaunchScreen.storyboard
================================================
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Base.lproj/Main.storyboard
================================================
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13771" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="d05-X5-P4F">
<device id="retina4_7" orientation="portrait">
<adaptation id="fullscreen"/>
</device>
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13772"/>
<capability name="Safe area layout guides" minToolsVersion="9.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--List View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ListViewController" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/>
</view>
<navigationItem key="navigationItem" id="X4H-Nf-RUO"/>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="364" y="30.134932533733135"/>
</scene>
<!--Navigation Controller-->
<scene sceneID="xRI-kr-bJu">
<objects>
<navigationController automaticallyAdjustsScrollViewInsets="NO" id="d05-X5-P4F" sceneMemberID="viewController">
<toolbarItems/>
<navigationBar key="navigationBar" contentMode="scaleToFill" insetsLayoutMarginsFromSafeArea="NO" id="V2g-yB-3m7">
<rect key="frame" x="0.0" y="20" width="375" height="44"/>
<autoresizingMask key="autoresizingMask"/>
</navigationBar>
<nil name="viewControllers"/>
<connections>
<segue destination="BYZ-38-t0r" kind="relationship" relationship="rootViewController" id="uAh-gE-wGB"/>
</connections>
</navigationController>
<placeholder placeholderIdentifier="IBFirstResponder" id="fF3-lK-lQB" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="396.80000000000001" y="-55.772113943028494"/>
</scene>
</scenes>
</document>
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/10.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "10.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/11.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "11.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/3.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "3.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/4.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "4.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/5.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "5.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/6.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "6.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/7.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "7.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/8.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "8.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/9.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"filename" : "9.jpg",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/Contents.json
================================================
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/ic_messages_pictype_gif_30x30_.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_messages_pictype_gif_30x30_@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/ic_messages_pictype_long_pic_30x30_.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "ic_messages_pictype_long_pic_30x30_@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/placeholder.imageset/Contents.json
================================================
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "placeholder@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "placeholder@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/Info.plist
================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UIRequiresFullScreen</key>
<true/>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
<key>UISupportedInterfaceOrientations~ipad</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
<string>UIInterfaceOrientationLandscapeLeft</string>
<string>UIInterfaceOrientationLandscapeRight</string>
</array>
</dict>
</plist>
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/ListViewController.h
================================================
#import <UIKit/UIKit.h>
@interface ListViewController : UIViewController
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/ListViewController.m
================================================
#import "ListViewController.h"
#import "RemoteImageViewController.h"
#import "LocalImageViewController.h"
#import "MFPictureModel.h"
@interface ListViewController ()
<
UITableViewDelegate,
UITableViewDataSource
>
@property (nonatomic, strong) NSArray *list;
@property (nonatomic, strong) UITableView *tableView;
@end
@implementation ListViewController
- (NSArray *)list {
if (!_list) {
_list = @[
@"网络图片",
@"本地图片",
@"网络福利",
@"本地福利",
];
}
return _list;
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:self.view.bounds style:(UITableViewStyleGrouped)];
_tableView.delegate = self;
_tableView.dataSource = self;
}
return _tableView;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.tableView];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.list.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 44;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:(UITableViewCellStyleDefault) reuseIdentifier:@"cell"];
}
cell.textLabel.text = self.list[indexPath.row];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:true];
if (!indexPath.row) {
RemoteImageViewController *remote = [[RemoteImageViewController alloc] init];
remote.picList = @[
[[MFPictureModel alloc] initWithURL:@"https://pic2.zhimg.com/80/v2-9d0d69e867ed790715fa11d1c55f3151_hd.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"https://ww3.sinaimg.cn/mw690/79ba7be1jw1e5jdfqobcdg20bh06gwwz.gif"
imageName:nil
imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:@"https://b-ssl.duitang.com/uploads/item/201609/03/20160903092531_ZTaFm.gif"
imageName:nil
imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:@"https://b-ssl.duitang.com/uploads/item/201609/03/20160903092605_3KdcV.gif"
imageName:nil
imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:@"https://pic2.zhimg.com/e336f051665a796be2d86ab37aa1ffb9_r.jpg"
imageName:nil
imageType:MFImageTypeLongImage],
[[MFPictureModel alloc] initWithURL:@"https://b-ssl.duitang.com/uploads/item/201609/03/20160903085932_PTrKh.gif"
imageName:nil
imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:@"https://b-ssl.duitang.com/uploads/item/201609/03/20160903085850_ZHaP5.gif"
imageName:nil
imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:@"https://p.upyun.com/demo/webp/webp/png-3.webp"
imageName:nil
imageType:MFImageTypeStaticWebP],
[[MFPictureModel alloc] initWithURL:@"https://p.upyun.com/demo/webp/webp/animated-gif-3.webp"
imageName:nil
imageType:MFImageTypeAnimatedWebP],
].mutableCopy;
[self.navigationController pushViewController:remote animated:true];
}else if (indexPath.row == 1) {
LocalImageViewController *local = [[LocalImageViewController alloc] init];
local.picList = @[
[[MFPictureModel alloc] initWithURL:nil imageName:@"1.gif" imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:nil imageName:@"2.gif" imageType:MFImageTypeGIF],
[[MFPictureModel alloc] initWithURL:nil imageName:@"1.webp" imageType:MFImageTypeStaticWebP],
[[MFPictureModel alloc] initWithURL:nil imageName:@"2.webp" imageType:MFImageTypeAnimatedWebP],
[[MFPictureModel alloc] initWithURL:nil imageName:@"4.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"5.jpg" imageType:MFImageTypeLongImage],
].mutableCopy;
[self.navigationController pushViewController:local animated:true];
}else if (indexPath.row == 2) {
RemoteImageViewController *remoteWelfare = [[RemoteImageViewController alloc] init];
remoteWelfare.picList = @[
[[MFPictureModel alloc] initWithURL:@"http://7xi8d6.com1.z0.glb.clouddn.com/20180122090204_A4hNiG_Screenshot.jpeg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://7xi8d6.com1.z0.glb.clouddn.com/20171114101305_NIAzCK_rakukoo_14_11_2017_10_12_58_703.jpeg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"https://ws1.sinaimg.cn/large/610dc034ly1fjndz4dh39j20u00u0ada.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"https://ws1.sinaimg.cn/large/610dc034ly1fibksd2mbmj20u011iacx.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://7xi8d6.com1.z0.glb.clouddn.com/2017-05-12-18380140_455327614813449_854681840315793408_n.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://ww1.sinaimg.cn/large/61e74233ly1feuogwvg27j20p00zkqe7.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-13-17265708_396005157434387_3099040288153272320_n.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://7xi8d6.com1.z0.glb.clouddn.com/2017-03-02-16906481_1495916493759925_5770648570629718016_n.jpg"
imageName:nil
imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:@"http://ww2.sinaimg.cn/large/610dc034gw1f9lmfwy2nij20u00u076w.jpg"
imageName:nil
imageType:MFImageTypeOther],
].mutableCopy;
[self.navigationController pushViewController:remoteWelfare animated:YES];
}else {
LocalImageViewController *localWelfare = [[LocalImageViewController alloc] init];
localWelfare.picList = @[
[[MFPictureModel alloc] initWithURL:nil imageName:@"6.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"7.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"8.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"9.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"10.jpg" imageType:MFImageTypeOther],
[[MFPictureModel alloc] initWithURL:nil imageName:@"11.jpg" imageType:MFImageTypeOther],
].mutableCopy;
[self.navigationController pushViewController:localWelfare animated:YES];
}
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/LocalImageViewController.h
================================================
#import <UIKit/UIKit.h>
@interface LocalImageViewController : UIViewController
@property (nonatomic, strong) NSMutableArray *picList;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/LocalImageViewController.m
================================================
#import "LocalImageViewController.h"
#import "MFPictureBrowser.h"
#import "MFDisplayPhotoCollectionViewCell.h"
#import <YYWebImage/YYWebImage.h>
#import "MFPictureBrowser/UIImageView+TransitionImage.h"
#import "MFPictureBrowser/UIImage+ForceDecoded.h"
#import "MFPictureModel.h"
@interface LocalImageViewController ()
<
UICollectionViewDelegate,
UICollectionViewDataSource,
UICollectionViewDelegateFlowLayout,
MFPictureBrowserDelegate
>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, assign) NSInteger currentIndex;
@end
@implementation LocalImageViewController
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(10, 10, [UIScreen mainScreen].bounds.size.width - 20, [UIScreen mainScreen].bounds.size.height - 20) collectionViewLayout:flow];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor whiteColor];
_collectionView.bounces = NO;
}
return _collectionView;
}
- (NSMutableArray *)picList {
if (!_picList) {
_picList = @[].mutableCopy;
}
return _picList;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.collectionView];
[self.collectionView registerClass:[MFDisplayPhotoCollectionViewCell class] forCellWithReuseIdentifier:@"reuseCell"];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
YYImageCache *cache = [YYWebImageManager sharedManager].cache;
[cache.memoryCache removeAllObjects];
[cache.diskCache removeAllObjects];
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.picList.count;
}
- (UICollectionViewCell *)collectionView: (UICollectionView *)collectionView
cellForItemAtIndexPath: (NSIndexPath *)indexPath {
MFDisplayPhotoCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"reuseCell" forIndexPath:indexPath];
[cell.button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
MFPictureModel *pictureModel = self.picList[indexPath.row];
__weak MFDisplayPhotoCollectionViewCell *weakCell = cell;
if (pictureModel.hidden) {
weakCell.displayImageView.alpha = 0;
}else {
weakCell.displayImageView.alpha = 1;
}
if (pictureModel.imageType == MFImageTypeGIF) {
if (pictureModel.posterImage) {
weakCell.displayImageView.image = pictureModel.posterImage;
[self configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
}else {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSURL *imageURL = [[NSBundle mainBundle] URLForResource:pictureModel.imageName withExtension:nil];
NSData *animatedData = [NSData dataWithContentsOfURL:imageURL];
UIImage *animatedImage = [UIImage forceDecodedImageWithData:animatedData];
pictureModel.animatedImage = animatedImage;
if (animatedImage) {
pictureModel.posterImage = animatedImage.images.firstObject;
dispatch_async(dispatch_get_main_queue(), ^{
[weakCell.displayImageView animatedTransitionImage:pictureModel.posterImage];
[self configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
});
}
});
}
}else if (pictureModel.imageType == MFImageTypeStaticWebP || pictureModel.imageType == MFImageTypeAnimatedWebP) {
if (pictureModel.posterImage) {
weakCell.displayImageView.image = pictureModel.posterImage;
[self configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
}else {
dispatch_async(dispatch_get_global_queue(0, 0), ^{
NSURL *imageURL = [[NSBundle mainBundle] URLForResource:pictureModel.imageName withExtension:nil];
NSData *webpData = [NSData dataWithContentsOfURL:imageURL];
YYImage *webpImage = [YYImage imageWithData:webpData];
if (webpImage) {
pictureModel.posterImage = webpImage;
pictureModel.webpAnimatedImage = webpImage;
dispatch_async(dispatch_get_main_queue(), ^{
[weakCell.displayImageView animatedTransitionImage:webpImage];
[self configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
});
}
});
}
}else {
UIImage *image = [UIImage imageNamed:pictureModel.imageName];
weakCell.displayImageView.image = image;
pictureModel.posterImage = image;
[self configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
}
return cell;
}
- (void)configTagImageView:(UIImageView *)tagImageView imageType:(MFImageType)imageType {
if (imageType == MFImageTypeLongImage) {
tagImageView.image = [UIImage imageNamed:@"ic_messages_pictype_long_pic_30x30_"];
}else if (imageType == MFImageTypeGIF || imageType == MFImageTypeAnimatedWebP) {
tagImageView.image = [UIImage imageNamed:@"ic_messages_pictype_gif_30x30_"];
}else {
tagImageView.image = nil;
}
tagImageView.alpha = 0;
if (tagImageView.image) {
tagImageView.alpha = 1;
}
}
- (void)buttonClick:(UIButton *)sender {
MFDisplayPhotoCollectionViewCell *cell = (MFDisplayPhotoCollectionViewCell *)sender.superview.superview;
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
MFPictureBrowser *browser = [[MFPictureBrowser alloc] init];
browser.delegate = self;
self.currentIndex = indexPath.row;
MFPictureModel *pictureModel = self.picList[indexPath.row];
pictureModel.hidden = true;
[self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
[browser showImageFromView:cell.displayImageView picturesCount:self.picList.count currentPictureIndex:indexPath.row];
}
- (CGSize)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath: (NSIndexPath *)indexPath{
return CGSizeMake(([UIScreen mainScreen].bounds.size.width - 20 - 20)/3, ([UIScreen mainScreen].bounds.size.width - 20 - 20)/3);
}
- (CGFloat)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
minimumLineSpacingForSectionAtIndex: (NSInteger)section{
return 5.0f;
}
- (CGFloat)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
minimumInteritemSpacingForSectionAtIndex: (NSInteger)section{
return 5.0f;
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
return UIEdgeInsetsMake(5, 5, 5, 5);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
}
- (UIImageView *)pictureBrowser:(MFPictureBrowser *)pictureBrowser imageViewAtIndex:(NSInteger)index {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
MFDisplayPhotoCollectionViewCell *cell = (MFDisplayPhotoCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
return cell.displayImageView;
}
- (id<MFPictureModelProtocol>)pictureBrowser:(MFPictureBrowser *)pictureBrowser pictureModelAtIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[index];
return pictureModel;
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser image:(UIImage *)image animatedImage:(UIImage *)animatedImage didLoadAtIndex:(NSInteger)index {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
MFPictureModel *pictureModel = self.picList[index];
if (animatedImage) {
pictureModel.posterImage = animatedImage.images.firstObject;
}else if (image) {
pictureModel.posterImage = image;
}
[self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser scrollToIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[self.currentIndex];
pictureModel.hidden = false;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:self.currentIndex inSection:0]]];
self.currentIndex = index;
MFPictureModel *currentPictureModel = self.picList[self.currentIndex];
currentPictureModel.hidden = true;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:self.currentIndex inSection:0]]];
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser dimissAtIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[index];
pictureModel.hidden = false;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]]];
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFDisplayPhotoCollectionViewCell.h
================================================
#import <UIKit/UIKit.h>
#import <YYImage/YYAnimatedImageView.h>
@interface MFDisplayPhotoCollectionViewCell : UICollectionViewCell
@property (nonatomic ,strong) YYAnimatedImageView *displayImageView;
@property (nonatomic, strong) UIImageView *tagImageView;
@property (nonatomic, strong) UIButton *button;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFDisplayPhotoCollectionViewCell.m
================================================
#import "MFDisplayPhotoCollectionViewCell.h"
@implementation MFDisplayPhotoCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
self.contentView.backgroundColor = [UIColor clearColor];
self.displayImageView = [[YYAnimatedImageView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, frame.size.height)];
self.displayImageView.layer.cornerRadius = 2;
self.displayImageView.layer.masksToBounds = YES;
self.displayImageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:self.displayImageView];
self.displayImageView.autoPlayAnimatedImage = false;
self.tagImageView = [[UIImageView alloc] initWithFrame:CGRectMake(frame.size.width - 32, frame.size.height - 30, 30, 30)];
self.tagImageView.alpha = 0;
[self.displayImageView addSubview:self.tagImageView];
self.button = [UIButton buttonWithType:UIButtonTypeCustom];
self.button.frame = self.contentView.bounds;
[self.contentView addSubview:self.button];
}
return self;
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureBrowser.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <UIKit/UIKit.h>
#import "MFPictureModelProtocol.h"
@class MFPictureBrowser;
@protocol MFPictureBrowserDelegate <NSObject>
/**
获取对应索引的视图
@param pictureBrowser 图片浏览器
@param index 索引
@return 视图
*/
- (UIImageView *)pictureBrowser:(MFPictureBrowser *)pictureBrowser imageViewAtIndex:(NSInteger)index;
/**
返回协议对象
@param pictureBrowser 图片浏览器
@param index 索引
@return 协议对象
*/
- (id<MFPictureModelProtocol>)pictureBrowser:(MFPictureBrowser *)pictureBrowser pictureModelAtIndex:(NSInteger)index;
@optional
/**
滚动到指定页时会调用该方法
@param pictureBrowser 图片浏览器
@param index 索引
*/
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser scrollToIndex:(NSInteger)index;
/**
网络图片加载完毕的回调
@param pictureBrowser 图片浏览器
@param image 加载成功返回的image
@param animatedImage 加载成功返回的animatedImage
@param index 索引
*/
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser image:(UIImage *)image animatedImage:(UIImage *)animatedImage didLoadAtIndex:(NSInteger)index;
/**
browser did dimiss时的回调
@param pictureBrowser 图片浏览器
@param index 索引
*/
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser dimissAtIndex:(NSInteger)index;
/**
长按会调用此方法
@param pictureBrowser 图片浏览器
@param index 索引
*/
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser longPressAtIndex:(NSInteger)index;
@end
@interface MFPictureBrowser : UIView
@property (nonatomic, weak) id<MFPictureBrowserDelegate> delegate;
/**
图片之间的间距,默认: 20
*/
@property (nonatomic, assign) CGFloat imagesSpacing;
/**
页数文字中心点,默认:居中,中心 y 距离底部 20
*/
@property (nonatomic, assign) CGPoint pageTextCenter;
/**
页数文字字体,默认:系统字体,16号
*/
@property (nonatomic, strong) UIFont *pageTextFont;
/**
页数文字颜色,默认:白色
*/
@property (nonatomic, strong) UIColor *pageTextColor;
/**
显示图片浏览器
@param fromView 用户点击的视图
@param picturesCount 图片的张数
@param currentPictureIndex 当前用户点击的图片索引
*/
- (void)showImageFromView:(UIImageView *)fromView picturesCount:(NSInteger)picturesCount currentPictureIndex:(NSInteger)currentPictureIndex;
/**
让图片浏览器消失
*/
- (void)dismiss;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureBrowser.m
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import "MFPictureBrowser.h"
#import "MFPictureView.h"
#import <MFCategory/UIView+MFFrame.h>
#import <YYWebImage/YYWebImage.h>
@interface MFPictureBrowser()
<
UIScrollViewDelegate,
MFPictureViewDelegate
>
/// MFPictureView数组,最多保存9个MFPictureView
@property (nonatomic, strong) NSMutableArray<MFPictureView *> *pictureViews;
@property (nonatomic, assign) NSInteger picturesCount;
@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, weak) UIScrollView *scrollView;
@property (nonatomic, weak) UILabel *pageTextLabel;
@property (nonatomic, weak) UITapGestureRecognizer *dismissTapGesture;
@property (nonatomic, strong) UIImageView *endView;
@property (nonatomic, assign) BOOL animationInProgress;
@end
@implementation MFPictureBrowser
- (instancetype)init {
self = [super init];
if (self) {
[self configuration];
}
return self;
}
- (void)configuration {
self.frame = [UIScreen mainScreen].bounds;
self.backgroundColor = [UIColor clearColor];
// 设置默认属性
self.imagesSpacing = 20;
self.pageTextFont = [UIFont systemFontOfSize:16];
self.pageTextCenter = CGPointMake(self.width * 0.5, self.height - 20);
self.pageTextColor = [UIColor whiteColor];
// 初始化数组
self.pictureViews = @[].mutableCopy;
// 初始化 scrollView
UIScrollView *scrollView = [[UIScrollView alloc] initWithFrame:CGRectMake(- self.imagesSpacing * 0.5, 0, self.width + self.imagesSpacing, self.height)];
scrollView.showsVerticalScrollIndicator = false;
scrollView.showsHorizontalScrollIndicator = false;
scrollView.pagingEnabled = true;
scrollView.delegate = self;
[self addSubview:scrollView];
self.scrollView = scrollView;
// 初始化label
UILabel *label = [[UILabel alloc] init];
label.alpha = 0;
label.textColor = self.pageTextColor;
label.center = self.pageTextCenter;
label.font = self.pageTextFont;
[self addSubview:label];
self.pageTextLabel = label;
// 添加手势事件
UILongPressGestureRecognizer *longPressGesture = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressGesture:)];
[self addGestureRecognizer:longPressGesture];
UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapGesture:)];
[self addGestureRecognizer:tapGesture];
self.dismissTapGesture = tapGesture;
self.animationInProgress = false;
}
#pragma mark - public
- (void)showImageFromView:(UIImageView *)fromView picturesCount:(NSInteger)picturesCount currentPictureIndex:(NSInteger)currentPictureIndex {
[self _showFromView:fromView picturesCount:picturesCount currentPictureIndex:currentPictureIndex];
for (NSInteger i = 0; i < picturesCount; i++) {
MFPictureView *pictureView = [self _createImagePictureViewAtIndex:i];
[self.pictureViews addObject:pictureView];
}
MFPictureView *pictureView = self.pictureViews[currentPictureIndex];
[self _showPictureView:pictureView fromView:fromView];
}
#pragma mark - private
- (void)_showFromView:(UIImageView *)fromView picturesCount:(NSInteger)picturesCount currentPictureIndex:(NSInteger)currentPictureIndex {
NSAssert(picturesCount > 0 && currentPictureIndex < picturesCount && picturesCount <= 9, @"Parameter is not correct");
NSAssert(self.delegate != nil, @"Please set up delegate for pictureBrowser");
NSAssert([_delegate respondsToSelector:@selector(pictureBrowser:imageViewAtIndex:)], @"Please implement delegate method of pictureBrowser:imageViewAtIndex:");
NSAssert([_delegate respondsToSelector:@selector(pictureBrowser:pictureModelAtIndex:)], @"Please implement delegate method of pictureBrowser:pictureModelAtIndex:");
// 记录值并设置位置
self.picturesCount = picturesCount;
self.currentIndex = currentPictureIndex;
// 添加到 window 上
[[UIApplication sharedApplication].keyWindow addSubview:self];
// 计算 scrollView 的 contentSize
self.scrollView.contentSize = CGSizeMake(picturesCount * _scrollView.width, _scrollView.height);
// 滚动到指定位置
[self.scrollView setContentOffset:CGPointMake(currentPictureIndex * _scrollView.width, 0) animated:false];
}
- (MFPictureView *)_createImagePictureViewAtIndex:(NSInteger)index {
id<MFPictureModelProtocol> pictureModel = [_delegate pictureBrowser:self pictureModelAtIndex:index];
UIImageView *imageView = [_delegate pictureBrowser:self imageViewAtIndex:index];
MFPictureView *pictureView = [[MFPictureView alloc] initWithPictureModel:pictureModel];
[self _configPictureView:pictureView index:index imageView:imageView];
return pictureView;
}
- (void)_configPictureView:(MFPictureView *)pictureView index:(NSInteger)index imageView:(UIImageView *)imageView {
[self.dismissTapGesture requireGestureRecognizerToFail:pictureView.imageView.gestureRecognizers.firstObject];
pictureView.pictureDelegate = self;
[self.scrollView addSubview:pictureView];
pictureView.index = index;
pictureView.size = self.size;
pictureView.pictureSize = imageView.image.size;
CGPoint center = pictureView.center;
center.x = index * _scrollView.width + _scrollView.width * 0.5;
pictureView.center = center;
}
- (void)_showPictureView:(MFPictureView *)pictureView fromView:(UIImageView *)fromView{
[self _hideStautsBar];
CGRect rect = [fromView convertRect:fromView.bounds toView:nil];
[pictureView animationShowWithFromRect:rect animationBlock:^{
self.backgroundColor = [UIColor blackColor];
if (self.picturesCount != 1) {
self.pageTextLabel.alpha = 1;
}else {
self.pageTextLabel.alpha = 0;
}
} completionBlock:^{}];
}
- (void)dismiss {
CGFloat x = [UIScreen mainScreen].bounds.size.width * 0.5;
CGFloat y = [UIScreen mainScreen].bounds.size.height * 0.5;
CGRect rect = CGRectMake(x, y, 0, 0);
self.endView = [_delegate pictureBrowser:self imageViewAtIndex:self.currentIndex];
if (self.endView.superview != nil) {
rect = [_endView convertRect:_endView.bounds toView:nil];
}else {
rect = _endView.frame;
}
// 取消未完成请求
for (MFPictureView *pictureView in self.pictureViews) {
if (pictureView.operation) {
[pictureView.operation cancel];
}
}
// 取到当前显示的 pictureView
MFPictureView *pictureView = [[_pictureViews filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"index == %d", self.currentIndex]] firstObject];
// 执行关闭动画
__weak __typeof(self)weakSelf = self;
[pictureView animationDismissWithToRect:rect animationBlock:^{
self.backgroundColor = [UIColor clearColor];
self.pageTextLabel.alpha = 0;
[self _showStatusBar];
} completionBlock:^{
[self removeFromSuperview];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf.pictureViews removeAllObjects];
if ([_delegate respondsToSelector:@selector(pictureBrowser:dimissAtIndex:)] && !strongSelf.animationInProgress) {
[_delegate pictureBrowser:strongSelf dimissAtIndex:strongSelf.currentIndex];
}
self.animationInProgress = true;
}];
}
#pragma mark - gesture
- (void)tapGesture:(UITapGestureRecognizer *)gesture {
[self dismiss];
}
- (void)longPressGesture:(UILongPressGestureRecognizer *)gesture {
if (gesture.state == UIGestureRecognizerStateEnded) {
if ([_delegate respondsToSelector:@selector(pictureBrowser:longPressAtIndex:)]) {
[_delegate pictureBrowser:self longPressAtIndex:self.currentIndex];
}
}
}
#pragma mark - 状态栏状态
- (void)_hideStautsBar {
UIView *statusBar = [[UIApplication sharedApplication] valueForKey:@"statusBar"];
[UIView animateWithDuration:0.15 animations:^{
statusBar.transform = CGAffineTransformMakeTranslation(0, -statusBar.height);
}];
}
- (void)_showStatusBar {
UIView *statusBar = [[UIApplication sharedApplication] valueForKey:@"statusBar"];
[UIView animateWithDuration:0.15 animations:^{
statusBar.transform = CGAffineTransformIdentity;
}];
}
- (void)setPageTextFont:(UIFont *)pageTextFont {
_pageTextFont = pageTextFont;
self.pageTextLabel.font = pageTextFont;
}
- (void)setPageTextColor:(UIColor *)pageTextColor {
_pageTextColor = pageTextColor;
self.pageTextLabel.textColor = pageTextColor;
}
- (void)setPageTextCenter:(CGPoint)pageTextCenter {
_pageTextCenter = pageTextCenter;
[self.pageTextLabel sizeToFit];
self.pageTextLabel.center = pageTextCenter;
}
- (void)setImagesSpacing:(CGFloat)imagesSpacing {
_imagesSpacing = imagesSpacing;
self.scrollView.frame = CGRectMake(- _imagesSpacing * 0.5, 0, self.width + _imagesSpacing, self.height);
}
- (void)setCurrentIndex:(NSInteger)currentIndex {
_currentIndex = currentIndex;
[self _setPageText:currentIndex];
}
- (void)_setPageText:(NSUInteger)index {
_pageTextLabel.text = [NSString stringWithFormat:@"%zd / %zd", index + 1, self.picturesCount];
[_pageTextLabel sizeToFit];
_pageTextLabel.center = self.pageTextCenter;
}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
NSUInteger index = (scrollView.contentOffset.x / scrollView.width + 0.5);
if (self.currentIndex != index) {
if ([_delegate respondsToSelector:@selector(pictureBrowser:scrollToIndex:)]) {
[_delegate pictureBrowser:self scrollToIndex:index];
}
self.currentIndex = index;
}
}
#pragma mark - MFPictureViewDelegate
- (void)pictureView:(MFPictureView *)pictureView didClickAtIndex:(NSInteger)index{
[self dismiss];
}
- (void)pictureView:(MFPictureView *)pictureView scale:(CGFloat)scale {
self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:1 - scale];
}
- (void)pictureView:(MFPictureView *)pictureView image:(UIImage *)image animatedImage:(UIImage *)animatedImage didLoadAtIndex:(NSInteger)index {
if ([_delegate respondsToSelector:@selector(pictureBrowser:image:animatedImage:didLoadAtIndex:)]) {
[_delegate pictureBrowser:self image:image animatedImage:animatedImage didLoadAtIndex:index];
}
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureModelProtocol.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <YYImage/YYImage.h>
typedef NS_ENUM(NSInteger, MFImageType) {
MFImageTypeUnknown,
MFImageTypeOther,
MFImageTypeGIF,
MFImageTypeAnimatedWebP,
MFImageTypeStaticWebP,
MFImageTypeLongImage
};
@protocol MFPictureModelProtocol <NSObject>
@property (nonatomic, strong) NSString *imageName;
@property (nonatomic, strong) NSString *imageURL;
@property (nonatomic, assign) MFImageType imageType;
@property (nonatomic, strong) UIImage *placeholderImage;
@property (nonatomic, strong) UIImage *posterImage;
@property (nonatomic, strong) UIImage *animatedImage;
@property (nonatomic, strong) YYImage *webpAnimatedImage;
@property (nonatomic, assign) BOOL compressed;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureView.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <UIKit/UIKit.h>
#import "MFPictureModelProtocol.h"
#import <YYWebImage/YYWebImage.h>
#import <YYImage/YYImage.h>
@class MFPictureView;
@protocol MFPictureViewDelegate <NSObject>
- (void)pictureView:(MFPictureView *)pictureView didClickAtIndex:(NSInteger)index;
- (void)pictureView:(MFPictureView *)pictureView scale:(CGFloat)scale;
- (void)pictureView:(MFPictureView *)pictureView image:(UIImage *)image animatedImage:(UIImage *)animatedImage didLoadAtIndex:(NSInteger)index;
@end
@interface MFPictureView : UIScrollView
// 当前视图所在的索引
@property (nonatomic, assign) NSInteger index;
// 图片的大小
@property (nonatomic, assign) CGSize pictureSize;
// 协议对象
@property (nonatomic, strong) id<MFPictureModelProtocol> pictureModel;
// 当前显示图片的控件
@property (nonatomic, strong, readonly) YYAnimatedImageView *imageView;
// 代理
@property (nonatomic, weak) id<MFPictureViewDelegate> pictureDelegate;
// 下载 operation
@property (nonatomic, strong) YYWebImageOperation *operation;
- (instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)initWithPictureModel:(id<MFPictureModelProtocol>)pictureModel;
/**
动画显示
@param rect 从哪个位置开始做动画
@param animationBlock 附带的动画信息
@param completionBlock 结束的回调
*/
- (void)animationShowWithFromRect:(CGRect)rect animationBlock:(void(^)(void))animationBlock completionBlock:(void(^)(void))completionBlock;
/**
动画消失
@param rect 回到哪个位置
@param animationBlock 附带的动画信息
@param completionBlock 结束的回调
*/
- (void)animationDismissWithToRect:(CGRect)rect animationBlock:(void(^)(void))animationBlock completionBlock:(void(^)(void))completionBlock;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureView.m
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import "MFPictureView.h"
#import "UIImageView+TransitionImage.h"
#import "UIImage+ForceDecoded.h"
#import "MFRunLoopDistribution.h"
#import <pthread.h>
static inline void _mf_dispatch_async_on_main_queue(void (^block)(void)) {
dispatch_async(dispatch_get_main_queue(), block);
}
static inline void _mf_dispatch_async_on_global_queue(void (^block)(void)) {
dispatch_async(dispatch_get_global_queue(0, 0), block);
}
@interface MFPictureView()
<
UIScrollViewDelegate
>
@property (nonatomic, assign) CGSize showPictureSize;
@property (nonatomic, assign) BOOL doubleClicks;
@property (nonatomic, assign) CGPoint lastContentOffset;
@property (nonatomic, assign) CGFloat scale;
@property (nonatomic, assign) CGFloat offsetY;
@property (nonatomic, assign, getter = isAnimationInProgress) BOOL animationInProgress;
@property (nonatomic, assign, getter = isLoadingFinished) BOOL loadingFinished;
@property (nonatomic, assign, getter = isLocalImage) BOOL localImage;
@property (nonatomic, assign, getter = isAnimatedImage) BOOL animatedImage;
@property (nonatomic, strong) UIProgressView *progressView;
@end
@implementation MFPictureView
- (instancetype)initWithPictureModel:(id<MFPictureModelProtocol>)pictureModel {
self = [super init];
if (self) {
self.localImage = false;
if (pictureModel.imageName) {
self.localImage = true;
}
self.animatedImage = false;
if (pictureModel.imageType == MFImageTypeGIF ||
pictureModel.imageType == MFImageTypeAnimatedWebP) {
self.animatedImage = true;
}
[self setupUI];
self.pictureModel = pictureModel;
}
return self;
}
- (void)setupUI {
self.delegate = self;
self.alwaysBounceVertical = true;
self.backgroundColor = [UIColor clearColor];
self.showsHorizontalScrollIndicator = false;
self.showsVerticalScrollIndicator = false;
self.maximumZoomScale = 2;
YYAnimatedImageView *imageView = [[YYAnimatedImageView alloc] init];
imageView.clipsToBounds = true;
imageView.layer.cornerRadius = 3;
imageView.contentMode = UIViewContentModeScaleAspectFill;
imageView.frame = self.bounds;
imageView.userInteractionEnabled = true;
_imageView = imageView;
[self addSubview:imageView];
if (!self.isLocalImage || (self.isLocalImage && self.isAnimatedImage)) {
UIProgressView *progressView = [[UIProgressView alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height - 3, [UIScreen mainScreen].bounds.size.width, 3)];
progressView.progressViewStyle = UIProgressViewStyleDefault;
progressView.progressTintColor = [UIColor colorWithWhite:1 alpha:0.2];
progressView.trackTintColor = [UIColor blackColor];
[self addSubview:progressView];
_progressView = progressView;
}
UITapGestureRecognizer *doubleTapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleClick:)];
doubleTapGesture.numberOfTapsRequired = 2;
[imageView addGestureRecognizer:doubleTapGesture];
}
#pragma mark - public
- (void)animationShowWithFromRect:(CGRect)rect animationBlock:(void (^)(void))animationBlock completionBlock:(void (^)(void))completionBlock {
self.imageView.frame = rect;
self.animationInProgress = true;
[UIView animateWithDuration:0.25 delay:0 options:7 << 16 animations:^{
if (animationBlock) {
animationBlock();
}
self.imageView.frame = [self getImageActualFrame:self.showPictureSize];
} completion:^(BOOL finished) {
if (finished) {
if (completionBlock) {
completionBlock();
}
self.animationInProgress = false;
}
}];
}
- (void)animationDismissWithToRect:(CGRect)rect animationBlock:(void (^)(void))animationBlock completionBlock:(void (^)(void))completionBlock {
self.progressView.alpha = 0;
[UIView animateWithDuration:0.25 delay:0 options:7 << 16 animations:^{
if (animationBlock) {
animationBlock();
}
CGRect toRect = rect;
toRect.origin.y += self.offsetY;
// 这一句话用于在放大的时候去关闭
toRect.origin.x += self.contentOffset.x;
self.imageView.frame = toRect;
} completion:^(BOOL finished) {
if (finished) {
if (completionBlock) {
completionBlock();
}
}
}];
}
#pragma mark - private IMPORTANT METHOD!!!
- (void)_configWithLocalPictureModel:(id<MFPictureModelProtocol>)pictureModel {
if (pictureModel.imageType == MFImageTypeGIF) {
UIImage *animatedImage = pictureModel.animatedImage;
if (animatedImage) {
[self _hideProgressView];
[self setPictureSize:animatedImage.size];
self.imageView.image = animatedImage;
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
_mf_dispatch_async_on_global_queue(^{
NSURL *imageURL = [[NSBundle mainBundle] URLForResource:pictureModel.imageName withExtension:nil];
NSData *animatedData = [NSData dataWithContentsOfURL:imageURL];
UIImage *animatedImage = [UIImage forceDecodedImageWithData:animatedData compressed:pictureModel.compressed];
_mf_dispatch_async_on_main_queue(^{
if (animatedImage) {
pictureModel.animatedImage = animatedImage;
pictureModel.posterImage = animatedImage.images.firstObject;
[self setPictureSize:animatedImage.size];
self.imageView.image = animatedImage;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:nil animatedImage:animatedImage didLoadAtIndex:weakSelf.index];
}
[self _hideProgressView];
}else {
[self _hideProgressView];
}
});
});
}
}else if (pictureModel.imageType == MFImageTypeStaticWebP) {
UIImage *webpImage = pictureModel.posterImage;
if (webpImage) {
[self _hideProgressView];
[self setPictureSize:webpImage.size];
self.imageView.image = webpImage;
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
_mf_dispatch_async_on_global_queue(^{
NSURL *imageURL = [[NSBundle mainBundle] URLForResource:pictureModel.imageName withExtension:nil];
NSData *webpData = [NSData dataWithContentsOfURL:imageURL];
UIImage *webpImage = [YYImage imageWithData:webpData];
pictureModel.posterImage = webpImage;
_mf_dispatch_async_on_main_queue(^{
if (webpImage) {
[self setPictureSize:webpImage.size];
self.imageView.image = webpImage;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:webpImage animatedImage:nil didLoadAtIndex:weakSelf.index];
}
[self _hideProgressView];
}else {
[self _hideProgressView];
}
});
});
}
}else if (pictureModel.imageType == MFImageTypeAnimatedWebP) {
YYImage *webpAnimatedImage = pictureModel.webpAnimatedImage;
if (webpAnimatedImage) {
[self _hideProgressView];
[self setPictureSize:webpAnimatedImage.size];
self.imageView.image = webpAnimatedImage;
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
_mf_dispatch_async_on_global_queue(^{
NSURL *imageURL = [[NSBundle mainBundle] URLForResource:pictureModel.imageName withExtension:nil];
NSData *webpData = [NSData dataWithContentsOfURL:imageURL];
YYImage *webpImage = [YYImage imageWithData:webpData];
pictureModel.webpAnimatedImage = webpImage;
_mf_dispatch_async_on_main_queue(^{
if (webpImage) {
[self setPictureSize:webpImage.size];
self.imageView.image = webpImage;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:webpImage animatedImage:nil didLoadAtIndex:weakSelf.index];
}
[self _hideProgressView];
}else {
[self _hideProgressView];
}
});
});
}
}else {
[self _hideProgressView];
UIImage *posterImage = pictureModel.posterImage;
if (posterImage) {
[self setPictureSize:posterImage.size];
self.imageView.image = posterImage;
}else {
UIImage *image = [UIImage imageNamed:pictureModel.imageName];
if (image) {
pictureModel.posterImage = image;
[self setPictureSize:image.size];
self.imageView.image = image;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:image animatedImage:nil didLoadAtIndex:weakSelf.index];
}
}
}
}
}
- (void)_configWithRemotePictureModel:(id<MFPictureModelProtocol>)pictureModel {
if (pictureModel.imageType == MFImageTypeGIF) {
UIImage *animatedImage = pictureModel.animatedImage;
if (animatedImage) {
[self _hideProgressView];
[self setPictureSize:animatedImage.size];
self.imageView.image = animatedImage;
}else {
NSURL *url = [NSURL URLWithString:pictureModel.imageURL];
NSString *key = [[YYWebImageManager sharedManager] cacheKeyForURL:url];
BOOL imageAvailable = [[YYImageCache sharedCache] containsImageForKey:key];
if (!imageAvailable) {
[self _showProgressView];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
__weak __typeof(self)weakSelf = self;
self.operation = [[YYWebImageManager sharedManager] requestImageWithURL:url options:YYWebImageOptionProgressiveBlur progress:^(NSInteger receivedSize, NSInteger expectedSize) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
_mf_dispatch_async_on_main_queue(^{
[strongSelf.progressView setProgress:(1.0 * receivedSize / expectedSize) <= 0.95 ? (1.0 * receivedSize / expectedSize) : 0.95 animated:true];
});
} transform:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (!error && stage == YYWebImageStageFinished) {
strongSelf.operation = nil;
YYImage *yyImage = (YYImage *)image;
NSData *animatedData = yyImage.animatedImageData;
UIImage *animatedImage = [UIImage forceDecodedImageWithData:animatedData compressed:pictureModel.compressed];
_mf_dispatch_async_on_main_queue(^{
[self _hideProgressView];
if (animatedImage) {
pictureModel.animatedImage = animatedImage;
pictureModel.posterImage = animatedImage.images.firstObject;
CGSize size = animatedImage.size;
[strongSelf setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[strongSelf.imageView animatedTransitionImage:animatedImage];
return true;
} withKey:pictureModel.imageURL];
}
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:strongSelf image:nil animatedImage:animatedImage didLoadAtIndex:strongSelf.index];
}
});
}else if (error) {
strongSelf.operation = nil;
_mf_dispatch_async_on_main_queue(^{
[strongSelf _hideProgressView];
});
}
}];
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
[[YYImageCache sharedCache] getImageDataForKey:key withBlock:^(NSData * _Nullable imageData) {
UIImage *animatedImage = [UIImage forceDecodedImageWithData:imageData compressed:pictureModel.compressed];
_mf_dispatch_async_on_main_queue(^{
[self _hideProgressView];
if (animatedImage) {
pictureModel.animatedImage = animatedImage;
pictureModel.posterImage = animatedImage.images.firstObject;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:nil animatedImage:animatedImage didLoadAtIndex:weakSelf.index];
}
CGSize size = animatedImage.size;
[self setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[self.imageView animatedTransitionImage:animatedImage];
return true;
} withKey:pictureModel.imageURL];
}
});
}];
}
}
}else if (pictureModel.imageType == MFImageTypeStaticWebP) {
UIImage *webpImage = pictureModel.posterImage;
if (webpImage) {
[self _hideProgressView];
[self setPictureSize:webpImage.size];
self.imageView.image = webpImage;
}else {
NSURL *url = [NSURL URLWithString:pictureModel.imageURL];
NSString *key = [[YYWebImageManager sharedManager] cacheKeyForURL:url];
BOOL imageAvailable = [[YYImageCache sharedCache] containsImageForKey:key];
if (!imageAvailable) {
[self _showProgressView];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
__weak __typeof(self)weakSelf = self;
self.operation = [[YYWebImageManager sharedManager] requestImageWithURL:url options:YYWebImageOptionProgressiveBlur progress:^(NSInteger receivedSize, NSInteger expectedSize) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
_mf_dispatch_async_on_main_queue(^{
[strongSelf.progressView setProgress:(1.0 * receivedSize / expectedSize) <= 0.95 ? (1.0 * receivedSize / expectedSize) : 0.95 animated:true];
});
} transform:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (!error && stage == YYWebImageStageFinished) {
strongSelf.operation = nil;
_mf_dispatch_async_on_main_queue(^{
[strongSelf _hideProgressView];
UIImage *webpImage = (YYImage *)image;
if (webpImage) {
pictureModel.posterImage = webpImage;
CGSize size = webpImage.size;
[strongSelf setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[strongSelf.imageView animatedTransitionImage:webpImage];
return true;
} withKey:pictureModel.imageURL];
}
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:strongSelf image:webpImage animatedImage:nil didLoadAtIndex:strongSelf.index];
}
});
}else if (error) {
strongSelf.operation = nil;
[strongSelf _hideProgressView];
}
}];
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
[[YYImageCache sharedCache] getImageDataForKey:key withBlock:^(NSData * _Nullable imageData) {
UIImage *webpImage = [YYImage imageWithData:imageData];
_mf_dispatch_async_on_main_queue(^{
[self _hideProgressView];
if (webpImage) {
pictureModel.posterImage = webpImage;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:webpImage animatedImage:nil didLoadAtIndex:weakSelf.index];
}
CGSize size = webpImage.size;
[self setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[self.imageView animatedTransitionImage:webpImage];
return true;
} withKey:pictureModel.imageURL];
}
});
}];
}
}
}else if (pictureModel.imageType == MFImageTypeAnimatedWebP) {
UIImage *webpAnimatedImage = pictureModel.webpAnimatedImage;
if (webpAnimatedImage) {
[self _hideProgressView];
[self setPictureSize:webpAnimatedImage.size];
self.imageView.image = webpAnimatedImage;
}else {
NSURL *url = [NSURL URLWithString:pictureModel.imageURL];
NSString *key = [[YYWebImageManager sharedManager] cacheKeyForURL:url];
BOOL imageAvailable = [[YYImageCache sharedCache] containsImageForKey:key];
if (!imageAvailable) {
[self _showProgressView];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
__weak __typeof(self)weakSelf = self;
self.operation = [[YYWebImageManager sharedManager] requestImageWithURL:url options:YYWebImageOptionProgressiveBlur progress:^(NSInteger receivedSize, NSInteger expectedSize) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
_mf_dispatch_async_on_main_queue(^{
[strongSelf.progressView setProgress:(1.0 * receivedSize / expectedSize) <= 0.95 ? (1.0 * receivedSize / expectedSize) : 0.95 animated:true];
});
} transform:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (!error && stage == YYWebImageStageFinished) {
strongSelf.operation = nil;
_mf_dispatch_async_on_main_queue(^{
[strongSelf _hideProgressView];
YYImage *webpImage = (YYImage *)image;
if (webpImage) {
pictureModel.posterImage = webpImage;
pictureModel.webpAnimatedImage = webpImage;
CGSize size = webpImage.size;
[strongSelf setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[strongSelf.imageView animatedTransitionImage:webpImage];
return true;
} withKey:pictureModel.imageURL];
}
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:strongSelf image:webpImage animatedImage:nil didLoadAtIndex:strongSelf.index];
}
});
}else if (error) {
strongSelf.operation = nil;
[strongSelf _hideProgressView];
}
}];
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
[[YYImageCache sharedCache] getImageDataForKey:key withBlock:^(NSData * _Nullable imageData) {
UIImage *webpImage = [YYImage imageWithData:imageData];
_mf_dispatch_async_on_main_queue(^{
[self _hideProgressView];
if (webpImage) {
pictureModel.posterImage = webpImage;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:webpImage animatedImage:nil didLoadAtIndex:weakSelf.index];
}
CGSize size = webpImage.size;
[self setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[self.imageView animatedTransitionImage:webpImage];
return true;
} withKey:pictureModel.imageURL];
}
});
}];
}
}
}else {
if (pictureModel.posterImage) {
[self _hideProgressView];
[self setPictureSize:pictureModel.posterImage.size];
self.imageView.image = pictureModel.posterImage;
}else {
NSURL *url = [NSURL URLWithString:pictureModel.imageURL];
NSString *key = [[YYWebImageManager sharedManager] cacheKeyForURL:url];
BOOL imageAvailable = [[YYImageCache sharedCache] containsImageForKey:key];
if (!imageAvailable) {
[self _showProgressView];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
__weak __typeof(self)weakSelf = self;
self.operation = [[YYWebImageManager sharedManager] requestImageWithURL:url options:YYWebImageOptionProgressiveBlur progress:^(NSInteger receivedSize, NSInteger expectedSize) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
_mf_dispatch_async_on_main_queue(^{
[strongSelf.progressView setProgress:(1.0 * receivedSize / expectedSize) <= 0.95 ? (1.0 * receivedSize / expectedSize) : 0.95 animated:true];
});
} transform:nil completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
_mf_dispatch_async_on_main_queue(^{
if (!error && stage == YYWebImageStageFinished) {
strongSelf.operation = nil;
[strongSelf _hideProgressView];
if (image) {
pictureModel.posterImage = image;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:strongSelf image:image animatedImage:nil didLoadAtIndex:strongSelf.index];
}
CGSize size = image.size;
[strongSelf setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[strongSelf.imageView animatedTransitionImage:image];
return true;
} withKey:pictureModel.imageURL];
}
}else if (error){
strongSelf.operation = nil;
[strongSelf _hideProgressView];
}
});
}];
}else {
[self _showProgressView];
[UIView animateWithDuration:1 animations:^{
[self.progressView setProgress:0.8 animated:true];
}];
UIImage *image = pictureModel.posterImage ?: pictureModel.placeholderImage;
[self setPictureSize:image.size];
self.imageView.image = image;
[[YYImageCache sharedCache] getImageDataForKey:key withBlock:^(NSData * _Nullable imageData) {
UIImage *image = [UIImage imageWithData:imageData];
_mf_dispatch_async_on_main_queue(^{
[self _hideProgressView];
if (image) {
pictureModel.posterImage = image;
__weak __typeof(self)weakSelf = self;
if ([_pictureDelegate respondsToSelector:@selector(pictureView:image:animatedImage:didLoadAtIndex:)]) {
[_pictureDelegate pictureView:weakSelf image:image animatedImage:nil didLoadAtIndex:weakSelf.index];
}
CGSize size = image.size;
[self setPictureSize:size];
[[MFRunLoopDistribution sharedRunLoopDistribution] addTask:^BOOL{
[self.imageView animatedTransitionImage:image];
return true;
} withKey:pictureModel.imageURL];
}
});
}];
}
}
}
}
#pragma mark - -------------------
- (void)_showProgressView {
_mf_dispatch_async_on_main_queue(^{
self.loadingFinished = false;
self.progressView.alpha = 1;
});
}
- (void)_hideProgressView {
if (pthread_main_np()) {
self.loadingFinished = true;
self.progressView.alpha = 0;
}else {
_mf_dispatch_async_on_main_queue(^{
self.loadingFinished = true;
self.progressView.alpha = 0;
});
}
}
- (void)setPictureModel:(id<MFPictureModelProtocol>)pictureModel {
if (!pictureModel) {
return;
}
_pictureModel = pictureModel;
if (pictureModel.imageName) {
[self _configWithLocalPictureModel:pictureModel];
}else {
[self _configWithRemotePictureModel:pictureModel];
}
}
- (void)setContentSize:(CGSize)contentSize {
[super setContentSize:contentSize];
if (self.zoomScale == 1) {
[UIView animateWithDuration:0.25 delay:0 options:7 << 16 animations:^{
CGPoint center = self.imageView.center;
center.x = self.contentSize.width * 0.5;
self.imageView.center = center;
} completion:nil];
}
}
- (void)setLastContentOffset:(CGPoint)lastContentOffset {
// 如果用户没有在拖动,并且绽放比 > 0.15
if (!(self.dragging == false && _scale > 0.15)) {
_lastContentOffset = lastContentOffset;
}
}
- (void)setPictureSize:(CGSize)pictureSize {
_pictureSize = pictureSize;
if (CGSizeEqualToSize(pictureSize, CGSizeZero)) {
return;
}
// 计算实际的大小
CGFloat screenW = [UIScreen mainScreen].bounds.size.width;
CGFloat scale = screenW / pictureSize.width;
CGFloat height = scale * pictureSize.height;
self.showPictureSize = CGSizeMake(screenW, height);
}
- (void)setShowPictureSize:(CGSize)showPictureSize {
_showPictureSize = showPictureSize;
self.imageView.frame = [self getImageActualFrame:showPictureSize];
self.contentSize = self.imageView.frame.size;
}
- (CGRect)getImageActualFrame:(CGSize)imageSize {
CGFloat x = 0;
CGFloat y = 0;
if (imageSize.height < [UIScreen mainScreen].bounds.size.height) {
y = ([UIScreen mainScreen].bounds.size.height - imageSize.height) / 2;
}
return CGRectMake(x, y, imageSize.width, imageSize.height);
}
- (CGRect)zoomRectForScale:(float)scale withCenter:(CGPoint)center {
CGRect zoomRect;
zoomRect.size.height =self.frame.size.height / scale;
zoomRect.size.width =self.frame.size.width / scale;
zoomRect.origin.x = center.x - (zoomRect.size.width / 2.0);
zoomRect.origin.y = center.y - (zoomRect.size.height / 2.0);
return zoomRect;
}
#pragma mark - 监听方法
- (void)doubleClick:(UITapGestureRecognizer *)gesture {
if (!self.isLoadingFinished) {
return;
}
CGFloat newScale = 2;
if (_doubleClicks) {
newScale = 1;
}
CGRect zoomRect = [self zoomRectForScale:newScale withCenter:[gesture locationInView:gesture.view]];
[self zoomToRect:zoomRect animated:YES];
_doubleClicks = !_doubleClicks;
}
#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
self.lastContentOffset = scrollView.contentOffset;
// 保存 offsetY
_offsetY = scrollView.contentOffset.y;
self.progressView.alpha = 0;
// 正在动画
if ([self.imageView.layer animationForKey:@"transform"] != nil) {
return;
}
// 用户正在缩放
if (self.zoomBouncing || self.zooming) {
return;
}
CGFloat screenH = [UIScreen mainScreen].bounds.size.height;
// 滑动到中间
if (scrollView.contentSize.height > screenH) {
// 代表没有滑动到底部
if (_lastContentOffset.y > 0 && _lastContentOffset.y <= scrollView.contentSize.height - screenH) {
return;
}
}
_scale = fabs(_lastContentOffset.y) / screenH;
// 如果内容高度 > 屏幕高度
// 并且偏移量 > 内容高度 - 屏幕高度
// 那么就代表滑动到最底部了
if (scrollView.contentSize.height > screenH &&
_lastContentOffset.y > scrollView.contentSize.height - screenH) {
_scale = (_lastContentOffset.y - (scrollView.contentSize.height - screenH)) / screenH;
}
// 条件1:拖动到顶部再继续往下拖
// 条件2:拖动到顶部再继续往上拖
// 两个条件都满足才去设置 scale -> 针对于长图
if (scrollView.contentSize.height > screenH) {
// 长图
if (scrollView.contentOffset.y < 0 || _lastContentOffset.y > scrollView.contentSize.height - screenH) {
[_pictureDelegate pictureView:self scale:_scale];
}
}else {
[_pictureDelegate pictureView:self scale:_scale];
}
// 如果用户松手
if (scrollView.dragging == false) {
if (_scale > 0.08 && _scale <= 1) {
// 关闭
[_pictureDelegate pictureView:self didClickAtIndex:self.index];
// 设置 contentOffset
[scrollView setContentOffset:_lastContentOffset animated:false];
}else {
if (!_scale && !self.isLoadingFinished) {
[UIView animateWithDuration:0.1 animations:^{
self.progressView.alpha = 1;
}];
}
}
}
}
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView {
return _imageView;
}
- (void)scrollViewDidZoom:(UIScrollView *)scrollView {
CGPoint center = _imageView.center;
CGFloat offsetY = (scrollView.bounds.size.height > scrollView.contentSize.height) ? (scrollView.bounds.size.height - scrollView.contentSize.height) * 0.5 : 0.0;
center.y = scrollView.contentSize.height * 0.5 + offsetY;
_imageView.center = center;
if (scrollView.zoomScale == 1 && !self.isLoadingFinished) {
[UIView animateWithDuration:0.1 animations:^{
self.progressView.alpha = 1;
}];
}
// 如果是缩小,保证在屏幕中间
if (scrollView.zoomScale < scrollView.minimumZoomScale) {
CGFloat offsetX = (scrollView.bounds.size.width > scrollView.contentSize.width) ? (scrollView.bounds.size.width - scrollView.contentSize.width) * 0.5 : 0.0;
center.x = scrollView.contentSize.width * 0.5 + offsetX;
_imageView.center = center;
}
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFRunLoopDistribution.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <Foundation/Foundation.h>
typedef BOOL(^MFRunLoopDistributionUnit)(void);
@interface MFRunLoopDistribution : NSObject
+ (instancetype)sharedRunLoopDistribution;
- (void)addTask:(MFRunLoopDistributionUnit)unit withKey:(id)key;
- (void)removeAllTasks;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFRunLoopDistribution.m
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import "MFRunLoopDistribution.h"
#import <objc/runtime.h>
@interface MFRunLoopDistribution ()
@property (nonatomic, strong) NSMutableArray *tasks;
@property (nonatomic, strong) NSMutableArray *tasksKeys;
@property (nonatomic, strong) NSTimer *timer;
@end
@implementation MFRunLoopDistribution
- (void)removeAllTasks {
[self.tasks removeAllObjects];
[self.tasksKeys removeAllObjects];
}
- (void)addTask:(MFRunLoopDistributionUnit)unit withKey:(id)key{
[self.tasks addObject:unit];
[self.tasksKeys addObject:key];
}
- (void)_timerFiredMethod:(NSTimer *)timer {}
- (instancetype)init {
if ((self = [super init])) {
_tasks = [NSMutableArray array];
_tasksKeys = [NSMutableArray array];
_timer = [NSTimer scheduledTimerWithTimeInterval:0.1 target:self selector:@selector(_timerFiredMethod:) userInfo:nil repeats:YES];
}
return self;
}
+ (instancetype)sharedRunLoopDistribution {
static MFRunLoopDistribution *singleton;
static dispatch_once_t once;
dispatch_once(&once, ^{
singleton = [[self alloc] init];
[self _registerRunLoopDistributionAsMainRunloopObserver:singleton];
});
return singleton;
}
+ (void)_registerRunLoopDistributionAsMainRunloopObserver:(MFRunLoopDistribution *)runLoopDistribution {
static CFRunLoopObserverRef defaultModeObserver;
_registerObserver(kCFRunLoopBeforeWaiting, defaultModeObserver, NSIntegerMax - 999, kCFRunLoopDefaultMode, (__bridge void *)runLoopDistribution, &_defaultModeRunLoopWorkDistributionCallback);
}
static void _registerObserver(CFOptionFlags activities, CFRunLoopObserverRef observer, CFIndex order, CFStringRef mode, void *info, CFRunLoopObserverCallBack callback) {
CFRunLoopRef runLoop = CFRunLoopGetCurrent();
CFRunLoopObserverContext context = {
0,
info,
&CFRetain,
&CFRelease,
NULL
};
observer = CFRunLoopObserverCreate(NULL,
activities,
YES,
order,
callback,
&context);
CFRunLoopAddObserver(runLoop, observer, mode);
CFRelease(observer);
}
static void _runLoopWorkDistributionCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) {
MFRunLoopDistribution *runLoopWorkDistribution = (__bridge MFRunLoopDistribution *)info;
if (runLoopWorkDistribution.tasks.count == 0) {
return;
}
BOOL result = NO;
while (result == NO && runLoopWorkDistribution.tasks.count) {
MFRunLoopDistributionUnit unit = runLoopWorkDistribution.tasks.firstObject;
result = unit();
[runLoopWorkDistribution.tasks removeObjectAtIndex:0];
[runLoopWorkDistribution.tasksKeys removeObjectAtIndex:0];
}
}
static void _defaultModeRunLoopWorkDistributionCallback(CFRunLoopObserverRef observer, CFRunLoopActivity activity, void *info) {
_runLoopWorkDistributionCallback(observer, activity, info);
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImage+ForceDecoded.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <UIKit/UIKit.h>
@interface UIImage (ForceDecoded)
+ (UIImage *)forceDecodedImageWithData:(NSData *)data;
+ (UIImage *)forceDecodedImageWithData:(NSData *)data compressed:(BOOL)compressed;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImage+ForceDecoded.m
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import "UIImage+ForceDecoded.h"
@implementation UIImage (ForceDecoded)
//https://github.com/ibireme/YYKit/blob/master/YYKit/Image/YYImageCoder.m
CGColorSpaceRef CGColorSpaceGetDeviceRGB() {
static CGColorSpaceRef space;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
space = CGColorSpaceCreateDeviceRGB();
});
return space;
}
CGImageRef CGImageCreateDecodedCopy(CGImageRef imageRef, BOOL decodeForDisplay) {
if (!imageRef) return NULL;
size_t width = CGImageGetWidth(imageRef);
size_t height = CGImageGetHeight(imageRef);
if (width == 0 || height == 0) return NULL;
if (decodeForDisplay) { //decode with redraw (may lose some precision)
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef) & kCGBitmapAlphaInfoMask;
BOOL hasAlpha = NO;
if (alphaInfo == kCGImageAlphaPremultipliedLast ||
alphaInfo == kCGImageAlphaPremultipliedFirst ||
alphaInfo == kCGImageAlphaLast ||
alphaInfo == kCGImageAlphaFirst) {
hasAlpha = YES;
}
// BGRA8888 (premultiplied) or BGRX8888
// same as UIGraphicsBeginImageContext() and -[UIView drawRect:]
CGBitmapInfo bitmapInfo = kCGBitmapByteOrder32Host;
bitmapInfo |= hasAlpha ? kCGImageAlphaPremultipliedFirst : kCGImageAlphaNoneSkipFirst;
CGContextRef context = CGBitmapContextCreate(NULL, width, height, 8, 0, CGColorSpaceGetDeviceRGB(), bitmapInfo);
if (!context) return NULL;
CGContextDrawImage(context, CGRectMake(0, 0, width, height), imageRef); // decode
CGImageRef newImage = CGBitmapContextCreateImage(context);
CFRelease(context);
return newImage;
} else {
CGColorSpaceRef space = CGImageGetColorSpace(imageRef);
size_t bitsPerComponent = CGImageGetBitsPerComponent(imageRef);
size_t bitsPerPixel = CGImageGetBitsPerPixel(imageRef);
size_t bytesPerRow = CGImageGetBytesPerRow(imageRef);
CGBitmapInfo bitmapInfo = CGImageGetBitmapInfo(imageRef);
if (bytesPerRow == 0 || width == 0 || height == 0) return NULL;
CGDataProviderRef dataProvider = CGImageGetDataProvider(imageRef);
if (!dataProvider) return NULL;
CFDataRef data = CGDataProviderCopyData(dataProvider); // decode
if (!data) return NULL;
CGDataProviderRef newProvider = CGDataProviderCreateWithCFData(data);
CFRelease(data);
if (!newProvider) return NULL;
CGImageRef newImage = CGImageCreate(width, height, bitsPerComponent, bitsPerPixel, bytesPerRow, space, bitmapInfo, newProvider, NULL, false, kCGRenderingIntentDefault);
CFRelease(newProvider);
return newImage;
}
}
+ (UIImage *)forceDecodedImageWithData:(NSData *)data {
return [self forceDecodedImageWithData:data compressed:true];
}
+ (UIImage *)forceDecodedImageWithData:(NSData *)data compressed:(BOOL)compressed {
if (!data) {
return nil;
}
CGFloat maxPixelSize = compressed ? data.length * 0.01 : data.length;
CGImageSourceRef source = CGImageSourceCreateWithData((__bridge CFDataRef)data, NULL);
CFDictionaryRef options = (__bridge CFDictionaryRef) @{
(id) kCGImageSourceCreateThumbnailWithTransform : @YES,
(id) kCGImageSourceCreateThumbnailFromImageAlways : @YES,
(id) kCGImageSourceThumbnailMaxPixelSize : @(maxPixelSize)
};
size_t count = CGImageSourceGetCount(source);
UIImage *animatedImage;
if (count <= 1) {
CGImageRef imageRef = CGImageSourceCreateThumbnailAtIndex(source, 0, options);
CGImageRef decodedImageRef = CGImageCreateDecodedCopy(imageRef, true);
CGImageRelease(imageRef);
animatedImage = [UIImage imageWithCGImage:decodedImageRef scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp];
} else {
NSMutableArray <UIImage *> *images = [NSMutableArray array];
NSTimeInterval duration = 0.0f;
for (size_t i = 0; i < count; i++) {
CGImageRef imageRef = CGImageSourceCreateThumbnailAtIndex(source, i, options);
CGImageRef decodedImageRef = CGImageCreateDecodedCopy(imageRef, true);
duration += [self frameDurationAtIndex:i source:source];
UIImage *image = [UIImage imageWithCGImage:decodedImageRef scale:[UIScreen mainScreen].scale orientation:UIImageOrientationUp];
[images addObject:image];
CGImageRelease(imageRef);
}
if (!duration) {
duration = (1.0f / 10.0f) * count;
}
animatedImage = [UIImage animatedImageWithImages:images duration:duration];
}
CFRelease(source);
return animatedImage;
}
+ (float)frameDurationAtIndex:(NSUInteger)index source:(CGImageSourceRef)source {
float frameDuration = 0.1f;
CFDictionaryRef cfFrameProperties = CGImageSourceCopyPropertiesAtIndex(source, index, nil);
NSDictionary <NSString *, NSDictionary *> *frameProperties = (__bridge NSDictionary *)cfFrameProperties;
NSDictionary <NSString *, NSNumber *> *gifProperties = frameProperties[(NSString *)kCGImagePropertyGIFDictionary];
NSNumber *delayTimeUnclampedProp = gifProperties[(NSString *)kCGImagePropertyGIFUnclampedDelayTime];
if (delayTimeUnclampedProp) {
frameDuration = [delayTimeUnclampedProp floatValue];
}else {
NSNumber *delayTimeProp = gifProperties[(NSString *)kCGImagePropertyGIFDelayTime];
if (delayTimeProp) {
frameDuration = [delayTimeProp floatValue];
}
}
CFRelease(cfFrameProperties);
return frameDuration;
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImageView+TransitionImage.h
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import <UIKit/UIKit.h>
@interface UIImageView (TransitionImage)
- (void)animatedTransitionImage:(UIImage *)image;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImageView+TransitionImage.m
================================================
// Copyright © 2018年 GodzzZZZ. All rights reserved.
#import "UIImageView+TransitionImage.h"
@implementation UIImageView (TransitionImage)
- (void)animatedTransitionImage:(UIImage *)image {
[UIView transitionWithView:self
duration:0.15f
options:UIViewAnimationOptionTransitionCrossDissolve
animations:^{
self.image = image;
} completion:NULL];
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureModel.h
================================================
#import <Foundation/Foundation.h>
#import "MFPictureModelProtocol.h"
@interface MFPictureModel : NSObject
<
MFPictureModelProtocol
>
@property (nonatomic, strong) NSString *imageURL;
@property (nonatomic, strong) NSString *imageName;
@property (nonatomic, assign) MFImageType imageType;
@property (nonatomic, strong) UIImage *placeholderImage;
@property (nonatomic, strong) UIImage *posterImage;
@property (nonatomic, strong) UIImage *animatedImage;
@property (nonatomic, strong) YYImage *webpAnimatedImage;
@property (nonatomic, assign) BOOL compressed;
@property (nonatomic, assign) BOOL hidden;
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType;
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType compressed:(BOOL)compressed hidden:(BOOL)hidden;
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType placeholderImage:(UIImage *)palceholderImage posterImage:(UIImage *)posterImage animatedImage:(UIImage *)animatedImage webpAnimatedImage:(YYImage *)webpAnimatedImage compressed:(BOOL)compressed hidden:(BOOL)hidden;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureModel.m
================================================
#import "MFPictureModel.h"
@implementation MFPictureModel
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType {
return [self initWithURL:imageURL imageName:imageName imageType:imageType placeholderImage:[UIImage imageNamed:@"placeholder"] posterImage:nil animatedImage:nil webpAnimatedImage:nil compressed:true hidden:false];
}
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType compressed:(BOOL)compressed hidden:(BOOL)hidden {
return [self initWithURL:imageURL imageName:imageName imageType:imageType placeholderImage:[UIImage imageNamed:@"placeholder"] posterImage:nil animatedImage:nil webpAnimatedImage:nil compressed:compressed hidden:false];
}
- (instancetype)initWithURL:(NSString *)imageURL imageName:(NSString *)imageName imageType:(MFImageType)imageType placeholderImage:(UIImage *)palceholderImage posterImage:(UIImage *)posterImage animatedImage:(UIImage *)animatedImage webpAnimatedImage:(YYImage *)webpAnimatedImage compressed:(BOOL)compressed hidden:(BOOL)hidden {
self = [super init];
if (self) {
_imageURL = imageURL;
_imageName = imageName;
_imageType = imageType;
_placeholderImage = palceholderImage;
_posterImage = posterImage;
_animatedImage = animatedImage;
_webpAnimatedImage = webpAnimatedImage;
_compressed = compressed;
_hidden = hidden;
}
return self;
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/RemoteImageViewController.h
================================================
#import <UIKit/UIKit.h>
@interface RemoteImageViewController : UIViewController
@property (nonatomic, strong) NSMutableArray *picList;
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/RemoteImageViewController.m
================================================
#import "RemoteImageViewController.h"
#import "MFPictureBrowser.h"
#import "MFDisplayPhotoCollectionViewCell.h"
#import "MFPictureModel.h"
#import <YYWebImage/YYWebImage.h>
#import "MFPictureBrowser/UIImageView+TransitionImage.h"
#import "MFPictureBrowser/UIImage+ForceDecoded.h"
@interface RemoteImageViewController ()
<
UICollectionViewDelegate,
UICollectionViewDataSource,
UICollectionViewDelegateFlowLayout,
MFPictureBrowserDelegate
>
@property (nonatomic, strong) UICollectionView *collectionView;
@property (nonatomic, assign) NSInteger currentIndex;
@end
@implementation RemoteImageViewController
- (UICollectionView *)collectionView {
if (!_collectionView) {
UICollectionViewFlowLayout *flow = [[UICollectionViewFlowLayout alloc] init];
_collectionView = [[UICollectionView alloc] initWithFrame:CGRectMake(10, 10, [UIScreen mainScreen].bounds.size.width - 20, [UIScreen mainScreen].bounds.size.height - 20) collectionViewLayout:flow];
_collectionView.delegate = self;
_collectionView.dataSource = self;
_collectionView.backgroundColor = [UIColor whiteColor];
_collectionView.bounces = NO;
}
return _collectionView;
}
- (NSMutableArray *)picList {
if (!_picList) {
_picList = @[].mutableCopy;
}
return _picList;
}
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
[self.view addSubview:self.collectionView];
[self.collectionView registerClass:[MFDisplayPhotoCollectionViewCell class] forCellWithReuseIdentifier:@"reuseCell"];
}
- (void)viewDidDisappear:(BOOL)animated {
[super viewDidDisappear:animated];
YYImageCache *cache = [YYImageCache sharedCache];
[cache.memoryCache removeAllObjects];
[cache.diskCache removeAllObjects];
}
- (NSInteger)numberOfSectionsInCollectionView:(UICollectionView *)collectionView {
return 1;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.picList.count;
}
- (UICollectionViewCell *)collectionView: (UICollectionView *)collectionView
cellForItemAtIndexPath: (NSIndexPath *)indexPath {
MFDisplayPhotoCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"reuseCell" forIndexPath:indexPath];
[cell.button addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
MFPictureModel *pictureModel = self.picList[indexPath.row];
NSURL *url = [NSURL URLWithString:pictureModel.imageURL];
__weak MFDisplayPhotoCollectionViewCell *weakCell = cell;
if (!pictureModel.hidden) {
weakCell.displayImageView.alpha = 1.0f;
}else {
weakCell.displayImageView.alpha = 0.0f;
}
__weak __typeof(self)weakSelf = self;
[weakCell.displayImageView yy_setImageWithURL:url placeholder:pictureModel.placeholderImage options:YYWebImageOptionProgressiveBlur | YYWebImageOptionSetImageWithFadeAnimation completion:^(UIImage * _Nullable image, NSURL * _Nonnull url, YYWebImageFromType from, YYWebImageStage stage, NSError * _Nullable error) {
__strong __typeof(weakSelf)strongSelf = weakSelf;
if (!error && stage == YYWebImageStageFinished) {
dispatch_async(dispatch_get_main_queue(), ^{
pictureModel.posterImage = image;
[strongSelf configTagImageView:weakCell.tagImageView imageType:pictureModel.imageType];
});
switch (pictureModel.imageType) {
case MFImageTypeGIF:
{
if (!pictureModel.animatedImage) {
YYImage *yyImage = (YYImage *)image;
NSData *animatedData = yyImage.animatedImageData;
UIImage *animatedImage = [UIImage forceDecodedImageWithData:animatedData];
pictureModel.animatedImage = animatedImage;
}
}
break;
case MFImageTypeAnimatedWebP:
{
if (!pictureModel.webpAnimatedImage) {
pictureModel.webpAnimatedImage = (YYImage *)image;
}
}
break;
case MFImageTypeStaticWebP:
{
if (!pictureModel.posterImage) {
pictureModel.posterImage = (YYImage *)image;
}
}
break;
default:
break;
}
}
}];
return cell;
}
- (void)configTagImageView:(UIImageView *)tagImageView imageType:(MFImageType)imageType {
if (imageType == MFImageTypeLongImage) {
tagImageView.image = [UIImage imageNamed:@"ic_messages_pictype_long_pic_30x30_"];
}else if (imageType == MFImageTypeGIF || imageType == MFImageTypeAnimatedWebP) {
tagImageView.image = [UIImage imageNamed:@"ic_messages_pictype_gif_30x30_"];
}else {
tagImageView.image = nil;
}
tagImageView.alpha = 0;
if (tagImageView.image) {
tagImageView.alpha = 1;
}
}
- (void)buttonClick:(UIButton *)sender {
MFDisplayPhotoCollectionViewCell *cell = (MFDisplayPhotoCollectionViewCell *)sender.superview.superview;
NSIndexPath *indexPath = [self.collectionView indexPathForCell:cell];
MFPictureBrowser *browser = [[MFPictureBrowser alloc] init];
browser.delegate = self;
self.currentIndex = indexPath.row;
MFPictureModel *pictureModel = self.picList[indexPath.row];
pictureModel.hidden = true;
[self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
[browser showImageFromView:cell.displayImageView picturesCount:self.picList.count currentPictureIndex:indexPath.row];
}
- (CGSize)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
sizeForItemAtIndexPath: (NSIndexPath *)indexPath{
return CGSizeMake(([UIScreen mainScreen].bounds.size.width - 20 - 20)/3, ([UIScreen mainScreen].bounds.size.width - 20 - 20)/3);
}
- (CGFloat)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
minimumLineSpacingForSectionAtIndex: (NSInteger)section{
return 5.0f;
}
- (CGFloat)collectionView: (UICollectionView *)collectionView
layout: (UICollectionViewLayout*)collectionViewLayout
minimumInteritemSpacingForSectionAtIndex: (NSInteger)section{
return 5.0f;
}
- (UIEdgeInsets)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout insetForSectionAtIndex:(NSInteger)section {
return UIEdgeInsetsMake(5, 5, 5, 5);
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
[collectionView deselectItemAtIndexPath:indexPath animated:YES];
}
- (UIImageView *)pictureBrowser:(MFPictureBrowser *)pictureBrowser imageViewAtIndex:(NSInteger)index {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
MFDisplayPhotoCollectionViewCell *cell = (MFDisplayPhotoCollectionViewCell *)[self.collectionView cellForItemAtIndexPath:indexPath];
return cell.displayImageView;
}
- (id<MFPictureModelProtocol>)pictureBrowser:(MFPictureBrowser *)pictureBrowser pictureModelAtIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[index];
return pictureModel;
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser image:(UIImage *)image animatedImage:(UIImage *)animatedImage didLoadAtIndex:(NSInteger)index {
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:index inSection:0];
MFPictureModel *pictureModel = self.picList[index];
if (animatedImage) {
pictureModel.posterImage = animatedImage.images.firstObject;
}else if (image) {
pictureModel.posterImage = image;
}
[self.collectionView reloadItemsAtIndexPaths:@[indexPath]];
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser scrollToIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[self.currentIndex];
pictureModel.hidden = false;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:self.currentIndex inSection:0]]];
self.currentIndex = index;
MFPictureModel *currentPictureModel = self.picList[self.currentIndex];
currentPictureModel.hidden = true;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:self.currentIndex inSection:0]]];
}
- (void)pictureBrowser:(MFPictureBrowser *)pictureBrowser dimissAtIndex:(NSInteger)index {
MFPictureModel *pictureModel = self.picList[index];
pictureModel.hidden = false;
[self.collectionView reloadItemsAtIndexPaths:@[[NSIndexPath indexPathForRow:index inSection:0]]];
}
@end
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/main.m
================================================
//
// main.m
// MFPictureBrowserDemo
//
// Created by 张冬冬 on 2018/4/17.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "AppDelegate.h"
int main(int argc, char * argv[]) {
@autoreleasepool {
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
}
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
4A24835D209C5BF7004C69EC /* 2.webp in Resources */ = {isa = PBXBuildFile; fileRef = 4A24835C209C5BF7004C69EC /* 2.webp */; };
4A29A8FD209C37020029A378 /* RemoteImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A29A8FC209C37020029A378 /* RemoteImageViewController.m */; };
4A5AEE862085987300EBFF88 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5AEE852085987300EBFF88 /* AppDelegate.m */; };
4A5AEE8C2085987300EBFF88 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A5AEE8A2085987300EBFF88 /* Main.storyboard */; };
4A5AEE912085987300EBFF88 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 4A5AEE8F2085987300EBFF88 /* LaunchScreen.storyboard */; };
4A5AEE942085987300EBFF88 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5AEE932085987300EBFF88 /* main.m */; };
4A5AEE9D2085A87600EBFF88 /* MFPictureBrowser.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5AEE9C2085A87600EBFF88 /* MFPictureBrowser.m */; };
4A5AEEA02085BC7500EBFF88 /* MFPictureView.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5AEE9F2085BC7500EBFF88 /* MFPictureView.m */; };
4A5AEEA32085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A5AEEA22085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.m */; };
4A60D12C2091733C00612995 /* UIImageView+TransitionImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A60D12B2091733C00612995 /* UIImageView+TransitionImage.m */; };
4A60D135209184B600612995 /* UIImage+ForceDecoded.m in Sources */ = {isa = PBXBuildFile; fileRef = 4A60D134209184B600612995 /* UIImage+ForceDecoded.m */; };
4AD36532209B0A67005F9089 /* 1.webp in Resources */ = {isa = PBXBuildFile; fileRef = 4AD36531209B0A67005F9089 /* 1.webp */; };
4AD36535209BE6B9005F9089 /* MFRunLoopDistribution.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AD36534209BE6B9005F9089 /* MFRunLoopDistribution.m */; };
4AE0C925208EBF6800A2B2D5 /* MFPictureModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 4AE0C924208EBF6800A2B2D5 /* MFPictureModel.m */; };
4AE0C929208F01FC00A2B2D5 /* 1.gif in Resources */ = {isa = PBXBuildFile; fileRef = 4AE0C928208F01FC00A2B2D5 /* 1.gif */; };
4AE0C92D208F046800A2B2D5 /* 2.gif in Resources */ = {isa = PBXBuildFile; fileRef = 4AE0C92C208F046800A2B2D5 /* 2.gif */; };
4AE0C92F208F1E5500A2B2D5 /* 3.gif in Resources */ = {isa = PBXBuildFile; fileRef = 4AE0C92E208F1E5500A2B2D5 /* 3.gif */; };
5E53B83F20863DD5007480C7 /* ListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E53B83E20863DD5007480C7 /* ListViewController.m */; };
5E53B84520863F14007480C7 /* LocalImageViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E53B84420863F14007480C7 /* LocalImageViewController.m */; };
5E53B849208642AE007480C7 /* Image.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E53B848208642AE007480C7 /* Image.xcassets */; };
C343AF5E55FDB1C04384A8C5 /* libPods-MFPictureBrowserDemo.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A3403644A2EFF9B61054AEB2 /* libPods-MFPictureBrowserDemo.a */; };
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
03F4406D2CD57D8E4838F5A5 /* Pods-MFPictureBrowserDemo.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MFPictureBrowserDemo.debug.xcconfig"; path = "Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo.debug.xcconfig"; sourceTree = "<group>"; };
4A24835C209C5BF7004C69EC /* 2.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = 2.webp; sourceTree = "<group>"; };
4A29A8FB209C37010029A378 /* RemoteImageViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RemoteImageViewController.h; sourceTree = "<group>"; };
4A29A8FC209C37020029A378 /* RemoteImageViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RemoteImageViewController.m; sourceTree = "<group>"; };
4A5AEE812085987300EBFF88 /* MFPictureBrowserDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = MFPictureBrowserDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
4A5AEE842085987300EBFF88 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
4A5AEE852085987300EBFF88 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
4A5AEE8B2085987300EBFF88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
4A5AEE902085987300EBFF88 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
4A5AEE922085987300EBFF88 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
4A5AEE932085987300EBFF88 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
4A5AEE9B2085A87600EBFF88 /* MFPictureBrowser.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFPictureBrowser.h; sourceTree = "<group>"; };
4A5AEE9C2085A87600EBFF88 /* MFPictureBrowser.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFPictureBrowser.m; sourceTree = "<group>"; };
4A5AEE9E2085BC7500EBFF88 /* MFPictureView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFPictureView.h; sourceTree = "<group>"; };
4A5AEE9F2085BC7500EBFF88 /* MFPictureView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFPictureView.m; sourceTree = "<group>"; };
4A5AEEA12085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MFDisplayPhotoCollectionViewCell.h; sourceTree = "<group>"; };
4A5AEEA22085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MFDisplayPhotoCollectionViewCell.m; sourceTree = "<group>"; };
4A60D12A2091733C00612995 /* UIImageView+TransitionImage.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImageView+TransitionImage.h"; sourceTree = "<group>"; };
4A60D12B2091733C00612995 /* UIImageView+TransitionImage.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImageView+TransitionImage.m"; sourceTree = "<group>"; };
4A60D133209184B600612995 /* UIImage+ForceDecoded.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIImage+ForceDecoded.h"; sourceTree = "<group>"; };
4A60D134209184B600612995 /* UIImage+ForceDecoded.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIImage+ForceDecoded.m"; sourceTree = "<group>"; };
4AD36531209B0A67005F9089 /* 1.webp */ = {isa = PBXFileReference; lastKnownFileType = file; path = 1.webp; sourceTree = "<group>"; };
4AD36533209BE6B9005F9089 /* MFRunLoopDistribution.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFRunLoopDistribution.h; sourceTree = "<group>"; };
4AD36534209BE6B9005F9089 /* MFRunLoopDistribution.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFRunLoopDistribution.m; sourceTree = "<group>"; };
4AE0C922208EBAE900A2B2D5 /* MFPictureModelProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFPictureModelProtocol.h; sourceTree = "<group>"; };
4AE0C923208EBF6800A2B2D5 /* MFPictureModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MFPictureModel.h; sourceTree = "<group>"; };
4AE0C924208EBF6800A2B2D5 /* MFPictureModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MFPictureModel.m; sourceTree = "<group>"; };
4AE0C928208F01FC00A2B2D5 /* 1.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = 1.gif; sourceTree = "<group>"; };
4AE0C92C208F046800A2B2D5 /* 2.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = 2.gif; sourceTree = "<group>"; };
4AE0C92E208F1E5500A2B2D5 /* 3.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = 3.gif; sourceTree = "<group>"; };
5E53B83D20863DD5007480C7 /* ListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ListViewController.h; sourceTree = "<group>"; };
5E53B83E20863DD5007480C7 /* ListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ListViewController.m; sourceTree = "<group>"; };
5E53B84320863F14007480C7 /* LocalImageViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = LocalImageViewController.h; sourceTree = "<group>"; };
5E53B84420863F14007480C7 /* LocalImageViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = LocalImageViewController.m; sourceTree = "<group>"; };
5E53B848208642AE007480C7 /* Image.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Image.xcassets; sourceTree = "<group>"; };
8E2D0E105573B85353E3FBA2 /* Pods-MFPictureBrowserDemo.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-MFPictureBrowserDemo.release.xcconfig"; path = "Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo.release.xcconfig"; sourceTree = "<group>"; };
A3403644A2EFF9B61054AEB2 /* libPods-MFPictureBrowserDemo.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-MFPictureBrowserDemo.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
/* Begin PBXFrameworksBuildPhase section */
4A5AEE7E2085987300EBFF88 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
C343AF5E55FDB1C04384A8C5 /* libPods-MFPictureBrowserDemo.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
0AAAB81BBA9D6597659FA589 /* Pods */ = {
isa = PBXGroup;
children = (
03F4406D2CD57D8E4838F5A5 /* Pods-MFPictureBrowserDemo.debug.xcconfig */,
8E2D0E105573B85353E3FBA2 /* Pods-MFPictureBrowserDemo.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
};
4A5AEE782085987300EBFF88 = {
isa = PBXGroup;
children = (
4A5AEE832085987300EBFF88 /* MFPictureBrowserDemo */,
4A5AEE822085987300EBFF88 /* Products */,
0AAAB81BBA9D6597659FA589 /* Pods */,
A77A5EFA813399DFB28FEDF5 /* Frameworks */,
);
sourceTree = "<group>";
};
4A5AEE822085987300EBFF88 /* Products */ = {
isa = PBXGroup;
children = (
4A5AEE812085987300EBFF88 /* MFPictureBrowserDemo.app */,
);
name = Products;
sourceTree = "<group>";
};
4A5AEE832085987300EBFF88 /* MFPictureBrowserDemo */ = {
isa = PBXGroup;
children = (
4A5AEE9A2085988A00EBFF88 /* MFPictureBrowser */,
4A5AEE842085987300EBFF88 /* AppDelegate.h */,
4A5AEE852085987300EBFF88 /* AppDelegate.m */,
5E53B83D20863DD5007480C7 /* ListViewController.h */,
5E53B83E20863DD5007480C7 /* ListViewController.m */,
4AE0C923208EBF6800A2B2D5 /* MFPictureModel.h */,
4AE0C924208EBF6800A2B2D5 /* MFPictureModel.m */,
4A29A8FB209C37010029A378 /* RemoteImageViewController.h */,
4A29A8FC209C37020029A378 /* RemoteImageViewController.m */,
5E53B84320863F14007480C7 /* LocalImageViewController.h */,
5E53B84420863F14007480C7 /* LocalImageViewController.m */,
4A5AEEA12085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.h */,
4A5AEEA22085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.m */,
4A5AEE8A2085987300EBFF88 /* Main.storyboard */,
4A5AEE8F2085987300EBFF88 /* LaunchScreen.storyboard */,
4A5AEE922085987300EBFF88 /* Info.plist */,
4A5AEE932085987300EBFF88 /* main.m */,
4AD36531209B0A67005F9089 /* 1.webp */,
4A24835C209C5BF7004C69EC /* 2.webp */,
4AE0C928208F01FC00A2B2D5 /* 1.gif */,
4AE0C92C208F046800A2B2D5 /* 2.gif */,
4AE0C92E208F1E5500A2B2D5 /* 3.gif */,
5E53B848208642AE007480C7 /* Image.xcassets */,
);
path = MFPictureBrowserDemo;
sourceTree = "<group>";
};
4A5AEE9A2085988A00EBFF88 /* MFPictureBrowser */ = {
isa = PBXGroup;
children = (
4AD36533209BE6B9005F9089 /* MFRunLoopDistribution.h */,
4AD36534209BE6B9005F9089 /* MFRunLoopDistribution.m */,
4A5AEE9B2085A87600EBFF88 /* MFPictureBrowser.h */,
4A5AEE9C2085A87600EBFF88 /* MFPictureBrowser.m */,
4A5AEE9E2085BC7500EBFF88 /* MFPictureView.h */,
4A5AEE9F2085BC7500EBFF88 /* MFPictureView.m */,
4A60D12A2091733C00612995 /* UIImageView+TransitionImage.h */,
4A60D12B2091733C00612995 /* UIImageView+TransitionImage.m */,
4A60D133209184B600612995 /* UIImage+ForceDecoded.h */,
4A60D134209184B600612995 /* UIImage+ForceDecoded.m */,
4AE0C922208EBAE900A2B2D5 /* MFPictureModelProtocol.h */,
);
path = MFPictureBrowser;
sourceTree = "<group>";
};
A77A5EFA813399DFB28FEDF5 /* Frameworks */ = {
isa = PBXGroup;
children = (
A3403644A2EFF9B61054AEB2 /* libPods-MFPictureBrowserDemo.a */,
);
name = Frameworks;
sourceTree = "<group>";
};
/* End PBXGroup section */
/* Begin PBXNativeTarget section */
4A5AEE802085987300EBFF88 /* MFPictureBrowserDemo */ = {
isa = PBXNativeTarget;
buildConfigurationList = 4A5AEE972085987300EBFF88 /* Build configuration list for PBXNativeTarget "MFPictureBrowserDemo" */;
buildPhases = (
CD5B2E9B46AE3F8D5A629EC8 /* [CP] Check Pods Manifest.lock */,
4A5AEE7D2085987300EBFF88 /* Sources */,
4A5AEE7E2085987300EBFF88 /* Frameworks */,
4A5AEE7F2085987300EBFF88 /* Resources */,
);
buildRules = (
);
dependencies = (
);
name = MFPictureBrowserDemo;
productName = MFPictureBrowserDemo;
productReference = 4A5AEE812085987300EBFF88 /* MFPictureBrowserDemo.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
/* Begin PBXProject section */
4A5AEE792085987300EBFF88 /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 0910;
ORGANIZATIONNAME = "张冬冬";
TargetAttributes = {
4A5AEE802085987300EBFF88 = {
CreatedOnToolsVersion = 9.1;
ProvisioningStyle = Automatic;
};
};
};
buildConfigurationList = 4A5AEE7C2085987300EBFF88 /* Build configuration list for PBXProject "MFPictureBrowserDemo" */;
compatibilityVersion = "Xcode 8.0";
developmentRegion = en;
hasScannedForEncodings = 0;
knownRegions = (
en,
Base,
);
mainGroup = 4A5AEE782085987300EBFF88;
productRefGroup = 4A5AEE822085987300EBFF88 /* Products */;
projectDirPath = "";
projectRoot = "";
targets = (
4A5AEE802085987300EBFF88 /* MFPictureBrowserDemo */,
);
};
/* End PBXProject section */
/* Begin PBXResourcesBuildPhase section */
4A5AEE7F2085987300EBFF88 /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4AD36532209B0A67005F9089 /* 1.webp in Resources */,
4AE0C92F208F1E5500A2B2D5 /* 3.gif in Resources */,
4A5AEE912085987300EBFF88 /* LaunchScreen.storyboard in Resources */,
4AE0C92D208F046800A2B2D5 /* 2.gif in Resources */,
4A24835D209C5BF7004C69EC /* 2.webp in Resources */,
5E53B849208642AE007480C7 /* Image.xcassets in Resources */,
4AE0C929208F01FC00A2B2D5 /* 1.gif in Resources */,
4A5AEE8C2085987300EBFF88 /* Main.storyboard in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXResourcesBuildPhase section */
/* Begin PBXShellScriptBuildPhase section */
CD5B2E9B46AE3F8D5A629EC8 /* [CP] Check Pods Manifest.lock */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
"${PODS_ROOT}/Manifest.lock",
);
name = "[CP] Check Pods Manifest.lock";
outputPaths = (
"$(DERIVED_FILE_DIR)/Pods-MFPictureBrowserDemo-checkManifestLockResult.txt",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
/* Begin PBXSourcesBuildPhase section */
4A5AEE7D2085987300EBFF88 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4A5AEE9D2085A87600EBFF88 /* MFPictureBrowser.m in Sources */,
4A5AEEA32085C11B00EBFF88 /* MFDisplayPhotoCollectionViewCell.m in Sources */,
5E53B83F20863DD5007480C7 /* ListViewController.m in Sources */,
4AD36535209BE6B9005F9089 /* MFRunLoopDistribution.m in Sources */,
4A5AEEA02085BC7500EBFF88 /* MFPictureView.m in Sources */,
4A5AEE942085987300EBFF88 /* main.m in Sources */,
5E53B84520863F14007480C7 /* LocalImageViewController.m in Sources */,
4A60D135209184B600612995 /* UIImage+ForceDecoded.m in Sources */,
4A29A8FD209C37020029A378 /* RemoteImageViewController.m in Sources */,
4A5AEE862085987300EBFF88 /* AppDelegate.m in Sources */,
4A60D12C2091733C00612995 /* UIImageView+TransitionImage.m in Sources */,
4AE0C925208EBF6800A2B2D5 /* MFPictureModel.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXSourcesBuildPhase section */
/* Begin PBXVariantGroup section */
4A5AEE8A2085987300EBFF88 /* Main.storyboard */ = {
isa = PBXVariantGroup;
children = (
4A5AEE8B2085987300EBFF88 /* Base */,
);
name = Main.storyboard;
sourceTree = "<group>";
};
4A5AEE8F2085987300EBFF88 /* LaunchScreen.storyboard */ = {
isa = PBXVariantGroup;
children = (
4A5AEE902085987300EBFF88 /* Base */,
);
name = LaunchScreen.storyboard;
sourceTree = "<group>";
};
/* End PBXVariantGroup section */
/* Begin XCBuildConfiguration section */
4A5AEE952085987300EBFF88 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_DYNAMIC_NO_PIC = NO;
GCC_NO_COMMON_BLOCKS = YES;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = (
"DEBUG=1",
"$(inherited)",
);
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
};
name = Debug;
};
4A5AEE962085987300EBFF88 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
ALWAYS_SEARCH_USER_PATHS = NO;
CLANG_ANALYZER_NONNULL = YES;
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
CLANG_CXX_LIBRARY = "libc++";
CLANG_ENABLE_MODULES = YES;
CLANG_ENABLE_OBJC_ARC = YES;
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
CLANG_WARN_BOOL_CONVERSION = YES;
CLANG_WARN_COMMA = YES;
CLANG_WARN_CONSTANT_CONVERSION = YES;
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
CLANG_WARN_EMPTY_BODY = YES;
CLANG_WARN_ENUM_CONVERSION = YES;
CLANG_WARN_INFINITE_RECURSION = YES;
CLANG_WARN_INT_CONVERSION = YES;
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
CLANG_WARN_STRICT_PROTOTYPES = YES;
CLANG_WARN_SUSPICIOUS_MOVE = YES;
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
CLANG_WARN_UNREACHABLE_CODE = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
GCC_C_LANGUAGE_STANDARD = gnu11;
GCC_NO_COMMON_BLOCKS = YES;
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
GCC_WARN_UNDECLARED_SELECTOR = YES;
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
VALIDATE_PRODUCT = YES;
};
name = Release;
};
4A5AEE982085987300EBFF88 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 03F4406D2CD57D8E4838F5A5 /* Pods-MFPictureBrowserDemo.debug.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5D33D27VC6;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/MFPictureBrowserDemo/MFPictureBrowser",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"PIN_WEBP=1",
);
INFOPLIST_FILE = MFPictureBrowserDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = net.microfeel.MFPictureBrowserDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Debug;
};
4A5AEE992085987300EBFF88 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 8E2D0E105573B85353E3FBA2 /* Pods-MFPictureBrowserDemo.release.xcconfig */;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = 5D33D27VC6;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"$(PROJECT_DIR)/MFPictureBrowserDemo/MFPictureBrowser",
);
GCC_PREPROCESSOR_DEFINITIONS = (
"$(inherited)",
"COCOAPODS=1",
"PIN_WEBP=1",
);
INFOPLIST_FILE = MFPictureBrowserDemo/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
PRODUCT_BUNDLE_IDENTIFIER = net.microfeel.MFPictureBrowserDemo;
PRODUCT_NAME = "$(TARGET_NAME)";
TARGETED_DEVICE_FAMILY = "1,2";
};
name = Release;
};
/* End XCBuildConfiguration section */
/* Begin XCConfigurationList section */
4A5AEE7C2085987300EBFF88 /* Build configuration list for PBXProject "MFPictureBrowserDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4A5AEE952085987300EBFF88 /* Debug */,
4A5AEE962085987300EBFF88 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
4A5AEE972085987300EBFF88 /* Build configuration list for PBXNativeTarget "MFPictureBrowserDemo" */ = {
isa = XCConfigurationList;
buildConfigurations = (
4A5AEE982085987300EBFF88 /* Debug */,
4A5AEE992085987300EBFF88 /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
};
rootObject = 4A5AEE792085987300EBFF88 /* Project object */;
}
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "self:MFPictureBrowserDemo.xcodeproj">
</FileRef>
</Workspace>
================================================
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo.xcworkspace/contents.xcworkspacedata
================================================
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:MFPictureBrowserDemo.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
================================================
FILE: MFPictureBrowserDemo/Podfile
================================================
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'MFPictureBrowserDemo' do
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
# use_frameworks!
# Pods for MFPictureBrowserDemo
pod ‘YYWebImage’
pod ‘YYImage/WebP’
pod ‘MFCategory’
end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFCookiesManager.h
================================================
//
// MFCookiesManager.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MFCookiesManager : NSObject
+ (void)saveCookies;
+ (void)loadCookiesWithName:(NSString *)cookiesName;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFCookiesManager.m
================================================
//
// MFCookiesManager.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "MFCookiesManager.h"
static NSString *cookies = @"cookies";
@implementation MFCookiesManager
+ (void)saveCookies {
NSData *cookiesData = [NSKeyedArchiver archivedDataWithRootObject:[[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies]];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[defaults setObject:cookiesData forKey:cookies];
[defaults synchronize];
}
+ (void)loadCookiesWithName:(NSString *)cookiesName {
NSArray *cookieList = [NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:cookies]];
NSHTTPCookieStorage *cookieStorage = [NSHTTPCookieStorage sharedHTTPCookieStorage];
for (NSHTTPCookie *cookie in cookieList){
if ([cookie.name isEqualToString:cookiesName]) {
[cookieStorage setCookie:cookie];
}
}
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFDeviceManager.h
================================================
//
// MFDeviceManager.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MFDeviceManager : NSObject
//Screen scale
+ (CGFloat)scale;
//生成GUID
+ (NSString *)guid;
//磁盘全部空间
+ (CGFloat)diskOfAllSizeGBytes;
//磁盘可用空间
+ (CGFloat)diskOfFreeSizeGBytes;
//获取文件大小
+ (long long)fileSizeAtPath:(NSString *)filePath;
//获取文件夹下所有文件的大小
+ (long long)folderSizeAtPath:(NSString *)folderPath;
//获取设备 IP 地址
+ (NSString *)getIPAddress;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFDeviceManager.m
================================================
//
// MFDeviceManager.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "MFDeviceManager.h"
#import <ifaddrs.h>
#import <arpa/inet.h>
@implementation MFDeviceManager
+ (CGFloat)scale{
if ([[UIDevice currentDevice].systemVersion floatValue]>=8.0) {
return [UIScreen mainScreen].nativeScale;
} else {
return [UIScreen mainScreen].scale;
}
}
+ (NSString *)guid {
CFUUIDRef theUUID = CFUUIDCreate(NULL);
CFStringRef theString = CFUUIDCreateString(NULL, theUUID);
NSString *unique = [NSString stringWithString:(__bridge id)theString];
CFRelease(theString); CFRelease(theUUID); // Cleanup CF objects
return unique;
}
//磁盘全部空间
+ (CGFloat)diskOfAllSizeGBytes{
CGFloat size = 0.0;
NSError *error;
NSDictionary *dic = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];
if (error) {
#ifdef DEBUG
NSLog(@"error: %@", error.localizedDescription);
#endif
}else{
NSNumber *number = [dic objectForKey:NSFileSystemSize];
size = [number floatValue]/1024/1024/1024;
}
return size;
}
//磁盘可用空间
+ (CGFloat)diskOfFreeSizeGBytes{
CGFloat size = 0.0;
NSError *error;
NSDictionary *dic = [[NSFileManager defaultManager] attributesOfFileSystemForPath:NSHomeDirectory() error:&error];
if (error) {
#ifdef DEBUG
NSLog(@"error: %@", error.localizedDescription);
#endif
}else{
NSNumber *number = [dic objectForKey:NSFileSystemFreeSize];
size = [number floatValue]/1024/1024/1024;
}
return size;
}
//获取文件大小
+ (long long)fileSizeAtPath:(NSString *)filePath{
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:filePath]) return 0;
return [[fileManager attributesOfItemAtPath:filePath error:nil] fileSize];
}
//获取文件夹下所有文件的大小
+ (long long)folderSizeAtPath:(NSString *)folderPath{
NSFileManager *fileManager = [NSFileManager defaultManager];
if (![fileManager fileExistsAtPath:folderPath]) return 0;
NSEnumerator *filesEnumerator = [[fileManager subpathsAtPath:folderPath] objectEnumerator];
NSString *fileName;
long long folerSize = 0;
while ((fileName = [filesEnumerator nextObject]) != nil) {
NSString *filePath = [folderPath stringByAppendingPathComponent:fileName];
folerSize += [self fileSizeAtPath:filePath];
}
return folerSize;
}
//获取设备 IP 地址
+ (NSString *)getIPAddress {
NSString *address = @"error";
struct ifaddrs *interfaces = NULL;
struct ifaddrs *temp_addr = NULL;
int success = 0;
success = getifaddrs(&interfaces);
if (success == 0) {
temp_addr = interfaces;
while(temp_addr != NULL) {
if(temp_addr->ifa_addr->sa_family == AF_INET) {
if([[NSString stringWithUTF8String:temp_addr->ifa_name] isEqualToString:@"en0"]) {
address = [NSString stringWithUTF8String:inet_ntoa(((struct sockaddr_in *)temp_addr->ifa_addr)->sin_addr)];
}
}
temp_addr = temp_addr->ifa_next;
}
}
freeifaddrs(interfaces);
return address;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFManager.h
================================================
//
// MFManager.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@interface MFManager : NSObject
+ (void)animatedTransferKeyWindow:(UIViewController *)controller;
+ (void)jumpAppStoreWithAppID:(NSString *)appID;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFManager.m
================================================
//
// MFManager.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "MFManager.h"
@implementation MFManager
+ (void)animatedTransferKeyWindow:(UIViewController *)controller {
[UIView transitionWithView:[UIApplication sharedApplication].keyWindow duration:0.3f options:UIViewAnimationOptionTransitionCrossDissolve animations:^{
BOOL oldState = [UIView areAnimationsEnabled];
[UIView setAnimationsEnabled:NO];
[UIApplication sharedApplication].keyWindow.rootViewController = controller;
[UIView setAnimationsEnabled:oldState];
} completion:nil];
}
+ (void)jumpAppStoreWithAppID:(NSString *)appID {
NSString *urlString = [NSString stringWithFormat:@"itms-apps://itunes.apple.com/app/id%@", appID];
NSURL *url = [NSURL URLWithString:urlString];
if (@available(iOS 10, *)) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}else {
[[UIApplication sharedApplication] openURL:url];
}
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFREManager.h
================================================
//
// MFREManager.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface MFREManager : NSObject
//判断手机号码格式是否正确
+ (BOOL)valiMobile:(NSString *)mobile;
//利用正则表达式验证
+ (BOOL)isAvailableEmail:(NSString *)email;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFREManager.m
================================================
//
// MFREManager.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "MFREManager.h"
@implementation MFREManager
//判断手机号码格式是否正确
+ (BOOL)valiMobile:(NSString *)mobile{
mobile = [mobile stringByReplacingOccurrencesOfString:@" " withString:@""];
if (mobile.length != 11)
{
return NO;
}else{
/**
* 移动号段正则表达式
*/
NSString *CM_NUM = @"^((13[4-9])|(147)|(15[0-2,7-9])|(178)|(18[2-4,7-8]))\\d{8}|(1705)\\d{7}$";
/**
* 联通号段正则表达式
*/
NSString *CU_NUM = @"^((13[0-2])|(145)|(15[5-6])|(176)|(18[5,6]))\\d{8}|(1709)\\d{7}$";
/**
* 电信号段正则表达式
*/
NSString *CT_NUM = @"^((133)|(153)|(177)|(18[0,1,9]))\\d{8}$";
NSPredicate *pred1 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CM_NUM];
BOOL isMatch1 = [pred1 evaluateWithObject:mobile];
NSPredicate *pred2 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CU_NUM];
BOOL isMatch2 = [pred2 evaluateWithObject:mobile];
NSPredicate *pred3 = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", CT_NUM];
BOOL isMatch3 = [pred3 evaluateWithObject:mobile];
if (isMatch1 || isMatch2 || isMatch3) {
return YES;
}else{
return NO;
}
}
}
//利用正则表达式验证
+ (BOOL)isAvailableEmail:(NSString *)email{
NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}";
NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex];
return [emailTest evaluateWithObject:email];
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFSavePhotoManager.h
================================================
//
// MFSavePhotoManager.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
typedef void (^successHandler)(void);
typedef void (^failureHandler)(NSError * _Nullable error);
@interface MFSavePhotoManager : NSObject
///保存普通类型的 image eg: png, jpg
+ (void)saveImage:(UIImage *_Nullable)image
success:(successHandler _Nullable )successHandle
failure:(failureHandler _Nullable )failureHanlde;
///保存 gif 类型的图片. imageData 可从 SD 或 YY 框架的缓存数据获取
/*
YYWebImageManager *manager = [YYWebImageManager sharedManager];
NSString *key = [manager cacheKeyForURL:url];
NSData *data = [manager.cache getImageDataForKey:key];
*/
+ (void)saveImageData:(NSData *_Nullable)imageData
success:(successHandler _Nullable )successHandle
failure:(failureHandler _Nullable )failureHanlde;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFSavePhotoManager.m
================================================
//
// MFSavePhotoManager.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "MFSavePhotoManager.h"
#import <Photos/Photos.h>
@implementation MFSavePhotoManager
+ (void)saveImage:(UIImage *)image
success:(successHandler)successHandle
failure:(failureHandler)failureHanlde {
dispatch_async(dispatch_get_main_queue(), ^{
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
[PHAssetChangeRequest creationRequestForAssetFromImage:image];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
if (success && successHandle) {
successHandle();
}else if (error && failureHanlde) {
failureHanlde(error);
}
}];
});
}
+ (void)saveImageData:(NSData *)imageData
success:(successHandler)successHandle
failure:(failureHandler)failureHanlde {
dispatch_async(dispatch_get_main_queue(), ^{
[[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{
PHAssetResourceCreationOptions *options = [[PHAssetResourceCreationOptions alloc] init];
[[PHAssetCreationRequest creationRequestForAsset] addResourceWithType:PHAssetResourceTypePhoto data:imageData options:options];
} completionHandler:^(BOOL success, NSError * _Nullable error) {
if (success && successHandle) {
successHandle();
}else if (error && failureHanlde) {
failureHanlde(error);
}
}];
});
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSArrayCategory/NSArray+Distinct.h
================================================
//
// NSArray+Distinct.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSArray (Distinct)
+ (NSArray *)distinctUnionOfArray:(NSArray *)originArray;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSArrayCategory/NSArray+Distinct.m
================================================
//
// NSArray+Distinct.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSArray+Distinct.h"
@implementation NSArray (Distinct)
+ (NSArray *)distinctUnionOfArray:(NSArray *)originArray {
return [originArray valueForKeyPath:@"@distinctUnionOfObjects.self"];
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDataCategory/NSData+MFHexString.h
================================================
//
// NSData+MFHexString.m
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSData (MFHexString)
+ (NSData *)convertedToDataFromHexString:(NSString *)hexString;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDataCategory/NSData+MFHexString.m
================================================
//
// NSData+MFHexString.m
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSData+MFHexString.h"
@implementation NSData (MFHexString)
+ (NSData *)convertedToDataFromHexString:(NSString *)hexString {
if (!hexString || [hexString length] == 0) {
return nil;
}
NSMutableData *hexData = [[NSMutableData alloc] initWithCapacity:20];
NSRange range;
if ([hexString length] % 2 == 0) {
range = NSMakeRange(0, 2);
} else {
range = NSMakeRange(0, 1);
}
for (NSInteger i = range.location; i < [hexString length]; i += 2) {
unsigned int anInt;
NSString *hexCharString = [hexString substringWithRange:range];
NSScanner *scanner = [[NSScanner alloc] initWithString:hexCharString];
[scanner scanHexInt:&anInt];
NSData *entity = [[NSData alloc] initWithBytes:&anInt length:1];
[hexData appendData:entity];
range.location += range.length;
range.length = 2;
}
return hexData;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDateFormatterCategory/NSDateFormatter+Cache.h
================================================
//
// NSDateFormatter+Cache.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSDateFormatter (Cache)
+ (instancetype)sharedInstance;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDateFormatterCategory/NSDateFormatter+Cache.m
================================================
//
// NSDateFormatter+Cache.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSDateFormatter+Cache.h"
@implementation NSDateFormatter (Cache)
+ (instancetype)sharedInstance {
static NSDateFormatter *formatter = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
formatter = [[NSDateFormatter alloc] init];
});
return formatter;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+File.h
================================================
//
// NSString+File.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (File)
+ (instancetype)uuid;
+ (instancetype)documentPath;
+ (instancetype)homePath;
+ (instancetype)tempPath;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+File.m
================================================
//
// NSString+File.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSString+File.h"
@implementation NSString (File)
+ (instancetype)uuid {
CFUUIDRef uuid = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef strUuid = CFUUIDCreateString(kCFAllocatorDefault,uuid);
NSString * str = [NSString stringWithString:(__bridge NSString *)strUuid];
CFRelease(strUuid);
CFRelease(uuid);
return str;
}
+ (instancetype)documentPath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
return documentsDirectory;
}
+ (instancetype)homePath {
return NSHomeDirectory();
}
+ (instancetype)tempPath {
return NSTemporaryDirectory();
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFBase64Encoder.h
================================================
//
// NSString+MFBase64Encoder.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (MFBase64Encoder)
- (NSString *)base64Encoded;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFBase64Encoder.m
================================================
//
// NSString+MFBase64Encoder.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSString+MFBase64Encoder.h"
@implementation NSString (MFBase64Encoder)
- (NSString *)base64Encoded {
NSData *data = [self dataUsingEncoding:NSUTF8StringEncoding];
return [data base64EncodedStringWithOptions:0];
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFMD5Encoder.h
================================================
//
// NSString+MFMD5Encoder.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSString (MFMD5Encoder)
- (NSString *)md5String;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFMD5Encoder.m
================================================
//
// NSString+MFMD5Encoder.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSString+MFMD5Encoder.h"
#import <CommonCrypto/CommonDigest.h>
@implementation NSString (MFMD5Encoder)
- (NSString *)md5String
{
const char *str = [(NSString *)self UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH] = {0};
CC_MD5(str, (CC_LONG)strlen(str), result);
NSMutableString *ret = [NSMutableString string];
for (int i = 0; i < CC_MD5_DIGEST_LENGTH; i++) {
[ret appendFormat:@"%02x", result[i]];
}
return ret;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSTimerCategory/NSTimer+MFWeakTimer.h
================================================
//
// NSTimer+MFWeakTimer.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface NSTimer (MFWeakTimer)
+ (NSTimer *_Nonnull)mf_scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^_Nonnull)(NSTimer * _Nonnull timer))block;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/NSTimerCategory/NSTimer+MFWeakTimer.m
================================================
//
// NSTimer+MFWeakTimer.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "NSTimer+MFWeakTimer.h"
@implementation NSTimer (MFWeakTimer)
+ (NSTimer *_Nonnull)mf_scheduledTimerWithTimeInterval:(NSTimeInterval)interval repeats:(BOOL)repeats block:(void (^_Nonnull)(NSTimer * _Nonnull timer))block {
if (@available(iOS 10.0, *)) {
return [self scheduledTimerWithTimeInterval:interval repeats:repeats block:[block copy]];
}else {
return [self scheduledTimerWithTimeInterval:interval target:self selector:@selector(timerhandleInvoke:) userInfo:[block copy] repeats:repeats];
}
}
+ (void)timerhandleInvoke:(NSTimer *)timer {
void (^block)(void) = timer.userInfo;
if (block) {
block();
}
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFHexColor.h
================================================
//
// UIColor+MFHexColor.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (MFHexColor)
+ (UIColor *)colorWithHexString:(NSString *)hexString;
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha;
- (NSString *)hexString;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFHexColor.m
================================================
//
// UIColor+MFHexColor.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIColor+MFHexColor.h"
@implementation UIColor (MFHexColor)
+ (UIColor *)colorWithHexString:(NSString *)hexString alpha:(CGFloat)alpha {
NSString *cString = [[hexString stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]] uppercaseString];
//hexString应该6到8个字符
if ([cString length] < 6) {
return [UIColor clearColor];
}
//如果hexString 有@"0X"前缀
if ([cString hasPrefix:@"0X"])
cString = [cString substringFromIndex:2];
//如果hexString 有@"#""前缀
if ([cString hasPrefix:@"#"])
cString = [cString substringFromIndex:1];
if ([cString length] != 6)
return [UIColor clearColor];
//RGBCOLOR转换
NSRange range;
range.location = 0;
range.length = 2;
//R
NSString *rString = [cString substringWithRange:range];
//G
range.location = 2;
NSString *gString = [cString substringWithRange:range];
//B
range.location = 4;
NSString *bString = [cString substringWithRange:range];
unsigned int r, g, b;
[[NSScanner scannerWithString:rString] scanHexInt:&r];
[[NSScanner scannerWithString:gString] scanHexInt:&g];
[[NSScanner scannerWithString:bString] scanHexInt:&b];
return [UIColor colorWithRed:((float) r / 255.0f) green:((float) g / 255.0f) blue:((float) b / 255.0f) alpha:alpha];
}
+ (UIColor *)colorWithHexString:(NSString *)hexString {
return [UIColor colorWithHexString:hexString alpha:1.0];
}
- (NSString *)hexString {
const CGFloat *components = CGColorGetComponents(self.CGColor);
CGFloat r = components[0];
CGFloat g = components[1];
CGFloat b = components[2];
return [NSString stringWithFormat:@"#%02lX%02lX%02lX",
lroundf(r * 255),
lroundf(g * 255),
lroundf(b * 255)];
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFLDColor.h
================================================
//
// UIColor+MFLDColor.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIColor (MFLDColor)
- (BOOL) isLightColor;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFLDColor.m
================================================
//
// UIColor+MFLDColor.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIColor+MFLDColor.h"
@implementation UIColor (MFLDColor)
- (BOOL)isLightColor {
CGFloat components[3];
[self p_getRGBComponents:components forColor:self];
CGFloat num = components[0] + components[1] + components[2];
if(num < 382)
return NO;
else
return YES;
}
// get rgb value
- (void)p_getRGBComponents:(CGFloat [3])components forColor:(UIColor *)color {
#if __IPHONE_OS_VERSION_MAX_ALLOWED > __IPHONE_6_1
int bitmapInfo = kCGBitmapByteOrderDefault | kCGImageAlphaPremultipliedLast;
#else
int bitmapInfo = kCGImageAlphaPremultipliedLast;
#endif
CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB();
unsigned char resultingPixel[4];
CGContextRef context = CGBitmapContextCreate(&resultingPixel,
1,
1,
8,
4,
rgbColorSpace,
bitmapInfo);
CGContextSetFillColorWithColor(context, [color CGColor]);
CGContextFillRect(context, CGRectMake(0, 0, 1, 1));
CGContextRelease(context);
CGColorSpaceRelease(rgbColorSpace);
for (int component = 0; component < 3; component++) {
components[component] = resultingPixel[component];
}
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIImageCategory/UIImage+Current.h
================================================
//
// UIImage+Current.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIImage (Current)
+ (UIImage *)getImageFromCurrentView:(UIView *)view;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIImageCategory/UIImage+Current.m
================================================
//
// UIImage+Current.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIImage+Current.h"
@implementation UIImage (Current)
+ (UIImage *)getImageFromCurrentView:(UIView *)view {
UIGraphicsBeginImageContextWithOptions(view.bounds.size, YES, 0.0);
[view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFExpandTouchSize.h
================================================
//
// UIView+MFExpandTouchSize.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (MFExpandTouchSize)
@property (nonatomic,assign) UIEdgeInsets expandTouchInset;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFExpandTouchSize.m
================================================
//
// UIView+MFExpandTouchSize.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIView+MFExpandTouchSize.h"
#import <objc/runtime.h>
void expandTouch_swizzingMethod(Class class,SEL orig,SEL new){
Method origMethod = class_getInstanceMethod(class, orig);
Method newMethod = class_getInstanceMethod(class, new);
if (class_addMethod(class, orig, method_getImplementation(newMethod), method_getTypeEncoding(newMethod))) {
class_replaceMethod(class, new, method_getImplementation(origMethod), method_getTypeEncoding(origMethod));
}else{
method_exchangeImplementations(origMethod, newMethod);
}
}
@implementation UIView (MFExpandTouchSize)
+ (void)load {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
expandTouch_swizzingMethod([self class], @selector(pointInside:withEvent:), @selector(mf_expandTouchPointInside:withEvent:));
});
}
- (BOOL)mf_expandTouchPointInside:(CGPoint)point withEvent:(UIEvent *)event {
if (UIEdgeInsetsEqualToEdgeInsets(self.expandTouchInset, UIEdgeInsetsZero)||self.hidden||([self isKindOfClass:[UIControl class]] && !((UIControl *)self).enabled)) {
[self mf_expandTouchPointInside:point withEvent:event];
}
CGRect hitRect = UIEdgeInsetsInsetRect(self.bounds, self.expandTouchInset);
hitRect.size.width = MAX(hitRect.size.width, 0);
hitRect.size.height = MAX(hitRect.size.height, 0);
return CGRectContainsPoint(hitRect, point);
}
- (void)setExpandTouchInset:(UIEdgeInsets)expandTouchInset {
objc_setAssociatedObject(self, @selector(expandTouchInset), [NSValue valueWithUIEdgeInsets:expandTouchInset], OBJC_ASSOCIATION_RETAIN_NONATOMIC);
}
- (UIEdgeInsets)expandTouchInset {
return [objc_getAssociatedObject(self, _cmd) UIEdgeInsetsValue];
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFFrame.h
================================================
//
// UIView+MFFrame.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (MFFrame)
@property (nonatomic, assign) CGFloat x;
@property (nonatomic, assign) CGFloat y;
@property (nonatomic, assign) CGFloat width;
@property (nonatomic, assign) CGFloat height;
@property (nonatomic, assign) CGSize size;
@property (nonatomic, assign) CGPoint origin;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFFrame.m
================================================
//
// UIView+MFFrame.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIView+MFFrame.h"
@implementation UIView (MFFrame)
- (CGFloat)x {
return self.frame.origin.x;
}
- (CGFloat)y {
return self.frame.origin.y;
}
- (CGFloat)width {
return self.frame.size.width;
}
- (CGFloat)height {
return self.frame.size.height;
}
- (void)setX:(CGFloat)x {
self.frame = CGRectMake(x, self.y, self.width, self.height);
}
- (void)setY:(CGFloat)y {
self.frame = CGRectMake(self.x, y, self.width, self.height);
}
- (void)setWidth:(CGFloat)width {
self.frame = CGRectMake(self.x, self.y, width, self.height);
}
- (void)setHeight:(CGFloat)height {
self.frame = CGRectMake(self.x, self.y, self.width, height);
}
- (CGSize)size {
return self.frame.size;
}
- (void)setSize:(CGSize)size {
self.frame = CGRectMake(self.x, self.y, size.width, size.height);
}
- (CGPoint)origin {
return self.frame.origin;
}
- (void)setOrigin:(CGPoint)origin {
self.frame = CGRectMake(origin.x, origin.y, self.width, self.height);
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFSnapshot.h
================================================
//
// UIView+MFSnapshot.h
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (MFSnapshot)
- (UIImage *)viewSnapshot;
- (UIImage *)layerSnapshot;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFSnapshot.m
================================================
//
// UIView+MFSnapshot.m
//
// Created by 张冬冬.
// Copyright © 2018年 张冬冬. All rights reserved.
//
#import "UIView+MFSnapshot.h"
@implementation UIView (MFSnapshot)
- (UIImage *)viewSnapshot {
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [UIScreen mainScreen].scale);
[self drawViewHierarchyInRect:self.bounds afterScreenUpdates:NO];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
- (UIImage *)layerSnapshot {
UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, [UIScreen mainScreen].scale);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+Shadow.h
================================================
//
// UIView+Shadow.m
// Created by pipelining.
// Copyright © 2018年 GodzzZZZ. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface UIView (Shadow)
- (void)addShadowWithColor:(UIColor *)shadowColor;
- (void)removeShadow;
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+Shadow.m
================================================
//
// UIView+Shadow.m
// Created by pipelining.
// Copyright © 2018年 GodzzZZZ. All rights reserved.
//
#import "UIView+Shadow.h"
@implementation UIView (Shadow)
- (void)addShadowWithColor:(UIColor *)shadowColor {
self.layer.shadowColor = shadowColor.CGColor;
self.layer.shadowRadius = 8;
self.layer.shadowOpacity = 0.7;
self.layer.shadowOffset = CGSizeMake(0, 5);
}
- (void)removeShadow {
self.layer.shadowOpacity = 0;
}
@end
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/LICENSE
================================================
MIT License
Copyright (c) 2018 GodzzZZZ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: MFPictureBrowserDemo/Pods/MFCategory/README.md
================================================
# MFCategory
OC常用分类
================================================
FILE: MFPictureBrowserDemo/Pods/Pods.xcodeproj/project.pbxproj
================================================
// !$*UTF8*$!
{
archiveVersion = 1;
classes = {
};
objectVersion = 48;
objects = {
/* Begin PBXBuildFile section */
02E865D72099D2FD1243697923B2B4B7 /* YYKVStorage.h in Headers */ = {isa = PBXBuildFile; fileRef = 0D1FCF67F9946129754D753F5504C711 /* YYKVStorage.h */; settings = {ATTRIBUTES = (Project, ); }; };
0413E125ABFFCFF246ED9ADACC43B7E4 /* MFREManager.h in Headers */ = {isa = PBXBuildFile; fileRef = FCA07E0F4B89C8B69DE604568E3501D9 /* MFREManager.h */; settings = {ATTRIBUTES = (Project, ); }; };
042EEBE27D87F926314C3D65D157D3BE /* YYImageCoder.m in Sources */ = {isa = PBXBuildFile; fileRef = 46A4B00C9EEC3C8DB459978CEAA0B882 /* YYImageCoder.m */; };
05CA2AF1247C77B1A4C0634ADE891640 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4418563B9EF3CB95C8F65879F546D44C /* ImageIO.framework */; };
07DA83207C6539EB33761509DAD155F8 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67D6E55E61A18B9FCEE8B47E22D4270C /* CoreFoundation.framework */; };
083CC59EA97F29E4893A842CEC47FAFB /* MFSavePhotoManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 414CC9D9152EB41690188B0A94CE53D8 /* MFSavePhotoManager.h */; settings = {ATTRIBUTES = (Project, ); }; };
0C1F5495E2C48A6CDBE80ED416284D59 /* NSArray+Distinct.m in Sources */ = {isa = PBXBuildFile; fileRef = 9E0F3EF807998BDC69BBCD6C5D8C3E52 /* NSArray+Distinct.m */; };
0E5C782DD1565CBFA38A7BFEB2AFE5AA /* NSTimer+MFWeakTimer.m in Sources */ = {isa = PBXBuildFile; fileRef = E81C4D19016A649D58FD3E31FE95068A /* NSTimer+MFWeakTimer.m */; };
0FC58C2058A4BB7DCBDCB8D3EB3F69FA /* NSString+File.h in Headers */ = {isa = PBXBuildFile; fileRef = CAB7A2005DA56FA086ABEE79F3DBF423 /* NSString+File.h */; settings = {ATTRIBUTES = (Project, ); }; };
105CD28A1A183013BDF2E9DC41C13025 /* MFManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AD931227771EBB1CAB963AEB7985225 /* MFManager.h */; settings = {ATTRIBUTES = (Project, ); }; };
10BAAA9BF7963F6E56402B76F8794D99 /* UIView+MFSnapshot.m in Sources */ = {isa = PBXBuildFile; fileRef = 59E34C1838F6D6759741ABB91258D932 /* UIView+MFSnapshot.m */; };
14A3306CD2222ABCED413D48BBF24307 /* NSString+MFMD5Encoder.m in Sources */ = {isa = PBXBuildFile; fileRef = B965A2D3DAE4E6CF4A69C2BA4CA30657 /* NSString+MFMD5Encoder.m */; };
1548EA871BB792DFD1ADB5D554D5B93B /* YYWebImageManager.m in Sources */ = {isa = PBXBuildFile; fileRef = F5D1D555371D69FF2516CDB195FB48A0 /* YYWebImageManager.m */; };
18D8488FB14EC002DEFA2CBE1B9D6DF1 /* UIImage+Current.m in Sources */ = {isa = PBXBuildFile; fileRef = 33126ACC412964BD7E2E2DB5D056193A /* UIImage+Current.m */; };
1A8AD5A82AB27D6B5FC4F49449E21889 /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A90BE5491E0D2F0314AC354A80EA7053 /* AssetsLibrary.framework */; };
1D333DCFE52ED903A939788CD835B780 /* YYImageCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F3A0EC16B9709D89AE00FDE77D3BB41B /* YYImageCache.m */; };
1F1B08FB73758E0F1E3004009D7F610E /* CALayer+YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 794D05F11A52A3A3967BD8230E27F9CE /* CALayer+YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
2104FA68551B02221EEA410ECDF1A14B /* UIColor+MFLDColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 59A5474B8982530896DD676925D76B7B /* UIColor+MFLDColor.h */; settings = {ATTRIBUTES = (Project, ); }; };
24F75AF86066385BA5D40010E57A36B7 /* UIColor+MFHexColor.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F5352C0CDC59A9C21D1F37AE73217DF /* UIColor+MFHexColor.h */; settings = {ATTRIBUTES = (Project, ); }; };
255CFB9F22BF1D76532766EF5197562B /* YYMemoryCache.h in Headers */ = {isa = PBXBuildFile; fileRef = F033C04E9D6CFA71BA5CECF8B24B1E0E /* YYMemoryCache.h */; settings = {ATTRIBUTES = (Project, ); }; };
272DBC1ADD0B026B6625C91EDF77C771 /* UIButton+YYWebImage.m in Sources */ = {isa = PBXBuildFile; fileRef = E90002DC07702BAAD7B220257400D5BF /* UIButton+YYWebImage.m */; };
29A9A76BA16EFE4672DB09693F830BD4 /* UIImageView+YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CF3CD94E8D04009A849C917B7E2721D /* UIImageView+YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
2B6522BAC13320D33D3D6ADD36526E26 /* NSData+MFHexString.h in Headers */ = {isa = PBXBuildFile; fileRef = 18A8A5FB1348C9094843CCC56048CED7 /* NSData+MFHexString.h */; settings = {ATTRIBUTES = (Project, ); }; };
2C9AEC6C0FD7DEE6846616CB6A4ADF1F /* YYSpriteSheetImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 9CAC01F29611B985E772308AA7843437 /* YYSpriteSheetImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
2DC2CA7D1626F12A8296E2B9A2741CED /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67D6E55E61A18B9FCEE8B47E22D4270C /* CoreFoundation.framework */; };
32E8FDD134677B65125211724B394D1D /* UIView+Shadow.h in Headers */ = {isa = PBXBuildFile; fileRef = F4849E59376115AB459DDD960FDCD27C /* UIView+Shadow.h */; settings = {ATTRIBUTES = (Project, ); }; };
345870329F21A4EA6978E58820D37217 /* YYWebImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 3BF8CD7C5CFEB2D2B37356DB0BDC5F89 /* YYWebImage-dummy.m */; };
3593C954B1047C28453590BA0D723D09 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1F5E026DFDC125DA63FB26DF3D0B33B /* Foundation.framework */; };
38D59E295C6E5924B8CC86DBEDCF6852 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F584F554FC4F3918A874F458E376711 /* MobileCoreServices.framework */; };
3ECA2690533A2AFC4133893200D39B12 /* YYImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 7838A96C85C34F629DF8916882103E32 /* YYImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
40F71A32A408C21C211D4766A1827B1E /* _YYWebImageSetter.h in Headers */ = {isa = PBXBuildFile; fileRef = FA93AEE8C1840A47C87811DDD26E846B /* _YYWebImageSetter.h */; settings = {ATTRIBUTES = (Project, ); }; };
43B1CFEE4FD272831183D1098AAE2769 /* YYImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 75F4A127D9B097D8F215A4AE17706549 /* YYImage.m */; };
52723F23446A4DDB4E9CD073EADFC54E /* YYImage-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = F1E3230C4E7D4DE61C64F4DF7AE30985 /* YYImage-dummy.m */; };
545EC49452E887AABE12F54BCF5EB416 /* YYAnimatedImageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 47508E096FF1A69BB3E1834812787FB7 /* YYAnimatedImageView.m */; };
5568546AC897E573177E738AA9683D2F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1F5E026DFDC125DA63FB26DF3D0B33B /* Foundation.framework */; };
5975016BDE98C9D90C82144316486F45 /* _YYWebImageSetter.m in Sources */ = {isa = PBXBuildFile; fileRef = 6BD323327DD6FD31FE6A513987C22AC1 /* _YYWebImageSetter.m */; };
59AD06CEB9C30E66DB24B42D9A9435C8 /* MobileCoreServices.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 3F584F554FC4F3918A874F458E376711 /* MobileCoreServices.framework */; };
5AB9C76511C219DD2B281BC4BC22D976 /* NSString+File.m in Sources */ = {isa = PBXBuildFile; fileRef = 27D2201704B93283CE3F081F925809F3 /* NSString+File.m */; };
5D902E65B6FD3861C04DDCB57ACE93ED /* Pods-MFPictureBrowserDemo-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = E22A84D16B0BFC973322E5A43AB3F983 /* Pods-MFPictureBrowserDemo-dummy.m */; };
60A37919DA2F26EDB3104D36E983E01E /* UIColor+MFHexColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 6439E5A5516A25ECA56884DE34BEE75A /* UIColor+MFHexColor.m */; };
66631C381422CA569BB9DFF407CDE6B5 /* YYCache-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = 497229BA559DDB5472BBE2168DA56BD9 /* YYCache-dummy.m */; };
680F900015946EE7E91C2FE52E52FD1F /* MFCookiesManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 22864423188C23E57030ED1E8E40D200 /* MFCookiesManager.m */; };
68876BB41E4CF65E3B066C3266A99391 /* YYDiskCache.h in Headers */ = {isa = PBXBuildFile; fileRef = 91E6C7401E50FC83BC216E30AD8EA51B /* YYDiskCache.h */; settings = {ATTRIBUTES = (Project, ); }; };
6B12CF3AC3EEBF0EDA135210774B5514 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A72DD915EC9DA0CB8E471AB1F10DEBE /* UIKit.framework */; };
6C79AE946EAE5491C61D0D8B7EA3D50B /* UIImage+YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = E67B35CF2E03E1BBA0B7802DA8EBA724 /* UIImage+YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
6D7D5F802FCB4C87BAE1A5D57F7092AF /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A624E91122CB033D86EBD46036B82B28 /* Accelerate.framework */; };
6EB8CC0852A66546FF2F6A983D4C504E /* YYDiskCache.m in Sources */ = {isa = PBXBuildFile; fileRef = F50A838E25BB546FB2CDB378D98B6AC1 /* YYDiskCache.m */; };
6F79380780284ED005F861FACE179D95 /* YYFrameImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 729013888648DE5112848CB23AE2D60C /* YYFrameImage.m */; };
71013DC69F2F5B727DC511AB551ECD55 /* MKAnnotationView+YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 686CF685C828E569E655F372A698C1E2 /* MKAnnotationView+YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
73A7AF0F36FF0FB9A5AD57E310E8805A /* YYMemoryCache.m in Sources */ = {isa = PBXBuildFile; fileRef = BE553099A1DB48C152573B1011A5CB3B /* YYMemoryCache.m */; };
749B82B89BD1E41420389983F4CB9D6D /* NSDateFormatter+Cache.m in Sources */ = {isa = PBXBuildFile; fileRef = A4307434B93D64ABCD8D5C0195FF6E96 /* NSDateFormatter+Cache.m */; };
785D27C659EE598DFC0F2580F52D29E6 /* UIView+MFSnapshot.h in Headers */ = {isa = PBXBuildFile; fileRef = 8C1022760C1A1E6DD3819746C56B5FB7 /* UIView+MFSnapshot.h */; settings = {ATTRIBUTES = (Project, ); }; };
7913CE51FDFAD0E01E3E5D534E84ECF5 /* ImageIO.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4418563B9EF3CB95C8F65879F546D44C /* ImageIO.framework */; };
7BBD6998D4960BA999E32684F03E6720 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1F5E026DFDC125DA63FB26DF3D0B33B /* Foundation.framework */; };
7BE0872A542AEB80D672FBBE1CDD9A9B /* YYCache.m in Sources */ = {isa = PBXBuildFile; fileRef = C319F72B335E282982A7B54082327494 /* YYCache.m */; };
7DFCF4696E65DB0F0E5377CC4576C6E3 /* NSData+MFHexString.m in Sources */ = {isa = PBXBuildFile; fileRef = 259C903D8916CADC3DE22115F1902447 /* NSData+MFHexString.m */; };
7E63962C48E08320F84689B7E2BFBFD9 /* YYCache.h in Headers */ = {isa = PBXBuildFile; fileRef = E7F11E54EA95CB17F9DC0B75433DB95A /* YYCache.h */; settings = {ATTRIBUTES = (Project, ); }; };
82EBB9B8294B7D64E6749DBE34DA86BE /* MFCookiesManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F25ECBDB5805338D6A5C25E9FF34877 /* MFCookiesManager.h */; settings = {ATTRIBUTES = (Project, ); }; };
85985555A36A012966D9B4F219C6C786 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 67D6E55E61A18B9FCEE8B47E22D4270C /* CoreFoundation.framework */; };
85CADF4495AC3FD0DED98ABE434C47DA /* YYSpriteSheetImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 3A4D78B7241EED991E9EA5767FFA5B35 /* YYSpriteSheetImage.m */; };
871A9CBDDEB8DB166D87217747B440BF /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A3B26ECE81C89075EAD21D4DF8B1D0 /* QuartzCore.framework */; };
8797F9B3FCF56C89B3D02D6C403B9B31 /* YYWebImageOperation.h in Headers */ = {isa = PBXBuildFile; fileRef = D67289DBF982BE4D6E7C5288DFDD80D4 /* YYWebImageOperation.h */; settings = {ATTRIBUTES = (Project, ); }; };
87D956671DDF22ED40C9EB4BA692DAFE /* AssetsLibrary.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A90BE5491E0D2F0314AC354A80EA7053 /* AssetsLibrary.framework */; };
88C85D77169D92CCB835699EE03BB8F2 /* MFDeviceManager.m in Sources */ = {isa = PBXBuildFile; fileRef = EBBF5E83328566742155402A3D1C09CD /* MFDeviceManager.m */; };
88DEFFC47ECD0BB02DE6EDF249D78375 /* UIButton+YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = EB0CE14D78EA969F1B653326808F7D2B /* UIButton+YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
89608D50EB882EB4B358E475F69E5798 /* YYWebImageOperation.m in Sources */ = {isa = PBXBuildFile; fileRef = 33FA4A8B527E5A40924E3FEE1B89917D /* YYWebImageOperation.m */; };
8DFE9DB7B082A4397A6583E5FE6AFDC7 /* MFCategory-dummy.m in Sources */ = {isa = PBXBuildFile; fileRef = CCDFCCE55F98E593534EDEC38283F3B9 /* MFCategory-dummy.m */; };
9196F9BF21D72D9ECB46EB0BC24FAEF5 /* YYFrameImage.h in Headers */ = {isa = PBXBuildFile; fileRef = 675B03562F0E45A550E100F786BE077C /* YYFrameImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
920E2B6A1C691D358B30FD5EFB417CC8 /* UIView+Shadow.m in Sources */ = {isa = PBXBuildFile; fileRef = 401CF9D9C2D2E35A473E570FD79E9C7F /* UIView+Shadow.m */; };
944BB684DC1C161FFC494A6EBEEE275D /* UIImageView+YYWebImage.m in Sources */ = {isa = PBXBuildFile; fileRef = FA90D34F39288E1B5D5DF41A2DC634D1 /* UIImageView+YYWebImage.m */; };
9497EB337FFFB7BF0E58AA7171047AE6 /* Accelerate.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A624E91122CB033D86EBD46036B82B28 /* Accelerate.framework */; };
94C286A53BA0D6F990F22F338376423D /* YYAnimatedImageView.h in Headers */ = {isa = PBXBuildFile; fileRef = A0B75EA0D37E0EB00EF90EBEECE8F36F /* YYAnimatedImageView.h */; settings = {ATTRIBUTES = (Project, ); }; };
94CAFB4DBD9B82564FDA21413629BF4D /* UIView+MFFrame.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F30AF9CF7BFF0B94E2B5C02264857B8 /* UIView+MFFrame.m */; };
97C5A226652C798FA68195BD204DC91F /* CALayer+YYWebImage.m in Sources */ = {isa = PBXBuildFile; fileRef = 8B35C2DBACDF44140CE0B83C15EC57B6 /* CALayer+YYWebImage.m */; };
99B03C4ECAB497CA6E198DD1BA03D46C /* MFSavePhotoManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 4472B7B0D062E373C0D16EB1E058BD69 /* MFSavePhotoManager.m */; };
9D7EC27377BEF6E1F431849144DC9E16 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1F5E026DFDC125DA63FB26DF3D0B33B /* Foundation.framework */; };
A43890A730F8817097457E7F1E38A96C /* NSDateFormatter+Cache.h in Headers */ = {isa = PBXBuildFile; fileRef = CD4AACB630F7D7EB7568A8E2A97EA292 /* NSDateFormatter+Cache.h */; settings = {ATTRIBUTES = (Project, ); }; };
A7F80D0C1B57144A1834B2D0EA8A0132 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A72DD915EC9DA0CB8E471AB1F10DEBE /* UIKit.framework */; };
A9C18E9904C01D8400886CFAA39469F5 /* NSString+MFMD5Encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = 582F0CFEA32A0FA96633974A3A6DEAE4 /* NSString+MFMD5Encoder.h */; settings = {ATTRIBUTES = (Project, ); }; };
AE1287B5E96B3DD6CBC14FA306B4A0E6 /* MFREManager.m in Sources */ = {isa = PBXBuildFile; fileRef = C0AB40AB5E8C0133BF01B633A9570247 /* MFREManager.m */; };
AEC270D9B9F21B35F6BC70BEFBA1BB86 /* YYKVStorage.m in Sources */ = {isa = PBXBuildFile; fileRef = 71AF685CEA0DE94748BE10A6E2A4C28A /* YYKVStorage.m */; };
AFC40425C34D6FD145E5812EB37D80E5 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A72DD915EC9DA0CB8E471AB1F10DEBE /* UIKit.framework */; };
B0AF6948FB992F59D834AA97DB4288F5 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = D0A3B26ECE81C89075EAD21D4DF8B1D0 /* QuartzCore.framework */; };
B9390AC9DCBDD7B25F1C803E3F1E5683 /* UIImage+Current.h in Headers */ = {isa = PBXBuildFile; fileRef = 3D848BE4180A8B73EA93D2DBBCE844AA /* UIImage+Current.h */; settings = {ATTRIBUTES = (Project, ); }; };
BA6CE1209CFB6AA4B7D6E5D15D1D9F98 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 7A72DD915EC9DA0CB8E471AB1F10DEBE /* UIKit.framework */; };
BCA78209FFEF4AB5E9A1377DBF06398F /* UIView+MFExpandTouchSize.h in Headers */ = {isa = PBXBuildFile; fileRef = 7CFD7E42176B883C53CCA3E944BCBF01 /* UIView+MFExpandTouchSize.h */; settings = {ATTRIBUTES = (Project, ); }; };
BDC66EF003D69B92E15B893541B4D75B /* YYImageCoder.h in Headers */ = {isa = PBXBuildFile; fileRef = B69CF91C0FF5CC8070422FBAB51E6A16 /* YYImageCoder.h */; settings = {ATTRIBUTES = (Project, ); }; };
BDDE29B59467D55BF3D9F40EDA6A3A2C /* YYWebImage.h in Headers */ = {isa = PBXBuildFile; fileRef = BC995431DC4629ECDF8001C10EA907EF /* YYWebImage.h */; settings = {ATTRIBUTES = (Project, ); }; };
C02C60E87116038B5D2D5BDB032E79DA /* NSString+MFBase64Encoder.h in Headers */ = {isa = PBXBuildFile; fileRef = E727DBDD2E743E74AD48638D4D16D6ED /* NSString+MFBase64Encoder.h */; settings = {ATTRIBUTES = (Project, ); }; };
C03783322E036B05A1D835BA5C704981 /* MFDeviceManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 5CDD0D8509D2F4E48EC3F67A86264C93 /* MFDeviceManager.h */; settings = {ATTRIBUTES = (Project, ); }; };
C235FE5994C4BF0EDC49E4C9450F9287 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A1F5E026DFDC125DA63FB26DF3D0B33B /* Foundation.framework */; };
C2D1AB19695E8C6623FAD8A998879E0A /* NSTimer+MFWeakTimer.h in Headers */ = {isa = PBXBuildFile; fileRef = 55EA1B819A72B60C758D04E15724A5B8 /* NSTimer+MFWeakTimer.h */; settings = {ATTRIBUTES = (Project, ); }; };
C6D2C35599DFD780092B6371B956842A /* UIView+MFFrame.h in Headers */ = {isa = PB
gitextract_yxwgostq/ ├── .gitignore ├── LICENSE ├── MFPictureBrowser.podspec ├── MFPictureBrowserDemo/ │ ├── MFPictureBrowserDemo/ │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Base.lproj/ │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Image.xcassets/ │ │ │ ├── 10.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 11.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 3.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 4.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 5.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 6.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 7.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 8.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── 9.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── Contents.json │ │ │ ├── ic_messages_pictype_gif_30x30_.imageset/ │ │ │ │ └── Contents.json │ │ │ ├── ic_messages_pictype_long_pic_30x30_.imageset/ │ │ │ │ └── Contents.json │ │ │ └── placeholder.imageset/ │ │ │ └── Contents.json │ │ ├── Info.plist │ │ ├── ListViewController.h │ │ ├── ListViewController.m │ │ ├── LocalImageViewController.h │ │ ├── LocalImageViewController.m │ │ ├── MFDisplayPhotoCollectionViewCell.h │ │ ├── MFDisplayPhotoCollectionViewCell.m │ │ ├── MFPictureBrowser/ │ │ │ ├── MFPictureBrowser.h │ │ │ ├── MFPictureBrowser.m │ │ │ ├── MFPictureModelProtocol.h │ │ │ ├── MFPictureView.h │ │ │ ├── MFPictureView.m │ │ │ ├── MFRunLoopDistribution.h │ │ │ ├── MFRunLoopDistribution.m │ │ │ ├── UIImage+ForceDecoded.h │ │ │ ├── UIImage+ForceDecoded.m │ │ │ ├── UIImageView+TransitionImage.h │ │ │ └── UIImageView+TransitionImage.m │ │ ├── MFPictureModel.h │ │ ├── MFPictureModel.m │ │ ├── RemoteImageViewController.h │ │ ├── RemoteImageViewController.m │ │ └── main.m │ ├── MFPictureBrowserDemo.xcodeproj/ │ │ ├── project.pbxproj │ │ └── project.xcworkspace/ │ │ └── contents.xcworkspacedata │ ├── MFPictureBrowserDemo.xcworkspace/ │ │ └── contents.xcworkspacedata │ ├── Podfile │ └── Pods/ │ ├── MFCategory/ │ │ ├── Classes/ │ │ │ ├── Manager/ │ │ │ │ ├── MFCookiesManager.h │ │ │ │ ├── MFCookiesManager.m │ │ │ │ ├── MFDeviceManager.h │ │ │ │ ├── MFDeviceManager.m │ │ │ │ ├── MFManager.h │ │ │ │ ├── MFManager.m │ │ │ │ ├── MFREManager.h │ │ │ │ ├── MFREManager.m │ │ │ │ ├── MFSavePhotoManager.h │ │ │ │ └── MFSavePhotoManager.m │ │ │ ├── NSArrayCategory/ │ │ │ │ ├── NSArray+Distinct.h │ │ │ │ └── NSArray+Distinct.m │ │ │ ├── NSDataCategory/ │ │ │ │ ├── NSData+MFHexString.h │ │ │ │ └── NSData+MFHexString.m │ │ │ ├── NSDateFormatterCategory/ │ │ │ │ ├── NSDateFormatter+Cache.h │ │ │ │ └── NSDateFormatter+Cache.m │ │ │ ├── NSStringCategory/ │ │ │ │ ├── NSString+File.h │ │ │ │ ├── NSString+File.m │ │ │ │ ├── NSString+MFBase64Encoder.h │ │ │ │ ├── NSString+MFBase64Encoder.m │ │ │ │ ├── NSString+MFMD5Encoder.h │ │ │ │ └── NSString+MFMD5Encoder.m │ │ │ ├── NSTimerCategory/ │ │ │ │ ├── NSTimer+MFWeakTimer.h │ │ │ │ └── NSTimer+MFWeakTimer.m │ │ │ ├── UIColorCategory/ │ │ │ │ ├── UIColor+MFHexColor.h │ │ │ │ ├── UIColor+MFHexColor.m │ │ │ │ ├── UIColor+MFLDColor.h │ │ │ │ └── UIColor+MFLDColor.m │ │ │ ├── UIImageCategory/ │ │ │ │ ├── UIImage+Current.h │ │ │ │ └── UIImage+Current.m │ │ │ └── UIViewCategory/ │ │ │ ├── UIView+MFExpandTouchSize.h │ │ │ ├── UIView+MFExpandTouchSize.m │ │ │ ├── UIView+MFFrame.h │ │ │ ├── UIView+MFFrame.m │ │ │ ├── UIView+MFSnapshot.h │ │ │ ├── UIView+MFSnapshot.m │ │ │ ├── UIView+Shadow.h │ │ │ └── UIView+Shadow.m │ │ ├── LICENSE │ │ └── README.md │ ├── Pods.xcodeproj/ │ │ └── project.pbxproj │ ├── Target Support Files/ │ │ ├── MFCategory/ │ │ │ ├── MFCategory-dummy.m │ │ │ ├── MFCategory-prefix.pch │ │ │ └── MFCategory.xcconfig │ │ ├── Pods-MFPictureBrowserDemo/ │ │ │ ├── Pods-MFPictureBrowserDemo-acknowledgements.markdown │ │ │ ├── Pods-MFPictureBrowserDemo-acknowledgements.plist │ │ │ ├── Pods-MFPictureBrowserDemo-dummy.m │ │ │ ├── Pods-MFPictureBrowserDemo-frameworks.sh │ │ │ ├── Pods-MFPictureBrowserDemo-resources.sh │ │ │ ├── Pods-MFPictureBrowserDemo.debug.xcconfig │ │ │ └── Pods-MFPictureBrowserDemo.release.xcconfig │ │ ├── YYCache/ │ │ │ ├── YYCache-dummy.m │ │ │ ├── YYCache-prefix.pch │ │ │ └── YYCache.xcconfig │ │ ├── YYImage/ │ │ │ ├── YYImage-dummy.m │ │ │ ├── YYImage-prefix.pch │ │ │ └── YYImage.xcconfig │ │ └── YYWebImage/ │ │ ├── YYWebImage-dummy.m │ │ ├── YYWebImage-prefix.pch │ │ └── YYWebImage.xcconfig │ ├── YYCache/ │ │ ├── LICENSE │ │ ├── README.md │ │ └── YYCache/ │ │ ├── YYCache.h │ │ ├── YYCache.m │ │ ├── YYDiskCache.h │ │ ├── YYDiskCache.m │ │ ├── YYKVStorage.h │ │ ├── YYKVStorage.m │ │ ├── YYMemoryCache.h │ │ └── YYMemoryCache.m │ ├── YYImage/ │ │ ├── LICENSE │ │ ├── README.md │ │ ├── Vendor/ │ │ │ └── WebP.framework/ │ │ │ ├── Headers/ │ │ │ │ ├── config.h │ │ │ │ ├── decode.h │ │ │ │ ├── demux.h │ │ │ │ ├── encode.h │ │ │ │ ├── extras.h │ │ │ │ ├── format_constants.h │ │ │ │ ├── mux.h │ │ │ │ ├── mux_types.h │ │ │ │ └── types.h │ │ │ └── WebP │ │ └── YYImage/ │ │ ├── YYAnimatedImageView.h │ │ ├── YYAnimatedImageView.m │ │ ├── YYFrameImage.h │ │ ├── YYFrameImage.m │ │ ├── YYImage.h │ │ ├── YYImage.m │ │ ├── YYImageCoder.h │ │ ├── YYImageCoder.m │ │ ├── YYSpriteSheetImage.h │ │ └── YYSpriteSheetImage.m │ └── YYWebImage/ │ ├── LICENSE │ ├── README.md │ └── YYWebImage/ │ ├── Categories/ │ │ ├── CALayer+YYWebImage.h │ │ ├── CALayer+YYWebImage.m │ │ ├── MKAnnotationView+YYWebImage.h │ │ ├── MKAnnotationView+YYWebImage.m │ │ ├── UIButton+YYWebImage.h │ │ ├── UIButton+YYWebImage.m │ │ ├── UIImage+YYWebImage.h │ │ ├── UIImage+YYWebImage.m │ │ ├── UIImageView+YYWebImage.h │ │ ├── UIImageView+YYWebImage.m │ │ ├── _YYWebImageSetter.h │ │ └── _YYWebImageSetter.m │ ├── YYImageCache.h │ ├── YYImageCache.m │ ├── YYWebImage.h │ ├── YYWebImageManager.h │ ├── YYWebImageManager.m │ ├── YYWebImageOperation.h │ └── YYWebImageOperation.m └── README.md
SYMBOL INDEX (83 symbols across 9 files)
FILE: MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureModelProtocol.h
type MFImageTypeUnknown (line 7) | typedef NS_ENUM(NSInteger, MFImageType) {
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/decode.h
type WebPRGBABuffer (line 29) | typedef struct WebPRGBABuffer WebPRGBABuffer;
type WebPYUVABuffer (line 30) | typedef struct WebPYUVABuffer WebPYUVABuffer;
type WebPDecBuffer (line 31) | typedef struct WebPDecBuffer WebPDecBuffer;
type WebPIDecoder (line 32) | typedef struct WebPIDecoder WebPIDecoder;
type WebPBitstreamFeatures (line 33) | typedef struct WebPBitstreamFeatures WebPBitstreamFeatures;
type WebPDecoderOptions (line 34) | typedef struct WebPDecoderOptions WebPDecoderOptions;
type WebPDecoderConfig (line 35) | typedef struct WebPDecoderConfig WebPDecoderConfig;
type WEBP_CSP_MODE (line 146) | typedef enum WEBP_CSP_MODE {
function WEBP_INLINE (line 162) | static WEBP_INLINE int WebPIsPremultipliedMode(WEBP_CSP_MODE mode) {
function WEBP_INLINE (line 167) | static WEBP_INLINE int WebPIsAlphaMode(WEBP_CSP_MODE mode) {
function WEBP_INLINE (line 173) | static WEBP_INLINE int WebPIsRGBMode(WEBP_CSP_MODE mode) {
type WebPRGBABuffer (line 180) | struct WebPRGBABuffer { // view as RGBA
type WebPYUVABuffer (line 186) | struct WebPYUVABuffer { // view as YUVA
type WebPDecBuffer (line 197) | struct WebPDecBuffer {
function WEBP_INLINE (line 217) | static WEBP_INLINE int WebPInitDecBuffer(WebPDecBuffer* buffer) {
type VP8StatusCode (line 228) | typedef enum VP8StatusCode {
function WEBP_INLINE (line 355) | static WEBP_INLINE uint8_t* WebPIDecGetYUV(
type WebPBitstreamFeatures (line 405) | struct WebPBitstreamFeatures {
function WEBP_INLINE (line 424) | static WEBP_INLINE VP8StatusCode WebPGetFeatures(
type WebPDecoderOptions (line 432) | struct WebPDecoderOptions {
type WebPDecoderConfig (line 450) | struct WebPDecoderConfig {
function WEBP_INLINE (line 462) | static WEBP_INLINE int WebPInitDecoderConfig(WebPDecoderConfig* config) {
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/demux.h
type WebPDemuxer (line 64) | typedef struct WebPDemuxer WebPDemuxer;
type WebPIterator (line 65) | typedef struct WebPIterator WebPIterator;
type WebPChunkIterator (line 66) | typedef struct WebPChunkIterator WebPChunkIterator;
type WebPAnimInfo (line 67) | typedef struct WebPAnimInfo WebPAnimInfo;
type WebPAnimDecoderOptions (line 68) | typedef struct WebPAnimDecoderOptions WebPAnimDecoderOptions;
type WebPDemuxState (line 79) | typedef enum WebPDemuxState {
function WEBP_INLINE (line 94) | static WEBP_INLINE WebPDemuxer* WebPDemux(const WebPData* data) {
function WEBP_INLINE (line 106) | static WEBP_INLINE WebPDemuxer* WebPDemuxPartial(
type WebPFormatFeature (line 117) | typedef enum WebPFormatFeature {
type WebPIterator (line 138) | struct WebPIterator {
type WebPChunkIterator (line 180) | struct WebPChunkIterator {
type WebPAnimDecoder (line 243) | typedef struct WebPAnimDecoder WebPAnimDecoder;
type WebPAnimDecoderOptions (line 246) | struct WebPAnimDecoderOptions {
function WEBP_INLINE (line 262) | static WEBP_INLINE int WebPAnimDecoderOptionsInit(
function WEBP_INLINE (line 282) | static WEBP_INLINE WebPAnimDecoder* WebPAnimDecoderNew(
type WebPAnimInfo (line 289) | struct WebPAnimInfo {
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/encode.h
type WebPConfig (line 31) | typedef struct WebPConfig WebPConfig;
type WebPPicture (line 32) | typedef struct WebPPicture WebPPicture;
type WebPAuxStats (line 33) | typedef struct WebPAuxStats WebPAuxStats;
type WebPMemoryWriter (line 34) | typedef struct WebPMemoryWriter WebPMemoryWriter;
type WebPImageHint (line 85) | typedef enum WebPImageHint {
type WebPConfig (line 94) | struct WebPConfig {
type WebPPreset (line 154) | typedef enum WebPPreset {
function WEBP_INLINE (line 170) | static WEBP_INLINE int WebPConfigInit(WebPConfig* config) {
function WEBP_INLINE (line 179) | static WEBP_INLINE int WebPConfigPreset(WebPConfig* config,
type WebPAuxStats (line 201) | struct WebPAuxStats {
type WebPMemoryWriter (line 239) | struct WebPMemoryWriter {
type WebPEncCSP (line 264) | typedef enum WebPEncCSP {
type WebPEncodingError (line 273) | typedef enum WebPEncodingError {
type WebPPicture (line 292) | struct WebPPicture {
function WEBP_INLINE (line 365) | static WEBP_INLINE int WebPPictureInit(WebPPicture* picture) {
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/format_constants.h
type VP8LImageTransformType (line 55) | typedef enum {
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/mux.h
type WebPMux (line 67) | typedef struct WebPMux WebPMux;
type WebPMuxFrameInfo (line 68) | typedef struct WebPMuxFrameInfo WebPMuxFrameInfo;
type WebPMuxAnimParams (line 69) | typedef struct WebPMuxAnimParams WebPMuxAnimParams;
type WebPAnimEncoderOptions (line 70) | typedef struct WebPAnimEncoderOptions WebPAnimEncoderOptions;
type WebPMuxError (line 73) | typedef enum WebPMuxError {
type WebPChunkId (line 83) | typedef enum WebPChunkId {
function WEBP_INLINE (line 113) | static WEBP_INLINE WebPMux* WebPMuxNew(void) {
function WEBP_INLINE (line 136) | static WEBP_INLINE WebPMux* WebPMuxCreate(const WebPData* bitstream,
type WebPMuxFrameInfo (line 199) | struct WebPMuxFrameInfo {
type WebPMuxAnimParams (line 282) | struct WebPMuxAnimParams {
type WebPAnimEncoder (line 418) | typedef struct WebPAnimEncoder WebPAnimEncoder;
type WebPPicture (line 421) | struct WebPPicture
type WebPConfig (line 422) | struct WebPConfig
type WebPAnimEncoderOptions (line 425) | struct WebPAnimEncoderOptions {
function WEBP_INLINE (line 452) | static WEBP_INLINE int WebPAnimEncoderOptionsInit(
function WEBP_INLINE (line 469) | static WEBP_INLINE WebPAnimEncoder* WebPAnimEncoderNew(
type WebPPicture (line 494) | struct WebPPicture
type WebPConfig (line 495) | struct WebPConfig
FILE: MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/mux_types.h
type WebPData (line 30) | typedef struct WebPData WebPData;
type WebPFeatureFlags (line 33) | typedef enum WebPFeatureFlags {
type WebPMuxAnimDispose (line 44) | typedef enum WebPMuxAnimDispose {
type WebPMuxAnimBlend (line 51) | typedef enum WebPMuxAnimBlend {
type WebPData (line 58) | struct WebPData {
function WEBP_INLINE (line 64) | static WEBP_INLINE void WebPDataInit(WebPData* webp_data) {
function WEBP_INLINE (line 72) | static WEBP_INLINE void WebPDataClear(WebPData* webp_data) {
function WEBP_INLINE (line 81) | static WEBP_INLINE int WebPDataCopy(const WebPData* src, WebPData* dst) {
FILE: MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/_YYWebImageSetter.h
function NS_ASSUME_NONNULL_BEGIN (line 20) | NS_ASSUME_NONNULL_BEGIN
FILE: MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImageManager.h
type UIImage (line 142) | typedef UIImage * _Nullable (^YYWebImageTransformBlock)(UIImage *image, ...
Condensed preview — 161 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (974K chars).
[
{
"path": ".gitignore",
"chars": 1637,
"preview": "\n# Created by https://www.gitignore.io/api/macos,objective-c\n\n### macOS ###\n*.DS_Store\n.AppleDouble\n.LSOverride\n\n# Icon "
},
{
"path": "LICENSE",
"chars": 1059,
"preview": "MIT License\n\nCopyright (c) 2018 清风\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this"
},
{
"path": "MFPictureBrowser.podspec",
"chars": 4022,
"preview": "#\n# Be sure to run `pod spec lint MFPictureBrowser.podspec' to ensure this is a\n# valid spec and to remove all comment"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/AppDelegate.h",
"chars": 145,
"preview": "\n\n#import <UIKit/UIKit.h>\n\n@interface AppDelegate : UIResponder <UIApplicationDelegate>\n\n@property (strong, nonatomic) U"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/AppDelegate.m",
"chars": 2031,
"preview": "\n\n#import \"AppDelegate.h\"\n#import <YYWebImage/YYWebImage.h>\n@interface AppDelegate ()\n\n@end\n\n@implementation AppDelegate"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Base.lproj/LaunchScreen.storyboard",
"chars": 1681,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Base.lproj/Main.storyboard",
"chars": 3005,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<document type=\"com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB\" version=\"3"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/10.imageset/Contents.json",
"chars": 299,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"10.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/11.imageset/Contents.json",
"chars": 299,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"11.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/3.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"3.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/4.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"4.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/5.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"5.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/6.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"6.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/7.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"7.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/8.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"8.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/9.imageset/Contents.json",
"chars": 298,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"filename\" : \"9.jpg\",\n \"scale\" : \"1x\"\n },\n {\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/Contents.json",
"chars": 62,
"preview": "{\n \"info\" : {\n \"version\" : 1,\n \"author\" : \"xcode\"\n }\n}"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/ic_messages_pictype_gif_30x30_.imageset/Contents.json",
"chars": 330,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/ic_messages_pictype_long_pic_30x30_.imageset/Contents.json",
"chars": 335,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Image.xcassets/placeholder.imageset/Contents.json",
"chars": 352,
"preview": "{\n \"images\" : [\n {\n \"idiom\" : \"universal\",\n \"scale\" : \"1x\"\n },\n {\n \"idiom\" : \"universal\",\n "
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/Info.plist",
"chars": 1492,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/ListViewController.h",
"chars": 82,
"preview": "\n\n#import <UIKit/UIKit.h>\n\n@interface ListViewController : UIViewController\n\n@end\n"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/ListViewController.m",
"chars": 9634,
"preview": "\n\n#import \"ListViewController.h\"\n#import \"RemoteImageViewController.h\"\n#import \"LocalImageViewController.h\"\n#import \"MFP"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/LocalImageViewController.h",
"chars": 142,
"preview": "\n\n#import <UIKit/UIKit.h>\n\n@interface LocalImageViewController : UIViewController\n@property (nonatomic, strong) NSMutabl"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/LocalImageViewController.m",
"chars": 9567,
"preview": "\n\n#import \"LocalImageViewController.h\"\n#import \"MFPictureBrowser.h\"\n#import \"MFDisplayPhotoCollectionViewCell.h\"\n#import"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFDisplayPhotoCollectionViewCell.h",
"chars": 312,
"preview": "\n\n#import <UIKit/UIKit.h>\n#import <YYImage/YYAnimatedImageView.h>\n@interface MFDisplayPhotoCollectionViewCell : UICollec"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFDisplayPhotoCollectionViewCell.m",
"chars": 1165,
"preview": "\n\n#import \"MFDisplayPhotoCollectionViewCell.h\"\n\n@implementation MFDisplayPhotoCollectionViewCell\n- (instancetype)initWit"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureBrowser.h",
"chars": 2176,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <UIKit/UIKit.h>\n#import \"MFPictureModelProtocol.h\"\n@class"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureBrowser.m",
"chars": 10233,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import \"MFPictureBrowser.h\"\n#import \"MFPictureView.h\"\n#import <M"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureModelProtocol.h",
"chars": 804,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <Foundation/Foundation.h>\n#import <UIKit/UIKit.h>\n#import"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureView.h",
"chars": 1686,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <UIKit/UIKit.h>\n#import \"MFPictureModelProtocol.h\"\n#impor"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFPictureView.m",
"chars": 36519,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import \"MFPictureView.h\"\n#import \"UIImageView+TransitionImage.h\""
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFRunLoopDistribution.h",
"chars": 318,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <Foundation/Foundation.h>\ntypedef BOOL(^MFRunLoopDistribu"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/MFRunLoopDistribution.m",
"chars": 3132,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import \"MFRunLoopDistribution.h\"\n#import <objc/runtime.h>\n\n@inte"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImage+ForceDecoded.h",
"chars": 257,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <UIKit/UIKit.h>\n\n@interface UIImage (ForceDecoded)\n+ (UII"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImage+ForceDecoded.m",
"chars": 5925,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import \"UIImage+ForceDecoded.h\"\n\n@implementation UIImage (ForceD"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImageView+TransitionImage.h",
"chars": 176,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import <UIKit/UIKit.h>\n\n@interface UIImageView (TransitionImage)"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureBrowser/UIImageView+TransitionImage.m",
"chars": 468,
"preview": "\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n\n#import \"UIImageView+TransitionImage.h\"\n\n@implementation UIImageV"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureModel.h",
"chars": 1212,
"preview": "\n\n#import <Foundation/Foundation.h>\n#import \"MFPictureModelProtocol.h\"\n@interface MFPictureModel : NSObject\n<\nMFPictureM"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/MFPictureModel.m",
"chars": 1514,
"preview": "\n\n#import \"MFPictureModel.h\"\n\n@implementation MFPictureModel\n- (instancetype)initWithURL:(NSString *)imageURL imageName:"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/RemoteImageViewController.h",
"chars": 143,
"preview": "\n\n#import <UIKit/UIKit.h>\n\n@interface RemoteImageViewController : UIViewController\n@property (nonatomic, strong) NSMutab"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/RemoteImageViewController.m",
"chars": 8962,
"preview": "\n\n#import \"RemoteImageViewController.h\"\n#import \"MFPictureBrowser.h\"\n#import \"MFDisplayPhotoCollectionViewCell.h\"\n#impor"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo/main.m",
"chars": 334,
"preview": "//\n// main.m\n// MFPictureBrowserDemo\n//\n// Created by 张冬冬 on 2018/4/17.\n// Copyright © 2018年 张冬冬. All rights reserve"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo.xcodeproj/project.pbxproj",
"chars": 25103,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 48;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata",
"chars": 165,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"self:MFPictureBrowse"
},
{
"path": "MFPictureBrowserDemo/MFPictureBrowserDemo.xcworkspace/contents.xcworkspacedata",
"chars": 238,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<Workspace\n version = \"1.0\">\n <FileRef\n location = \"group:MFPictureBrows"
},
{
"path": "MFPictureBrowserDemo/Podfile",
"chars": 330,
"preview": "# Uncomment the next line to define a global platform for your project\n# platform :ios, '9.0'\n\ntarget 'MFPictureBrowserD"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFCookiesManager.h",
"chars": 254,
"preview": "//\n// MFCookiesManager.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFCookiesManager.m",
"chars": 951,
"preview": "//\n// MFCookiesManager.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"MFCookiesM"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFDeviceManager.h",
"chars": 516,
"preview": "//\n// MFDeviceManager.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation/"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFDeviceManager.m",
"chars": 3205,
"preview": "//\n// MFDeviceManager.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"MFDeviceMan"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFManager.h",
"chars": 304,
"preview": "//\n// MFManager.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation/Founda"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFManager.m",
"chars": 1032,
"preview": "//\n// MFManager.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"MFManager.h\"\n@imp"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFREManager.h",
"chars": 280,
"preview": "//\n// MFREManager.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation/Foun"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFREManager.m",
"chars": 1629,
"preview": "//\n// MFREManager.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"MFREManager.h\"\n"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFSavePhotoManager.h",
"chars": 899,
"preview": "//\n// MFSavePhotoManager.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundati"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/Manager/MFSavePhotoManager.m",
"chars": 1572,
"preview": "//\n// MFSavePhotoManager.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"MFSavePh"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSArrayCategory/NSArray+Distinct.h",
"chars": 229,
"preview": "//\n// NSArray+Distinct.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSArrayCategory/NSArray+Distinct.m",
"chars": 306,
"preview": "//\n// NSArray+Distinct.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSArray+Di"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDataCategory/NSData+MFHexString.h",
"chars": 237,
"preview": "//\n// NSData+MFHexString.m\n\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDataCategory/NSData+MFHexString.m",
"chars": 1029,
"preview": "//\n// NSData+MFHexString.m\n\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSData+MFH"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDateFormatterCategory/NSDateFormatter+Cache.h",
"chars": 213,
"preview": "//\n// NSDateFormatter+Cache.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Found"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSDateFormatterCategory/NSDateFormatter+Cache.m",
"chars": 430,
"preview": "//\n// NSDateFormatter+Cache.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSDat"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+File.h",
"chars": 269,
"preview": "//\n// NSString+File.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundation/Fo"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+File.m",
"chars": 808,
"preview": "//\n// NSString+File.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSString+File"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFBase64Encoder.h",
"chars": 216,
"preview": "//\n// NSString+MFBase64Encoder.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Fo"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFBase64Encoder.m",
"chars": 345,
"preview": "//\n// NSString+MFBase64Encoder.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NS"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFMD5Encoder.h",
"chars": 206,
"preview": "//\n// NSString+MFMD5Encoder.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Found"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSStringCategory/NSString+MFMD5Encoder.m",
"chars": 600,
"preview": "//\n// NSString+MFMD5Encoder.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSStr"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSTimerCategory/NSTimer+MFWeakTimer.h",
"chars": 336,
"preview": "//\n// NSTimer+MFWeakTimer.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <Foundat"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/NSTimerCategory/NSTimer+MFWeakTimer.m",
"chars": 775,
"preview": "//\n// NSTimer+MFWeakTimer.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"NSTimer"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFHexColor.h",
"chars": 321,
"preview": "//\n// UIColor+MFHexColor.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UIKit/UI"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFHexColor.m",
"chars": 1956,
"preview": "//\n// UIColor+MFHexColor.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UIColor+"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFLDColor.h",
"chars": 186,
"preview": "//\n// UIColor+MFLDColor.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UIKit/UIK"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIColorCategory/UIColor+MFLDColor.m",
"chars": 1542,
"preview": "//\n// UIColor+MFLDColor.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UIColor+M"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIImageCategory/UIImage+Current.h",
"chars": 212,
"preview": "//\n// UIImage+Current.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UIKit/UIKit"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIImageCategory/UIImage+Current.m",
"chars": 477,
"preview": "//\n// UIImage+Current.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UIImage+Cur"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFExpandTouchSize.h",
"chars": 237,
"preview": "//\n// UIView+MFExpandTouchSize.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UI"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFExpandTouchSize.m",
"chars": 1823,
"preview": "//\n// UIView+MFExpandTouchSize.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UI"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFFrame.h",
"chars": 418,
"preview": "//\n// UIView+MFFrame.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UIKit/UIKit."
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFFrame.m",
"chars": 1079,
"preview": "//\n// UIView+MFFrame.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UIView+MFFra"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFSnapshot.h",
"chars": 218,
"preview": "//\n// UIView+MFSnapshot.h\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import <UIKit/UIK"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+MFSnapshot.m",
"chars": 793,
"preview": "//\n// UIView+MFSnapshot.m\n//\n// Created by 张冬冬.\n// Copyright © 2018年 张冬冬. All rights reserved.\n//\n\n#import \"UIView+MF"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+Shadow.h",
"chars": 237,
"preview": "//\n// UIView+Shadow.m\n// Created by pipelining.\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n//\n\n#import <UIKi"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/Classes/UIViewCategory/UIView+Shadow.m",
"chars": 453,
"preview": "//\n// UIView+Shadow.m\n// Created by pipelining.\n// Copyright © 2018年 GodzzZZZ. All rights reserved.\n//\n\n#import \"UIVi"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/LICENSE",
"chars": 1065,
"preview": "MIT License\n\nCopyright (c) 2018 GodzzZZZ\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\no"
},
{
"path": "MFPictureBrowserDemo/Pods/MFCategory/README.md",
"chars": 20,
"preview": "# MFCategory\nOC常用分类\n"
},
{
"path": "MFPictureBrowserDemo/Pods/Pods.xcodeproj/project.pbxproj",
"chars": 90715,
"preview": "// !$*UTF8*$!\n{\n\tarchiveVersion = 1;\n\tclasses = {\n\t};\n\tobjectVersion = 48;\n\tobjects = {\n\n/* Begin PBXBuildFile section *"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/MFCategory/MFCategory-dummy.m",
"chars": 124,
"preview": "#import <Foundation/Foundation.h>\n@interface PodsDummy_MFCategory : NSObject\n@end\n@implementation PodsDummy_MFCategory\n@"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/MFCategory/MFCategory-prefix.pch",
"chars": 195,
"preview": "#ifdef __OBJC__\n#import <UIKit/UIKit.h>\n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPO"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/MFCategory/MFCategory.xcconfig",
"chars": 649,
"preview": "CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/MFCategory\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPO"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo-acknowledgements.markdown",
"chars": 4545,
"preview": "# Acknowledgements\nThis application makes use of the following third party libraries:\n\n## MFCategory\n\nMIT License\n\nCopyr"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo-acknowledgements.plist",
"chars": 6039,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!DOCTYPE plist PUBLIC \"-//Apple//DTD PLIST 1.0//EN\" \"http://www.apple.com/DTDs/P"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo-dummy.m",
"chars": 154,
"preview": "#import <Foundation/Foundation.h>\n@interface PodsDummy_Pods_MFPictureBrowserDemo : NSObject\n@end\n@implementation PodsDum"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo-frameworks.sh",
"chars": 6756,
"preview": "#!/bin/sh\nset -e\nset -u\nset -o pipefail\n\nif [ -z ${FRAMEWORKS_FOLDER_PATH+x} ]; then\n # If FRAMEWORKS_FOLDER_PATH is "
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo-resources.sh",
"chars": 6326,
"preview": "#!/bin/sh\nset -e\nset -u\nset -o pipefail\n\nif [ -z ${UNLOCALIZED_RESOURCES_FOLDER_PATH+x} ]; then\n # If UNLOCALIZED_RES"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo.debug.xcconfig",
"chars": 1329,
"preview": "FRAMEWORK_SEARCH_PATHS = $(inherited) \"${PODS_ROOT}/YYImage/Vendor\"\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPOD"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/Pods-MFPictureBrowserDemo/Pods-MFPictureBrowserDemo.release.xcconfig",
"chars": 1329,
"preview": "FRAMEWORK_SEARCH_PATHS = $(inherited) \"${PODS_ROOT}/YYImage/Vendor\"\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPOD"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYCache/YYCache-dummy.m",
"chars": 118,
"preview": "#import <Foundation/Foundation.h>\n@interface PodsDummy_YYCache : NSObject\n@end\n@implementation PodsDummy_YYCache\n@end\n"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYCache/YYCache-prefix.pch",
"chars": 195,
"preview": "#ifdef __OBJC__\n#import <UIKit/UIKit.h>\n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPO"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYCache/YYCache.xcconfig",
"chars": 677,
"preview": "CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYCache\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS="
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYImage/YYImage-dummy.m",
"chars": 118,
"preview": "#import <Foundation/Foundation.h>\n@interface PodsDummy_YYImage : NSObject\n@end\n@implementation PodsDummy_YYImage\n@end\n"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYImage/YYImage-prefix.pch",
"chars": 195,
"preview": "#ifdef __OBJC__\n#import <UIKit/UIKit.h>\n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPO"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYImage/YYImage.xcconfig",
"chars": 861,
"preview": "CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYImage\nFRAMEWORK_SEARCH_PATHS = $(inherited) \"${PODS_ROOT}/YY"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYWebImage/YYWebImage-dummy.m",
"chars": 124,
"preview": "#import <Foundation/Foundation.h>\n@interface PodsDummy_YYWebImage : NSObject\n@end\n@implementation PodsDummy_YYWebImage\n@"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYWebImage/YYWebImage-prefix.pch",
"chars": 195,
"preview": "#ifdef __OBJC__\n#import <UIKit/UIKit.h>\n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPO"
},
{
"path": "MFPictureBrowserDemo/Pods/Target Support Files/YYWebImage/YYWebImage.xcconfig",
"chars": 977,
"preview": "CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/YYWebImage\nGCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPO"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/LICENSE",
"chars": 1095,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 ibireme <ibireme@gmail.com>\n\nPermission is hereby granted, free of charge, to "
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/README.md",
"chars": 4921,
"preview": "YYCache\n==============\n\n[](https://raw.gith"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYCache.h",
"chars": 7583,
"preview": "//\n// YYCache.h\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/13.\n// Copyright (c"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYCache.m",
"chars": 4360,
"preview": "//\n// YYCache.m\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/13.\n// Copyright (c"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYDiskCache.h",
"chars": 14886,
"preview": "//\n// YYDiskCache.h\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/11.\n// Copyrigh"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYDiskCache.m",
"chars": 13320,
"preview": "//\n// YYDiskCache.m\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/11.\n// Copyrigh"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYKVStorage.h",
"chars": 11290,
"preview": "//\n// YYKVStorage.h\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/4/22.\n// Copyrigh"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYKVStorage.m",
"chars": 38734,
"preview": "//\n// YYKVStorage.m\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/4/22.\n// Copyrigh"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYMemoryCache.h",
"chars": 7045,
"preview": "//\n// YYMemoryCache.h\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/7.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYCache/YYCache/YYMemoryCache.m",
"chars": 14989,
"preview": "//\n// YYMemoryCache.m\n// YYCache <https://github.com/ibireme/YYCache>\n//\n// Created by ibireme on 15/2/7.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/LICENSE",
"chars": 1095,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 ibireme <ibireme@gmail.com>\n\nPermission is hereby granted, free of charge, to "
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/README.md",
"chars": 12530,
"preview": "YYImage\n==============\n[](https://raw.githu"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/config.h",
"chars": 4077,
"preview": "/* src/webp/config.h. Generated from config.h.in by configure. */\n/* src/webp/config.h.in. Generated from configure.a"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/decode.h",
"chars": 22526,
"preview": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/demux.h",
"chars": 15235,
"preview": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/encode.h",
"chars": 26298,
"preview": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/extras.h",
"chars": 1874,
"preview": "// Copyright 2015 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/format_constants.h",
"chars": 3930,
"preview": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/mux.h",
"chars": 22885,
"preview": "// Copyright 2011 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/mux_types.h",
"chars": 3149,
"preview": "// Copyright 2012 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/Vendor/WebP.framework/Headers/types.h",
"chars": 1687,
"preview": "// Copyright 2010 Google Inc. All Rights Reserved.\n//\n// Use of this source code is governed by a BSD-style license\n// t"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYAnimatedImageView.h",
"chars": 4376,
"preview": "//\n// YYAnimatedImageView.h\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/10/19.\n// "
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYAnimatedImageView.m",
"chars": 23375,
"preview": "//\n// YYAnimatedImageView.m\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/10/19.\n// "
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYFrameImage.h",
"chars": 3905,
"preview": "//\n// YYFrameImage.h\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/12/9.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYFrameImage.m",
"chars": 5398,
"preview": "//\n// YYFrameImage.m\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/12/9.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYImage.h",
"chars": 2998,
"preview": "//\n// YYImage.h\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/10/20.\n// Copyright ("
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYImage.m",
"chars": 8936,
"preview": "//\n// YYImage.m\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 14/10/20.\n// Copyright ("
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYImageCoder.h",
"chars": 18507,
"preview": "//\n// YYImageCoder.h\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 15/5/13.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYImageCoder.m",
"chars": 114209,
"preview": "//\n// YYImageCoder.m\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 15/5/13.\n// Copyrig"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYSpriteSheetImage.h",
"chars": 3549,
"preview": "//\n// YYSpriteImage.h\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 15/4/21.\n// Copyri"
},
{
"path": "MFPictureBrowserDemo/Pods/YYImage/YYImage/YYSpriteSheetImage.m",
"chars": 2553,
"preview": "//\n// YYSpriteImage.m\n// YYImage <https://github.com/ibireme/YYImage>\n//\n// Created by ibireme on 15/4/21.\n// Copyri"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/LICENSE",
"chars": 1095,
"preview": "The MIT License (MIT)\n\nCopyright (c) 2015 ibireme <ibireme@gmail.com>\n\nPermission is hereby granted, free of charge, to "
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/README.md",
"chars": 9825,
"preview": "YYWebImage\n==============\n[](https://raw.gi"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/CALayer+YYWebImage.h",
"chars": 4137,
"preview": "//\n// CALayer+YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/23."
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/CALayer+YYWebImage.m",
"chars": 7626,
"preview": "//\n// CALayer+YYWebImage.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/23."
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/MKAnnotationView+YYWebImage.h",
"chars": 4096,
"preview": "//\n// MKAnnotationView+YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/MKAnnotationView+YYWebImage.m",
"chars": 7669,
"preview": "//\n// MKAnnotationView+YYWebImage.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIButton+YYWebImage.h",
"chars": 9271,
"preview": "//\n// UIButton+YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/23"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIButton+YYWebImage.m",
"chars": 18681,
"preview": "//\n// UIButton+YYWebImage.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/23"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIImage+YYWebImage.h",
"chars": 10645,
"preview": "//\n// UIImage+YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 13/4/4.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIImage+YYWebImage.m",
"chars": 30607,
"preview": "//\n// UIImage+YYWebImage.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 13/4/4.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIImageView+YYWebImage.h",
"chars": 7903,
"preview": "//\n// UIImageView+YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/UIImageView+YYWebImage.m",
"chars": 15523,
"preview": "//\n// UIImageView+YYWebImage.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/_YYWebImageSetter.h",
"chars": 2120,
"preview": "//\n// _YYWebImageSetter.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/7/15.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/Categories/_YYWebImageSetter.m",
"chars": 3266,
"preview": "//\n// _YYWebImageSetter.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/7/15.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYImageCache.h",
"chars": 8530,
"preview": "//\n// YYImageCache.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/15.\n// C"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYImageCache.m",
"chars": 8797,
"preview": "//\n// YYImageCache.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/15.\n// C"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImage.h",
"chars": 1888,
"preview": "//\n// YYWebImage.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/23.\n// Cop"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImageManager.h",
"chars": 10529,
"preview": "//\n// YYWebImageManager.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/19.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImageManager.m",
"chars": 6654,
"preview": "//\n// YYWebImageManager.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/19.\n"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImageOperation.h",
"chars": 4112,
"preview": "//\n// YYWebImageOperation.h\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/15"
},
{
"path": "MFPictureBrowserDemo/Pods/YYWebImage/YYWebImage/YYWebImageOperation.m",
"chars": 33190,
"preview": "//\n// YYWebImageOperation.m\n// YYWebImage <https://github.com/ibireme/YYWebImage>\n//\n// Created by ibireme on 15/2/15"
},
{
"path": "README.md",
"chars": 1648,
"preview": "# [废弃]MFPictureBrowser\n\n类似于<即刻>应用的图片浏览器效果(支持PNG, JPG, GIF, WebP).\n\n\n![Tot"
}
]
// ... and 1 more files (download for full content)
About this extraction
This page contains the full source code of the GodzzZZZ/MFPictureBrowser GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 161 files (896.3 KB), approximately 239.7k tokens, and a symbol index with 83 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.