├── DWAsyncLayer ├── DWAsyncLayer.h └── DWAsyncLayer.m ├── DWAuthorizationTool ├── DWAuthorizationTool.h └── DWAuthorizationTool.m ├── DWButtonUtils ├── UIButton+DWButtonUtils.h └── UIButton+DWButtonUtils.m ├── DWCameraManager ├── DWCameraManager.h └── DWCameraManager.m ├── DWColorUtils ├── UIColor+DWColorUtils.h └── UIColor+DWColorUtils.m ├── DWContactManager ├── DWContactManager.h ├── DWContactManager.m ├── DWContactManagerResource.bundle │ └── DWContactManagerPinYinCorrect.plist ├── DWContactModel.h └── DWContactModel.m ├── DWCrashCollector ├── DWCrashCollector.h └── DWCrashCollector.m ├── DWDataUtils ├── NSData+DWDataUtils.h └── NSData+DWDataUtils.m ├── DWDictionaryUtils ├── NSDictionary+DWDictionaryUtils.h └── NSDictionary+DWDictionaryUtils.m ├── DWDispatcher ├── DEMO │ ├── DWDispatcher.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── DWDispatcher │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m └── DWDispatcher │ ├── DWDispatcher.h │ └── DWDispatcher.m ├── DWEmailHelper ├── DWEmailHelper.h ├── DWEmailHelper.m ├── Dependency │ ├── DWTransaction │ │ ├── DWTransaction.h │ │ └── DWTransaction.m │ └── SKPSMTPMessage │ │ ├── Base64Transcoder.h │ │ ├── Base64Transcoder.m │ │ ├── HSK_CFUtilities.h │ │ ├── HSK_CFUtilities.m │ │ ├── NSData+Base64Additions.h │ │ ├── NSData+Base64Additions.m │ │ ├── NSStream+SKPSMTPExtensions.h │ │ ├── NSStream+SKPSMTPExtensions.m │ │ ├── SKPSMTPMessage.h │ │ └── SKPSMTPMessage.m └── ReadMe.txt ├── DWFixContainer ├── DWFixedContainer.h └── DWFixedContainer.m ├── DWGifTool ├── UIImageView+DWGifTool.h └── UIImageView+DWGifTool.m ├── DWImageUtils ├── UIImage+DWImageUtils.h └── UIImage+DWImageUtils.m ├── DWImageViewUtils ├── UIImageView+DWImageViewUtils.h └── UIImageView+DWImageViewUtils.m ├── DWImageViewer ├── DWImageViewer.h └── DWImageViewer.m ├── DWLabelUtils ├── UILabel+DWLabelUtils.h └── UILabel+DWLabelUtils.m ├── DWMD5Utils ├── DWMD5Utils.h └── DWMD5Utils.m ├── DWMacro └── DWMacro.h ├── DWModelAdapter ├── DWModelAdapter.h └── DWModelAdapter.m ├── DWNavigationTransition ├── DEMO │ ├── DWNavigationTransition.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── DWNavigationTransition.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ ├── DWNavigationTransition │ │ ├── AViewController.h │ │ ├── AViewController.m │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── BViewController.h │ │ ├── BViewController.m │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m │ ├── Podfile │ ├── Podfile.lock │ └── Pods │ │ ├── Headers │ │ ├── Private │ │ │ └── DWNavigationTransition │ │ │ │ ├── DWTransitionFunction.h │ │ │ │ ├── UINavigationBar+DWNavigationTransition.h │ │ │ │ ├── UINavigationController+DWNavigationTransition.h │ │ │ │ ├── UIScrollView+DWNavigationTransition.h │ │ │ │ ├── UIView+DWNavigationTransition.h │ │ │ │ └── UIViewController+DWNavigationTransition.h │ │ └── Public │ │ │ └── DWNavigationTransition │ │ │ ├── DWTransitionFunction.h │ │ │ ├── UINavigationBar+DWNavigationTransition.h │ │ │ ├── UINavigationController+DWNavigationTransition.h │ │ │ ├── UIScrollView+DWNavigationTransition.h │ │ │ ├── UIView+DWNavigationTransition.h │ │ │ └── UIViewController+DWNavigationTransition.h │ │ ├── Local Podspecs │ │ └── DWNavigationTransition.podspec.json │ │ ├── Manifest.lock │ │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── DWNavigationTransition.xcscheme │ │ │ ├── Pods-DWNavigationTransition.xcscheme │ │ │ └── xcschememanagement.plist │ │ ├── SDWebImage │ │ ├── LICENSE │ │ ├── README.md │ │ ├── SDWebImage │ │ │ ├── NSButton+WebCache.h │ │ │ ├── NSButton+WebCache.m │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── NSImage+Compatibility.h │ │ │ ├── NSImage+Compatibility.m │ │ │ ├── Private │ │ │ │ ├── NSBezierPath+RoundedCorners.h │ │ │ │ ├── NSBezierPath+RoundedCorners.m │ │ │ │ ├── SDAsyncBlockOperation.h │ │ │ │ ├── SDAsyncBlockOperation.m │ │ │ │ ├── SDImageAPNGCoderInternal.h │ │ │ │ ├── SDImageAssetManager.h │ │ │ │ ├── SDImageAssetManager.m │ │ │ │ ├── SDImageCachesManagerOperation.h │ │ │ │ ├── SDImageCachesManagerOperation.m │ │ │ │ ├── SDImageGIFCoderInternal.h │ │ │ │ ├── SDInternalMacros.h │ │ │ │ ├── SDInternalMacros.m │ │ │ │ ├── SDWeakProxy.h │ │ │ │ ├── SDWeakProxy.m │ │ │ │ ├── SDmetamacros.h │ │ │ │ ├── UIColor+HexString.h │ │ │ │ └── UIColor+HexString.m │ │ │ ├── SDAnimatedImage.h │ │ │ ├── SDAnimatedImage.m │ │ │ ├── SDAnimatedImageRep.h │ │ │ ├── SDAnimatedImageRep.m │ │ │ ├── SDAnimatedImageView+WebCache.h │ │ │ ├── SDAnimatedImageView+WebCache.m │ │ │ ├── SDAnimatedImageView.h │ │ │ ├── SDAnimatedImageView.m │ │ │ ├── SDDiskCache.h │ │ │ ├── SDDiskCache.m │ │ │ ├── SDImageAPNGCoder.h │ │ │ ├── SDImageAPNGCoder.m │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCache.m │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDImageCacheConfig.m │ │ │ ├── SDImageCacheDefine.h │ │ │ ├── SDImageCacheDefine.m │ │ │ ├── SDImageCachesManager.h │ │ │ ├── SDImageCachesManager.m │ │ │ ├── SDImageCoder.h │ │ │ ├── SDImageCoder.m │ │ │ ├── SDImageCoderHelper.h │ │ │ ├── SDImageCoderHelper.m │ │ │ ├── SDImageCodersManager.h │ │ │ ├── SDImageCodersManager.m │ │ │ ├── SDImageFrame.h │ │ │ ├── SDImageFrame.m │ │ │ ├── SDImageGIFCoder.h │ │ │ ├── SDImageGIFCoder.m │ │ │ ├── SDImageGraphics.h │ │ │ ├── SDImageGraphics.m │ │ │ ├── SDImageIOCoder.h │ │ │ ├── SDImageIOCoder.m │ │ │ ├── SDImageLoader.h │ │ │ ├── SDImageLoader.m │ │ │ ├── SDImageLoadersManager.h │ │ │ ├── SDImageLoadersManager.m │ │ │ ├── SDImageTransformer.h │ │ │ ├── SDImageTransformer.m │ │ │ ├── SDMemoryCache.h │ │ │ ├── SDMemoryCache.m │ │ │ ├── SDWebImageCacheKeyFilter.h │ │ │ ├── SDWebImageCacheKeyFilter.m │ │ │ ├── SDWebImageCacheSerializer.h │ │ │ ├── SDWebImageCacheSerializer.m │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageCompat.m │ │ │ ├── SDWebImageDefine.h │ │ │ ├── SDWebImageDefine.m │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloader.m │ │ │ ├── SDWebImageDownloaderConfig.h │ │ │ ├── SDWebImageDownloaderConfig.m │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageDownloaderOperation.m │ │ │ ├── SDWebImageDownloaderRequestModifier.h │ │ │ ├── SDWebImageDownloaderRequestModifier.m │ │ │ ├── SDWebImageError.h │ │ │ ├── SDWebImageError.m │ │ │ ├── SDWebImageIndicator.h │ │ │ ├── SDWebImageIndicator.m │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageManager.m │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImagePrefetcher.m │ │ │ ├── SDWebImageTransition.h │ │ │ ├── SDWebImageTransition.m │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIButton+WebCache.m │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+ForceDecode.m │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+GIF.m │ │ │ ├── UIImage+MemoryCacheCost.h │ │ │ ├── UIImage+MemoryCacheCost.m │ │ │ ├── UIImage+Metadata.h │ │ │ ├── UIImage+Metadata.m │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImage+MultiFormat.m │ │ │ ├── UIImage+Transform.h │ │ │ ├── UIImage+Transform.m │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIImageView+WebCache.m │ │ │ ├── UIView+WebCache.h │ │ │ ├── UIView+WebCache.m │ │ │ ├── UIView+WebCacheOperation.h │ │ │ └── UIView+WebCacheOperation.m │ │ └── WebImage │ │ │ ├── SDWebImage.h │ │ │ └── SDWebImage.modulemap │ │ └── Target Support Files │ │ ├── DWNavigationTransition │ │ ├── DWNavigationTransition-dummy.m │ │ ├── DWNavigationTransition-prefix.pch │ │ └── DWNavigationTransition.xcconfig │ │ └── Pods-DWNavigationTransition │ │ ├── Pods-DWNavigationTransition-acknowledgements.markdown │ │ ├── Pods-DWNavigationTransition-acknowledgements.plist │ │ ├── Pods-DWNavigationTransition-dummy.m │ │ ├── Pods-DWNavigationTransition.debug.xcconfig │ │ └── Pods-DWNavigationTransition.release.xcconfig ├── DWNavigationTransition.podspec ├── DWNavigationTransition │ ├── DWTransitionFunction.h │ ├── DWTransitionFunction.m │ ├── UINavigationBar+DWNavigationTransition.h │ ├── UINavigationBar+DWNavigationTransition.m │ ├── UINavigationController+DWNavigationTransition.h │ ├── UINavigationController+DWNavigationTransition.m │ ├── UIScrollView+DWNavigationTransition.h │ ├── UIScrollView+DWNavigationTransition.m │ ├── UITabBarController+DWNavigationTransition.h │ ├── UITabBarController+DWNavigationTransition.m │ ├── UIView+DWNavigationTransition.h │ ├── UIView+DWNavigationTransition.m │ ├── UIViewController+DWNavigationTransition.h │ └── UIViewController+DWNavigationTransition.m ├── LICENSE └── README.md ├── DWPathUtils ├── UIBezierPath+DWPathUtils.h └── UIBezierPath+DWPathUtils.m ├── DWPaymentManager ├── DWPaymentManager │ ├── Framework │ │ ├── DWAbstractManager.h │ │ ├── DWAbstractManager.m │ │ ├── DWPaymentConfig.h │ │ ├── DWPaymentConfig.m │ │ ├── DWPaymentHeader.h │ │ ├── DWPaymentManager.h │ │ └── DWPaymentManager.m │ ├── Lib │ │ ├── Alipay │ │ │ ├── AlipaySDK.bundle │ │ │ │ ├── bar@2x.png │ │ │ │ ├── refresh@2x.png │ │ │ │ ├── refresh_click@2x.png │ │ │ │ ├── shutdown@2x.png │ │ │ │ └── shutdown_click@2x.png │ │ │ ├── AlipaySDK.framework │ │ │ │ ├── AlipaySDK │ │ │ │ ├── Headers │ │ │ │ │ ├── APayAuthInfo.h │ │ │ │ │ └── AlipaySDK.h │ │ │ │ ├── Info.plist │ │ │ │ └── en.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ └── 支付宝联集成指南.md │ │ ├── UnionPay │ │ │ ├── UPPaymentControl.h │ │ │ ├── libPaymentControl.a │ │ │ └── 广银联集成指南.md │ │ └── WeixinPay │ │ │ ├── WXApi.h │ │ │ ├── WXApiObject.h │ │ │ ├── libWeChatSDK.a │ │ │ └── 微信支付集成指南.md │ ├── Plugin │ │ ├── Alipay │ │ │ ├── DWAlipayManager.h │ │ │ └── DWAlipayManager.m │ │ ├── UnionPay │ │ │ ├── DWUnionPayManager.h │ │ │ └── DWUnionPayManager.m │ │ └── WeixinPay │ │ │ ├── DWWeiXinManager.h │ │ │ └── DWWeiXinManager.m │ └── ReadMe.md └── PaymentDemo │ ├── PaymentDemo.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ ├── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── zhangdingwen.xcuserdatad │ │ │ └── UserInterfaceState.xcuserstate │ └── xcuserdata │ │ ├── Wicky.xcuserdatad │ │ └── xcschemes │ │ │ ├── PaymentDemo.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── zhangdingwen.xcuserdatad │ │ └── xcschemes │ │ └── xcschememanagement.plist │ ├── PaymentDemo │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── DWPaymentManager │ │ ├── Framework │ │ │ ├── DWAbstractManager.h │ │ │ ├── DWAbstractManager.m │ │ │ ├── DWPaymentConfig.h │ │ │ ├── DWPaymentConfig.m │ │ │ ├── DWPaymentHeader.h │ │ │ ├── DWPaymentManager.h │ │ │ └── DWPaymentManager.m │ │ ├── Lib │ │ │ ├── Alipay │ │ │ │ ├── AlipaySDK.bundle │ │ │ │ │ ├── bar@2x.png │ │ │ │ │ ├── refresh@2x.png │ │ │ │ │ ├── refresh_click@2x.png │ │ │ │ │ ├── shutdown@2x.png │ │ │ │ │ └── shutdown_click@2x.png │ │ │ │ ├── AlipaySDK.framework │ │ │ │ │ ├── AlipaySDK │ │ │ │ │ ├── Headers │ │ │ │ │ │ ├── APayAuthInfo.h │ │ │ │ │ │ └── AlipaySDK.h │ │ │ │ │ ├── Info.plist │ │ │ │ │ └── en.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ └── 支付宝联集成指南.md │ │ │ ├── UnionPay │ │ │ │ ├── UPPaymentControl.h │ │ │ │ ├── libPaymentControl.a │ │ │ │ └── 广银联集成指南.md │ │ │ └── WeixinPay │ │ │ │ ├── WXApi.h │ │ │ │ ├── WXApiObject.h │ │ │ │ ├── libWeChatSDK.a │ │ │ │ └── 微信支付集成指南.md │ │ ├── Plugin │ │ │ ├── Alipay │ │ │ │ ├── DWAlipayManager.h │ │ │ │ └── DWAlipayManager.m │ │ │ ├── UnionPay │ │ │ │ ├── DWUnionPayManager.h │ │ │ │ └── DWUnionPayManager.m │ │ │ └── WeixinPay │ │ │ │ ├── DWWeiXinManager.h │ │ │ │ └── DWWeiXinManager.m │ │ └── ReadMe.md │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m │ ├── PaymentDemoTests │ ├── Info.plist │ └── PaymentDemoTests.m │ └── PaymentDemoUITests │ ├── Info.plist │ └── PaymentDemoUITests.m ├── DWPlayer ├── DEMO │ ├── DWPlayer.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ ├── DWPlayer.xcworkspace │ │ └── contents.xcworkspacedata │ ├── DWPlayer │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ └── Contents.json │ │ │ └── Contents.json │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ ├── main.m │ │ └── video4.mp4 │ ├── Podfile │ ├── Podfile.lock │ └── Pods │ │ ├── Headers │ │ ├── Private │ │ │ └── DWPlayer │ │ │ │ ├── DWPlayer.h │ │ │ │ ├── DWPlayerManager.h │ │ │ │ ├── DWPlayerView.h │ │ │ │ └── DWPlayerViewController.h │ │ └── Public │ │ │ └── DWPlayer │ │ │ ├── DWPlayer.h │ │ │ ├── DWPlayerManager.h │ │ │ ├── DWPlayerView.h │ │ │ └── DWPlayerViewController.h │ │ ├── Local Podspecs │ │ └── DWPlayer.podspec.json │ │ ├── Manifest.lock │ │ ├── Pods.xcodeproj │ │ ├── project.pbxproj │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── DWPlayer.xcscheme │ │ │ ├── Pods-DWPlayer.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── Target Support Files │ │ ├── DWPlayer │ │ ├── DWPlayer-dummy.m │ │ ├── DWPlayer-prefix.pch │ │ └── DWPlayer.xcconfig │ │ └── Pods-DWPlayer │ │ ├── Pods-DWPlayer-acknowledgements.markdown │ │ ├── Pods-DWPlayer-acknowledgements.plist │ │ ├── Pods-DWPlayer-dummy.m │ │ ├── Pods-DWPlayer.debug.xcconfig │ │ └── Pods-DWPlayer.release.xcconfig ├── DWPlayer.podspec ├── DWPlayer │ ├── DWPlayer.h │ ├── DWPlayerManager.h │ ├── DWPlayerManager.m │ ├── DWPlayerView.h │ ├── DWPlayerView.m │ ├── DWPlayerViewController.h │ └── DWPlayerViewController.m ├── LICENSE └── README.md ├── DWProtocolEnhancer ├── DWProtocolEnhancer.h └── DWProtocolEnhancer.m ├── DWRangeUtils ├── DWRangeUtils.h └── DWRangeUtils.m ├── DWRegExpUtils ├── DWRegexUtils.h └── DWRegexUtils.m ├── DWRuntimeUtils ├── NSObject+DWRuntimeUtils.h └── NSObject+DWRuntimeUtils.m ├── DWSlider ├── DWSlider.h └── DWSlider.m ├── DWSocketUtils ├── DWSocketUtils.h └── DWSocketUtils.m ├── DWStaticView ├── DWStaticView.h └── DWStaticView.m ├── DWTableViewUtils ├── UITableView+DWTableViewUtils.h └── UITableView+DWTableViewUtils.m ├── DWTextFieldUtils ├── UITextField+DWTextFieldUtils.h └── UITextField+DWTextFieldUtils.m ├── DWTextViewUtils ├── UITextView+DWTextViewUtils.h └── UITextView+DWTextViewUtils.m ├── DWTiledImageView ├── DWTiledImageView.h └── DWTiledImageView.m ├── DWTimer ├── DWTimer.h └── DWTimer.m ├── DWTransformUtils ├── DWTransformUtils.h └── DWTransformUtils.m ├── DWTransition ├── DEMO │ ├── DWTransition.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ └── xcuserdata │ │ │ └── wicky.xcuserdatad │ │ │ └── xcschemes │ │ │ └── xcschememanagement.plist │ └── DWTransition │ │ ├── AlphaViewController.h │ │ ├── AlphaViewController.m │ │ ├── AppDelegate.h │ │ ├── AppDelegate.m │ │ ├── Assets.xcassets │ │ ├── AppIcon.appiconset │ │ │ └── Contents.json │ │ └── Contents.json │ │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ │ ├── Info.plist │ │ ├── NavViewController.h │ │ ├── NavViewController.m │ │ ├── ViewController.h │ │ ├── ViewController.m │ │ └── main.m ├── DWTransition.podspec ├── DWTransition │ ├── DWTransition.h │ ├── DWTransition.m │ ├── DWTransitionPopInteraction.h │ └── DWTransitionPopInteraction.m ├── LICENSE └── README.md ├── DWViewControllerUtils ├── DWViewControllerUtils.h └── DWViewControllerUtils.m ├── DWViewUtils ├── UIView+DWViewUtils.h └── UIView+DWViewUtils.m ├── DWWebImage ├── DWWebImage.h └── DWWebImage.m ├── DecimalExtension ├── DecimalExtension.h └── DecimalExtension.m └── Finish ├── DWArrayUtils ├── NSArray+DWArrayUtils.h └── NSArray+DWArrayUtils.m ├── DWDateUtils ├── NSDate+DWDateUtils.h └── NSDate+DWDateUtils.m ├── DWDeviceUtils ├── UIDevice+DWDeviceUtils.h └── UIDevice+DWDeviceUtils.m ├── DWFileManager ├── DWFileManager.h └── DWFileManager.m ├── DWGradientView ├── DWGradientView.h └── DWGradientView.m ├── DWManualOperation ├── DWManualOperation.h └── DWManualOperation.m ├── DWOperationCancleFlag ├── DWOperationCancelFlag.h └── DWOperationCancelFlag.m ├── DWStringUtils ├── NSString+DWStringUtils.h └── NSString+DWStringUtils.m └── DWTransaction ├── DWTransaction.h └── DWTransaction.m /DWAsyncLayer/DWAsyncLayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAsyncLayer.h 3 | // DWCoreTextLabel 4 | // 5 | // Created by Wicky on 2017/2/9. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | 图层异步绘制类 11 | 12 | 提供图层的异步绘制,线程安全。 13 | 14 | version 1.0.0 15 | 提供异步绘制 16 | */ 17 | 18 | #import 19 | #import 20 | 21 | @interface DWAsyncLayer : CALayer 22 | 23 | @property (nonatomic ,copy) void (^displayBlock)(CGContextRef context,BOOL(^isCanceled)()); 24 | 25 | @property (nonatomic ,assign) BOOL displaysAsynchronously; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DWAuthorizationTool/DWAuthorizationTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAuthorizationTool.h 3 | // a 4 | // 5 | // Created by Wicky on 2018/1/15. 6 | // Copyright © 2018年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWAuthorizationTool 11 | 授权工具类,提供授权状态获取及获取授权功能。 12 | 13 | version 1.0.0 14 | 提供通讯录、相机、定位、相册、麦克风、日历、备忘录权限查询及获取功能。 15 | */ 16 | #import 17 | 18 | typedef NS_ENUM(NSUInteger, DWAuthorizationStatus) { 19 | DWAuthorizationStatusNotDetermined,///未决定 20 | DWAuthorizationStatusRestricted,///受限 21 | DWAuthorizationStatusDenied,///拒绝 22 | DWAuthorizationStatusAuthorized///授权 23 | }; 24 | 25 | typedef void(^RequestAuthorization)(BOOL authorized,DWAuthorizationStatus status,NSError * error); 26 | 27 | @interface DWAuthorizationTool : NSObject 28 | 29 | #pragma mark --- Query --- 30 | +(DWAuthorizationStatus)queryAddressBookStatus; 31 | +(DWAuthorizationStatus)queryCameraStauts; 32 | +(DWAuthorizationStatus)queryLocationStatus; 33 | +(DWAuthorizationStatus)queryPhotoAlbumStatus; 34 | +(DWAuthorizationStatus)queryMicrophoneStatus; 35 | +(DWAuthorizationStatus)queryCalendarStatus; 36 | +(DWAuthorizationStatus)queryReminderStatus; 37 | 38 | #pragma mark --- Request --- 39 | +(void)requestLocation:(RequestAuthorization)completion; 40 | +(void)requestAddressBook:(RequestAuthorization)completion; 41 | +(void)requestCamera:(RequestAuthorization)completion; 42 | +(void)requestPhotoAlbum:(RequestAuthorization)completion; 43 | +(void)requestMicrophone:(RequestAuthorization)completion; 44 | +(void)requestCalendar:(RequestAuthorization)completion; 45 | +(void)requestReminder:(RequestAuthorization)completion; 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /DWButtonUtils/UIButton+DWButtonUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIButton+DWButtonUtils.h 3 | // test 4 | // 5 | // Created by Wicky on 2016/11/16. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | * 提供防重点、响应区域放大、Block方法等属性 13 | */ 14 | @interface UIButton (DWButtonUtils) 15 | 16 | /** 17 | 防重复点击间隔 18 | */ 19 | @property (nonatomic ,assign) NSTimeInterval dw_IgnoreClickInterval; 20 | 21 | /** 22 | 扩大按钮响应区域,上左下右,负数扩大正数缩小 23 | */ 24 | @property (nonatomic ,assign) UIEdgeInsets dw_EnlargeRect; 25 | 26 | 27 | -(void)dw_addActionBlock:(void(^)(UIButton * btn))action; 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DWColorUtils/UIColor+DWColorUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+DWColorUtils.h 3 | // DWColorUtils 4 | // 5 | // Created by Wicky on 16/10/29. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIColor (DWColorUtils) 12 | /** 13 | 返回添加alpha通道的颜色 14 | */ 15 | @property (readonly ,nonatomic ,assign) UIColor *(^alphaWith)(CGFloat alpha); 16 | 17 | ///红色通道色值 18 | @property (nonatomic ,assign,readonly) CGFloat red; 19 | 20 | ///绿色通道色值 21 | @property (nonatomic ,assign,readonly) CGFloat green; 22 | 23 | ///蓝色通道色值 24 | @property (nonatomic ,assign,readonly) CGFloat blue; 25 | 26 | ///透明通道色值 27 | @property (nonatomic ,assign,readonly) CGFloat alpha; 28 | 29 | /** 30 | 以16进制字符串及透明度生成颜色 31 | */ 32 | +(instancetype)colorWithRGBString:(NSString *)string alpha:(CGFloat)alpha; 33 | /** 34 | 以16进制字符串生成颜色 35 | */ 36 | +(instancetype)colorWithRGBString:(NSString *)string; 37 | 38 | /** 39 | 返回颜色是否相同 40 | */ 41 | -(BOOL)isEqualToColor:(UIColor *)color; 42 | @end 43 | -------------------------------------------------------------------------------- /DWContactManager/DWContactManagerResource.bundle/DWContactManagerPinYinCorrect.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 长孙 52 | 涨孙 53 | 尉迟 54 | 域迟 55 | 澹台 56 | 痰台 57 | 万俟 58 | 殁崎 59 | 单于 60 | 馋于 61 | 查理 62 | 茶理 63 | 令狐 64 | 羚狐 65 | 66 | 67 | -------------------------------------------------------------------------------- /DWCrashCollector/DWCrashCollector.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWCrashCollector.h 3 | // DWLogger 4 | // 5 | // Created by Wicky on 2017/10/12. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWCrashCollector 11 | 崩溃收集类 12 | 13 | 可以收集异常与信号两类崩溃并保存日志。 14 | 此类仅提供两个类型方法,无需实例化,实例化无效。 15 | 16 | version 1.0.0 17 | 提供崩溃捕捉 18 | 提供捕捉后崩溃处理等接口 19 | 20 | version 1.0.1 21 | 添加默认保存目录 22 | 添加崩溃堆栈信息 23 | */ 24 | 25 | #import 26 | 27 | typedef void(^ExceptionHandlerType)(NSException * exc); 28 | 29 | @interface DWCrashCollector : NSObject 30 | 31 | ///自定义崩溃如何处理 32 | +(void)configToCollectCrashWithSavePath:(NSString *)savePath handler:(ExceptionHandlerType)handler; 33 | 34 | ///已默认行为(保存崩溃日志至指定路径)处理崩溃,当savePath为空时默认为Cache/DWLogger文件夹 35 | +(void)collectCrashInDefaultWithSavePath:(NSString *)savePath; 36 | 37 | ///收集crash的默认行为 38 | +(ExceptionHandlerType)defaultHandler; 39 | 40 | ///设置标识为name的crash为处理过的crash 41 | +(void)setCrashHandledWithName:(NSString *)name; 42 | 43 | ///未被处理过的crash 44 | +(NSMutableArray *)unHandledCrashes; 45 | 46 | ///处理未处理的crash 47 | +(void)handleUnHandledCrashWithHandler:(void(^)(NSMutableArray * unHandledCrashes,NSString * lastCrash,NSString * lastCrashReason))handler; 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /DWDataUtils/NSData+DWDataUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+DWDataUtils.h 3 | // AccountBook 4 | // 5 | // Created by Wicky on 2017/10/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | DWDataUtils 12 | 13 | 提供NSData的相关便捷方法 14 | 15 | version 1.0.0 16 | 提供Base64编解码方法 17 | 18 | version 1.0.1 19 | 提供AES256加解密方法 20 | 提供MD5摘要计算 21 | */ 22 | 23 | #import 24 | 25 | @interface NSData (DWDataEncodeUtils) 26 | 27 | ///解码一个base64字符串 28 | +(NSData *)dw_DecodeDataFromBase64String:(NSString *)aString; 29 | 30 | ///将data进行base64编码 31 | -(NSString *)dw_Base64EncodedString; 32 | 33 | ///解码一个webSafe的base64字符串 34 | +(NSData *)dw_WebSafeDecodeDataFromBase64String:(NSString *)aString; 35 | 36 | /** 37 | 将data进行webSafe的base64编码 38 | 39 | @param padding 转码是是否用空格占位空出的两字节 40 | */ 41 | -(NSString *)dw_WebSafeBase64EncodedStringWithPadding:(BOOL)padding; 42 | 43 | /** 44 | 以key按AES256对当前data加密 45 | 46 | @param key 加密的密钥 47 | @return 加密后的数据 48 | */ 49 | -(NSData *)dw_AES256EncryptWithKey:(NSString *)key; 50 | 51 | /** 52 | 以key按AES256对当前data解密 53 | 54 | @param key 加密的密钥 55 | @return 解密后的数据 56 | */ 57 | -(NSData *)dw_AES256DecryptWithKey:(NSString *)key; 58 | 59 | /** 60 | 获取data的MD5计算后的字符串 61 | 62 | @return MD5计算后的字符串 63 | */ 64 | -(NSString *)dw_MD5String; 65 | @end 66 | -------------------------------------------------------------------------------- /DWDictionaryUtils/NSDictionary+DWDictionaryUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+DWDictionaryUtils.h 3 | // Contact 4 | // 5 | // Created by Wicky on 2017/5/25. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWDictionanryUtils 11 | 提供Dic的便捷方法 12 | 13 | version 1.0.0 14 | 暂时没啥用到的=。= 15 | */ 16 | 17 | #import 18 | 19 | @interface NSDictionary (DWDictionaryLogUtils) 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DWDictionaryUtils/NSDictionary+DWDictionaryUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+DWDictionaryUtils.m 3 | // Contact 4 | // 5 | // Created by Wicky on 2017/5/25. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "NSDictionary+DWDictionaryUtils.h" 10 | 11 | @implementation NSDictionary (DWDictionaryLogUtils) 12 | 13 | -(NSString *)descriptionWithLocale:(id)locale indent:(NSUInteger)level { 14 | NSArray *allKeys = [self allKeys]; 15 | NSString * footerBlank = @""; 16 | for (int i = 0; i < level; i++) { 17 | footerBlank = [footerBlank stringByAppendingString:@"\t"]; 18 | } 19 | NSMutableString *str = [[NSMutableString alloc] initWithFormat:@"{"]; 20 | NSString * contentBlank = [footerBlank stringByAppendingString:@"\t"]; 21 | for (NSString *key in allKeys) { 22 | id value= self[key]; 23 | if ([value respondsToSelector:@selector(descriptionWithLocale:indent:)]) { 24 | value = [value descriptionWithLocale:locale indent:level + 1]; 25 | } 26 | [str appendFormat:@"\n%@\"%@\" = %@,",contentBlank,key,value]; 27 | } 28 | if (allKeys.count) { 29 | [str deleteCharactersInRange:NSMakeRange(str.length - 1, 1)]; 30 | } 31 | [str appendString:[NSString stringWithFormat:@"\n%@}",footerBlank]]; 32 | return str; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWDispatcher.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DWDispatcher 4 | // 5 | // Created by Wicky on 2019/9/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DWDispatcher 4 | // 5 | // Created by Wicky on 2019/9/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DWDispatcher 4 | // 5 | // Created by Wicky on 2019/9/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "DWDispatcher.h" 11 | 12 | @interface ViewController () 13 | 14 | @property (nonatomic ,strong) DWDispatcher * dispatcher; 15 | 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | // Do any additional setup after loading the view. 23 | } 24 | 25 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 26 | static int i = 0; 27 | [self.dispatcher dispatchObject:@(i)]; 28 | i++; 29 | } 30 | 31 | #pragma mark --- setter/getter --- 32 | -(DWDispatcher *)dispatcher { 33 | if (!_dispatcher) { 34 | _dispatcher = [DWDispatcher dispatcherWithTimeInterval:0.5 idleTimesToHangUp:20 handler:^(NSArray * _Nonnull items) { 35 | NSLog(@"%@",items); 36 | }]; 37 | } 38 | return _dispatcher; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /DWDispatcher/DEMO/DWDispatcher/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DWDispatcher 4 | // 5 | // Created by Wicky on 2019/9/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWDispatcher/DWDispatcher/DWDispatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWDispatcher.h 3 | // DWDispatcher 4 | // 5 | // Created by Wicky on 2019/9/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | typedef void(^DWDispatcherHandler)(NSArray * items); 14 | 15 | @interface DWDispatcher : NSObject 16 | 17 | @property (nonatomic ,assign ,readonly) NSTimeInterval timeInterval; 18 | 19 | @property (nonatomic ,assign ,readonly) BOOL onService; 20 | 21 | @property (nonatomic ,assign ,readonly) NSInteger idleTimesToHangUp; 22 | 23 | +(instancetype)dispatcherWithTimeInterval:(NSTimeInterval)timeInterval idleTimesToHangUp:(NSInteger)idleTimes handler:(DWDispatcherHandler)handler; 24 | 25 | -(void)dispatchObject:(id)object; 26 | 27 | @end 28 | 29 | NS_ASSUME_NONNULL_END 30 | -------------------------------------------------------------------------------- /DWEmailHelper/DWEmailHelper.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWEmailHelper.h 3 | // AccountBook 4 | // 5 | // Created by Wicky on 2017/10/16. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWEmailHelper 11 | 12 | 邮件助手类 13 | 借助第三方库SKPSMTPMessage.h发送邮件 14 | 15 | version 1.0.0 16 | 提供邮件发送的便捷类 17 | 修复部分情况下无法正常发送邮件的问题 18 | */ 19 | 20 | #import 21 | #import "SKPSMTPMessage.h" 22 | 23 | @class DWEmailEntity; 24 | @interface DWEmailHelper : NSObject 25 | 26 | ///单例方法 27 | +(instancetype)shareHelper; 28 | 29 | /** 30 | 发送邮件 31 | 32 | @param entity 邮件信息实体 33 | @param completion 完成后处理操作 34 | */ 35 | +(void)sendEmailEntity:(DWEmailEntity *)entity completion:(void(^)(BOOL success,SKPSMTPMessage * msg,NSError * error))completion; 36 | 37 | @end 38 | 39 | ///附件类,用于以文件路径生成附件实例后放入邮件信息实体 40 | @interface DWEmailAttachment : NSObject 41 | 42 | /** 43 | 以文件绝对路径生成附件实例类 44 | 45 | @param filePath 文件路径 46 | @return 附件实例 47 | */ 48 | +(instancetype)attachmentFromFilePath:(NSString *)filePath; 49 | 50 | @end 51 | 52 | ///信息实体类 53 | @interface DWEmailEntity : NSObject 54 | 55 | ///标题 56 | @property (nonatomic ,copy) NSString * subject; 57 | 58 | ///正文 59 | @property (nonatomic ,copy) NSString * content; 60 | 61 | ///附件 62 | @property (nonatomic ,strong) NSArray * attachments; 63 | 64 | ///接收邮箱 65 | @property (nonatomic ,copy) NSString * reciverEmailAddress; 66 | 67 | ///发送邮箱 68 | @property (nonatomic ,copy) NSString * hostEmailAddress; 69 | 70 | ///邮箱登录名,若为nil是则默认为发送邮箱 71 | @property (nonatomic ,copy) NSString * loginName; 72 | 73 | /// 74 | /** 75 | 发送邮箱的登录密码 76 | 77 | 注: 78 | 非发送邮箱登录密码,而是授权码,即登录第三方邮件客户端的专用密码。 79 | */ 80 | @property (nonatomic ,copy) NSString * password; 81 | 82 | @end 83 | -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/DWTransaction/DWTransaction.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTransaction.h 3 | // hgfd 4 | // 5 | // Created by Wicky on 2017/2/25. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWTransaction 11 | 事物类,将任务与runloop空闲时提交 12 | 13 | 源码修改自YYTextTransaction/ASDK 14 | */ 15 | 16 | #import 17 | 18 | @interface DWTransaction : NSObject 19 | 20 | +(instancetype)dw_TransactionWithTarget:(id)target selector:(SEL)selector; 21 | 22 | +(instancetype)dw_TransactionWithTarget:(id)target selector:(SEL)selector withObject:(id)object; 23 | 24 | -(void)commit; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/SKPSMTPMessage/Base64Transcoder.h: -------------------------------------------------------------------------------- 1 | // 2 | // Base64Transcoder.h 3 | // SMTPSender 4 | // 5 | // Created by 吴晓明 on 13-1-23. 6 | // Copyright (c) 2013年 吴 晓明. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | extern size_t EstimateBas64EncodedDataSize(size_t inDataSize); 12 | extern size_t EstimateBas64DecodedDataSize(size_t inDataSize); 13 | 14 | extern bool Base64EncodeData(const void *inInputData, size_t inInputDataSize, char *outOutputData, size_t *ioOutputDataSize, BOOL wrapped); 15 | extern bool Base64DecodeData(const void *inInputData, size_t inInputDataSize, void *ioOutputData, size_t *ioOutputDataSize); -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/SKPSMTPMessage/HSK_CFUtilities.h: -------------------------------------------------------------------------------- 1 | // 2 | // HSK_CFUtilities.h 3 | // SMTPSender 4 | // 5 | // Created by wu xiaoming on 13-1-23. 6 | // Copyright (c) 2013年 wu xiaoming. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | void CFStreamCreatePairWithUNIXSocketPair(CFAllocatorRef alloc, CFReadStreamRef *readStream, CFWriteStreamRef *writeStream); 13 | CFIndex CFWriteStreamWriteFully(CFWriteStreamRef outputStream, const uint8_t* buffer, CFIndex length); -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/SKPSMTPMessage/NSData+Base64Additions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSData+Base64Additions.h 3 | // SMTPSender 4 | // 5 | // Created by wu xiaoming on 13-1-23. 6 | // Copyright (c) 2013年 wu xiaoming. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | 12 | @interface NSData (Base64Additions) 13 | 14 | +(id)decodeBase64ForString:(NSString *)decodeString; 15 | +(id)decodeWebSafeBase64ForString:(NSString *)decodeString; 16 | 17 | -(NSString *)encodeBase64ForData; 18 | -(NSString *)encodeWebSafeBase64ForData; 19 | -(NSString *)encodeWrappedBase64ForData; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/SKPSMTPMessage/NSStream+SKPSMTPExtensions.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSStream+SKPSMTPExtensions.h 3 | // SMTPSender 4 | // 5 | // Created by wu xiaoming on 13-1-23. 6 | // Copyright (c) 2013年 wu xiaoming. All rights reserved. 7 | // 8 | 9 | /* 10 | MRC Needed. 11 | -fno-objc-arc 12 | */ 13 | 14 | #import 15 | #import 16 | 17 | @interface NSStream (SKPSMTPExtensions) 18 | 19 | + (void)getStreamsToHostNamed:(NSString *)hostName port:(NSInteger)port inputStream:(NSInputStream **)inputStream outputStream:(NSOutputStream **)outputStream; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DWEmailHelper/Dependency/SKPSMTPMessage/NSStream+SKPSMTPExtensions.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSStream+SKPSMTPExtensions.m 3 | // SMTPSender 4 | // 5 | // Created by wu xiaoming on 13-1-23. 6 | // Copyright (c) 2013年 wu xiaoming. All rights reserved. 7 | // 8 | 9 | #import "NSStream+SKPSMTPExtensions.h" 10 | 11 | 12 | @implementation NSStream (SKPSMTPExtensions) 13 | 14 | + (void)getStreamsToHostNamed:(NSString *)hostName port:(NSInteger)port inputStream:(NSInputStream **)inputStream outputStream:(NSOutputStream **)outputStream 15 | { 16 | CFHostRef host; 17 | CFReadStreamRef readStream; 18 | CFWriteStreamRef writeStream; 19 | 20 | readStream = NULL; 21 | writeStream = NULL; 22 | 23 | host = CFHostCreateWithName(NULL, (CFStringRef) hostName); 24 | if (host != NULL) 25 | { 26 | (void) CFStreamCreatePairWithSocketToCFHost(NULL, host, port, &readStream, &writeStream); 27 | CFRelease(host); 28 | } 29 | 30 | if (inputStream == NULL) 31 | { 32 | if (readStream != NULL) 33 | { 34 | CFRelease(readStream); 35 | } 36 | } 37 | else 38 | { 39 | *inputStream = [(NSInputStream *) readStream autorelease]; 40 | } 41 | if (outputStream == NULL) 42 | { 43 | if (writeStream != NULL) 44 | { 45 | CFRelease(writeStream); 46 | } 47 | } 48 | else 49 | { 50 | *outputStream = [(NSOutputStream *) writeStream autorelease]; 51 | } 52 | } 53 | 54 | @end -------------------------------------------------------------------------------- /DWEmailHelper/ReadMe.txt: -------------------------------------------------------------------------------- 1 | WARNING!!! 2 | USE SKPSMTPMessage IN DEPENDENCY BUT NOT IN COCOAPODS. 3 | THE CODES IN COCOAPODS ARE DIFFERENT. 4 | -------------------------------------------------------------------------------- /DWFixContainer/DWFixedContainer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWFixedContainer.h 3 | // hgfd 4 | // 5 | // Created by Wicky on 2017/2/26. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWFixedContainer 11 | 总量固定的数组/字典,遵循FIFO 12 | */ 13 | 14 | #import 15 | 16 | @interface DWFixedArray : NSObject 17 | 18 | @property (nonatomic ,copy) void (^objectDequeueBlock)(id obj); 19 | 20 | @property (nonatomic ,assign ,readonly) NSUInteger count; 21 | 22 | +(instancetype)arrayWithVolunm:(NSUInteger)volumn; 23 | 24 | -(void)addObject:(id)anObject; 25 | 26 | -(void)removeObject:(id)anObject; 27 | 28 | -(void)removeAllObjects; 29 | 30 | -(BOOL)containsObject:(id)anObject; 31 | 32 | @end 33 | 34 | @interface DWFixedDictionary : NSObject 35 | 36 | @property (nonatomic ,copy) void (^objectDequeueBlock)(id obj); 37 | 38 | @property (nonatomic ,assign) NSUInteger count; 39 | 40 | @property (nonatomic ,strong ,readonly) NSArray * allKeys; 41 | 42 | @property (nonatomic ,strong ,readonly) NSArray * allValues; 43 | 44 | +(instancetype)dictionaryWithVolumn:(NSUInteger)volumn; 45 | 46 | -(void)setValue:(id)value forKey:(NSString *)key; 47 | 48 | -(id)valueForKey:(NSString *)key; 49 | 50 | -(void)removeObjectForKey:(NSString *)key; 51 | 52 | -(BOOL)containsObject:(id)obj; 53 | 54 | -(BOOL)containsKey:(NSString *)key; 55 | 56 | @end 57 | -------------------------------------------------------------------------------- /DWGifTool/UIImageView+DWGifTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIImageView+DWGifTool.h 3 | // GifDemo 4 | // 5 | // Created by Wicky on 16/9/26. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | UIImageView+DWGifTool 11 | 12 | UIImageView播放动图的分类 13 | 14 | version 1.0.0 15 | 添加以动图生成imageView实例api 16 | 添加对现有imageView展示动图api 17 | 添加动图控制相关api 18 | */ 19 | 20 | #import 21 | static NSString * const kImageViewGifFinish = @"kImageViewGifFinish"; 22 | static NSString * const kImageViewGifStart = @"kImageViewGifStart"; 23 | static NSString * const kImageViewGifCancel = @"kImageViewGifCancel"; 24 | @interface UIImageView (DWGifTool) 25 | ///保存动图每帧的数组 26 | @property (nonatomic) NSMutableArray * gifArray; 27 | ///单次循环动图的持续时间 28 | @property (nonatomic ,assign) CGFloat gifDuration; 29 | 30 | ///以frame、图片地址、循环次数生成imageView。 31 | /* 32 | repeatCount: 无限循环请填写MAXFLOAT 33 | */ 34 | -(instancetype)initWithFrame:(CGRect)frame gifPathString:(NSString *)path repeatCount:(CGFloat)repeatCount; 35 | 36 | ///以图片地址、循环次数按图片大小生成imageView 37 | -(instancetype)initWithGifPathString:(NSString *)path repeatCount:(CGFloat)repeatCount; 38 | 39 | ///以图片地址及是否循环按图片大小穿件imageView 40 | -(instancetype)initWithGifPathString:(NSString *)path repeat:(BOOL)repeat; 41 | 42 | ///播放Gif 43 | -(void)startGifWithPath:(NSString *)path repeatCount:(CGFloat)repeatCount; 44 | 45 | ///恢复动图 46 | -(void)resumeGif; 47 | 48 | ///暂停动图 49 | -(void)suspendGif; 50 | 51 | ///销毁动图 52 | -(void)invalidGif; 53 | @end 54 | -------------------------------------------------------------------------------- /DWImageViewer/DWImageViewer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWImageViewer.h 3 | // GomeLoanClient 4 | // 5 | // Created by Wicky on 2018/1/21. 6 | // Copyright © 2018年 GMJK. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DWImageViewer : UIWindow 12 | 13 | +(void)viewImageView:(UIImageView *)view; 14 | 15 | +(void)viewImageView:(UIImageView *)view uploadHandler:(dispatch_block_t)handler; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DWLabelUtils/UILabel+DWLabelUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UILabel+DWLabelUtils.h 3 | // ppp 4 | // 5 | // Created by Wicky on 2016/12/3. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWLabelUtils 11 | 12 | 提供Label扩展的工具类 13 | 14 | version 1.0.0 15 | 提供垂直对齐方式 16 | 17 | version 1.0.1 18 | 提供文本显示内距 19 | 20 | version 1.0.2 21 | 解决与TextField英文显示的冲突 22 | */ 23 | 24 | #import 25 | 26 | typedef NS_ENUM(NSUInteger, DWTextVerticalAlignment) {///垂直对齐方式 27 | DWTextVerticalAlignmentCenter,///垂直居中 28 | DWTextVerticalAlignmentTop,///垂直顶部对齐 29 | DWTextVerticalAlignmentBottom///垂直底部对齐 30 | }; 31 | @interface UILabel (DWLabelUtils) 32 | 33 | /** 34 | 垂直对齐方式 35 | */ 36 | @property (nonatomic ,assign) DWTextVerticalAlignment textVerticalAlignment; 37 | 38 | @property (nonatomic ,assign) UIEdgeInsets textInset; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DWMD5Utils/DWMD5Utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWMD5Utils.h 3 | // DWAsyncImage 4 | // 5 | // Created by Wicky on 2017/2/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /// 10 | /** 11 | MD5加密类 12 | 为字符串或NSData提供MD5加密并提供Category 13 | */ 14 | 15 | #import 16 | 17 | @interface DWMD5Utils : NSObject 18 | 19 | +(NSString *)dw_GetMD5StringFromString:(NSString *)str; 20 | 21 | +(NSString *)dw_GetMD5StringFromData:(NSData *)data; 22 | 23 | @end 24 | 25 | @interface NSString (DWMD5Utils) 26 | 27 | @property (nonatomic,copy,readonly) NSString * dw_MD5String; 28 | 29 | @end 30 | 31 | @interface NSData (DWMD5Utils) 32 | 33 | @property (nonatomic,copy,readonly) NSString * dw_MD5String; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /DWMD5Utils/DWMD5Utils.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWMD5Utils.m 3 | // DWAsyncImage 4 | // 5 | // Created by Wicky on 2017/2/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWMD5Utils.h" 10 | #import 11 | 12 | @implementation DWMD5Utils 13 | 14 | +(NSString *)dw_GetMD5StringFromData:(NSData *)data 15 | { 16 | return [self getMD5StrWithStr:data.bytes]; 17 | } 18 | 19 | +(NSString *)dw_GetMD5StringFromString:(NSString *)str 20 | { 21 | return [self getMD5StrWithStr:str.UTF8String]; 22 | } 23 | 24 | +(NSString *)getMD5StrWithStr:(const char *)str 25 | { 26 | CC_MD5_CTX md5; 27 | CC_MD5_Init (&md5); 28 | CC_MD5_Update (&md5, str, (uint)strlen(str)); 29 | 30 | unsigned char digest[CC_MD5_DIGEST_LENGTH]; 31 | CC_MD5_Final (digest, &md5); 32 | return [NSString stringWithFormat: @"%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x", 33 | digest[0], digest[1], 34 | digest[2], digest[3], 35 | digest[4], digest[5], 36 | digest[6], digest[7], 37 | digest[8], digest[9], 38 | digest[10], digest[11], 39 | digest[12], digest[13], 40 | digest[14], digest[15]]; 41 | } 42 | 43 | @end 44 | 45 | @implementation NSString (DWMD5Utils) 46 | 47 | -(NSString *)dw_MD5String 48 | { 49 | return [DWMD5Utils dw_GetMD5StringFromString:self]; 50 | } 51 | 52 | @end 53 | 54 | @implementation NSData (DWMD5Utils) 55 | 56 | -(NSString *)dw_MD5String 57 | { 58 | return [DWMD5Utils dw_GetMD5StringFromData:self]; 59 | } 60 | 61 | @end 62 | 63 | -------------------------------------------------------------------------------- /DWModelAdapter/DWModelAdapter.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWModelAdapter.h 3 | // DWModelAdapter 4 | // 5 | // Created by Wicky on 2016/12/8. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | DWModelAdapter 13 | 14 | 模型转换工具 15 | 可以建立基本转换配置字典 16 | 17 | 使用方法 18 | 1.建立映射表 19 | 2.将映射表置于字典中 20 | 21 | 如建立A与B的映射表 22 | @{@"class":@"B",@"map":@{@"propertyAName1":@"propertyBName1",...}} 23 | 24 | 置于字典 25 | @{@"A":@{@"class":@"B",@"map":@{@"propertyAName1":@"propertyBName1",...}}} 26 | */ 27 | 28 | @interface DWModelAdapter : NSObject 29 | -(NSObject *)convertModel:(NSObject *)modelA withAdapters:(NSDictionary *)adpaters; 30 | @end 31 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWNavigationTransition.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/AViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AViewController.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/3. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface AViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/BViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // BViewController.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/10. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface BViewController : UIViewController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/BViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // BViewController.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/10. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "BViewController.h" 10 | 11 | @interface BViewController () 12 | 13 | @end 14 | 15 | @implementation BViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor cyanColor]; 20 | } 21 | 22 | -(void)viewWillAppear:(BOOL)animated { 23 | [super viewWillAppear:animated]; 24 | [self.navigationController setNavigationBarHidden:NO animated:animated]; 25 | [self.navigationController.navigationBar setBackgroundImage:[self createImageWithColor:[UIColor colorWithRed:0 green:0 blue:1 alpha:0.3]] forBarMetrics:(UIBarMetricsDefault)]; 26 | } 27 | 28 | -(UIImage*)createImageWithColor:(UIColor*)color 29 | { 30 | CGRect rect=CGRectMake(0.0f,0.0f,1.0f,1.0f); 31 | UIGraphicsBeginImageContext(rect.size); 32 | CGContextRef context=UIGraphicsGetCurrentContext(); 33 | CGContextSetFillColorWithColor(context,[color CGColor]); 34 | CGContextFillRect(context,rect); 35 | UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext(); 36 | UIGraphicsEndImageContext(); 37 | return theImage; 38 | } 39 | 40 | /* 41 | #pragma mark - Navigation 42 | 43 | // In a storyboard-based application, you will often want to do a little preparation before navigation 44 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 45 | // Get the new view controller using [segue destinationViewController]. 46 | // Pass the selected object to the new view controller. 47 | } 48 | */ 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AViewController.h" 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor yellowColor]; 21 | } 22 | 23 | -(void)viewWillAppear:(BOOL)animated { 24 | [super viewWillAppear:animated]; 25 | [self.navigationController setNavigationBarHidden:NO animated:animated]; 26 | [self.navigationController.navigationBar setBackgroundImage:[self createImageWithColor:[UIColor colorWithWhite:1 alpha:0.7]] forBarMetrics:(UIBarMetricsDefault)]; 27 | } 28 | 29 | -(UIImage*)createImageWithColor:(UIColor*)color 30 | { 31 | CGRect rect=CGRectMake(0.0f,0.0f,1.0f,1.0f); 32 | UIGraphicsBeginImageContext(rect.size); 33 | CGContextRef context=UIGraphicsGetCurrentContext(); 34 | CGContextSetFillColorWithColor(context,[color CGColor]); 35 | CGContextFillRect(context,rect); 36 | UIImage *theImage=UIGraphicsGetImageFromCurrentImageContext(); 37 | UIGraphicsEndImageContext(); 38 | return theImage; 39 | } 40 | 41 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 42 | AViewController * red = [AViewController new]; 43 | red.view.backgroundColor = [UIColor redColor]; 44 | [self.navigationController pushViewController:red animated:YES]; 45 | } 46 | 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/DWNavigationTransition/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Podfile: -------------------------------------------------------------------------------- 1 | target 'DWNavigationTransition' do 2 | pod 'DWNavigationTransition', :path => '../' 3 | end 4 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DWNavigationTransition (0.0.0.1) 3 | 4 | DEPENDENCIES: 5 | - DWNavigationTransition (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | DWNavigationTransition: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | DWNavigationTransition: 47187b9eebed0aed2e5c9692f9b825b2a4c70cbd 13 | 14 | PODFILE CHECKSUM: c5a31c183e862631df7e363a0e8e20031b0124e9 15 | 16 | COCOAPODS: 1.6.2 17 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/DWTransitionFunction.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/DWTransitionFunction.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/UINavigationBar+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UINavigationBar+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/UINavigationController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UINavigationController+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/UIScrollView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIScrollView+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/UIView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIView+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Private/DWNavigationTransition/UIViewController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIViewController+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/DWTransitionFunction.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/DWTransitionFunction.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/UINavigationBar+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UINavigationBar+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/UINavigationController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UINavigationController+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/UIScrollView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIScrollView+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/UIView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIView+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Headers/Public/DWNavigationTransition/UIViewController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWNavigationTransition/UIViewController+DWNavigationTransition.h -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Local Podspecs/DWNavigationTransition.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DWNavigationTransition", 3 | "version": "0.0.0.1", 4 | "license": { 5 | "type": "MIT", 6 | "file": "LICENSE" 7 | }, 8 | "summary": "导航栏平滑处理。Help you handle navigationBar.", 9 | "homepage": "https://github.com/CodeWicky/-Tools/tree/master/DWNavigationTransition", 10 | "authors": { 11 | "codeWicky": "codewicky@163.com" 12 | }, 13 | "source": { 14 | "git": "https://github.com/CodeWicky/-Tools.git", 15 | "tag": "0.0.0.1" 16 | }, 17 | "requires_arc": true, 18 | "platforms": { 19 | "ios": "9.1" 20 | }, 21 | "source_files": "DWNavigationTransition/**/*.{h,m}", 22 | "frameworks": "UIKit" 23 | } 24 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DWNavigationTransition (0.0.0.1) 3 | 4 | DEPENDENCIES: 5 | - DWNavigationTransition (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | DWNavigationTransition: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | DWNavigationTransition: 47187b9eebed0aed2e5c9692f9b825b2a4c70cbd 13 | 14 | PODFILE CHECKSUM: c5a31c183e862631df7e363a0e8e20031b0124e9 15 | 16 | COCOAPODS: 1.6.2 17 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Pods.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWNavigationTransition.xcscheme 8 | 9 | isShown 10 | 11 | orderHint 12 | 0 13 | 14 | Pods-DWNavigationTransition.xcscheme 15 | 16 | isShown 17 | 18 | orderHint 19 | 1 20 | 21 | 22 | SuppressBuildableAutocreation 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2018 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/NSBezierPath+RoundedCorners.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import "UIImage+Transform.h" 14 | 15 | @interface NSBezierPath (RoundedCorners) 16 | 17 | /** 18 | Convenience way to create a bezier path with the specify rounding corners on macOS. Same as the one on `UIBezierPath`. 19 | */ 20 | + (nonnull instancetype)sd_bezierPathWithRoundedRect:(NSRect)rect byRoundingCorners:(SDRectCorner)corners cornerRadius:(CGFloat)cornerRadius; 21 | 22 | @end 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDAsyncBlockOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @class SDAsyncBlockOperation; 12 | typedef void (^SDAsyncBlock)(SDAsyncBlockOperation * __nonnull asyncOperation); 13 | 14 | @interface SDAsyncBlockOperation : NSOperation 15 | 16 | - (nonnull instancetype)initWithBlock:(nonnull SDAsyncBlock)block; 17 | + (nonnull instancetype)blockOperationWithBlock:(nonnull SDAsyncBlock)block; 18 | - (void)complete; 19 | 20 | @end 21 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDImageAPNGCoderInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDImageAPNGCoder.h" 11 | 12 | @interface SDImageAPNGCoder () 13 | 14 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source; 15 | - (NSUInteger)sd_imageLoopCountWithSource:(nonnull CGImageSourceRef)source; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDImageAssetManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | // Apple parse the Asset Catalog compiled file(`Assets.car`) by CoreUI.framework, however it's a private framework and there are no other ways to directly get the data. So we just process the normal bundle files :) 13 | 14 | @interface SDImageAssetManager : NSObject 15 | 16 | @property (nonatomic, strong, nonnull) NSMapTable *imageTable; 17 | 18 | + (nonnull instancetype)sharedAssetManager; 19 | - (nullable NSString *)getPathForName:(nonnull NSString *)name bundle:(nonnull NSBundle *)bundle preferredScale:(nonnull CGFloat *)scale; 20 | - (nullable UIImage *)imageForName:(nonnull NSString *)name; 21 | - (void)storeImage:(nonnull UIImage *)image forName:(nonnull NSString *)name; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDImageCachesManagerOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | // This is used for operation management, but not for operation queue execute 13 | @interface SDImageCachesManagerOperation : NSOperation 14 | 15 | @property (nonatomic, assign, readonly) NSUInteger pendingCount; 16 | 17 | - (void)beginWithTotalCount:(NSUInteger)totalCount; 18 | - (void)completeOne; 19 | - (void)done; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDImageGIFCoderInternal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDImageGIFCoder.h" 11 | 12 | @interface SDImageGIFCoder () 13 | 14 | - (float)sd_frameDurationAtIndex:(NSUInteger)index source:(nonnull CGImageSourceRef)source; 15 | 16 | @end 17 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDmetamacros.h" 11 | 12 | #ifndef SD_LOCK 13 | #define SD_LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); 14 | #endif 15 | 16 | #ifndef SD_UNLOCK 17 | #define SD_UNLOCK(lock) dispatch_semaphore_signal(lock); 18 | #endif 19 | 20 | #ifndef weakify 21 | #define weakify(...) \ 22 | sd_keywordify \ 23 | metamacro_foreach_cxt(sd_weakify_,, __weak, __VA_ARGS__) 24 | #endif 25 | 26 | #ifndef strongify 27 | #define strongify(...) \ 28 | sd_keywordify \ 29 | _Pragma("clang diagnostic push") \ 30 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \ 31 | metamacro_foreach(sd_strongify_,, __VA_ARGS__) \ 32 | _Pragma("clang diagnostic pop") 33 | #endif 34 | 35 | #define sd_weakify_(INDEX, CONTEXT, VAR) \ 36 | CONTEXT __typeof__(VAR) metamacro_concat(VAR, _weak_) = (VAR); 37 | 38 | #define sd_strongify_(INDEX, VAR) \ 39 | __strong __typeof__(VAR) VAR = metamacro_concat(VAR, _weak_); 40 | 41 | #if DEBUG 42 | #define sd_keywordify autoreleasepool {} 43 | #else 44 | #define sd_keywordify try {} @catch (...) {} 45 | #endif 46 | 47 | #ifndef onExit 48 | #define onExit \ 49 | sd_keywordify \ 50 | __strong sd_cleanupBlock_t metamacro_concat(sd_exitBlock_, __LINE__) __attribute__((cleanup(sd_executeCleanupBlock), unused)) = ^ 51 | #endif 52 | 53 | typedef void (^sd_cleanupBlock_t)(void); 54 | 55 | #if defined(__cplusplus) 56 | extern "C" { 57 | #endif 58 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block); 59 | #if defined(__cplusplus) 60 | } 61 | #endif 62 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDInternalMacros.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDInternalMacros.h" 10 | 11 | void sd_executeCleanupBlock (__strong sd_cleanupBlock_t *block) { 12 | (*block)(); 13 | } 14 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/SDWeakProxy.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWeakProxy : NSProxy 13 | 14 | @property (nonatomic, weak, readonly, nullable) id target; 15 | 16 | - (nonnull instancetype)initWithTarget:(nonnull id)target; 17 | + (nonnull instancetype)proxyWithTarget:(nonnull id)target; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/UIColor+HexString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIColor (HexString) 12 | 13 | /** 14 | Convenience way to get hex string from color. The output should always be 32-bit RGBA hex string like `#00000000`. 15 | */ 16 | @property (nonatomic, copy, readonly, nonnull) NSString *sd_hexString; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/Private/UIColor+HexString.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIColor+HexString.h" 10 | 11 | @implementation UIColor (HexString) 12 | 13 | - (NSString *)sd_hexString { 14 | CGFloat red, green, blue, alpha; 15 | #if SD_UIKIT 16 | if (![self getRed:&red green:&green blue:&blue alpha:&alpha]) { 17 | [self getWhite:&red alpha:&alpha]; 18 | green = red; 19 | blue = red; 20 | } 21 | #else 22 | @try { 23 | [self getRed:&red green:&green blue:&blue alpha:&alpha]; 24 | } 25 | @catch (NSException *exception) { 26 | [self getWhite:&red alpha:&alpha]; 27 | green = red; 28 | blue = red; 29 | } 30 | #endif 31 | 32 | red = roundf(red * 255.f); 33 | green = roundf(green * 255.f); 34 | blue = roundf(blue * 255.f); 35 | alpha = roundf(alpha * 255.f); 36 | 37 | uint hex = ((uint)alpha << 24) | ((uint)red << 16) | ((uint)green << 8) | ((uint)blue); 38 | 39 | return [NSString stringWithFormat:@"#%08x", hex]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDAnimatedImageRep.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | /** 14 | A subclass of `NSBitmapImageRep` to fix that GIF loop count issue because `NSBitmapImageRep` will reset `NSImageCurrentFrameDuration` by using `kCGImagePropertyGIFDelayTime` but not `kCGImagePropertyGIFUnclampedDelayTime`. 15 | Built in GIF coder use this instead of `NSBitmapImageRep` for better GIF rendering. If you do not want this, only enable `SDImageIOCoder`, which just call `NSImage` API and actually use `NSBitmapImageRep` for GIF image. 16 | This also support APNG format using `SDImageAPNGCoder`. Which provide full alpha-channel support and the correct duration match the `kCGImagePropertyAPNGUnclampedDelayTime`. 17 | */ 18 | @interface SDAnimatedImageRep : NSBitmapImageRep 19 | 20 | @end 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageAPNGCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports APNG encoding/decoding 14 | */ 15 | @interface SDImageAPNGCoder : NSObject 16 | 17 | @property (nonatomic, class, readonly, nonnull) SDImageAPNGCoder *sharedCoder; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCoder.h" 10 | 11 | SDImageCoderOption const SDImageCoderDecodeFirstFrameOnly = @"decodeFirstFrameOnly"; 12 | SDImageCoderOption const SDImageCoderDecodeScaleFactor = @"decodeScaleFactor"; 13 | 14 | SDImageCoderOption const SDImageCoderEncodeFirstFrameOnly = @"encodeFirstFrameOnly"; 15 | SDImageCoderOption const SDImageCoderEncodeCompressionQuality = @"encodeCompressionQuality"; 16 | 17 | SDImageCoderOption const SDImageCoderWebImageContext = @"webImageContext"; 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | /** 13 | This class is used for creating animated images via `animatedImageWithFrames` in `SDImageCoderHelper`. 14 | @note If you need to specify animated images loop count, use `sd_imageLoopCount` property in `UIImage+Metadata.h`. 15 | */ 16 | @interface SDImageFrame : NSObject 17 | 18 | /** 19 | The image of current frame. You should not set an animated image. 20 | */ 21 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 22 | /** 23 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 24 | */ 25 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 26 | 27 | /** 28 | Create a frame instance with specify image and duration 29 | 30 | @param image current frame's image 31 | @param duration current frame's duration 32 | @return frame instance 33 | */ 34 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageFrame.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageFrame.h" 10 | 11 | @interface SDImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDImageFrame *frame = [[SDImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports animated GIF encoding/decoding 14 | @note `SDImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDImageGIFCoder` for fully animated GIFs. For `UIImageView`, it will produce animated `UIImage`(`NSImage` on macOS) for rendering. For `SDAnimatedImageView`, it will use `SDAnimatedImage` for rendering. 16 | @note The recommended approach for animated GIFs is using `SDAnimatedImage` with `SDAnimatedImageView`. It's more performant than `UIImageView` for GIF displaying(especially on memory usage) 17 | */ 18 | @interface SDImageGIFCoder : NSObject 19 | 20 | @property (nonatomic, class, readonly, nonnull) SDImageGIFCoder *sharedCoder; 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageGraphics.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import 11 | 12 | /** 13 | These following graphics context method are provided to easily write cross-platform(AppKit/UIKit) code. 14 | For UIKit, these methods just call the same method in `UIGraphics.h`. See the documentation for usage. 15 | For AppKit, these methods use `NSGraphicsContext` to create image context and match the behavior like UIKit. 16 | */ 17 | 18 | /// Returns the current graphics context. 19 | FOUNDATION_EXPORT CGContextRef __nullable SDGraphicsGetCurrentContext(void) CF_RETURNS_NOT_RETAINED; 20 | /// Creates a bitmap-based graphics context and makes it the current context. 21 | FOUNDATION_EXPORT void SDGraphicsBeginImageContext(CGSize size); 22 | /// Creates a bitmap-based graphics context with the specified options. 23 | FOUNDATION_EXPORT void SDGraphicsBeginImageContextWithOptions(CGSize size, BOOL opaque, CGFloat scale); 24 | /// Removes the current bitmap-based graphics context from the top of the stack. 25 | FOUNDATION_EXPORT void SDGraphicsEndImageContext(void); 26 | /// Returns an image based on the contents of the current bitmap-based graphics context. 27 | FOUNDATION_EXPORT UIImage * __nullable SDGraphicsGetImageFromCurrentImageContext(void); 28 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `SDAnimatedImageView` to keep both CPU and memory balanced. 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices, see: https://devstreaming-cdn.apple.com/videos/wwdc/2017/511tj33587vdhds/511/511_working_with_heif_and_hevc.pdf 21 | Decode(Software): !Simulator && (iOS 11 || tvOS 11 || macOS 10.13) 22 | Decode(Hardware): !Simulator && ((iOS 11 && A9Chip) || (macOS 10.13 && 6thGenerationIntelCPU)) 23 | Encode(Software): macOS 10.13 24 | Encode(Hardware): !Simulator && ((iOS 11 && A10FusionChip) || (macOS 10.13 && 6thGenerationIntelCPU)) 25 | */ 26 | @interface SDImageIOCoder : NSObject 27 | 28 | @property (nonatomic, class, readonly, nonnull) SDImageIOCoder *sharedCoder; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDImageLoadersManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageLoader.h" 10 | 11 | /** 12 | A loaders manager to manage multiple loaders 13 | */ 14 | @interface SDImageLoadersManager : NSObject 15 | 16 | /** 17 | Returns the global shared loaders manager instance. By default we will set [`SDWebImageDownloader.sharedDownloader`] into the loaders array. 18 | */ 19 | @property (nonatomic, class, readonly, nonnull) SDImageLoadersManager *sharedManager; 20 | 21 | /** 22 | All image loaders in manager. The loaders array is a priority queue, which means the later added loader will have the highest priority 23 | */ 24 | @property (nonatomic, copy, nullable) NSArray>* loaders; 25 | 26 | /** 27 | Add a new image loader to the end of loaders array. Which has the highest priority. 28 | 29 | @param loader loader 30 | */ 31 | - (void)addLoader:(nonnull id)loader; 32 | 33 | /** 34 | Remove a image loader in the loaders array. 35 | 36 | @param loader loader 37 | */ 38 | - (void)removeLoader:(nonnull id)loader; 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageCacheKeyFilter.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSString * _Nullable(^SDWebImageCacheKeyFilterBlock)(NSURL * _Nonnull url); 13 | 14 | /** 15 | This is the protocol for cache key filter. 16 | We can use a block to specify the cache key filter. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheKeyFilter 19 | 20 | - (nullable NSString *)cacheKeyForURL:(nonnull NSURL *)url; 21 | 22 | @end 23 | 24 | /** 25 | A cache key filter class with block. 26 | */ 27 | @interface SDWebImageCacheKeyFilter : NSObject 28 | 29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 30 | + (nonnull instancetype)cacheKeyFilterWithBlock:(nonnull SDWebImageCacheKeyFilterBlock)block; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageCacheKeyFilter.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCacheKeyFilter.h" 10 | 11 | @interface SDWebImageCacheKeyFilter () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheKeyFilterBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheKeyFilter 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheKeyFilterBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheKeyFilterWithBlock:(SDWebImageCacheKeyFilterBlock)block { 28 | SDWebImageCacheKeyFilter *cacheKeyFilter = [[SDWebImageCacheKeyFilter alloc] initWithBlock:block]; 29 | return cacheKeyFilter; 30 | } 31 | 32 | - (NSString *)cacheKeyForURL:(NSURL *)url { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(url); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageCacheSerializer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSData * _Nullable(^SDWebImageCacheSerializerBlock)(UIImage * _Nonnull image, NSData * _Nullable data, NSURL * _Nullable imageURL); 13 | 14 | /** 15 | This is the protocol for cache serializer. 16 | We can use a block to specify the cache serializer. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageCacheSerializer 19 | 20 | - (nullable NSData *)cacheDataWithImage:(nonnull UIImage *)image originalData:(nullable NSData *)data imageURL:(nullable NSURL *)imageURL; 21 | 22 | @end 23 | 24 | /** 25 | A cache serializer class with block. 26 | */ 27 | @interface SDWebImageCacheSerializer : NSObject 28 | 29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 30 | + (nonnull instancetype)cacheSerializerWithBlock:(nonnull SDWebImageCacheSerializerBlock)block; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageCacheSerializer.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCacheSerializer.h" 10 | 11 | @interface SDWebImageCacheSerializer () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageCacheSerializerBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageCacheSerializer 18 | 19 | - (instancetype)initWithBlock:(SDWebImageCacheSerializerBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)cacheSerializerWithBlock:(SDWebImageCacheSerializerBlock)block { 28 | SDWebImageCacheSerializer *cacheSerializer = [[SDWebImageCacheSerializer alloc] initWithBlock:block]; 29 | return cacheSerializer; 30 | } 31 | 32 | - (NSData *)cacheDataWithImage:(UIImage *)image originalData:(NSData *)data imageURL:(nullable NSURL *)imageURL { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(image, data, imageURL); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if !__has_feature(objc_arc) 12 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 13 | #endif 14 | 15 | #if !OS_OBJECT_USE_OBJC 16 | #error SDWebImage need ARC for dispatch object 17 | #endif 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageDownloaderConfig.h" 10 | 11 | static SDWebImageDownloaderConfig * _defaultDownloaderConfig; 12 | 13 | @implementation SDWebImageDownloaderConfig 14 | 15 | + (SDWebImageDownloaderConfig *)defaultDownloaderConfig { 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | _defaultDownloaderConfig = [SDWebImageDownloaderConfig new]; 19 | }); 20 | return _defaultDownloaderConfig; 21 | } 22 | 23 | - (instancetype)init { 24 | self = [super init]; 25 | if (self) { 26 | _maxConcurrentDownloads = 6; 27 | _downloadTimeout = 15.0; 28 | _executionOrder = SDWebImageDownloaderFIFOExecutionOrder; 29 | } 30 | return self; 31 | } 32 | 33 | - (id)copyWithZone:(NSZone *)zone { 34 | SDWebImageDownloaderConfig *config = [[[self class] allocWithZone:zone] init]; 35 | config.maxConcurrentDownloads = self.maxConcurrentDownloads; 36 | config.downloadTimeout = self.downloadTimeout; 37 | config.minimumProgressInterval = self.minimumProgressInterval; 38 | config.sessionConfiguration = [self.sessionConfiguration copyWithZone:zone]; 39 | config.operationClass = self.operationClass; 40 | config.executionOrder = self.executionOrder; 41 | config.urlCredential = self.urlCredential; 42 | config.username = self.username; 43 | config.password = self.password; 44 | 45 | return config; 46 | } 47 | 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderRequestModifier.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | typedef NSURLRequest * _Nullable (^SDWebImageDownloaderRequestModifierBlock)(NSURLRequest * _Nonnull request); 13 | 14 | /** 15 | This is the protocol for downloader request modifier. 16 | We can use a block to specify the downloader request modifier. But Using protocol can make this extensible, and allow Swift user to use it easily instead of using `@convention(block)` to store a block into context options. 17 | */ 18 | @protocol SDWebImageDownloaderRequestModifier 19 | 20 | - (nullable NSURLRequest *)modifiedRequestWithRequest:(nonnull NSURLRequest *)request; 21 | 22 | @end 23 | 24 | /** 25 | A downloader request modifier class with block. 26 | */ 27 | @interface SDWebImageDownloaderRequestModifier : NSObject 28 | 29 | - (nonnull instancetype)initWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 30 | + (nonnull instancetype)requestModifierWithBlock:(nonnull SDWebImageDownloaderRequestModifierBlock)block; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageDownloaderRequestModifier.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageDownloaderRequestModifier.h" 10 | 11 | @interface SDWebImageDownloaderRequestModifier () 12 | 13 | @property (nonatomic, copy, nonnull) SDWebImageDownloaderRequestModifierBlock block; 14 | 15 | @end 16 | 17 | @implementation SDWebImageDownloaderRequestModifier 18 | 19 | - (instancetype)initWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 20 | self = [super init]; 21 | if (self) { 22 | self.block = block; 23 | } 24 | return self; 25 | } 26 | 27 | + (instancetype)requestModifierWithBlock:(SDWebImageDownloaderRequestModifierBlock)block { 28 | SDWebImageDownloaderRequestModifier *requestModifier = [[SDWebImageDownloaderRequestModifier alloc] initWithBlock:block]; 29 | return requestModifier; 30 | } 31 | 32 | - (NSURLRequest *)modifiedRequestWithRequest:(NSURLRequest *)request { 33 | if (!self.block) { 34 | return nil; 35 | } 36 | return self.block(request); 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageError.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | FOUNDATION_EXPORT NSErrorDomain const _Nonnull SDWebImageErrorDomain; 13 | 14 | /// The HTTP status code for invalid download response (NSNumber *) 15 | FOUNDATION_EXPORT NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey; 16 | 17 | /// SDWebImage error domain and codes 18 | typedef NS_ERROR_ENUM(SDWebImageErrorDomain, SDWebImageError) { 19 | SDWebImageErrorInvalidURL = 1000, // The URL is invalid, such as nil URL or corrupted URL 20 | SDWebImageErrorBadImageData = 1001, // The image data can not be decoded to image, or the image data is empty 21 | SDWebImageErrorCacheNotModified = 1002, // The remote location specify that the cached image is not modified, such as the HTTP response 304 code. It's useful for `SDWebImageRefreshCached` 22 | SDWebImageErrorInvalidDownloadOperation = 2000, // The image download operation is invalid, such as nil operation or unexpected error occur when operation initialized 23 | SDWebImageErrorInvalidDownloadStatusCode = 2001, // The image downloda response a invalid status code. You can check the status code in error's userInfo under `SDWebImageErrorDownloadStatusCodeKey` 24 | }; 25 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageError.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Jamie Pinkham 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageError.h" 11 | 12 | NSErrorDomain const _Nonnull SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 13 | NSErrorUserInfoKey const _Nonnull SDWebImageErrorDownloadStatusCodeKey = @"SDWebImageErrorDownloadStatusCodeKey"; 14 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | /// A protocol represents cancelable operation. 12 | @protocol SDWebImageOperation 13 | 14 | - (void)cancel; 15 | 16 | @end 17 | 18 | /// NSOperation conform to `SDWebImageOperation`. 19 | @interface NSOperation (SDWebImageOperation) 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /** 12 | UIImage category about force decode feature (avoid Image/IO's lazy decoding during rendering behavior). 13 | */ 14 | @interface UIImage (ForceDecode) 15 | 16 | /** 17 | A bool value indicating whether the image has already been decoded. This can help to avoid extra force decode. 18 | */ 19 | @property (nonatomic, assign) BOOL sd_isDecoded; 20 | 21 | /** 22 | Decode the provided image. This is useful if you want to force decode the image before rendering to improve performance. 23 | 24 | @param image The image to be decoded 25 | @return The decoded image 26 | */ 27 | + (nullable UIImage *)sd_decodedImageWithImage:(nullable UIImage *)image; 28 | 29 | /** 30 | Decode and scale down the provided image 31 | 32 | @param image The image to be decoded 33 | @return The decoded and scaled down image 34 | */ 35 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 36 | 37 | /** 38 | Decode and scale down the provided image with limit bytes 39 | 40 | @param image The image to be decoded 41 | @param bytes The limit bytes size. Provide 0 to use the build-in limit. 42 | @return The decoded and scaled down image 43 | */ 44 | + (nullable UIImage *)sd_decodedAndScaledDownImageWithImage:(nullable UIImage *)image limitBytes:(NSUInteger)bytes; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDImageCoderHelper.h" 11 | #import "objc/runtime.h" 12 | 13 | @implementation UIImage (ForceDecode) 14 | 15 | - (BOOL)sd_isDecoded { 16 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_isDecoded)); 17 | return value.boolValue; 18 | } 19 | 20 | - (void)setSd_isDecoded:(BOOL)sd_isDecoded { 21 | objc_setAssociatedObject(self, @selector(sd_isDecoded), @(sd_isDecoded), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 22 | } 23 | 24 | + (UIImage *)sd_decodedImageWithImage:(UIImage *)image { 25 | if (!image) { 26 | return nil; 27 | } 28 | return [SDImageCoderHelper decodedImageWithImage:image]; 29 | } 30 | 31 | + (UIImage *)sd_decodedAndScaledDownImageWithImage:(UIImage *)image { 32 | return [self sd_decodedAndScaledDownImageWithImage:image limitBytes:0]; 33 | } 34 | 35 | + (UIImage *)sd_decodedAndScaledDownImageWithImage:(UIImage *)image limitBytes:(NSUInteger)bytes { 36 | if (!image) { 37 | return nil; 38 | } 39 | return [SDImageCoderHelper decodedAndScaledDownImageWithImage:image limitBytes:bytes]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | /** 13 | This category is just use as a convenience method. For more detail control, use methods in `UIImage+MultiFormat.h` or directlly use `SDImageCoder`. 14 | */ 15 | @interface UIImage (GIF) 16 | 17 | /** 18 | Creates an animated UIImage from an NSData. 19 | This will create animated image if the data is Animated GIF. And will create a static image is the data is Static GIF. 20 | 21 | @param data The GIF data 22 | @return The created image 23 | */ 24 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import "SDImageGIFCoder.h" 12 | 13 | @implementation UIImage (GIF) 14 | 15 | + (nullable UIImage *)sd_imageWithGIFData:(nullable NSData *)data { 16 | if (!data) { 17 | return nil; 18 | } 19 | return [[SDImageGIFCoder sharedCoder] decodedImageWithData:data options:0]; 20 | } 21 | 22 | @end 23 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+MemoryCacheCost.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | /** 12 | UIImage category for memory cache cost. 13 | */ 14 | @interface UIImage (MemoryCacheCost) 15 | 16 | /** 17 | The memory cache cost for specify image used by image cache. The cost function is the bytes size held in memory. 18 | If you set some associated object to `UIImage`, you can set the custom value to indicate the memory cost. 19 | 20 | For `UIImage`, this method return the single frame bytes size when `image.images` is nil for static image. Retuen full frame bytes size when `image.images` is not nil for animated image. 21 | For `NSImage`, this method return the single frame bytes size because `NSImage` does not store all frames in memory. 22 | @note Note that because of the limitations of category this property can get out of sync if you create another instance with CGImage or other methods. 23 | @note For custom animated class conforms to `SDAnimatedImage`, you can override this getter method in your subclass to return a more proper value instead, which representing the current frame's total bytes. 24 | */ 25 | @property (assign, nonatomic) NSUInteger sd_memoryCost; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIImage+MemoryCacheCost.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+MemoryCacheCost.h" 10 | #import "objc/runtime.h" 11 | #import "NSImage+Compatibility.h" 12 | 13 | FOUNDATION_STATIC_INLINE NSUInteger SDMemoryCacheCostForImage(UIImage *image) { 14 | CGImageRef imageRef = image.CGImage; 15 | if (!imageRef) { 16 | return 0; 17 | } 18 | NSUInteger bytesPerFrame = CGImageGetBytesPerRow(imageRef) * CGImageGetHeight(imageRef); 19 | NSUInteger frameCount; 20 | #if SD_MAC 21 | frameCount = 1; 22 | #elif SD_UIKIT || SD_WATCH 23 | frameCount = image.images.count > 0 ? image.images.count : 1; 24 | #endif 25 | NSUInteger cost = bytesPerFrame * frameCount; 26 | return cost; 27 | } 28 | 29 | @implementation UIImage (MemoryCacheCost) 30 | 31 | - (NSUInteger)sd_memoryCost { 32 | NSNumber *value = objc_getAssociatedObject(self, @selector(sd_memoryCost)); 33 | NSUInteger memoryCost; 34 | if (value != nil) { 35 | memoryCost = [value unsignedIntegerValue]; 36 | } else { 37 | memoryCost = SDMemoryCacheCostForImage(self); 38 | } 39 | return memoryCost; 40 | } 41 | 42 | - (void)setSd_memoryCost:(NSUInteger)sd_memoryCost { 43 | objc_setAssociatedObject(self, @selector(sd_memoryCost), @(sd_memoryCost), OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "SDWebImageOperation.h" 11 | 12 | /** 13 | These methods are used to support canceling for UIView image loading, it's designed to be used internal but not external. 14 | All the stored operations are weak, so it will be dalloced after image loading finished. If you need to store operations, use your own class to keep a strong reference for them. 15 | */ 16 | @interface UIView (WebCacheOperation) 17 | 18 | /** 19 | * Get the image load operation for key 20 | * 21 | * @param key key for identifying the operations 22 | * @return the image load operation 23 | */ 24 | - (nullable id)sd_imageLoadOperationForKey:(nullable NSString *)key; 25 | 26 | /** 27 | * Set the image load operation (storage in a UIView based weak map table) 28 | * 29 | * @param operation the operation 30 | * @param key key for storing the operation 31 | */ 32 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 33 | 34 | /** 35 | * Cancel all operations for the current UIView and key 36 | * 37 | * @param key key for identifying the operations 38 | */ 39 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 40 | 41 | /** 42 | * Just remove the operations corresponding to the current UIView and key without cancelling them 43 | * 44 | * @param key key for identifying the operations 45 | */ 46 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/SDWebImage/WebImage/SDWebImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/DWNavigationTransition/DWNavigationTransition-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_DWNavigationTransition : NSObject 3 | @end 4 | @implementation PodsDummy_DWNavigationTransition 5 | @end 6 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/DWNavigationTransition/DWNavigationTransition-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/DWNavigationTransition/DWNavigationTransition.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/DWNavigationTransition 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DWNavigationTransition" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWNavigationTransition" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/Pods-DWNavigationTransition/Pods-DWNavigationTransition-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## DWNavigationTransition 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/Pods-DWNavigationTransition/Pods-DWNavigationTransition-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DWNavigationTransition : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DWNavigationTransition 5 | @end 6 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/Pods-DWNavigationTransition/Pods-DWNavigationTransition.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWNavigationTransition" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/DWNavigationTransition" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DWNavigationTransition" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DWNavigationTransition/DEMO/Pods/Target Support Files/Pods-DWNavigationTransition/Pods-DWNavigationTransition.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWNavigationTransition" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/DWNavigationTransition" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DWNavigationTransition" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DWNavigationTransition' 3 | s.version = '0.0.0.1' 4 | s.license = { :type => 'MIT', :file => 'LICENSE' } 5 | s.summary = '导航栏平滑处理。Help you handle navigationBar.' 6 | s.homepage = 'https://github.com/CodeWicky/-Tools/tree/master/DWNavigationTransition' 7 | s.authors = { 'codeWicky' => 'codewicky@163.com' } 8 | s.source = { :git => 'https://github.com/CodeWicky/-Tools.git', :tag => s.version.to_s } 9 | s.requires_arc = true 10 | s.ios.deployment_target = '9.1' 11 | s.source_files = 'DWNavigationTransition/**/*.{h,m}' 12 | s.frameworks = 'UIKit' 13 | 14 | end 15 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/DWTransitionFunction.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTransitionFunction.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/24. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #define DWQuickSwizzleMethod(A,B) DWSwizzleMethod([self class],@selector(A),[self class],@selector(B)) 12 | #define DWQuickGetAssociatedValue() DWGetAssociatedValue(self,_cmd) 13 | #define DWQuickSetAssociatedValue(key,value) DWSetAssociatedValue(self,key,value) 14 | 15 | extern void DWSwizzleMethod(Class originalCls, SEL originalSelector, Class swizzledCls, SEL swizzledSelector); 16 | extern id DWGetAssociatedValue(id target,const void * key); 17 | extern void DWSetAssociatedValue(id target,const void * key,id value); 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/DWTransitionFunction.m: -------------------------------------------------------------------------------- 1 | // 2 | // aViewController.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/24. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWTransitionFunction.h" 10 | #import 11 | 12 | void DWSwizzleMethod(Class originalCls, SEL originalSelector, Class swizzledCls, SEL swizzledSelector) { 13 | Method originalMethod = class_getInstanceMethod(originalCls, originalSelector); 14 | Method swizzledMethod = class_getInstanceMethod(swizzledCls, swizzledSelector); 15 | 16 | BOOL didAddMethod = 17 | class_addMethod(originalCls, 18 | originalSelector, 19 | method_getImplementation(swizzledMethod), 20 | method_getTypeEncoding(swizzledMethod)); 21 | 22 | if (didAddMethod) { 23 | class_replaceMethod(originalCls, 24 | swizzledSelector, 25 | method_getImplementation(originalMethod), 26 | method_getTypeEncoding(originalMethod)); 27 | } else { 28 | method_exchangeImplementations(originalMethod, swizzledMethod); 29 | } 30 | } 31 | 32 | id DWGetAssociatedValue(id target,const void * key) { 33 | if (NULL == key) { 34 | return nil; 35 | } 36 | return objc_getAssociatedObject(target, key); 37 | } 38 | 39 | void DWSetAssociatedValue(id target,const void * key,id value) { 40 | if (NULL == key) { 41 | return; 42 | } 43 | objc_setAssociatedObject(target, key, value, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 44 | } 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UINavigationBar+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // 7 | 8 | #import 9 | 10 | @interface UINavigationBar (DWNavigationTransition) 11 | 12 | @property (nonatomic ,strong ,readonly) UIView * dw_backgroundView; 13 | 14 | @property (nonatomic ,assign) BOOL dw_isFakeBar; 15 | 16 | -(void)copyFromBar:(UINavigationBar *)bar; 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UINavigationBar+DWNavigationTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationBar+DWNavigationTransition.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // 7 | 8 | #import "UINavigationBar+DWNavigationTransition.h" 9 | #import "DWTransitionFunction.h" 10 | 11 | @implementation UINavigationBar (DWNavigationTransition) 12 | 13 | #ifdef __IPHONE_11_0 14 | + (void)load { 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | DWQuickSwizzleMethod(layoutSubviews, dw_navigationTransition_layoutSubviews); 18 | }); 19 | } 20 | #endif 21 | 22 | -(void)dw_navigationTransition_layoutSubviews { 23 | [self dw_navigationTransition_layoutSubviews]; 24 | CGRect frame = self.dw_backgroundView.frame; 25 | frame.size.height = self.frame.size.height + fabs(frame.origin.y); 26 | self.dw_backgroundView.frame = frame; 27 | } 28 | 29 | -(void)copyFromBar:(UINavigationBar *)bar { 30 | self.barTintColor = bar.barTintColor; 31 | self.shadowImage = bar.shadowImage; 32 | self.barStyle = bar.barStyle; 33 | self.translucent = bar.translucent; 34 | [self setBackgroundImage:[bar backgroundImageForBarMetrics:(UIBarMetricsDefault)] forBarMetrics:(UIBarMetricsDefault)]; 35 | } 36 | 37 | #pragma mark --- setter/getter --- 38 | -(UIView *)dw_backgroundView { 39 | UIView * view = DWQuickGetAssociatedValue(); 40 | if (!view) { 41 | view = [self valueForKey:@"_backgroundView"]; 42 | DWQuickSetAssociatedValue(_cmd, view); 43 | } 44 | return view; 45 | } 46 | 47 | -(void)setDw_isFakeBar:(BOOL)dw_isFakeBar { 48 | DWQuickSetAssociatedValue(@selector(dw_isFakeBar), @(dw_isFakeBar)); 49 | } 50 | 51 | -(BOOL)dw_isFakeBar { 52 | return [DWQuickGetAssociatedValue() boolValue]; 53 | } 54 | 55 | @end 56 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UINavigationController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UINavigationController+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/24. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UINavigationController (DWNavigationTransition) 12 | 13 | @property (nonatomic ,assign ,readonly) BOOL dw_useNavigationTransition; 14 | 15 | @property (nonatomic ,assign) BOOL dw_backgroundViewHidden; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UIScrollView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/6. 6 | // 7 | 8 | #import 9 | 10 | @interface UIScrollView (DWNavigationTransition) 11 | 12 | #ifdef __IPHONE_11_0 13 | @property (nonatomic, assign) BOOL dw_shouldRestoreContentInsetAdjustmentBehavior NS_AVAILABLE_IOS(11_0); 14 | @property (nonatomic, assign) UIScrollViewContentInsetAdjustmentBehavior dw_storedContentInsetAdjustmentBehavior NS_AVAILABLE_IOS(11_0); 15 | #endif 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UIScrollView+DWNavigationTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIScrollView+DWNavigationTransition.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/6. 6 | // 7 | 8 | #import "UIScrollView+DWNavigationTransition.h" 9 | #import "DWTransitionFunction.h" 10 | 11 | @implementation UIScrollView (DWNavigationTransition) 12 | 13 | -(void)setDw_shouldRestoreContentInsetAdjustmentBehavior:(BOOL)dw_shouldRestoreContentInsetAdjustmentBehavior { 14 | DWQuickSetAssociatedValue(@selector(dw_shouldRestoreContentInsetAdjustmentBehavior), @(dw_shouldRestoreContentInsetAdjustmentBehavior)); 15 | } 16 | 17 | -(BOOL)dw_shouldRestoreContentInsetAdjustmentBehavior { 18 | return [DWQuickGetAssociatedValue() boolValue]; 19 | } 20 | 21 | -(void)setDw_storedContentInsetAdjustmentBehavior:(UIScrollViewContentInsetAdjustmentBehavior)dw_storedContentInsetAdjustmentBehavior { 22 | DWQuickSetAssociatedValue(@selector(dw_storedContentInsetAdjustmentBehavior), @(dw_storedContentInsetAdjustmentBehavior)); 23 | } 24 | 25 | -(UIScrollViewContentInsetAdjustmentBehavior)dw_storedContentInsetAdjustmentBehavior { 26 | return [DWQuickGetAssociatedValue() boolValue]; 27 | } 28 | 29 | @end 30 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UITabBarController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBarController+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/16. 6 | // 7 | 8 | #import 9 | 10 | @interface UITabBarController (DWNavigationTransition) 11 | 12 | @property (nonatomic ,assign ,readonly) BOOL dw_useNavigationTransition; 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UITabBarController+DWNavigationTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UITabBarController+DWNavigationTransition.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/16. 6 | // 7 | 8 | #import "UITabBarController+DWNavigationTransition.h" 9 | #import "UIViewController+DWNavigationTransition.h" 10 | 11 | @implementation UITabBarController (DWNavigationTransition) 12 | @dynamic dw_useNavigationTransition; 13 | 14 | -(BOOL)dw_useNavigationTransition { 15 | return self.selectedViewController.dw_useNavigationTransition; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UIView+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/2. 6 | // 7 | 8 | #import 9 | 10 | @interface UIView (DWNavigationTransition) 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UIView+DWNavigationTransition.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DWNavigationTransition.m 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/7/2. 6 | // 7 | 8 | #import "UIView+DWNavigationTransition.h" 9 | #import "UINavigationController+DWNavigationTransition.h" 10 | #import "UINavigationBar+DWNavigationTransition.h" 11 | #import "DWTransitionFunction.h" 12 | 13 | @implementation UIView (DWNavigationTransition) 14 | 15 | +(void)load { 16 | static dispatch_once_t onceToken; 17 | dispatch_once(&onceToken, ^{ 18 | DWSwizzleMethod(NSClassFromString(@"_UIBarBackground"), @selector(setHidden:), [self class], @selector(dw_navigationTransition_setHidden:)); 19 | }); 20 | } 21 | 22 | -(void)dw_navigationTransition_setHidden:(BOOL)hidden { 23 | UIResponder *responder = (UIResponder *)self; 24 | while (responder) { 25 | ///这里如果判断到是占位的bar则不做响应,减少运算量 26 | if ([responder isKindOfClass:[UINavigationBar class]] && ((UINavigationBar *)responder).dw_isFakeBar) { 27 | return; 28 | } 29 | ///这里如果判断到是Navigation上的navigationBar的话,则按照导航显隐进行展示 30 | if ([responder isKindOfClass:[UINavigationController class]]) { 31 | [self dw_navigationTransition_setHidden:((UINavigationController *)responder).dw_backgroundViewHidden]; 32 | return; 33 | } 34 | responder = responder.nextResponder; 35 | } 36 | [self dw_navigationTransition_setHidden:hidden]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWNavigationTransition/DWNavigationTransition/UIViewController+DWNavigationTransition.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIViewController+DWNavigationTransition.h 3 | // DWNavigationTransition 4 | // 5 | // Created by Wicky on 2019/6/27. 6 | // 7 | 8 | #import 9 | 10 | @interface UIViewController (DWNavigationTransition) 11 | 12 | @property (nonatomic ,assign) BOOL dw_useNavigationTransition; 13 | 14 | @property (nonatomic ,assign) BOOL dw_inTransition; 15 | 16 | @property (nonatomic ,strong) UINavigationBar * dw_transitionBar; 17 | 18 | @property (nonatomic ,strong) UINavigationBar * dw_statusStoreBar; 19 | 20 | @property (nonatomic ,strong) UIViewController * dw_transitioningViewController; 21 | 22 | @property (nonatomic ,assign) BOOL dw_isPushTransition; 23 | 24 | @property (nonatomic ,assign) BOOL dw_isPopTransition; 25 | 26 | -(void)dw_addTransitionBarIfNeeded; 27 | 28 | -(void)dw_removeTransitionBarIfNeeded; 29 | 30 | -(void)dw_resizeTransitionBarFrame; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /DWNavigationTransition/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DWNavigationTransition/README.md: -------------------------------------------------------------------------------- 1 | # DWMediaPreviewController 2 | 一个媒体预览工具 3 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Framework/DWAbstractManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAbstractManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | /** 10 | 支付抽象类。 11 | 12 | 提供抽象方法,以便规范化支付流程。 13 | 具体支付方式不同参数不同需在子类自行实现其他接口。 14 | */ 15 | 16 | #import "DWPaymentHeader.h" 17 | @interface DWAbstractManager : NSObject 18 | 19 | ///支付完成回调 20 | @property (nonatomic ,copy) PaymentCompletion paymentCompletion; 21 | 22 | ///以下均为抽象方法,子类需自行重写父类方法。 23 | 24 | /** 25 | 支付方法 26 | 27 | @param orderInfo 支付信息 28 | @param completion 支付成功回调 29 | */ 30 | +(void)payWithOrderInfo:(id)orderInfo completion:(PaymentCompletion)completion; 31 | 32 | /** 33 | 默认支付回调 34 | 35 | @param url 回调url 36 | */ 37 | +(void)defaultCallBackWithUrl:(NSURL *)url; 38 | 39 | 40 | /** 41 | 注册SDK 42 | */ 43 | +(void)registIfNeedWithConfig:(DWPaymentConfig *)config; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Framework/DWAbstractManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWAbstractManager.m 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | #define AbstractMethodNotImplemented() \ 12 | @throw [NSException exceptionWithName:NSInternalInconsistencyException \ 13 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \ 14 | userInfo:nil] 15 | 16 | @implementation DWAbstractManager 17 | 18 | +(void)payWithOrderInfo:(id)orderInfo completion:(PaymentCompletion)completion { 19 | AbstractMethodNotImplemented(); 20 | } 21 | 22 | +(void)defaultCallBackWithUrl:(NSURL *)url { 23 | AbstractMethodNotImplemented(); 24 | } 25 | 26 | +(void)registIfNeedWithConfig:(DWPaymentConfig *)config { 27 | AbstractMethodNotImplemented(); 28 | } 29 | 30 | #pragma mark --- singlton --- 31 | 32 | -(id)copyWithZone:(NSZone *)zone { 33 | return self; 34 | } 35 | 36 | -(id)mutableCopyWithZone:(NSZone *)zone { 37 | return self; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Framework/DWPaymentConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentConfig.h 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, DWPaymentType) {///支付方式枚举 12 | DWPaymentTypeUndefined,///未指定支付方式 13 | DWPaymentTypeAlipay,///支付宝 14 | DWPaymentTypeWeiXin,///微信 15 | DWPaymentTypeUnionPay,///银联 16 | }; 17 | 18 | @interface DWPaymentConfig : NSObject 19 | 20 | ///支付类型 21 | @property (nonatomic ,assign) DWPaymentType payType; 22 | 23 | ///支付SDK所对应的AppID 24 | @property (nonatomic ,copy) NSString * AppID; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Framework/DWPaymentConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentConfig.m 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWPaymentConfig.h" 10 | 11 | @implementation DWPaymentConfig 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Framework/DWPaymentHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentHeader.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | /** 10 | 头文件 11 | */ 12 | 13 | #ifndef DWPaymentHeader_h 14 | #define DWPaymentHeader_h 15 | 16 | #import 17 | #import "DWPaymentConfig.h" 18 | 19 | typedef NS_ENUM(NSUInteger, PayStatus) {///支付状态 20 | PayStatusSuccess,///支付成功 21 | PayStatusPending,///支付处理中(此种状态支付结果以异步返给server的结果为准) 22 | PayStatusCancel,///支付取消 23 | PayStatusFail,///支付失败 24 | }; 25 | 26 | /** 27 | 支付完成回调 28 | 29 | @param payType 支付类型 30 | @param status 支付状态 31 | @param code 状态码 32 | @param message 状态描述 33 | @param payResult 支付结果 34 | */ 35 | typedef void(^PaymentCompletion)(DWPaymentType payType,PayStatus status,NSString * code,NSString * message,id payResult); 36 | 37 | #if DEBUG 38 | #define DevEvn//开发环境标识符 39 | #endif 40 | 41 | #endif /* DWPaymentHeader_h */ 42 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/bar@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh_click@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown_click@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/AlipaySDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/AlipaySDK -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Headers/APayAuthInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // APAuthInfo.h 3 | // AliSDKDemo 4 | // 5 | // Created by alipay on 16-12-12. 6 | // Copyright (c) 2016年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APayAuthInfo : NSObject 12 | 13 | @property(nonatomic, copy)NSString *appID; 14 | @property(nonatomic, copy)NSString *pid; 15 | @property(nonatomic, copy)NSString *redirectUri; 16 | 17 | /** 18 | * 初始化AuthInfo 19 | * 20 | * @param appIDStr 应用ID 21 | * @param pidStr 商户ID 可不填 22 | * @param uriStr 授权的应用回调地址 比如:alidemo://auth 23 | * 24 | * @return authinfo实例 25 | */ 26 | - (id)initWithAppID:(NSString *)appIDStr 27 | pid:(NSString *)pidStr 28 | redirectUri:(NSString *)uriStr; 29 | 30 | - (NSString *)description; 31 | - (NSString *)wapDescription; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Info.plist -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/Alipay/支付宝联集成指南.md: -------------------------------------------------------------------------------- 1 | #支付宝集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.09.06.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.10.45.png) 10 | 11 | ###3.引入依赖库 12 | target - Build Phases - Link Binary With Libraries 13 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/3ebefcabdf8062f717dbb5d866ba7cfb.png) 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/UnionPay/UPPaymentControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // PaymentControl.h 3 | // PaymentControl 4 | // 5 | // Created by qcao on 15/10/20. 6 | // Copyright © 2015年 China Unionpay Co.,Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | typedef void (^UPPaymentResultBlock)(NSString* code, NSDictionary* data); 14 | 15 | 16 | @interface UPPaymentControl : NSObject 17 | 18 | 19 | /** 20 | * 创建支付单例服务 21 | * 22 | * @return 返回单例对象 23 | */ 24 | 25 | + (UPPaymentControl *)defaultControl; 26 | 27 | 28 | /** 29 | * 支付接口 30 | * 31 | * @param tn 订单信息 32 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 33 | * @param mode 支付环境 34 | * @param viewController 启动支付控件的viewController 35 | * @return 返回成功失败 36 | */ 37 | - (BOOL)startPay:(NSString*)tn 38 | fromScheme:(NSString *)schemeStr 39 | mode:(NSString*)mode 40 | viewController:(UIViewController*)viewController; 41 | 42 | 43 | 44 | /** 45 | * APP是否已安装检测接口,通过该接口得知用户是否安装银联支付的APP。 46 | * 47 | * @return 返回是否已经安装了银联支付APP 48 | */ 49 | 50 | 51 | - (BOOL)isPaymentAppInstalled; 52 | 53 | /** 54 | * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url 55 | * 56 | * @param url 支付结果url,传入后由SDK解析 57 | * @param completionBlock 结果回调,保证跳转钱包支付过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。 58 | */ 59 | 60 | - (void)handlePaymentResult:(NSURL*)url completeBlock:(UPPaymentResultBlock)completionBlock; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/UnionPay/libPaymentControl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/UnionPay/libPaymentControl.a -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/UnionPay/广银联集成指南.md: -------------------------------------------------------------------------------- 1 | #银联集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.23.59.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.25.51.png) 10 | 11 | ###3.配置白名单 12 | Info.plist 13 | 14 | ``` 15 | LSApplicationQueriesSchemes 16 | 17 | uppaysdk 18 | uppaywallet 19 | uppayx1 20 | uppayx2 21 | uppayx3 22 | 23 | ``` 24 | 25 | ###4.配置ATS 26 | ###5.引入依赖库 27 | target - Build Phases - Link Binary With Libraries 28 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.30.23.png) 29 | ###6.设置-ObjC 30 | target - Build Settings - Other Linker Flags 31 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.32.35.png) 32 | 33 | ###7.设置Compile Sources As Objective-C++ 34 | target - Build Settings - Apple LLVM 8.1 - Language - Compile Sources AS 35 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.36.31.png) 36 | 37 | 38 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/WeixinPay/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/DWPaymentManager/Lib/WeixinPay/libWeChatSDK.a -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Lib/WeixinPay/微信支付集成指南.md: -------------------------------------------------------------------------------- 1 | #微信支付集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.39.51.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | 此处应与APPID相同 10 | 11 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.41.17.png) 12 | 13 | ###3.引入依赖库 14 | target - Build Phases - Link Binary With Libraries 15 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.44.49.png) 16 | ###4.设置-ObjC 17 | target - Build Settings - Other Linker Flags 18 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.42.54.png) 19 | 20 | 21 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Plugin/Alipay/DWAlipayManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAlipayManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | @interface DWAlipayManager : DWAbstractManager 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Plugin/UnionPay/DWUnionPayManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWUnionPayManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | @interface DWUnionPayManager : DWAbstractManager 12 | 13 | /** 14 | 提供银联支付入口 15 | 16 | @param orderInfo 支付信息 17 | @param currentVC 当前控制器 18 | @param completion 支付完成回调 19 | */ 20 | +(void)payWithOrderInfo:(id)orderInfo currentVC:(UIViewController *)currentVC completion:(PaymentCompletion)completion; 21 | @end 22 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/Plugin/WeixinPay/DWWeiXinManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWWeiXinManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | @interface DWWeiXinManager : DWAbstractManager 12 | 13 | /** 14 | 当不使用提供的默认支付完成回调实现时,可考虑调用此API,也可自行实现。 15 | 此API实现了微信支付的默认回调并提供非微信支付回调的回调接口 16 | 17 | @param url 回调url 18 | @param otherHandler 非微信支付的回调接口 19 | */ 20 | +(void)defaultCallBackWithUrl:(NSURL *)url otherHandler:(BOOL(^)())otherHandler; 21 | @end 22 | -------------------------------------------------------------------------------- /DWPaymentManager/DWPaymentManager/ReadMe.md: -------------------------------------------------------------------------------- 1 | # DWPaymentManager使用方法 2 | 3 | ### 以插件的形式让代码入侵性更小,使用谁引入谁即可。 4 | 5 | ### 关于库的引入 6 | --- 7 | 使用时**按需在Lib中引入对应支付方式三方库,Plugin中引入对应提供的管理者即可**。例如需支持支付宝,则对应引入Alipay即可。 8 | 9 | ### 关于支付调用 10 | --- 11 | 支付是统一调用DWPaymentManager的类方法并传入`支付类型`及`订单信息`即可。 12 | 13 | ``` 14 | NSString * orderString = ... 15 | [DWPaymentManager payWithOrderInfo:orderString payType:DWPaymentTypeAlipay currentVC:self completion:^(DWPaymentType payType, id payResult) { 16 | NSLog(@"Alipay Result = %@",payResult); 17 | }]; 18 | ``` 19 | 20 | ### 关于SDK的扩展及补充 21 | --- 22 | 当前提供支付宝、微信、广银联三种支付方式。如需额外添加方式,建议继承自抽象类DWAbstractManager。该抽象类提供了支付流程的必要接口,子类需重写其提供的接口,也可按需扩展接口,原接口务必重写。 23 | 24 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/project.xcworkspace/xcuserdata/zhangdingwen.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/project.xcworkspace/xcuserdata/zhangdingwen.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/xcuserdata/Wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PaymentDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 9BE55BB01F345DFF00224DC8 16 | 17 | primary 18 | 19 | 20 | 9BE55BC91F345DFF00224DC8 21 | 22 | primary 23 | 24 | 25 | 9BE55BD41F345DFF00224DC8 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo.xcodeproj/xcuserdata/zhangdingwen.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | PaymentDemo.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/4. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Framework/DWAbstractManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAbstractManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | /** 10 | 支付抽象类。 11 | 12 | 提供抽象方法,以便规范化支付流程。 13 | 具体支付方式不同参数不同需在子类自行实现其他接口。 14 | */ 15 | 16 | #import "DWPaymentHeader.h" 17 | @interface DWAbstractManager : NSObject 18 | 19 | ///支付完成回调 20 | @property (nonatomic ,copy) PaymentCompletion paymentCompletion; 21 | 22 | ///以下均为抽象方法,子类需自行重写父类方法。 23 | 24 | /** 25 | 支付方法 26 | 27 | @param orderInfo 支付信息 28 | @param completion 支付成功回调 29 | */ 30 | +(void)payWithOrderInfo:(id)orderInfo completion:(PaymentCompletion)completion; 31 | 32 | /** 33 | 默认支付回调 34 | 35 | @param url 回调url 36 | */ 37 | +(void)defaultCallBackWithUrl:(NSURL *)url; 38 | 39 | 40 | /** 41 | 注册SDK 42 | */ 43 | +(void)registIfNeedWithConfig:(DWPaymentConfig *)config; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Framework/DWAbstractManager.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWAbstractManager.m 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | #define AbstractMethodNotImplemented() \ 12 | @throw [NSException exceptionWithName:NSInternalInconsistencyException \ 13 | reason:[NSString stringWithFormat:@"You must override %@ in a subclass.", NSStringFromSelector(_cmd)] \ 14 | userInfo:nil] 15 | 16 | @implementation DWAbstractManager 17 | 18 | +(void)payWithOrderInfo:(id)orderInfo completion:(PaymentCompletion)completion { 19 | AbstractMethodNotImplemented(); 20 | } 21 | 22 | +(void)defaultCallBackWithUrl:(NSURL *)url { 23 | AbstractMethodNotImplemented(); 24 | } 25 | 26 | +(void)registIfNeedWithConfig:(DWPaymentConfig *)config { 27 | AbstractMethodNotImplemented(); 28 | } 29 | 30 | #pragma mark --- singlton --- 31 | 32 | -(id)copyWithZone:(NSZone *)zone { 33 | return self; 34 | } 35 | 36 | -(id)mutableCopyWithZone:(NSZone *)zone { 37 | return self; 38 | } 39 | @end 40 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Framework/DWPaymentConfig.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentConfig.h 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, DWPaymentType) {///支付方式枚举 12 | DWPaymentTypeUndefined,///未指定支付方式 13 | DWPaymentTypeAlipay,///支付宝 14 | DWPaymentTypeWeiXin,///微信 15 | DWPaymentTypeUnionPay,///银联 16 | }; 17 | 18 | @interface DWPaymentConfig : NSObject 19 | 20 | ///支付类型 21 | @property (nonatomic ,assign) DWPaymentType payType; 22 | 23 | ///支付SDK所对应的AppID 24 | @property (nonatomic ,copy) NSString * AppID; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Framework/DWPaymentConfig.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentConfig.m 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWPaymentConfig.h" 10 | 11 | @implementation DWPaymentConfig 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Framework/DWPaymentHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWPaymentHeader.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | /** 10 | 头文件 11 | */ 12 | 13 | #ifndef DWPaymentHeader_h 14 | #define DWPaymentHeader_h 15 | 16 | #import 17 | #import "DWPaymentConfig.h" 18 | 19 | typedef NS_ENUM(NSUInteger, PayStatus) {///支付状态 20 | PayStatusSuccess,///支付成功 21 | PayStatusPending,///支付处理中(此种状态支付结果以异步返给server的结果为准) 22 | PayStatusCancel,///支付取消 23 | PayStatusFail,///支付失败 24 | }; 25 | 26 | /** 27 | 支付完成回调 28 | 29 | @param payType 支付类型 30 | @param status 支付状态 31 | @param code 状态码 32 | @param message 状态描述 33 | @param payResult 支付结果 34 | */ 35 | typedef void(^PaymentCompletion)(DWPaymentType payType,PayStatus status,NSString * code,NSString * message,id payResult); 36 | 37 | #if DEBUG 38 | #define DevEvn//开发环境标识符 39 | #endif 40 | 41 | #endif /* DWPaymentHeader_h */ 42 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/bar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/bar@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/refresh_click@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown_click@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.bundle/shutdown_click@2x.png -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/AlipaySDK: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/AlipaySDK -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Headers/APayAuthInfo.h: -------------------------------------------------------------------------------- 1 | // 2 | // APAuthInfo.h 3 | // AliSDKDemo 4 | // 5 | // Created by alipay on 16-12-12. 6 | // Copyright (c) 2016年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface APayAuthInfo : NSObject 12 | 13 | @property(nonatomic, copy)NSString *appID; 14 | @property(nonatomic, copy)NSString *pid; 15 | @property(nonatomic, copy)NSString *redirectUri; 16 | 17 | /** 18 | * 初始化AuthInfo 19 | * 20 | * @param appIDStr 应用ID 21 | * @param pidStr 商户ID 可不填 22 | * @param uriStr 授权的应用回调地址 比如:alidemo://auth 23 | * 24 | * @return authinfo实例 25 | */ 26 | - (id)initWithAppID:(NSString *)appIDStr 27 | pid:(NSString *)pidStr 28 | redirectUri:(NSString *)uriStr; 29 | 30 | - (NSString *)description; 31 | - (NSString *)wapDescription; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/Info.plist -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/AlipaySDK.framework/en.lproj/InfoPlist.strings -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/Alipay/支付宝联集成指南.md: -------------------------------------------------------------------------------- 1 | #支付宝集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.09.06.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.10.45.png) 10 | 11 | ###3.引入依赖库 12 | target - Build Phases - Link Binary With Libraries 13 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/3ebefcabdf8062f717dbb5d866ba7cfb.png) 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/UnionPay/UPPaymentControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // PaymentControl.h 3 | // PaymentControl 4 | // 5 | // Created by qcao on 15/10/20. 6 | // Copyright © 2015年 China Unionpay Co.,Ltd. All rights reserved. 7 | // 8 | 9 | #import 10 | #import 11 | 12 | 13 | typedef void (^UPPaymentResultBlock)(NSString* code, NSDictionary* data); 14 | 15 | 16 | @interface UPPaymentControl : NSObject 17 | 18 | 19 | /** 20 | * 创建支付单例服务 21 | * 22 | * @return 返回单例对象 23 | */ 24 | 25 | + (UPPaymentControl *)defaultControl; 26 | 27 | 28 | /** 29 | * 支付接口 30 | * 31 | * @param tn 订单信息 32 | * @param schemeStr 调用支付的app注册在info.plist中的scheme 33 | * @param mode 支付环境 34 | * @param viewController 启动支付控件的viewController 35 | * @return 返回成功失败 36 | */ 37 | - (BOOL)startPay:(NSString*)tn 38 | fromScheme:(NSString *)schemeStr 39 | mode:(NSString*)mode 40 | viewController:(UIViewController*)viewController; 41 | 42 | 43 | 44 | /** 45 | * APP是否已安装检测接口,通过该接口得知用户是否安装银联支付的APP。 46 | * 47 | * @return 返回是否已经安装了银联支付APP 48 | */ 49 | 50 | 51 | - (BOOL)isPaymentAppInstalled; 52 | 53 | /** 54 | * 处理钱包或者独立快捷app支付跳回商户app携带的支付结果Url 55 | * 56 | * @param url 支付结果url,传入后由SDK解析 57 | * @param completionBlock 结果回调,保证跳转钱包支付过程中,即使调用方app被系统kill时,能通过这个回调取到支付结果。 58 | */ 59 | 60 | - (void)handlePaymentResult:(NSURL*)url completeBlock:(UPPaymentResultBlock)completionBlock; 61 | 62 | @end 63 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/UnionPay/libPaymentControl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/UnionPay/libPaymentControl.a -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/UnionPay/广银联集成指南.md: -------------------------------------------------------------------------------- 1 | #银联集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.23.59.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.25.51.png) 10 | 11 | ###3.配置白名单 12 | Info.plist 13 | 14 | ``` 15 | LSApplicationQueriesSchemes 16 | 17 | uppaysdk 18 | uppaywallet 19 | uppayx1 20 | uppayx2 21 | uppayx3 22 | 23 | ``` 24 | 25 | ###4.配置ATS 26 | ###5.引入依赖库 27 | target - Build Phases - Link Binary With Libraries 28 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.30.23.png) 29 | ###6.设置-ObjC 30 | target - Build Settings - Other Linker Flags 31 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.32.35.png) 32 | 33 | ###7.设置Compile Sources As Objective-C++ 34 | target - Build Settings - Apple LLVM 8.1 - Language - Compile Sources AS 35 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%884.36.31.png) 36 | 37 | 38 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/WeixinPay/libWeChatSDK.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/WeixinPay/libWeChatSDK.a -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Lib/WeixinPay/微信支付集成指南.md: -------------------------------------------------------------------------------- 1 | #微信支付集成步骤 2 | 3 | ###1.拖入文件 4 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.39.51.png) 5 | 6 | ###2.配置Url Type 7 | target - Info - URL Types 8 | 9 | 此处应与APPID相同 10 | 11 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.41.17.png) 12 | 13 | ###3.引入依赖库 14 | target - Build Phases - Link Binary With Libraries 15 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.44.49.png) 16 | ###4.设置-ObjC 17 | target - Build Settings - Other Linker Flags 18 | ![](http://ou5knrhdx.bkt.clouddn.com/DWPaymentManager/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7%202017-08-04%20%E4%B8%8B%E5%8D%885.42.54.png) 19 | 20 | 21 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Plugin/Alipay/DWAlipayManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWAlipayManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | @interface DWAlipayManager : DWAbstractManager 11 | 12 | @end 13 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Plugin/UnionPay/DWUnionPayManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWUnionPayManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | @interface DWUnionPayManager : DWAbstractManager 12 | 13 | /** 14 | 提供银联支付入口 15 | 16 | @param orderInfo 支付信息 17 | @param currentVC 当前控制器 18 | @param completion 支付完成回调 19 | */ 20 | +(void)payWithOrderInfo:(id)orderInfo currentVC:(UIViewController *)currentVC completion:(PaymentCompletion)completion; 21 | @end 22 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/Plugin/WeixinPay/DWWeiXinManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWWeiXinManager.h 3 | // AliSDKDemo 4 | // 5 | // Created by Wicky on 2017/8/3. 6 | // Copyright © 2017年 Alipay.com. All rights reserved. 7 | // 8 | 9 | #import "DWAbstractManager.h" 10 | 11 | @interface DWWeiXinManager : DWAbstractManager 12 | 13 | /** 14 | 当不使用提供的默认支付完成回调实现时,可考虑调用此API,也可自行实现。 15 | 此API实现了微信支付的默认回调并提供非微信支付回调的回调接口 16 | 17 | @param url 回调url 18 | @param otherHandler 非微信支付的回调接口 19 | */ 20 | +(void)defaultCallBackWithUrl:(NSURL *)url otherHandler:(BOOL(^)())otherHandler; 21 | @end 22 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/DWPaymentManager/ReadMe.md: -------------------------------------------------------------------------------- 1 | #DWPaymentManager使用方法 2 | 3 | ###以插件的形式让代码入侵性更小,使用谁引入谁即可。 4 | 5 | ###关于库的引入 6 | --- 7 | 使用时**按需在Lib中引入对应支付方式三方库,Plugin中引入对应提供的管理者即可**。例如需支持支付宝,则对应引入Alipay即可。 8 | 9 | ###关于支付调用 10 | --- 11 | 支付是统一调用DWPaymentManager的类方法并传入`支付类型`及`订单信息`即可。 12 | 13 | ``` 14 | NSString * orderString = ... 15 | [DWPaymentManager payWithOrderInfo:orderString payType:DWPaymentTypeAlipay currentVC:self completion:^(DWPaymentType payType, id payResult) { 16 | NSLog(@"Alipay Result = %@",payResult); 17 | }]; 18 | ``` 19 | 20 | ###关于SDK的扩展及补充 21 | --- 22 | 当前提供支付宝、微信、广银联三种支付方式。如需额外添加方式,建议继承自抽象类DWAbstractManager。该抽象类提供了支付流程的必要接口,子类需重写其提供的接口,也可按需扩展接口,原接口务必重写。 23 | 24 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/4. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemo/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // PaymentDemo 4 | // 5 | // Created by Wicky on 2017/8/4. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemoTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemoTests/PaymentDemoTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PaymentDemoTests.m 3 | // PaymentDemoTests 4 | // 5 | // Created by Wicky on 2017/8/4. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PaymentDemoTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PaymentDemoTests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | // Put setup code here. This method is called before the invocation of each test method in the class. 20 | } 21 | 22 | - (void)tearDown { 23 | // Put teardown code here. This method is called after the invocation of each test method in the class. 24 | [super tearDown]; 25 | } 26 | 27 | - (void)testExample { 28 | // This is an example of a functional test case. 29 | // Use XCTAssert and related functions to verify your tests produce the correct results. 30 | } 31 | 32 | - (void)testPerformanceExample { 33 | // This is an example of a performance test case. 34 | [self measureBlock:^{ 35 | // Put the code you want to measure the time of here. 36 | }]; 37 | } 38 | 39 | @end 40 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemoUITests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /DWPaymentManager/PaymentDemo/PaymentDemoUITests/PaymentDemoUITests.m: -------------------------------------------------------------------------------- 1 | // 2 | // PaymentDemoUITests.m 3 | // PaymentDemoUITests 4 | // 5 | // Created by Wicky on 2017/8/4. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface PaymentDemoUITests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation PaymentDemoUITests 16 | 17 | - (void)setUp { 18 | [super setUp]; 19 | 20 | // Put setup code here. This method is called before the invocation of each test method in the class. 21 | 22 | // In UI tests it is usually best to stop immediately when a failure occurs. 23 | self.continueAfterFailure = NO; 24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method. 25 | [[[XCUIApplication alloc] init] launch]; 26 | 27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this. 28 | } 29 | 30 | - (void)tearDown { 31 | // Put teardown code here. This method is called after the invocation of each test method in the class. 32 | [super tearDown]; 33 | } 34 | 35 | - (void)testExample { 36 | // Use recording to get started writing UI tests. 37 | // Use XCTAssert and related functions to verify your tests produce the correct results. 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWPlayer.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 2 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DWPlayer 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/Base.lproj/Main.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DWPlayer 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DWPlayer 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import 11 | 12 | @interface ViewController () 13 | 14 | @end 15 | 16 | @implementation ViewController 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | 21 | } 22 | 23 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 24 | DWPlayerViewController * player = [DWPlayerViewController new]; 25 | player.view.backgroundColor = [UIColor blackColor]; 26 | NSString * filePath = [[NSBundle mainBundle] pathForResource:@"video4" ofType:@"mp4"]; 27 | NSURL * url = [NSURL fileURLWithPath:filePath]; 28 | [player configVideoWithURL:url]; 29 | [self presentViewController:player animated:YES completion:^{ 30 | dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(2 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ 31 | [player play]; 32 | }); 33 | }]; 34 | } 35 | 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DWPlayer 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/DWPlayer/video4.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CodeWicky/-Tools/1b1350ac7ad9e9ba60743a0216ec07f37eee05c3/DWPlayer/DEMO/DWPlayer/video4.mp4 -------------------------------------------------------------------------------- /DWPlayer/DEMO/Podfile: -------------------------------------------------------------------------------- 1 | target 'DWPlayer' do 2 | pod 'DWPlayer', :path => '../' 3 | end 4 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DWPlayer (0.0.0.1) 3 | 4 | DEPENDENCIES: 5 | - DWPlayer (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | DWPlayer: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | DWPlayer: 3927548eb829ad8431facf140c75170af630c6d3 13 | 14 | PODFILE CHECKSUM: d1c956a7ae0b8312f0e0aad6b2d67a076f76b325 15 | 16 | COCOAPODS: 1.6.2 17 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Private/DWPlayer/DWPlayer.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayer.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Private/DWPlayer/DWPlayerManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerManager.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Private/DWPlayer/DWPlayerView.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerView.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Private/DWPlayer/DWPlayerViewController.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerViewController.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Public/DWPlayer/DWPlayer.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayer.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Public/DWPlayer/DWPlayerManager.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerManager.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Public/DWPlayer/DWPlayerView.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerView.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Headers/Public/DWPlayer/DWPlayerViewController.h: -------------------------------------------------------------------------------- 1 | ../../../../../DWPlayer/DWPlayerViewController.h -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Local Podspecs/DWPlayer.podspec.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "DWPlayer", 3 | "version": "0.0.0.1", 4 | "license": { 5 | "type": "MIT", 6 | "file": "LICENSE" 7 | }, 8 | "summary": "基于AVFoundation的视频播放组件。Component to play video based on AVFoundation.", 9 | "homepage": "https://github.com/CodeWicky/-Tools/tree/master/DWPlayer", 10 | "authors": { 11 | "codeWicky": "codewicky@163.com" 12 | }, 13 | "source": { 14 | "git": "https://github.com/CodeWicky/-Tools.git", 15 | "tag": "0.0.0.1" 16 | }, 17 | "requires_arc": true, 18 | "platforms": { 19 | "ios": "9.1" 20 | }, 21 | "source_files": "DWPlayer/**/*.{h,m}", 22 | "frameworks": "UIKit" 23 | } 24 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - DWPlayer (0.0.0.1) 3 | 4 | DEPENDENCIES: 5 | - DWPlayer (from `../`) 6 | 7 | EXTERNAL SOURCES: 8 | DWPlayer: 9 | :path: "../" 10 | 11 | SPEC CHECKSUMS: 12 | DWPlayer: 3927548eb829ad8431facf140c75170af630c6d3 13 | 14 | PODFILE CHECKSUM: d1c956a7ae0b8312f0e0aad6b2d67a076f76b325 15 | 16 | COCOAPODS: 1.6.2 17 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Pods.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWPlayer.xcscheme 8 | 9 | isShown 10 | 11 | 12 | Pods-DWPlayer.xcscheme 13 | 14 | isShown 15 | 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/DWPlayer/DWPlayer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_DWPlayer : NSObject 3 | @end 4 | @implementation PodsDummy_DWPlayer 5 | @end 6 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/DWPlayer/DWPlayer-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/DWPlayer/DWPlayer.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = ${PODS_CONFIGURATION_BUILD_DIR}/DWPlayer 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Private/DWPlayer" "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWPlayer" 4 | PODS_BUILD_DIR = ${BUILD_DIR} 5 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 6 | PODS_ROOT = ${SRCROOT} 7 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/../.. 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/Pods-DWPlayer/Pods-DWPlayer-acknowledgements.markdown: -------------------------------------------------------------------------------- 1 | # Acknowledgements 2 | This application makes use of the following third party libraries: 3 | 4 | ## DWPlayer 5 | 6 | MIT License 7 | 8 | Copyright (c) 2017 9 | 10 | Permission is hereby granted, free of charge, to any person obtaining a copy 11 | of this software and associated documentation files (the "Software"), to deal 12 | in the Software without restriction, including without limitation the rights 13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 14 | copies of the Software, and to permit persons to whom the Software is 15 | furnished to do so, subject to the following conditions: 16 | 17 | The above copyright notice and this permission notice shall be included in all 18 | copies or substantial portions of the Software. 19 | 20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 26 | SOFTWARE. 27 | 28 | Generated by CocoaPods - https://cocoapods.org 29 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/Pods-DWPlayer/Pods-DWPlayer-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_DWPlayer : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_DWPlayer 5 | @end 6 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/Pods-DWPlayer/Pods-DWPlayer.debug.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWPlayer" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/DWPlayer" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DWPlayer" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DWPlayer/DEMO/Pods/Target Support Files/Pods-DWPlayer/Pods-DWPlayer.release.xcconfig: -------------------------------------------------------------------------------- 1 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 2 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/DWPlayer" 3 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_CONFIGURATION_BUILD_DIR}/DWPlayer" 4 | OTHER_LDFLAGS = $(inherited) -ObjC -l"DWPlayer" -framework "UIKit" 5 | PODS_BUILD_DIR = ${BUILD_DIR} 6 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 8 | PODS_ROOT = ${SRCROOT}/Pods 9 | -------------------------------------------------------------------------------- /DWPlayer/DWPlayer.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DWPlayer' 3 | s.version = '0.0.0.2' 4 | s.license = { :type => 'MIT', :file => 'LICENSE' } 5 | s.summary = '基于AVFoundation的视频播放组件。Component to play video based on AVFoundation.' 6 | s.homepage = 'https://github.com/CodeWicky/-Tools/tree/master/DWPlayer' 7 | s.authors = { 'codeWicky' => 'codewicky@163.com' } 8 | s.source = { :git => 'https://github.com/CodeWicky/-Tools.git', :tag => s.version.to_s } 9 | s.requires_arc = true 10 | s.ios.deployment_target = '9.1' 11 | s.source_files = 'DWPlayer/**/*.{h,m}' 12 | s.frameworks = 'UIKit' 13 | 14 | end 15 | -------------------------------------------------------------------------------- /DWPlayer/DWPlayer/DWPlayer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWPlayer.h 3 | // DWPlayer 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #ifndef DWPlayer_h 10 | #define DWPlayer_h 11 | 12 | #import "DWPlayerManager.h" 13 | #import "DWPlayerView.h" 14 | #import "DWPlayerViewController.h" 15 | 16 | #endif /* DWPlayer_h */ 17 | -------------------------------------------------------------------------------- /DWPlayer/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DWPlayer/README.md: -------------------------------------------------------------------------------- 1 | # DWPlayer 2 | 视频播放工具类 3 | -------------------------------------------------------------------------------- /DWProtocolEnhancer/DWProtocolEnhancer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWProtocolEnhancer.h 3 | // DWProtocolEnhancer 4 | // 5 | // Created by Wicky on 2019/3/19. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | 为协议方法提供默认实现 11 | 12 | 使用方法: 13 | 1.声明协议 14 | 2.在协议的.m文件中调用@dw_protocol(Test_P) 15 | # 其中Test_P为想要提供默认实现的协议名 16 | 3.然后在其后实现要提供默认实现的协议方法 17 | 4.追加@end 18 | */ 19 | 20 | #import 21 | 22 | #define dw_protocol_imp(ptl) \ 23 | @interface ptl##TemporaryClass : NSObject \ 24 | @end \ 25 | @implementation ptl##TemporaryClass\ 26 | +(void)load {\ 27 | dw_registProtocol([self class]);\ 28 | } \ 29 | 30 | void dw_registProtocol(Class clazz); 31 | -------------------------------------------------------------------------------- /DWRangeUtils/DWRangeUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWRangeUtils.h 3 | // RegExp 4 | // 5 | // Created by Wicky on 17/1/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DWRangeUtils : NSObject 12 | ///返回目标范围内排除一定范围后的范围数组 13 | NSArray * DWRangeExcept(NSRange targetRange,NSRange exceptRange); 14 | @end 15 | -------------------------------------------------------------------------------- /DWRangeUtils/DWRangeUtils.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWRangeUtils.m 3 | // RegExp 4 | // 5 | // Created by Wicky on 17/1/8. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWRangeUtils.h" 10 | 11 | @implementation DWRangeUtils 12 | NSArray * DWRangeExcept(NSRange targetRange,NSRange exceptRange){ 13 | NSRange interRange = NSIntersectionRange(targetRange, exceptRange); 14 | if (interRange.length == 0) { 15 | return nil; 16 | } 17 | else if (NSEqualRanges(targetRange, interRange)) 18 | { 19 | return nil; 20 | } 21 | NSMutableArray * arr = [NSMutableArray array]; 22 | 23 | if (interRange.location > targetRange.location) { 24 | [arr addObject:[NSValue valueWithRange:NSMakeRange(targetRange.location, interRange.location - targetRange.location)]]; 25 | } 26 | if (NSMaxRange(targetRange) > NSMaxRange(interRange)) { 27 | [arr addObject:[NSValue valueWithRange:NSMakeRange(NSMaxRange(interRange), NSMaxRange(targetRange) - NSMaxRange(interRange))]]; 28 | } 29 | return arr.copy; 30 | }; 31 | @end 32 | -------------------------------------------------------------------------------- /DWStaticView/DWStaticView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWStaticView.h 3 | // Protocol 4 | // 5 | // Created by Wicky on 2017/2/16. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | DWStaticView 13 | 静态视图,旨在节省渲染性能来提高程序流畅性。 14 | 视图中不具备外观变化的视图可以调用本类提供静态视图操作api。 15 | 调用静态视图操作api添加的视图将不具备图层层级而是作为寄宿图绘制本实例中。 16 | 外观会发生变化的视图可以调用UIView原本的视图操作api,则与UIView处理机制相同。 17 | 18 | 开发者必须注意的是,静态视图是作为寄宿图直接绘制再本实例中,故所有静态视图层级关系按添加顺序维护,非静态视图同UIView中处理一样也保持按添加顺序维持层级关系,但所有静态视图层级关系低于非静态视图层级,与添加顺序无关。 19 | 20 | version 1.0.0 21 | 静态视图初步完成,完成基本绘制功能 22 | 23 | version 1.0.2 24 | 完善静态状态切换功能,添加插入视图接口,添加重绘接口 25 | */ 26 | @interface DWStaticView : UIView 27 | 28 | @property (nonatomic ,assign) BOOL staticBackLayer; 29 | 30 | @property (nonatomic ,strong ,readonly) NSArray * staticBackSubviews; 31 | 32 | ///添加背景静态视图 33 | -(void)addStaticBackSubview:(UIView *)view; 34 | 35 | ///以角标插入视图 36 | -(void)insertStaticBackSubview:(UIView *)view atIndex:(NSInteger)index; 37 | 38 | ///插入背景静态视图在指定视图之上 39 | -(void)insertStaticBackSubview:(UIView *)view aboveSubview:(UIView *)siblingSubview; 40 | 41 | ///插入背景静态视图在指定视图之下 42 | -(void)insertStaticBackSubview:(UIView *)view belowSubview:(UIView *)siblingSubview; 43 | 44 | ///移除背景静态视图 45 | -(void)removeStaticBackSubview:(UIView *)view; 46 | 47 | ///设置视图需要重绘(子视图frame发生改变时需要调用) 48 | -(void)setNeedsRedrawStaticView; 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /DWTableViewUtils/UITableView+DWTableViewUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITableView+DWTableViewUtils.h 3 | // DWTableViewHelper 4 | // 5 | // Created by Wicky on 2017/1/26. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWTableViewUtils 11 | 12 | 提供TableView相关扩展方法 13 | 14 | version 1.0.0 15 | 提供占位图、刷新列表扩展方法、占位图显隐相关api 16 | 17 | version 1.0.1 18 | 提供indexPath计算api 19 | */ 20 | 21 | #import 22 | 23 | @interface UITableView (DWTableViewUtils) 24 | 25 | ///无数据占位图 26 | @property (nonatomic ,strong) UIView * placeHolderView; 27 | 28 | ///刷新列表并获取刷新完成回调 29 | -(void)reloadDataWithCompletion:(void(^)())completion; 30 | 31 | ///刷新列表同时自动处理占位图 32 | -(void)reloadDataAndHandlePlaceHolderView; 33 | 34 | ///展示占位图 35 | -(void)showPlaceHolderView; 36 | 37 | ///隐藏占位图 38 | -(void)hidePlaceHolderView; 39 | 40 | @end 41 | 42 | @interface UITableView (DWTableViewIndexPathUtils) 43 | 44 | ///计算总项目数 45 | -(NSUInteger)dw_TotalItems; 46 | 47 | /** 48 | 计算两个idxP之间的距离 49 | 50 | @param idxPA 第一个indexPath 51 | @param idxPB 第二个indexPath 52 | @return 距离 53 | 54 | 注: 55 | 距离有效值为非负数。 56 | 返回-1说明无法完成计算,检验idxP的合法性及dataSource的有效性 57 | */ 58 | -(NSInteger)dw_DistanceBetweenIndexPathA:(NSIndexPath *)idxPA indexPathB:(NSIndexPath *)idxPB; 59 | 60 | ///计算idxP是否合法 61 | -(BOOL)dw_IsValidIndexPath:(NSIndexPath *)idxP; 62 | 63 | 64 | /** 65 | 计算目标idxP周围指定个数的idxPs数组 66 | 67 | @param idxP 目标idxP 68 | @param isNext 顺序查找还是逆序查找 69 | @param count 指定个数 70 | @param step 步长(若小于1将被转化为1) 71 | @return 结果数组 72 | */ 73 | -(NSArray *)dw_IndexPathsAroundIndexPath:(NSIndexPath *)idxP nextOrPreivious:(BOOL)isNext count:(NSUInteger)count step:(NSInteger)step; 74 | @end 75 | -------------------------------------------------------------------------------- /DWTextFieldUtils/UITextField+DWTextFieldUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextField+DWTextFieldUtils.h 3 | // DWTextField 4 | // 5 | // Created by Wicky on 2016/11/21. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | 10 | /** 11 | DWTextFieldUtils 12 | 13 | TextField的扩展 14 | 15 | version 1.0.0 16 | 添加按位分隔api 17 | 18 | version 1.0.1 19 | 分隔符支持任意长度,字符串中可含有分隔符且无影响 20 | */ 21 | #import 22 | 23 | @interface UITextField (DWTextFieldUtils) 24 | 25 | ///分割长度数组 26 | /** 27 | 形如 28 | @[@3,@4,@4] 29 | 则以3、4、4形式分隔,且限制长度3+4+4为11 30 | */ 31 | @property (nonatomic ,strong) NSArray * componentsLength; 32 | 33 | ///分隔符 34 | /** 35 | 默认为空格 36 | */ 37 | @property (nonatomic ,copy) NSString * componentsSeparator; 38 | 39 | ///剔除分隔符的绝对字符串 40 | @property (nonatomic ,strong ,readonly) NSString * absoluteString; 41 | 42 | ///若需要限制长度并分割,请在需要限制的条件下在shouldChange代理中返回此方法 43 | /** 44 | 形如 45 | -(BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string 46 | { 47 | return [textField dw_ShouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string]; 48 | } 49 | */ 50 | -(BOOL)dw_ShouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string; 51 | @end 52 | -------------------------------------------------------------------------------- /DWTextViewUtils/UITextView+DWTextViewUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UITextView+DWTextViewUtils.h 3 | // sss 4 | // 5 | // Created by Wicky on 2017/3/7. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | UITextView工具类 11 | 12 | version 1.0.0 13 | 为textView提供placeholder功能,区分9.0以下及以上api。 14 | */ 15 | 16 | #import 17 | 18 | @interface UITextView (DWTextViewUtils) 19 | 20 | @property (nonatomic ,copy) NSString * placeholder; 21 | 22 | @property (nonatomic ,strong) UIColor * placeholderTextColor; 23 | 24 | @property (nonatomic ,strong) UIFont * placeholderFont; 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWTiledImageView/DWTiledImageView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTiledImageView.h 3 | // DWTiledImageView 4 | // 5 | // Created by Wicky on 2019/4/26. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DWTiledImageView : UIView 14 | 15 | @property (nonatomic ,strong) UIImage * image; 16 | 17 | @property (nonatomic ,assign) CGSize tileSize; 18 | 19 | @property (nonatomic ,assign) size_t levelsOfDetail; 20 | 21 | -(void)invalidateCache; 22 | 23 | @end 24 | 25 | NS_ASSUME_NONNULL_END 26 | -------------------------------------------------------------------------------- /DWTimer/DWTimer.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTimer.h 3 | // GCDTimer 4 | // 5 | // Created by Wicky on 16/9/23. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface DWTimer : NSObject 12 | @property (nonatomic ,copy)void(^cancelHandler)(); 13 | +(instancetype)dw_TimerWithTimeInterval:(NSTimeInterval)timeInterval 14 | delay:(NSTimeInterval)delay 15 | mainQueue:(BOOL)mainQueue 16 | handler:(void(^)())handler; 17 | -(void)resume; 18 | -(void)suspend; 19 | -(void)cancel; 20 | -(void)invalid; 21 | @end 22 | -------------------------------------------------------------------------------- /DWTransformUtils/DWTransformUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTransformUtils.h 3 | // layer 4 | // 5 | // Created by Wicky on 16/12/25. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NS_ENUM(NSUInteger, DWTransformLeanType) {///倾斜类型 12 | DWTransformLeanTypeTopSideToLeft,///顶边左倾 13 | DWTransformLeanTypeTopSideToRight,///顶边右倾 14 | DWTransformLeanTypeBottomSideToLeft,///底边左倾 15 | DWTransformLeanTypeBottomSideToRight,///底边右倾 16 | DWTransformLeanTypeLeftSideToUp,///左边上倾 17 | DWTransformLeanTypeLeftSideToDown,///左边下倾 18 | DWTransformLeanTypeRightSideToUp,///右边上倾 19 | DWTransformLeanTypeRightSideToDown///右边下倾 20 | }; 21 | 22 | @interface DWTransformUtils : NSObject 23 | 24 | +(CGAffineTransform)dw_TransformWithOriginSize:(CGSize)size leanOffset:(CGFloat)offset leanType:(DWTransformLeanType)leanType; 25 | 26 | +(CATransform3D)dw_Transform3DWithOriginSize:(CGSize)size leanOffset:(CGFloat)offset leanType:(DWTransformLeanType)leanType; 27 | 28 | +(CGFloat)dw_GetScaleXByTransform:(CGAffineTransform)trans; 29 | 30 | +(CGFloat)dw_GetScaleYByTransform:(CGAffineTransform)trans; 31 | 32 | +(CGFloat)dw_GetTranslateXByTransform:(CGAffineTransform)trans; 33 | 34 | +(CGFloat)dw_GetTranslateYByTransform:(CGAffineTransform)trans; 35 | 36 | +(CGFloat)dw_GetRotateByTransform:(CGAffineTransform)trans; 37 | @end 38 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition.xcodeproj/xcuserdata/wicky.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | DWTransition.xcscheme_^#shared#^_ 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/AlphaViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // AlphaViewController.h 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "DWTransition.h" 11 | 12 | @interface AlphaViewController : UIViewController 13 | 14 | @end 15 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/AlphaViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // AlphaViewController.m 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/23. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "AlphaViewController.h" 10 | 11 | @interface AlphaViewController () 12 | 13 | @end 14 | 15 | @implementation AlphaViewController 16 | @synthesize dw_pushAnimationType; 17 | 18 | - (void)viewDidLoad { 19 | [super viewDidLoad]; 20 | self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.3]; 21 | } 22 | 23 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 24 | if (self.navigationController.viewControllers.count < 5) { 25 | [self.navigationController pushViewController:[AlphaViewController new] animated:YES]; 26 | } else { 27 | UIViewController * vc = self.navigationController.viewControllers[2]; 28 | [self.navigationController popToViewController:vc animated:YES]; 29 | } 30 | } 31 | 32 | -(instancetype)init { 33 | if (self = [super init]) { 34 | self.dw_pushAnimationType = DWTransitionTransparentPushType; 35 | } 36 | return self; 37 | } 38 | 39 | /* 40 | #pragma mark - Navigation 41 | 42 | // In a storyboard-based application, you will often want to do a little preparation before navigation 43 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { 44 | // Get the new view controller using [segue destinationViewController]. 45 | // Pass the selected object to the new view controller. 46 | } 47 | */ 48 | 49 | @end 50 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/13. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | 16 | @end 17 | 18 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/Assets.xcassets/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "info" : { 3 | "version" : 1, 4 | "author" : "xcode" 5 | } 6 | } -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/Base.lproj/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIMainStoryboardFile 26 | Main 27 | UIRequiredDeviceCapabilities 28 | 29 | armv7 30 | 31 | UISupportedInterfaceOrientations 32 | 33 | UIInterfaceOrientationPortrait 34 | UIInterfaceOrientationLandscapeLeft 35 | UIInterfaceOrientationLandscapeRight 36 | 37 | UISupportedInterfaceOrientations~ipad 38 | 39 | UIInterfaceOrientationPortrait 40 | UIInterfaceOrientationPortraitUpsideDown 41 | UIInterfaceOrientationLandscapeLeft 42 | UIInterfaceOrientationLandscapeRight 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/NavViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // NavViewController.h 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/13. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface NavViewController : UINavigationController 14 | 15 | @end 16 | 17 | NS_ASSUME_NONNULL_END 18 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/13. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UIViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/13. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "AlphaViewController.h" 11 | @interface ViewController () 12 | 13 | @end 14 | 15 | @implementation ViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.view.backgroundColor = [UIColor colorWithRed:(arc4random() % 256) / 255.0 green:(arc4random() % 256) / 255.0 blue:(arc4random() % 256) / 255.0 alpha:1]; 20 | } 21 | 22 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event { 23 | [self.navigationController pushViewController:[AlphaViewController new] animated:YES]; 24 | } 25 | 26 | @end 27 | -------------------------------------------------------------------------------- /DWTransition/DEMO/DWTransition/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/13. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "AppDelegate.h" 11 | 12 | int main(int argc, char * argv[]) { 13 | @autoreleasepool { 14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /DWTransition/DWTransition.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = 'DWTransition' 3 | s.version = '0.0.0.1' 4 | s.license = { :type => 'MIT', :file => 'LICENSE' } 5 | s.summary = '导航栏平滑处理。Help you handle navigationBar.' 6 | s.homepage = 'https://github.com/CodeWicky/-Tools/tree/master/DWTransition' 7 | s.authors = { 'codeWicky' => 'codewicky@163.com' } 8 | s.source = { :git => 'https://github.com/CodeWicky/-Tools.git', :tag => s.version.to_s } 9 | s.requires_arc = true 10 | s.ios.deployment_target = '9.1' 11 | s.source_files = 'DWTransition/**/*.{h,m}' 12 | s.frameworks = 'UIKit' 13 | 14 | end 15 | -------------------------------------------------------------------------------- /DWTransition/DWTransition/DWTransitionPopInteraction.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWTransitionPopInteraction.h 3 | // DWTransition 4 | // 5 | // Created by Wicky on 2019/7/22. 6 | // Copyright © 2019 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | /** 12 | 控制器转场交互类 13 | 14 | 用于配合DWTransition使用时为侧滑返回提供默认实现 15 | 16 | version 1.0.0 17 | 提供侧滑返回的默认实现 18 | */ 19 | 20 | @interface DWTransitionPopInteraction : UIPercentDrivenInteractiveTransition 21 | 22 | ///The navigationController for current popInteraction. 23 | @property (nonatomic ,weak) UINavigationController * navigationController; 24 | 25 | ///To support slide on edge when using DWTransition,custom the recognizer of popInteraction. 26 | @property (nonatomic ,strong) UIPanGestureRecognizer * popInteractionGestureRecognizer; 27 | 28 | +(instancetype)interactionWithNavigationController:(UINavigationController *)navi; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /DWTransition/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /DWTransition/README.md: -------------------------------------------------------------------------------- 1 | # DWTransition 2 | 转场工具类 3 | -------------------------------------------------------------------------------- /DWViewUtils/UIView+DWViewUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+DWViewUtils.h 3 | // a 4 | // 5 | // Created by Wicky on 2017/3/13. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (DWViewFrameUtils) 12 | @property (nonatomic ,assign) CGFloat originX; 13 | @property (nonatomic ,assign) CGFloat originY; 14 | @property (nonatomic ,assign) CGFloat width; 15 | @property (nonatomic ,assign) CGFloat height; 16 | @property (nonatomic ,assign ,readonly) CGFloat top; 17 | @property (nonatomic ,assign ,readonly) CGFloat bottom; 18 | @property (nonatomic ,assign ,readonly) CGFloat left; 19 | @property (nonatomic ,assign ,readonly) CGFloat right; 20 | @property (nonatomic ,assign) CGPoint topRightPoint; 21 | @property (nonatomic ,assign) CGPoint bottomLeftPoint; 22 | @property (nonatomic ,assign) CGPoint bottomRightPoint; 23 | @property (nonatomic ,assign ,readonly) CGPoint centerOfSelf; 24 | @property (nonatomic ,assign) CGFloat viewCornerR; 25 | -(void)setOrigin:(CGPoint)origin; 26 | -(void)setSize:(CGSize)size; 27 | @end 28 | 29 | @interface UIView (DWViewHierarchyUtils) 30 | 31 | /** 32 | 是否在屏幕中,即是否在可显示层级中 33 | 34 | 当view与屏幕frame有交集且hidden为NO,alpha不为0时等一切可视情况(被完全遮盖也视作可视情况)为YES,其他为NO 35 | */ 36 | @property (nonatomic ,assign ,readonly,getter=isInScreen) BOOL inScreen; 37 | 38 | /** 39 | 获取当前view所属控制器 40 | */ 41 | @property (nonatomic ,strong ,readonly) UIViewController * viewController; 42 | 43 | @end 44 | 45 | @interface UIView (DWViewDecorateUtils) 46 | 47 | ///添加线 48 | -(void)dw_AddLineWithFrame:(CGRect)frame color:(UIColor *)color; 49 | 50 | ///添加圆角 51 | -(void)dw_AddCorner:(UIRectCorner)corners radius:(CGFloat)radius; 52 | 53 | @end 54 | 55 | @interface UIView (DWViewSubViewsUtils) 56 | 57 | ///移除所有子视图 58 | -(void)removeAllSubviews; 59 | 60 | ///按照ZIndex插入视图,ZIndex越大层级越高 61 | -(void)dw_InsertSubview:(UIView *)view atZIndex:(NSUInteger)index; 62 | 63 | @end 64 | 65 | -------------------------------------------------------------------------------- /DecimalExtension/DecimalExtension.h: -------------------------------------------------------------------------------- 1 | // 2 | // DecimalExtension.h 3 | // DWHUD 4 | // 5 | // Created by Wicky on 16/10/25. 6 | // Copyright © 2016年 Wicky. All rights reserved. 7 | // 8 | 9 | /* 10 | DecimalExtension 11 | 12 | 补充一些数学运算 13 | */ 14 | #import 15 | @interface DecimalExtension : NSObject 16 | /* 17 | x按四舍五入保留y位小数 18 | */ 19 | CGFloat roundX(CGFloat x,int y); 20 | /* 21 | x按五入保留y位小数 22 | */ 23 | CGFloat ceilX(CGFloat x,int y); 24 | /* 25 | x按四舍保留y位小数 26 | */ 27 | CGFloat floorX(CGFloat x,int y); 28 | /* 29 | 返回10的x次方 30 | */ 31 | int pow10x(int x); 32 | /** 33 | 返回x的平方 34 | */ 35 | CGFloat powX2(CGFloat x); 36 | /** 37 | 返回x的立方 38 | */ 39 | CGFloat powX3(CGFloat x); 40 | /** 41 | 返回平均数 42 | */ 43 | CGFloat avr(CGFloat x,CGFloat y); 44 | /** 45 | 角度转弧度 46 | */ 47 | CGFloat radianFromDegree(CGFloat degree); 48 | /** 49 | 弧度转角度 50 | */ 51 | CGFloat degreeFromRadian(CGFloat radian); 52 | /** 53 | 余弦定理计算角度 54 | a、b:夹边 55 | c:对边 56 | 57 | 若返回-1则说明当前参数无法构成三角形 58 | */ 59 | CGFloat angleFromCosinesLaw(CGFloat a,CGFloat b,CGFloat c); 60 | /** 61 | 余弦定理计算对边 62 | a、b:夹边 63 | alpha:夹角 64 | 65 | 若返回-1则说明夹角数值不合法 66 | */ 67 | CGFloat lengthFromCosinesLaw(CGFloat a,CGFloat b,CGFloat alpha); 68 | /** 69 | 返回点2到点1连线与x轴正方向夹角 70 | */ 71 | CGFloat angleFromTwoPoint(CGFloat x1,CGFloat y1,CGFloat x2,CGFloat y2); 72 | @end 73 | -------------------------------------------------------------------------------- /Finish/DWDeviceUtils/UIDevice+DWDeviceUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIDevice+DWDeviceUtils.h 3 | // DWLogger 4 | // 5 | // Created by Wicky on 2017/10/9. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /** 10 | DWDeviceUtils 11 | 提供Device相关信息及便捷方法 12 | */ 13 | 14 | #import 15 | 16 | @interface UIDevice (DWDeviceSystemInfo) 17 | 18 | ///获取当前工程Build号 19 | +(NSString *)dw_projectBuildNo; 20 | 21 | ///获取当前工程BundleID 22 | +(NSString *)dw_projectBundleId; 23 | 24 | ///获取当前工程工程名称 25 | +(NSString *)dw_projectDisplayName; 26 | 27 | ///获取当前工程版本号 28 | +(NSString *)dw_projectVersion; 29 | 30 | ///获取当前设备UUID 31 | +(NSString *)dw_deviceUUID; 32 | 33 | ///获取当前设备别名 34 | +(NSString *)dw_deviceUserName; 35 | 36 | ///获取当前设备名 37 | +(NSString *)dw_deviceName; 38 | 39 | ///获取当前设备系统版本 40 | +(NSString *)dw_deviceSystemVersion; 41 | 42 | ///获取当前设备型号 43 | +(NSString *)dw_deviceModel; 44 | 45 | ///获取当前设备具体型号 46 | +(NSString *)dw_deviceDetailModel; 47 | 48 | ///获取当前设备平台号 49 | +(NSString *)dw_devicePlatform; 50 | 51 | ///获取当前设备CPU架构 52 | +(NSString *)dw_deviceCPUType; 53 | 54 | ///获取当前设备总内存大小(Kb) 55 | +(CGFloat)dw_deviceTotalMemory; 56 | 57 | ///获取当前设备可用内存大小(Kb) 58 | +(CGFloat)dw_deviceFreeMemory; 59 | 60 | ///获取当前手机运营商 61 | +(NSString *)dw_mobileOperator; 62 | 63 | ///获取当前开发SDK版本 64 | +(NSString *)dw_developSDKVersion; 65 | 66 | ///获取当前手机电量 67 | +(CGFloat)dw_batteryVolumn; 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Finish/DWGradientView/DWGradientView.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWGradientView.h 3 | // AccountBook 4 | // 5 | // Created by Wicky on 2018/10/16. 6 | // Copyright © 2018年 Wicky. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | NS_ASSUME_NONNULL_BEGIN 12 | 13 | @interface DWGradientView : UIControl 14 | 15 | ///CGColors 16 | @property (nonatomic ,strong ,nullable) NSArray * colors; 17 | 18 | @property (nonatomic ,strong) NSArray * locations; 19 | 20 | @property (nonatomic ,assign) CGPoint startPoint; 21 | 22 | @property (nonatomic ,assign) CGPoint endPoint; 23 | 24 | @end 25 | 26 | NS_ASSUME_NONNULL_END 27 | -------------------------------------------------------------------------------- /Finish/DWGradientView/DWGradientView.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWGradientView.m 3 | // AccountBook 4 | // 5 | // Created by Wicky on 2018/10/16. 6 | // Copyright © 2018年 Wicky. All rights reserved. 7 | // 8 | 9 | #import "DWGradientView.h" 10 | 11 | @interface DWGradientView () 12 | 13 | @property (nonatomic ,strong ,readonly) CAGradientLayer * layer; 14 | 15 | @end 16 | 17 | @implementation DWGradientView 18 | @dynamic layer; 19 | 20 | +(Class)layerClass { 21 | return [CAGradientLayer class]; 22 | } 23 | 24 | -(void)setColors:(NSArray*)colors { 25 | self.layer.colors = colors; 26 | } 27 | 28 | -(NSArray *)colors { 29 | return self.layer.colors; 30 | } 31 | 32 | -(void)setLocations:(NSArray *)locations { 33 | self.layer.locations = locations; 34 | } 35 | 36 | -(NSArray *)locations { 37 | return self.layer.locations; 38 | } 39 | 40 | -(void)setStartPoint:(CGPoint)startPoint { 41 | self.layer.startPoint = startPoint; 42 | } 43 | 44 | -(CGPoint)startPoint { 45 | return self.layer.startPoint; 46 | } 47 | 48 | -(void)setEndPoint:(CGPoint)endPoint { 49 | self.layer.endPoint = endPoint; 50 | } 51 | 52 | -(CGPoint)endPoint { 53 | return self.layer.endPoint; 54 | } 55 | 56 | 57 | @end 58 | -------------------------------------------------------------------------------- /Finish/DWManualOperation/DWManualOperation.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWManualOperation.h 3 | // a 4 | // 5 | // Created by Wicky on 2018/1/17. 6 | // Copyright © 2018年 Wicky. All rights reserved. 7 | // 8 | /** 9 | DWManualOperation 10 | 手动完成任务类 11 | 12 | 继承自NSOperation,重写 isExecuting 和 isFinished 两个状态的改变机制。 13 | 14 | 每添加一个任务会将 DWManualOperation 类内部维护的任务计数器加一,每调用 -handlerDone 时任务计数器减一,当任务计数器为0时自动改变operation状态为完成状态。 15 | 16 | 适用于为将异步任务封装在DWManualOperation中后自行控制任务被标记为完成状态的时机。 17 | 可用于多个异步任务实际完成后触发另一个任务的情况。例如两个请求任务均结束后再进行数据刷新。 18 | 同时可与 NSOperation 的其他子类配合再 NSOperationQueue 中使用。 19 | 20 | version 1.0.0 21 | 提供基本功能,提供控制任务完成时机接口,提供直接完成任务接口。 22 | 23 | version 1.0.1 24 | 提供任务回调串并行接口,以便控制回调的调用方式。 25 | 26 | version 1.0.2 27 | 改变任务完成时释放自身时机至任务完成回调后释放自身。 28 | */ 29 | 30 | #import 31 | 32 | @class DWManualOperation; 33 | typedef void(^OperationHandler)(DWManualOperation * op); 34 | @interface DWManualOperation : NSOperation 35 | 36 | ///是否已并行模式调用回调,默认为真 37 | @property (nonatomic ,assign) BOOL concurrentHandler; 38 | 39 | /** 40 | 以需要实现的任务生成operation对象 41 | 42 | @param handler 需要实现的任务 43 | @return operation实例 44 | 45 | @disc 调用 -start 方法后会统计任务总数并将任务计数器置为总数 46 | */ 47 | +(instancetype)manualOperationWithHandler:(OperationHandler)handler; 48 | 49 | /** 50 | 为operation对象添加任务 51 | 52 | @param handler 需要添加的任务 53 | 54 | @disc 1.调用 -start 方法后会统计任务总数并将任务计数器置为总数 55 | 2.当 operation 的 isExecuting 或 isFinished 为 YES 时本方法将不执行任何操作。 56 | */ 57 | -(void)addExecutionHandler:(OperationHandler)handler; 58 | 59 | 60 | /** 61 | 将任务计数器数值减1。 62 | 63 | @disc 1.当任务计数器为0时不执行任何操作。 64 | 2.当前任务正在进行或已经完成时不执行任何操作。 65 | 3.当调用 -handlerDone 后若减1后计数器为0将会置当前任务 isExecuting 为 NO,isFinished 为 YES。即标志当前任务完成 66 | */ 67 | -(void)handlerDone; 68 | 69 | /** 70 | 立刻将当前任务标识为完成状态,isExecuting 为 NO,isFinished 为 YES。 71 | */ 72 | -(void)finishOperation; 73 | 74 | @end 75 | -------------------------------------------------------------------------------- /Finish/DWOperationCancleFlag/DWOperationCancelFlag.h: -------------------------------------------------------------------------------- 1 | // 2 | // DWOperationCancelFlag.h 3 | // hgfd 4 | // 5 | // Created by Wicky on 2017/2/26. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | /* 10 | DWOperationCancelFlag 11 | 12 | 任务取消标志位。 13 | 通过Block捕获变量的机制来判断任务是否被取消。 14 | 15 | DWOperationCancelFlag本身属性中的cancelFlag可表示最近任务的取消状态。 16 | 而通过 -settleAnCancelFlag 或 -restartAnCancelFlag 获取的标志位可以表示获取标志位时正在执行的任务当前的取消状态。详细使用方法见范例。 17 | 18 | 注,获取标志位结果为真代表任务被取消了。 19 | */ 20 | 21 | #define CancelFlag(flag) flag.cancelFlag() 22 | 23 | #import 24 | 25 | typedef BOOL (^CancelFlag)(void); 26 | 27 | @interface DWOperationCancelFlag : NSObject 28 | 29 | @property (nonatomic ,copy) CancelFlag cancelFlag; 30 | 31 | ///开始任务 32 | -(void)start; 33 | 34 | ///取消任务 35 | -(void)cancel; 36 | 37 | ///设置一个返回标志 38 | -(CancelFlag)settleAnCancelFlag; 39 | 40 | ///重设一个取消标志 41 | -(CancelFlag)restartAnCancelFlag; 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /Finish/DWOperationCancleFlag/DWOperationCancelFlag.m: -------------------------------------------------------------------------------- 1 | // 2 | // DWOperationCancelFlag.m 3 | // hgfd 4 | // 5 | // Created by Wicky on 2017/2/26. 6 | // Copyright © 2017年 Wicky. All rights reserved. 7 | // 8 | 9 | #ifndef __DW__Debug__ 10 | #define __DW__Debug__ 11 | #endif 12 | 13 | #import "DWOperationCancelFlag.h" 14 | #import 15 | 16 | @interface DWOperationCancelFlag () 17 | 18 | @property (atomic ,readonly) int32_t signal; 19 | 20 | @end 21 | 22 | @implementation DWOperationCancelFlag 23 | 24 | -(void)start { 25 | int32_t current = self.signal; 26 | self.cancelFlag = ^BOOL(){ 27 | #ifdef __DW__Debug__ 28 | if (self.signal != current) { 29 | NSLog(@"will cancel operation at %d",current); 30 | } 31 | #endif 32 | return (self.signal != current); 33 | }; 34 | } 35 | 36 | -(void)cancel { 37 | #pragma clang diagnostic push 38 | #pragma clang diagnostic ignored "-Wdeprecated-declarations" 39 | OSAtomicIncrement32(&_signal); 40 | #pragma clang diagnostic pop 41 | } 42 | 43 | -(CancelFlag)settleAnCancelFlag { 44 | return [self.cancelFlag copy]; 45 | } 46 | 47 | -(CancelFlag)restartAnCancelFlag { 48 | [self cancel]; 49 | [self start]; 50 | return [self settleAnCancelFlag]; 51 | } 52 | 53 | @end 54 | --------------------------------------------------------------------------------