├── .gitignore ├── .swift-version ├── Document ├── README-English.md ├── document - native.md ├── document - JS.md └── document - html- css.md ├── Example ├── LICENSE ├── Podfile ├── Podfile.lock ├── Pods │ ├── MJRefresh │ │ ├── LICENSE │ │ ├── MJRefresh │ │ │ ├── Base │ │ │ │ ├── MJRefreshAutoFooter.h │ │ │ │ ├── MJRefreshAutoFooter.m │ │ │ │ ├── MJRefreshBackFooter.h │ │ │ │ ├── MJRefreshBackFooter.m │ │ │ │ ├── MJRefreshComponent.h │ │ │ │ ├── MJRefreshComponent.m │ │ │ │ ├── MJRefreshFooter.h │ │ │ │ ├── MJRefreshFooter.m │ │ │ │ ├── MJRefreshHeader.h │ │ │ │ └── MJRefreshHeader.m │ │ │ ├── Custom │ │ │ │ ├── Footer │ │ │ │ │ ├── Auto │ │ │ │ │ │ ├── MJRefreshAutoGifFooter.h │ │ │ │ │ │ ├── MJRefreshAutoGifFooter.m │ │ │ │ │ │ ├── MJRefreshAutoNormalFooter.h │ │ │ │ │ │ ├── MJRefreshAutoNormalFooter.m │ │ │ │ │ │ ├── MJRefreshAutoStateFooter.h │ │ │ │ │ │ └── MJRefreshAutoStateFooter.m │ │ │ │ │ └── Back │ │ │ │ │ │ ├── MJRefreshBackGifFooter.h │ │ │ │ │ │ ├── MJRefreshBackGifFooter.m │ │ │ │ │ │ ├── MJRefreshBackNormalFooter.h │ │ │ │ │ │ ├── MJRefreshBackNormalFooter.m │ │ │ │ │ │ ├── MJRefreshBackStateFooter.h │ │ │ │ │ │ └── MJRefreshBackStateFooter.m │ │ │ │ └── Header │ │ │ │ │ ├── MJRefreshGifHeader.h │ │ │ │ │ ├── MJRefreshGifHeader.m │ │ │ │ │ ├── MJRefreshNormalHeader.h │ │ │ │ │ ├── MJRefreshNormalHeader.m │ │ │ │ │ ├── MJRefreshStateHeader.h │ │ │ │ │ └── MJRefreshStateHeader.m │ │ │ ├── MJRefresh.bundle │ │ │ │ ├── arrow@2x.png │ │ │ │ ├── en.lproj │ │ │ │ │ └── Localizable.strings │ │ │ │ ├── zh-Hans.lproj │ │ │ │ │ └── Localizable.strings │ │ │ │ └── zh-Hant.lproj │ │ │ │ │ └── Localizable.strings │ │ │ ├── MJRefresh.h │ │ │ ├── MJRefreshConst.h │ │ │ ├── MJRefreshConst.m │ │ │ ├── NSBundle+MJRefresh.h │ │ │ ├── NSBundle+MJRefresh.m │ │ │ ├── UIScrollView+MJExtension.h │ │ │ ├── UIScrollView+MJExtension.m │ │ │ ├── UIScrollView+MJRefresh.h │ │ │ ├── UIScrollView+MJRefresh.m │ │ │ ├── UIView+MJExtension.h │ │ │ └── UIView+MJExtension.m │ │ └── README.md │ ├── Manifest.lock │ ├── Pods.xcodeproj │ │ └── project.pbxproj │ ├── SDWebImage │ │ ├── LICENSE │ │ ├── README.md │ │ └── SDWebImage │ │ │ ├── NSData+ImageContentType.h │ │ │ ├── NSData+ImageContentType.m │ │ │ ├── NSImage+WebCache.h │ │ │ ├── NSImage+WebCache.m │ │ │ ├── SDImageCache.h │ │ │ ├── SDImageCache.m │ │ │ ├── SDImageCacheConfig.h │ │ │ ├── SDImageCacheConfig.m │ │ │ ├── SDWebImageCoder.h │ │ │ ├── SDWebImageCoder.m │ │ │ ├── SDWebImageCoderHelper.h │ │ │ ├── SDWebImageCoderHelper.m │ │ │ ├── SDWebImageCodersManager.h │ │ │ ├── SDWebImageCodersManager.m │ │ │ ├── SDWebImageCompat.h │ │ │ ├── SDWebImageCompat.m │ │ │ ├── SDWebImageDownloader.h │ │ │ ├── SDWebImageDownloader.m │ │ │ ├── SDWebImageDownloaderOperation.h │ │ │ ├── SDWebImageDownloaderOperation.m │ │ │ ├── SDWebImageFrame.h │ │ │ ├── SDWebImageFrame.m │ │ │ ├── SDWebImageGIFCoder.h │ │ │ ├── SDWebImageGIFCoder.m │ │ │ ├── SDWebImageImageIOCoder.h │ │ │ ├── SDWebImageImageIOCoder.m │ │ │ ├── SDWebImageManager.h │ │ │ ├── SDWebImageManager.m │ │ │ ├── SDWebImageOperation.h │ │ │ ├── SDWebImagePrefetcher.h │ │ │ ├── SDWebImagePrefetcher.m │ │ │ ├── UIButton+WebCache.h │ │ │ ├── UIButton+WebCache.m │ │ │ ├── UIImage+ForceDecode.h │ │ │ ├── UIImage+ForceDecode.m │ │ │ ├── UIImage+GIF.h │ │ │ ├── UIImage+GIF.m │ │ │ ├── UIImage+MultiFormat.h │ │ │ ├── UIImage+MultiFormat.m │ │ │ ├── UIImageView+HighlightedWebCache.h │ │ │ ├── UIImageView+HighlightedWebCache.m │ │ │ ├── UIImageView+WebCache.h │ │ │ ├── UIImageView+WebCache.m │ │ │ ├── UIView+WebCache.h │ │ │ ├── UIView+WebCache.m │ │ │ ├── UIView+WebCacheOperation.h │ │ │ └── UIView+WebCacheOperation.m │ ├── Target Support Files │ │ ├── MJRefresh │ │ │ ├── Info.plist │ │ │ ├── MJRefresh-dummy.m │ │ │ ├── MJRefresh-prefix.pch │ │ │ ├── MJRefresh-umbrella.h │ │ │ ├── MJRefresh.modulemap │ │ │ └── MJRefresh.xcconfig │ │ ├── Pods-TokenHybrid │ │ │ ├── Info.plist │ │ │ ├── Pods-TokenHybrid-acknowledgements.markdown │ │ │ ├── Pods-TokenHybrid-acknowledgements.plist │ │ │ ├── Pods-TokenHybrid-dummy.m │ │ │ ├── Pods-TokenHybrid-frameworks.sh │ │ │ ├── Pods-TokenHybrid-resources.sh │ │ │ ├── Pods-TokenHybrid-umbrella.h │ │ │ ├── Pods-TokenHybrid.debug.xcconfig │ │ │ ├── Pods-TokenHybrid.modulemap │ │ │ └── Pods-TokenHybrid.release.xcconfig │ │ ├── SDWebImage │ │ │ ├── Info.plist │ │ │ ├── SDWebImage-dummy.m │ │ │ ├── SDWebImage-prefix.pch │ │ │ ├── SDWebImage-umbrella.h │ │ │ ├── SDWebImage.modulemap │ │ │ └── SDWebImage.xcconfig │ │ ├── TokenNetworking │ │ │ ├── Info.plist │ │ │ ├── TokenNetworking-dummy.m │ │ │ ├── TokenNetworking-prefix.pch │ │ │ ├── TokenNetworking-umbrella.h │ │ │ ├── TokenNetworking.modulemap │ │ │ └── TokenNetworking.xcconfig │ │ ├── UITableView+FDTemplateLayoutCell │ │ │ ├── Info.plist │ │ │ ├── UITableView+FDTemplateLayoutCell-dummy.m │ │ │ ├── UITableView+FDTemplateLayoutCell-prefix.pch │ │ │ ├── UITableView+FDTemplateLayoutCell-umbrella.h │ │ │ ├── UITableView+FDTemplateLayoutCell.modulemap │ │ │ └── UITableView+FDTemplateLayoutCell.xcconfig │ │ ├── Yoga │ │ │ ├── Info.plist │ │ │ ├── Yoga-dummy.m │ │ │ ├── Yoga-prefix.pch │ │ │ ├── Yoga-umbrella.h │ │ │ ├── Yoga.modulemap │ │ │ └── Yoga.xcconfig │ │ └── YogaKit │ │ │ ├── Info.plist │ │ │ ├── YogaKit-dummy.m │ │ │ ├── YogaKit-prefix.pch │ │ │ ├── YogaKit-umbrella.h │ │ │ ├── YogaKit.modulemap │ │ │ └── YogaKit.xcconfig │ ├── TokenNetworking │ │ ├── LICENSE │ │ └── TokenNetworking │ │ │ ├── TokenNetworking.h │ │ │ ├── TokenNetworking.m │ │ │ ├── TokenNetworkingCategories.h │ │ │ └── TokenNetworkingCategories.m │ ├── UITableView+FDTemplateLayoutCell │ │ ├── Classes │ │ │ ├── UITableView+FDIndexPathHeightCache.h │ │ │ ├── UITableView+FDIndexPathHeightCache.m │ │ │ ├── UITableView+FDKeyedHeightCache.h │ │ │ ├── UITableView+FDKeyedHeightCache.m │ │ │ ├── UITableView+FDTemplateLayoutCell.h │ │ │ ├── UITableView+FDTemplateLayoutCell.m │ │ │ ├── UITableView+FDTemplateLayoutCellDebug.h │ │ │ └── UITableView+FDTemplateLayoutCellDebug.m │ │ ├── LICENSE │ │ └── README.md │ ├── Yoga │ │ ├── LICENSE │ │ ├── LICENSE-examples │ │ ├── README.md │ │ └── yoga │ │ │ ├── YGEnums.c │ │ │ ├── YGEnums.h │ │ │ ├── YGMacros.h │ │ │ ├── YGNodeList.c │ │ │ ├── YGNodeList.h │ │ │ ├── Yoga.c │ │ │ └── Yoga.h │ └── YogaKit │ │ ├── LICENSE │ │ ├── LICENSE-examples │ │ ├── README.md │ │ └── YogaKit │ │ └── Source │ │ ├── UIView+Yoga.h │ │ ├── UIView+Yoga.m │ │ ├── YGLayout+Private.h │ │ ├── YGLayout.h │ │ ├── YGLayout.m │ │ └── YGLayoutExtensions.swift ├── Source │ ├── JavaScriptSupport │ │ ├── Scripts │ │ │ └── TokenBase.js │ │ ├── TokenHybridDefine.h │ │ ├── TokenJSContext.h │ │ ├── TokenJSContext.m │ │ ├── TokenTool.h │ │ └── TokenTool.m │ ├── TokenExtension │ │ ├── NSString+Token.h │ │ ├── NSString+Token.m │ │ ├── NSUserDefaults+Token.h │ │ ├── NSUserDefaults+Token.m │ │ ├── TokenExtensionHeader.h │ │ ├── UIColor+SSRender.h │ │ ├── UIColor+SSRender.m │ │ ├── UIColor+Token.h │ │ ├── UIColor+Token.m │ │ ├── UIView+Token.h │ │ └── UIView+Token.m │ ├── category │ │ ├── JSValue+Token.h │ │ ├── JSValue+Token.m │ │ ├── NSDictionary+chainScript.h │ │ ├── NSDictionary+chainScript.m │ │ ├── NSString+TokenHybrid.h │ │ ├── NSString+TokenHybrid.m │ │ ├── TokenComponent+pullRefresh.h │ │ ├── TokenComponent+pullRefresh.m │ │ ├── TokenXMLNode+JSExport.h │ │ ├── TokenXMLNode+JSExport.m │ │ ├── UIView+Attributes.h │ │ ├── UIView+Attributes.m │ │ ├── UIView+TokenFlexLayout.h │ │ └── UIView+TokenFlexLayout.m │ ├── component │ │ ├── TableView │ │ │ ├── TokenDataItem.h │ │ │ ├── TokenDataItem.m │ │ │ ├── TokenTableCell.h │ │ │ ├── TokenTableCell.m │ │ │ ├── TokenTableComponent.h │ │ │ ├── TokenTableComponent.m │ │ │ ├── TokenTableSectionView.h │ │ │ └── TokenTableSectionView.m │ │ ├── TokenButtonComponent.h │ │ ├── TokenButtonComponent.m │ │ ├── TokenHybridRenderController.h │ │ ├── TokenHybridRenderController.m │ │ ├── TokenHybridRenderView.h │ │ ├── TokenHybridRenderView.m │ │ ├── TokenImageComponent.h │ │ ├── TokenImageComponent.m │ │ ├── TokenInputComponent.h │ │ ├── TokenInputComponent.m │ │ ├── TokenLabelComponent.h │ │ ├── TokenLabelComponent.m │ │ ├── TokenPageControl.h │ │ ├── TokenPageControl.m │ │ ├── TokenPickerComponent.h │ │ ├── TokenPickerComponent.m │ │ ├── TokenPureComponent.h │ │ ├── TokenPureComponent.m │ │ ├── TokenScrollComponent.h │ │ ├── TokenScrollComponent.m │ │ ├── TokenSearchBarComponent.h │ │ ├── TokenSearchBarComponent.m │ │ ├── TokenSegmentedComponent.h │ │ ├── TokenSegmentedComponent.m │ │ ├── TokenSwitchComponent.h │ │ ├── TokenSwitchComponent.m │ │ ├── TokenTextAreaComponent.h │ │ ├── TokenTextAreaComponent.m │ │ ├── TokenWebViewComponent.h │ │ └── TokenWebViewComponent.m │ ├── model │ │ ├── TokenAssociateContext.h │ │ ├── TokenAssociateContext.m │ │ ├── TokenDocument.h │ │ ├── TokenDocument.m │ │ ├── TokenXMLNode.h │ │ └── TokenXMLNode.m │ ├── parser │ │ ├── TokenCSSParser.h │ │ ├── TokenCSSParser.m │ │ ├── TokenXMLParser.h │ │ └── TokenXMLParser.m │ └── tool │ │ ├── TokenHybridConstant.h │ │ ├── TokenHybridConstant.m │ │ ├── TokenHybridOrganizer.h │ │ ├── TokenHybridOrganizer.m │ │ ├── TokenHybridStack.h │ │ ├── TokenHybridStack.m │ │ ├── TokenNodeComponentRegister.h │ │ ├── TokenNodeComponentRegister.m │ │ ├── TokenViewBuilder.h │ │ └── TokenViewBuilder.m ├── TokenHybrid.xcodeproj │ ├── project.pbxproj │ └── project.xcworkspace │ │ └── contents.xcworkspacedata ├── TokenHybrid.xcworkspace │ └── contents.xcworkspacedata ├── TokenHybrid │ ├── AppDelegate.h │ ├── AppDelegate.m │ ├── Assets.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Base.lproj │ │ ├── LaunchScreen.storyboard │ │ └── Main.storyboard │ ├── CustomViewController.h │ ├── CustomViewController.m │ ├── Info.plist │ ├── ViewController.h │ ├── ViewController.m │ └── main.m └── TokenHybridTests │ ├── Info.plist │ └── TokenHybridTests.m ├── LICENSE ├── README.md ├── Source ├── JavaScriptSupport │ ├── Scripts │ │ └── TokenBase.js │ ├── TokenHybridDefine.h │ ├── TokenJSContext.h │ ├── TokenJSContext.m │ ├── TokenTool.h │ └── TokenTool.m ├── TokenExtension │ ├── NSString+Token.h │ ├── NSString+Token.m │ ├── NSUserDefaults+Token.h │ ├── NSUserDefaults+Token.m │ ├── TokenExtensionHeader.h │ ├── UIColor+SSRender.h │ ├── UIColor+SSRender.m │ ├── UIColor+Token.h │ ├── UIColor+Token.m │ ├── UIView+Token.h │ └── UIView+Token.m ├── category │ ├── JSValue+Token.h │ ├── JSValue+Token.m │ ├── NSDictionary+chainScript.h │ ├── NSDictionary+chainScript.m │ ├── NSString+TokenHybrid.h │ ├── NSString+TokenHybrid.m │ ├── TokenComponent+pullRefresh.h │ ├── TokenComponent+pullRefresh.m │ ├── TokenXMLNode+JSExport.h │ ├── TokenXMLNode+JSExport.m │ ├── UIView+Attributes.h │ ├── UIView+Attributes.m │ ├── UIView+TokenFlexLayout.h │ └── UIView+TokenFlexLayout.m ├── component │ ├── TableView │ │ ├── TokenDataItem.h │ │ ├── TokenDataItem.m │ │ ├── TokenTableCell.h │ │ ├── TokenTableCell.m │ │ ├── TokenTableComponent.h │ │ ├── TokenTableComponent.m │ │ ├── TokenTableSectionView.h │ │ └── TokenTableSectionView.m │ ├── TokenButtonComponent.h │ ├── TokenButtonComponent.m │ ├── TokenHybridRenderController.h │ ├── TokenHybridRenderController.m │ ├── TokenHybridRenderView.h │ ├── TokenHybridRenderView.m │ ├── TokenImageComponent.h │ ├── TokenImageComponent.m │ ├── TokenInputComponent.h │ ├── TokenInputComponent.m │ ├── TokenLabelComponent.h │ ├── TokenLabelComponent.m │ ├── TokenPageControl.h │ ├── TokenPageControl.m │ ├── TokenPickerComponent.h │ ├── TokenPickerComponent.m │ ├── TokenPureComponent.h │ ├── TokenPureComponent.m │ ├── TokenScrollComponent.h │ ├── TokenScrollComponent.m │ ├── TokenSearchBarComponent.h │ ├── TokenSearchBarComponent.m │ ├── TokenSegmentedComponent.h │ ├── TokenSegmentedComponent.m │ ├── TokenSwitchComponent.h │ ├── TokenSwitchComponent.m │ ├── TokenTextAreaComponent.h │ ├── TokenTextAreaComponent.m │ ├── TokenWebViewComponent.h │ └── TokenWebViewComponent.m ├── model │ ├── TokenAssociateContext.h │ ├── TokenAssociateContext.m │ ├── TokenDocument.h │ ├── TokenDocument.m │ ├── TokenXMLNode.h │ └── TokenXMLNode.m ├── parser │ ├── TokenCSSParser.h │ ├── TokenCSSParser.m │ ├── TokenXMLParser.h │ └── TokenXMLParser.m └── tool │ ├── TokenHybridConstant.h │ ├── TokenHybridConstant.m │ ├── TokenHybridOrganizer.h │ ├── TokenHybridOrganizer.m │ ├── TokenHybridStack.h │ ├── TokenHybridStack.m │ ├── TokenNodeComponentRegister.h │ ├── TokenNodeComponentRegister.m │ ├── TokenViewBuilder.h │ └── TokenViewBuilder.m ├── TokenHybrid.podspec └── screenshots ├── code.png └── example.gif /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | # 3 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 4 | 5 | ## Build generated 6 | build/ 7 | DerivedData/ 8 | 9 | ## Various settings 10 | *.pbxuser 11 | !default.pbxuser 12 | *.mode1v3 13 | !default.mode1v3 14 | *.mode2v3 15 | !default.mode2v3 16 | *.perspectivev3 17 | !default.perspectivev3 18 | xcuserdata/ 19 | 20 | ## Other 21 | *.moved-aside 22 | *.xccheckout 23 | *.xcscmblueprint 24 | 25 | ## Obj-C/Swift specific 26 | *.hmap 27 | *.ipa 28 | *.dSYM.zip 29 | *.dSYM 30 | 31 | # CocoaPods 32 | # 33 | # We recommend against adding the Pods directory to your .gitignore. However 34 | # you should judge for yourself, the pros and cons are mentioned at: 35 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control 36 | # 37 | # Pods/ 38 | 39 | # Carthage 40 | # 41 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 42 | # Carthage/Checkouts 43 | 44 | Carthage/Build 45 | 46 | # fastlane 47 | # 48 | # It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the 49 | # screenshots whenever they are needed. 50 | # For more information about the recommended setup visit: 51 | # https://docs.fastlane.tools/best-practices/source-control/#source-control 52 | 53 | fastlane/report.xml 54 | fastlane/Preview.html 55 | fastlane/screenshots 56 | fastlane/test_output 57 | 58 | # Code Injection 59 | # 60 | # After new code Injection tools there's a generated folder /iOSInjectionProject 61 | # https://github.com/johnno1962/injectionforxcode 62 | 63 | iOSInjectionProject/ 64 | -------------------------------------------------------------------------------- /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /Example/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 XiongChen 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 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | platform:ios,'9.0' 3 | inhibit_all_warnings! 4 | 5 | target 'TokenHybrid' do 6 | pod 'YogaKit' 7 | pod 'SDWebImage' 8 | pod 'MJRefresh' 9 | pod 'UITableView+FDTemplateLayoutCell' 10 | pod 'TokenNetworking' 11 | end 12 | 13 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJRefresh (3.1.15.1) 3 | - SDWebImage (4.2.2): 4 | - SDWebImage/Core (= 4.2.2) 5 | - SDWebImage/Core (4.2.2) 6 | - TokenNetworking (1.0.1) 7 | - UITableView+FDTemplateLayoutCell (1.6) 8 | - Yoga (1.6.0) 9 | - YogaKit (1.6.0): 10 | - Yoga (~> 1.6) 11 | 12 | DEPENDENCIES: 13 | - MJRefresh 14 | - SDWebImage 15 | - TokenNetworking 16 | - UITableView+FDTemplateLayoutCell 17 | - YogaKit 18 | 19 | SPEC CHECKSUMS: 20 | MJRefresh: 5f8552bc25ca8751c010f621c1098dbdaacbccd6 21 | SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198 22 | TokenNetworking: 09d71ff2ddb0b50e7982f26ba5e8b793b0e61618 23 | UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f 24 | Yoga: 81670877477311136b1b3f69a6307ce62e1c89cf 25 | YogaKit: 8fe0ddd21673226c0b6077fc3ad5c8fa6cda722e 26 | 27 | PODFILE CHECKSUM: db899926c512725784e3eb05ad1766156c411aa1 28 | 29 | COCOAPODS: 1.3.1 30 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 MJRefresh (https://github.com/CoderMJLee/MJRefresh) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Base/MJRefreshAutoFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshAutoFooter : MJRefreshFooter 12 | /** 是否自动刷新(默认为YES) */ 13 | @property (assign, nonatomic, getter=isAutomaticallyRefresh) BOOL automaticallyRefresh; 14 | 15 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 16 | @property (assign, nonatomic) CGFloat appearencePercentTriggerAutoRefresh MJRefreshDeprecated("请使用triggerAutomaticallyRefreshPercent属性"); 17 | 18 | /** 当底部控件出现多少时就自动刷新(默认为1.0,也就是底部控件完全出现时,才会自动刷新) */ 19 | @property (assign, nonatomic) CGFloat triggerAutomaticallyRefreshPercent; 20 | @end 21 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Base/MJRefreshBackFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshFooter.h" 10 | 11 | @interface MJRefreshBackFooter : MJRefreshFooter 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Base/MJRefreshFooter.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshFooter.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/5. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 上拉刷新控件 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshFooter : MJRefreshComponent 13 | /** 创建footer */ 14 | + (instancetype)footerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建footer */ 16 | + (instancetype)footerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 提示没有更多的数据 */ 19 | - (void)endRefreshingWithNoMoreData; 20 | - (void)noticeNoMoreData MJRefreshDeprecated("使用endRefreshingWithNoMoreData"); 21 | 22 | /** 重置没有更多的数据(消除没有更多数据的状态) */ 23 | - (void)resetNoMoreData; 24 | 25 | /** 忽略多少scrollView的contentInset的bottom */ 26 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetBottom; 27 | 28 | /** 自动根据有无数据来显示和隐藏(有数据就显示,没有数据隐藏。默认是NO) */ 29 | @property (assign, nonatomic, getter=isAutomaticallyHidden) BOOL automaticallyHidden MJRefreshDeprecated("不建议使用此属性,开发者请自行控制footer的显示和隐藏。基于安全考虑,在未来的某些版本此属性可能作废"); 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Base/MJRefreshHeader.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // MJRefreshHeader.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 下拉刷新控件:负责监控用户下拉的状态 9 | 10 | #import "MJRefreshComponent.h" 11 | 12 | @interface MJRefreshHeader : MJRefreshComponent 13 | /** 创建header */ 14 | + (instancetype)headerWithRefreshingBlock:(MJRefreshComponentRefreshingBlock)refreshingBlock; 15 | /** 创建header */ 16 | + (instancetype)headerWithRefreshingTarget:(id)target refreshingAction:(SEL)action; 17 | 18 | /** 这个key用来存储上一次下拉刷新成功的时间 */ 19 | @property (copy, nonatomic) NSString *lastUpdatedTimeKey; 20 | /** 上一次下拉刷新成功的时间 */ 21 | @property (strong, nonatomic, readonly) NSDate *lastUpdatedTime; 22 | 23 | /** 忽略多少scrollView的contentInset的top */ 24 | @property (assign, nonatomic) CGFloat ignoredScrollViewContentInsetTop; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoGifFooter : MJRefreshAutoStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoStateFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter : MJRefreshAutoStateFooter 12 | /** 菊花的样式 */ 13 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoNormalFooter.m: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoNormalFooter.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoNormalFooter.h" 10 | 11 | @interface MJRefreshAutoNormalFooter() 12 | @property (weak, nonatomic) UIActivityIndicatorView *loadingView; 13 | @end 14 | 15 | @implementation MJRefreshAutoNormalFooter 16 | #pragma mark - 懒加载子控件 17 | - (UIActivityIndicatorView *)loadingView 18 | { 19 | if (!_loadingView) { 20 | UIActivityIndicatorView *loadingView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:self.activityIndicatorViewStyle]; 21 | loadingView.hidesWhenStopped = YES; 22 | [self addSubview:_loadingView = loadingView]; 23 | } 24 | return _loadingView; 25 | } 26 | 27 | - (void)setActivityIndicatorViewStyle:(UIActivityIndicatorViewStyle)activityIndicatorViewStyle 28 | { 29 | _activityIndicatorViewStyle = activityIndicatorViewStyle; 30 | 31 | self.loadingView = nil; 32 | [self setNeedsLayout]; 33 | } 34 | #pragma mark - 重写父类的方法 35 | - (void)prepare 36 | { 37 | [super prepare]; 38 | 39 | self.activityIndicatorViewStyle = UIActivityIndicatorViewStyleGray; 40 | } 41 | 42 | - (void)placeSubviews 43 | { 44 | [super placeSubviews]; 45 | 46 | if (self.loadingView.constraints.count) return; 47 | 48 | // 圈圈 49 | CGFloat loadingCenterX = self.mj_w * 0.5; 50 | if (!self.isRefreshingTitleHidden) { 51 | loadingCenterX -= self.stateLabel.mj_textWith * 0.5 + self.labelLeftInset; 52 | } 53 | CGFloat loadingCenterY = self.mj_h * 0.5; 54 | self.loadingView.center = CGPointMake(loadingCenterX, loadingCenterY); 55 | } 56 | 57 | - (void)setState:(MJRefreshState)state 58 | { 59 | MJRefreshCheckState 60 | 61 | // 根据状态做事情 62 | if (state == MJRefreshStateNoMoreData || state == MJRefreshStateIdle) { 63 | [self.loadingView stopAnimating]; 64 | } else if (state == MJRefreshStateRefreshing) { 65 | [self.loadingView startAnimating]; 66 | } 67 | } 68 | 69 | @end 70 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Auto/MJRefreshAutoStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshAutoStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshAutoFooter.h" 10 | 11 | @interface MJRefreshAutoStateFooter : MJRefreshAutoFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | 17 | /** 设置state状态下的文字 */ 18 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 19 | 20 | /** 隐藏刷新状态的文字 */ 21 | @property (assign, nonatomic, getter=isRefreshingTitleHidden) BOOL refreshingTitleHidden; 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackGifFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackGifFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackGifFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackNormalFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackNormalFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackStateFooter.h" 10 | 11 | @interface MJRefreshBackNormalFooter : MJRefreshBackStateFooter 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Footer/Back/MJRefreshBackStateFooter.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshBackStateFooter.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/6/13. 6 | // Copyright © 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshBackFooter.h" 10 | 11 | @interface MJRefreshBackStateFooter : MJRefreshBackFooter 12 | /** 文字距离圈圈、箭头的距离 */ 13 | @property (assign, nonatomic) CGFloat labelLeftInset; 14 | /** 显示刷新状态的label */ 15 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 16 | /** 设置state状态下的文字 */ 17 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 18 | 19 | /** 获取state状态下的title */ 20 | - (NSString *)titleForState:(MJRefreshState)state; 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshGifHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshGifHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshGifHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *gifView; 13 | 14 | /** 设置state状态下的动画图片images 动画持续时间duration*/ 15 | - (void)setImages:(NSArray *)images duration:(NSTimeInterval)duration forState:(MJRefreshState)state; 16 | - (void)setImages:(NSArray *)images forState:(MJRefreshState)state; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshNormalHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshNormalHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshStateHeader.h" 10 | 11 | @interface MJRefreshNormalHeader : MJRefreshStateHeader 12 | @property (weak, nonatomic, readonly) UIImageView *arrowView; 13 | /** 菊花的样式 */ 14 | @property (assign, nonatomic) UIActivityIndicatorViewStyle activityIndicatorViewStyle; 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/Custom/Header/MJRefreshStateHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // MJRefreshStateHeader.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 15/4/24. 6 | // Copyright (c) 2015年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "MJRefreshHeader.h" 10 | 11 | @interface MJRefreshStateHeader : MJRefreshHeader 12 | #pragma mark - 刷新时间相关 13 | /** 利用这个block来决定显示的更新时间文字 */ 14 | @property (copy, nonatomic) NSString *(^lastUpdatedTimeText)(NSDate *lastUpdatedTime); 15 | /** 显示上一次刷新时间的label */ 16 | @property (weak, nonatomic, readonly) UILabel *lastUpdatedTimeLabel; 17 | 18 | #pragma mark - 状态相关 19 | /** 文字距离圈圈、箭头的距离 */ 20 | @property (assign, nonatomic) CGFloat labelLeftInset; 21 | /** 显示刷新状态的label */ 22 | @property (weak, nonatomic, readonly) UILabel *stateLabel; 23 | /** 设置state状态下的文字 */ 24 | - (void)setTitle:(NSString *)title forState:(MJRefreshState)state; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cx478815108/TokenHybrid/e63b6d6613777804edb1720d8387aa1f59a1170a/Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/arrow@2x.png -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cx478815108/TokenHybrid/e63b6d6613777804edb1720d8387aa1f59a1170a/Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/en.lproj/Localizable.strings -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cx478815108/TokenHybrid/e63b6d6613777804edb1720d8387aa1f59a1170a/Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hans.lproj/Localizable.strings -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefresh.bundle/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "MJRefreshHeaderIdleText" = "下拉可以刷新"; 2 | "MJRefreshHeaderPullingText" = "鬆開立即刷新"; 3 | "MJRefreshHeaderRefreshingText" = "正在刷新數據中..."; 4 | 5 | "MJRefreshAutoFooterIdleText" = "點擊或上拉加載更多"; 6 | "MJRefreshAutoFooterRefreshingText" = "正在加載更多的數據..."; 7 | "MJRefreshAutoFooterNoMoreDataText" = "已經全部加載完畢"; 8 | 9 | "MJRefreshBackFooterIdleText" = "上拉可以加載更多"; 10 | "MJRefreshBackFooterPullingText" = "鬆開立即加載更多"; 11 | "MJRefreshBackFooterRefreshingText" = "正在加載更多的數據..."; 12 | "MJRefreshBackFooterNoMoreDataText" = "已經全部加載完畢"; 13 | 14 | "MJRefreshHeaderLastTimeText" = "最後更新:"; 15 | "MJRefreshHeaderDateTodayText" = "今天"; 16 | "MJRefreshHeaderNoneLastDateText" = "無記錄"; 17 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | 4 | #import "UIScrollView+MJRefresh.h" 5 | #import "UIScrollView+MJExtension.h" 6 | #import "UIView+MJExtension.h" 7 | 8 | #import "MJRefreshNormalHeader.h" 9 | #import "MJRefreshGifHeader.h" 10 | 11 | #import "MJRefreshBackNormalFooter.h" 12 | #import "MJRefreshBackGifFooter.h" 13 | #import "MJRefreshAutoNormalFooter.h" 14 | #import "MJRefreshAutoGifFooter.h" -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/MJRefreshConst.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | #import 4 | 5 | const CGFloat MJRefreshLabelLeftInset = 25; 6 | const CGFloat MJRefreshHeaderHeight = 54.0; 7 | const CGFloat MJRefreshFooterHeight = 44.0; 8 | const CGFloat MJRefreshFastAnimationDuration = 0.25; 9 | const CGFloat MJRefreshSlowAnimationDuration = 0.4; 10 | 11 | NSString *const MJRefreshKeyPathContentOffset = @"contentOffset"; 12 | NSString *const MJRefreshKeyPathContentInset = @"contentInset"; 13 | NSString *const MJRefreshKeyPathContentSize = @"contentSize"; 14 | NSString *const MJRefreshKeyPathPanState = @"state"; 15 | 16 | NSString *const MJRefreshHeaderLastUpdatedTimeKey = @"MJRefreshHeaderLastUpdatedTimeKey"; 17 | 18 | NSString *const MJRefreshHeaderIdleText = @"MJRefreshHeaderIdleText"; 19 | NSString *const MJRefreshHeaderPullingText = @"MJRefreshHeaderPullingText"; 20 | NSString *const MJRefreshHeaderRefreshingText = @"MJRefreshHeaderRefreshingText"; 21 | 22 | NSString *const MJRefreshAutoFooterIdleText = @"MJRefreshAutoFooterIdleText"; 23 | NSString *const MJRefreshAutoFooterRefreshingText = @"MJRefreshAutoFooterRefreshingText"; 24 | NSString *const MJRefreshAutoFooterNoMoreDataText = @"MJRefreshAutoFooterNoMoreDataText"; 25 | 26 | NSString *const MJRefreshBackFooterIdleText = @"MJRefreshBackFooterIdleText"; 27 | NSString *const MJRefreshBackFooterPullingText = @"MJRefreshBackFooterPullingText"; 28 | NSString *const MJRefreshBackFooterRefreshingText = @"MJRefreshBackFooterRefreshingText"; 29 | NSString *const MJRefreshBackFooterNoMoreDataText = @"MJRefreshBackFooterNoMoreDataText"; 30 | 31 | NSString *const MJRefreshHeaderLastTimeText = @"MJRefreshHeaderLastTimeText"; 32 | NSString *const MJRefreshHeaderDateTodayText = @"MJRefreshHeaderDateTodayText"; 33 | NSString *const MJRefreshHeaderNoneLastDateText = @"MJRefreshHeaderNoneLastDateText"; -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.h 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSBundle (MJRefresh) 12 | + (instancetype)mj_refreshBundle; 13 | + (UIImage *)mj_arrowImage; 14 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value; 15 | + (NSString *)mj_localizedStringForKey:(NSString *)key; 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/NSBundle+MJRefresh.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSBundle+MJRefresh.m 3 | // MJRefreshExample 4 | // 5 | // Created by MJ Lee on 16/6/13. 6 | // Copyright © 2016年 小码哥. All rights reserved. 7 | // 8 | 9 | #import "NSBundle+MJRefresh.h" 10 | #import "MJRefreshComponent.h" 11 | 12 | @implementation NSBundle (MJRefresh) 13 | + (instancetype)mj_refreshBundle 14 | { 15 | static NSBundle *refreshBundle = nil; 16 | if (refreshBundle == nil) { 17 | // 这里不使用mainBundle是为了适配pod 1.x和0.x 18 | refreshBundle = [NSBundle bundleWithPath:[[NSBundle bundleForClass:[MJRefreshComponent class]] pathForResource:@"MJRefresh" ofType:@"bundle"]]; 19 | } 20 | return refreshBundle; 21 | } 22 | 23 | + (UIImage *)mj_arrowImage 24 | { 25 | static UIImage *arrowImage = nil; 26 | if (arrowImage == nil) { 27 | arrowImage = [[UIImage imageWithContentsOfFile:[[self mj_refreshBundle] pathForResource:@"arrow@2x" ofType:@"png"]] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; 28 | } 29 | return arrowImage; 30 | } 31 | 32 | + (NSString *)mj_localizedStringForKey:(NSString *)key 33 | { 34 | return [self mj_localizedStringForKey:key value:nil]; 35 | } 36 | 37 | + (NSString *)mj_localizedStringForKey:(NSString *)key value:(NSString *)value 38 | { 39 | static NSBundle *bundle = nil; 40 | if (bundle == nil) { 41 | // (iOS获取的语言字符串比较不稳定)目前框架只处理en、zh-Hans、zh-Hant三种情况,其他按照系统默认处理 42 | NSString *language = [NSLocale preferredLanguages].firstObject; 43 | if ([language hasPrefix:@"en"]) { 44 | language = @"en"; 45 | } else if ([language hasPrefix:@"zh"]) { 46 | if ([language rangeOfString:@"Hans"].location != NSNotFound) { 47 | language = @"zh-Hans"; // 简体中文 48 | } else { // zh-Hant\zh-HK\zh-TW 49 | language = @"zh-Hant"; // 繁體中文 50 | } 51 | } else { 52 | language = @"en"; 53 | } 54 | 55 | // 从MJRefresh.bundle中查找资源 56 | bundle = [NSBundle bundleWithPath:[[NSBundle mj_refreshBundle] pathForResource:language ofType:@"lproj"]]; 57 | } 58 | value = [bundle localizedStringForKey:key value:value table:nil]; 59 | return [[NSBundle mainBundle] localizedStringForKey:key value:value table:nil]; 60 | } 61 | @end 62 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/UIScrollView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIScrollView (MJExtension) 13 | @property (readonly, nonatomic) UIEdgeInsets mj_inset; 14 | 15 | @property (assign, nonatomic) CGFloat mj_insetT; 16 | @property (assign, nonatomic) CGFloat mj_insetB; 17 | @property (assign, nonatomic) CGFloat mj_insetL; 18 | @property (assign, nonatomic) CGFloat mj_insetR; 19 | 20 | @property (assign, nonatomic) CGFloat mj_offsetX; 21 | @property (assign, nonatomic) CGFloat mj_offsetY; 22 | 23 | @property (assign, nonatomic) CGFloat mj_contentW; 24 | @property (assign, nonatomic) CGFloat mj_contentH; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/UIScrollView+MJRefresh.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIScrollView+MJRefresh.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 15/3/4. 7 | // Copyright (c) 2015年 小码哥. All rights reserved. 8 | // 给ScrollView增加下拉刷新、上拉刷新的功能 9 | 10 | #import 11 | #import "MJRefreshConst.h" 12 | 13 | @class MJRefreshHeader, MJRefreshFooter; 14 | 15 | @interface UIScrollView (MJRefresh) 16 | /** 下拉刷新控件 */ 17 | @property (strong, nonatomic) MJRefreshHeader *mj_header; 18 | @property (strong, nonatomic) MJRefreshHeader *header MJRefreshDeprecated("使用mj_header"); 19 | /** 上拉刷新控件 */ 20 | @property (strong, nonatomic) MJRefreshFooter *mj_footer; 21 | @property (strong, nonatomic) MJRefreshFooter *footer MJRefreshDeprecated("使用mj_footer"); 22 | 23 | #pragma mark - other 24 | - (NSInteger)mj_totalDataCount; 25 | @property (copy, nonatomic) void (^mj_reloadDataBlock)(NSInteger totalDataCount); 26 | @end 27 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/UIView+MJExtension.h: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.h 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import 11 | 12 | @interface UIView (MJExtension) 13 | @property (assign, nonatomic) CGFloat mj_x; 14 | @property (assign, nonatomic) CGFloat mj_y; 15 | @property (assign, nonatomic) CGFloat mj_w; 16 | @property (assign, nonatomic) CGFloat mj_h; 17 | @property (assign, nonatomic) CGSize mj_size; 18 | @property (assign, nonatomic) CGPoint mj_origin; 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/MJRefresh/MJRefresh/UIView+MJExtension.m: -------------------------------------------------------------------------------- 1 | // 代码地址: https://github.com/CoderMJLee/MJRefresh 2 | // 代码地址: http://code4app.com/ios/%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90%E4%B8%8B%E6%8B%89%E4%B8%8A%E6%8B%89%E5%88%B7%E6%96%B0/52326ce26803fabc46000000 3 | // UIView+Extension.m 4 | // MJRefreshExample 5 | // 6 | // Created by MJ Lee on 14-5-28. 7 | // Copyright (c) 2014年 小码哥. All rights reserved. 8 | // 9 | 10 | #import "UIView+MJExtension.h" 11 | 12 | @implementation UIView (MJExtension) 13 | - (void)setMj_x:(CGFloat)mj_x 14 | { 15 | CGRect frame = self.frame; 16 | frame.origin.x = mj_x; 17 | self.frame = frame; 18 | } 19 | 20 | - (CGFloat)mj_x 21 | { 22 | return self.frame.origin.x; 23 | } 24 | 25 | - (void)setMj_y:(CGFloat)mj_y 26 | { 27 | CGRect frame = self.frame; 28 | frame.origin.y = mj_y; 29 | self.frame = frame; 30 | } 31 | 32 | - (CGFloat)mj_y 33 | { 34 | return self.frame.origin.y; 35 | } 36 | 37 | - (void)setMj_w:(CGFloat)mj_w 38 | { 39 | CGRect frame = self.frame; 40 | frame.size.width = mj_w; 41 | self.frame = frame; 42 | } 43 | 44 | - (CGFloat)mj_w 45 | { 46 | return self.frame.size.width; 47 | } 48 | 49 | - (void)setMj_h:(CGFloat)mj_h 50 | { 51 | CGRect frame = self.frame; 52 | frame.size.height = mj_h; 53 | self.frame = frame; 54 | } 55 | 56 | - (CGFloat)mj_h 57 | { 58 | return self.frame.size.height; 59 | } 60 | 61 | - (void)setMj_size:(CGSize)mj_size 62 | { 63 | CGRect frame = self.frame; 64 | frame.size = mj_size; 65 | self.frame = frame; 66 | } 67 | 68 | - (CGSize)mj_size 69 | { 70 | return self.frame.size; 71 | } 72 | 73 | - (void)setMj_origin:(CGPoint)mj_origin 74 | { 75 | CGRect frame = self.frame; 76 | frame.origin = mj_origin; 77 | self.frame = frame; 78 | } 79 | 80 | - (CGPoint)mj_origin 81 | { 82 | return self.frame.origin; 83 | } 84 | @end 85 | -------------------------------------------------------------------------------- /Example/Pods/Manifest.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - MJRefresh (3.1.15.1) 3 | - SDWebImage (4.2.2): 4 | - SDWebImage/Core (= 4.2.2) 5 | - SDWebImage/Core (4.2.2) 6 | - TokenNetworking (1.0.1) 7 | - UITableView+FDTemplateLayoutCell (1.6) 8 | - Yoga (1.6.0) 9 | - YogaKit (1.6.0): 10 | - Yoga (~> 1.6) 11 | 12 | DEPENDENCIES: 13 | - MJRefresh 14 | - SDWebImage 15 | - TokenNetworking 16 | - UITableView+FDTemplateLayoutCell 17 | - YogaKit 18 | 19 | SPEC CHECKSUMS: 20 | MJRefresh: 5f8552bc25ca8751c010f621c1098dbdaacbccd6 21 | SDWebImage: 89a9d32cd520bbb46eb14e541d5109b3564af198 22 | TokenNetworking: 09d71ff2ddb0b50e7982f26ba5e8b793b0e61618 23 | UITableView+FDTemplateLayoutCell: 5c949b4a5059c404b442926c0e80f81d10a2d66f 24 | Yoga: 81670877477311136b1b3f69a6307ce62e1c89cf 25 | YogaKit: 8fe0ddd21673226c0b6077fc3ad5c8fa6cda722e 26 | 27 | PODFILE CHECKSUM: db899926c512725784e3eb05ad1766156c411aa1 28 | 29 | COCOAPODS: 1.3.1 30 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2009-2017 Olivier Poitrey rs@dailymotion.com 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is furnished 8 | to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/NSData+ImageContentType.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Fabrice Aneche 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import 11 | #import "SDWebImageCompat.h" 12 | 13 | typedef NS_ENUM(NSInteger, SDImageFormat) { 14 | SDImageFormatUndefined = -1, 15 | SDImageFormatJPEG = 0, 16 | SDImageFormatPNG, 17 | SDImageFormatGIF, 18 | SDImageFormatTIFF, 19 | SDImageFormatWebP, 20 | SDImageFormatHEIC 21 | }; 22 | 23 | @interface NSData (ImageContentType) 24 | 25 | /** 26 | * Return image format 27 | * 28 | * @param data the input image data 29 | * 30 | * @return the image format as `SDImageFormat` (enum) 31 | */ 32 | + (SDImageFormat)sd_imageFormatForImageData:(nullable NSData *)data; 33 | 34 | /** 35 | Convert SDImageFormat to UTType 36 | 37 | @param format Format as SDImageFormat 38 | @return The UTType as CFStringRef 39 | */ 40 | + (nonnull CFStringRef)sd_UTTypeFromSDImageFormat:(SDImageFormat)format; 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/NSImage+WebCache.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_MAC 12 | 13 | #import 14 | 15 | @interface NSImage (WebCache) 16 | 17 | - (CGImageRef)CGImage; 18 | - (NSArray *)images; 19 | - (BOOL)isGIF; 20 | 21 | @end 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/NSImage+WebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "NSImage+WebCache.h" 10 | 11 | #if SD_MAC 12 | 13 | @implementation NSImage (WebCache) 14 | 15 | - (CGImageRef)CGImage { 16 | NSRect imageRect = NSMakeRect(0, 0, self.size.width, self.size.height); 17 | CGImageRef cgImage = [self CGImageForProposedRect:&imageRect context:NULL hints:nil]; 18 | return cgImage; 19 | } 20 | 21 | - (NSArray *)images { 22 | return nil; 23 | } 24 | 25 | - (BOOL)isGIF { 26 | BOOL isGIF = NO; 27 | for (NSImageRep *rep in self.representations) { 28 | if ([rep isKindOfClass:[NSBitmapImageRep class]]) { 29 | NSBitmapImageRep *bitmapRep = (NSBitmapImageRep *)rep; 30 | NSUInteger frameCount = [[bitmapRep valueForProperty:NSImageFrameCount] unsignedIntegerValue]; 31 | isGIF = frameCount > 1 ? YES : NO; 32 | break; 33 | } 34 | } 35 | return isGIF; 36 | } 37 | 38 | @end 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDImageCacheConfig : NSObject 13 | 14 | /** 15 | * Decompressing images that are downloaded and cached can improve performance but can consume lot of memory. 16 | * Defaults to YES. Set this to NO if you are experiencing a crash due to excessive memory consumption. 17 | */ 18 | @property (assign, nonatomic) BOOL shouldDecompressImages; 19 | 20 | /** 21 | * disable iCloud backup [defaults to YES] 22 | */ 23 | @property (assign, nonatomic) BOOL shouldDisableiCloud; 24 | 25 | /** 26 | * use memory cache [defaults to YES] 27 | */ 28 | @property (assign, nonatomic) BOOL shouldCacheImagesInMemory; 29 | 30 | /** 31 | * The reading options while reading cache from disk. 32 | * Defaults to 0. You can set this to mapped file to improve performance. 33 | */ 34 | @property (assign, nonatomic) NSDataReadingOptions diskCacheReadingOptions; 35 | 36 | /** 37 | * The maximum length of time to keep an image in the cache, in seconds. 38 | */ 39 | @property (assign, nonatomic) NSInteger maxCacheAge; 40 | 41 | /** 42 | * The maximum size of the cache, in bytes. 43 | */ 44 | @property (assign, nonatomic) NSUInteger maxCacheSize; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDImageCacheConfig.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDImageCacheConfig.h" 10 | 11 | static const NSInteger kDefaultCacheMaxCacheAge = 60 * 60 * 24 * 7; // 1 week 12 | 13 | @implementation SDImageCacheConfig 14 | 15 | - (instancetype)init { 16 | if (self = [super init]) { 17 | _shouldDecompressImages = YES; 18 | _shouldDisableiCloud = YES; 19 | _shouldCacheImagesInMemory = YES; 20 | _diskCacheReadingOptions = 0; 21 | _maxCacheAge = kDefaultCacheMaxCacheAge; 22 | _maxCacheSize = 0; 23 | } 24 | return self; 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageCoder.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCoder.h" 10 | 11 | NSString * const SDWebImageCoderScaleDownLargeImagesKey = @"scaleDownLargeImages"; 12 | 13 | CGColorSpaceRef SDCGColorSpaceGetDeviceRGB(void) { 14 | static CGColorSpaceRef colorSpace; 15 | static dispatch_once_t onceToken; 16 | dispatch_once(&onceToken, ^{ 17 | colorSpace = CGColorSpaceCreateDeviceRGB(); 18 | }); 19 | return colorSpace; 20 | } 21 | 22 | BOOL SDCGImageRefContainsAlpha(CGImageRef imageRef) { 23 | if (!imageRef) { 24 | return NO; 25 | } 26 | CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); 27 | BOOL hasAlpha = !(alphaInfo == kCGImageAlphaNone || 28 | alphaInfo == kCGImageAlphaNoneSkipFirst || 29 | alphaInfo == kCGImageAlphaNoneSkipLast); 30 | return hasAlpha; 31 | } 32 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageCompat.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "UIImage+MultiFormat.h" 11 | 12 | #if !__has_feature(objc_arc) 13 | #error SDWebImage is ARC only. Either turn on ARC for the project or use -fobjc-arc flag 14 | #endif 15 | 16 | inline UIImage *SDScaledImageForKey(NSString * _Nullable key, UIImage * _Nullable image) { 17 | if (!image) { 18 | return nil; 19 | } 20 | 21 | #if SD_MAC 22 | return image; 23 | #elif SD_UIKIT || SD_WATCH 24 | if ((image.images).count > 0) { 25 | NSMutableArray *scaledImages = [NSMutableArray array]; 26 | 27 | for (UIImage *tempImage in image.images) { 28 | [scaledImages addObject:SDScaledImageForKey(key, tempImage)]; 29 | } 30 | 31 | UIImage *animatedImage = [UIImage animatedImageWithImages:scaledImages duration:image.duration]; 32 | if (animatedImage) { 33 | animatedImage.sd_imageLoopCount = image.sd_imageLoopCount; 34 | } 35 | return animatedImage; 36 | } else { 37 | #if SD_WATCH 38 | if ([[WKInterfaceDevice currentDevice] respondsToSelector:@selector(screenScale)]) { 39 | #elif SD_UIKIT 40 | if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { 41 | #endif 42 | CGFloat scale = 1; 43 | if (key.length >= 8) { 44 | NSRange range = [key rangeOfString:@"@2x."]; 45 | if (range.location != NSNotFound) { 46 | scale = 2.0; 47 | } 48 | 49 | range = [key rangeOfString:@"@3x."]; 50 | if (range.location != NSNotFound) { 51 | scale = 3.0; 52 | } 53 | } 54 | 55 | UIImage *scaledImage = [[UIImage alloc] initWithCGImage:image.CGImage scale:scale orientation:image.imageOrientation]; 56 | image = scaledImage; 57 | } 58 | return image; 59 | } 60 | #endif 61 | } 62 | 63 | NSString *const SDWebImageErrorDomain = @"SDWebImageErrorDomain"; 64 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageFrame.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface SDWebImageFrame : NSObject 13 | 14 | // This class is used for creating animated images via `animatedImageWithFrames` in `SDWebImageCoderHelper`. Attension if you need animated images loop count, use `sd_imageLoopCount` property in `UIImage+MultiFormat` 15 | 16 | /** 17 | The image of current frame. You should not set an animated image. 18 | */ 19 | @property (nonatomic, strong, readonly, nonnull) UIImage *image; 20 | /** 21 | The duration of current frame to be displayed. The number is seconds but not milliseconds. You should not set this to zero. 22 | */ 23 | @property (nonatomic, readonly, assign) NSTimeInterval duration; 24 | 25 | /** 26 | Create a frame instance with specify image and duration 27 | 28 | @param image current frame's image 29 | @param duration current frame's duration 30 | @return frame instance 31 | */ 32 | + (instancetype _Nonnull)frameWithImage:(UIImage * _Nonnull)image duration:(NSTimeInterval)duration; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageFrame.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageFrame.h" 10 | 11 | @interface SDWebImageFrame () 12 | 13 | @property (nonatomic, strong, readwrite, nonnull) UIImage *image; 14 | @property (nonatomic, readwrite, assign) NSTimeInterval duration; 15 | 16 | @end 17 | 18 | @implementation SDWebImageFrame 19 | 20 | + (instancetype)frameWithImage:(UIImage *)image duration:(NSTimeInterval)duration { 21 | SDWebImageFrame *frame = [[SDWebImageFrame alloc] init]; 22 | frame.image = image; 23 | frame.duration = duration; 24 | 25 | return frame; 26 | } 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageGIFCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder using ImageIO that supports GIF encoding/decoding 14 | @note `SDWebImageIOCoder` supports GIF but only as static (will use the 1st frame). 15 | @note Use `SDWebImageGIFCoder` for fully animated GIFs - less performant than `FLAnimatedImage` 16 | @note If you decide to make all `UIImageView`(including `FLAnimatedImageView`) instance support GIF. You should add this coder to `SDWebImageCodersManager` and make sure that it has a higher priority than `SDWebImageIOCoder` 17 | @note The recommended approach for animated GIFs is using `FLAnimatedImage`. It's more performant than `UIImageView` for GIF displaying 18 | */ 19 | @interface SDWebImageGIFCoder : NSObject 20 | 21 | + (nonnull instancetype)sharedCoder; 22 | 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageImageIOCoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | #import "SDWebImageCoder.h" 11 | 12 | /** 13 | Built in coder that supports PNG, JPEG, TIFF, includes support for progressive decoding. 14 | 15 | GIF 16 | Also supports static GIF (meaning will only handle the 1st frame). 17 | For a full GIF support, we recommend `FLAnimatedImage` or our less performant `SDWebImageGIFCoder` 18 | 19 | HEIC 20 | This coder also supports HEIC format because ImageIO supports it natively. But it depends on the system capabilities, so it won't work on all devices. 21 | Hardware works if: (iOS 11 || macOS 10.13) && (isMac || isIPhoneAndA10FusionChipAbove) && (!Simulator) 22 | */ 23 | @interface SDWebImageImageIOCoder : NSObject 24 | 25 | + (nonnull instancetype)sharedCoder; 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/SDWebImageOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import 10 | 11 | @protocol SDWebImageOperation 12 | 13 | - (void)cancel; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | @interface UIImage (ForceDecode) 12 | 13 | + (nullable UIImage *)decodedImageWithImage:(nullable UIImage *)image; 14 | 15 | + (nullable UIImage *)decodedAndScaledDownImageWithImage:(nullable UIImage *)image; 16 | 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImage+ForceDecode.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImage+ForceDecode.h" 10 | #import "SDWebImageCodersManager.h" 11 | 12 | @implementation UIImage (ForceDecode) 13 | 14 | + (UIImage *)decodedImageWithImage:(UIImage *)image { 15 | if (!image) { 16 | return nil; 17 | } 18 | NSData *tempData; 19 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(NO)}]; 20 | } 21 | 22 | + (UIImage *)decodedAndScaledDownImageWithImage:(UIImage *)image { 23 | if (!image) { 24 | return nil; 25 | } 26 | NSData *tempData; 27 | return [[SDWebImageCodersManager sharedInstance] decompressedImageWithImage:image data:&tempData options:@{SDWebImageCoderScaleDownLargeImagesKey: @(YES)}]; 28 | } 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImage+GIF.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "SDWebImageCompat.h" 11 | 12 | @interface UIImage (GIF) 13 | 14 | /** 15 | * Creates an animated UIImage from an NSData. 16 | * For static GIF, will create an UIImage with `images` array set to nil. For animated GIF, will create an UIImage with valid `images` array. 17 | */ 18 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data; 19 | 20 | /** 21 | * Checks if an UIImage instance is a GIF. Will use the `images` array. 22 | */ 23 | - (BOOL)isGIF; 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImage+GIF.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * (c) Laurin Brandner 5 | * 6 | * For the full copyright and license information, please view the LICENSE 7 | * file that was distributed with this source code. 8 | */ 9 | 10 | #import "UIImage+GIF.h" 11 | #import "SDWebImageGIFCoder.h" 12 | #import "NSImage+WebCache.h" 13 | 14 | @implementation UIImage (GIF) 15 | 16 | + (UIImage *)sd_animatedGIFWithData:(NSData *)data { 17 | if (!data) { 18 | return nil; 19 | } 20 | return [[SDWebImageGIFCoder sharedCoder] decodedImageWithData:data]; 21 | } 22 | 23 | - (BOOL)isGIF { 24 | return (self.images != nil); 25 | } 26 | 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImage+MultiFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | #import "NSData+ImageContentType.h" 11 | 12 | @interface UIImage (MultiFormat) 13 | 14 | /** 15 | * UIKit: 16 | * For static image format, this value is always 0. 17 | * For animated image format, 0 means infinite looping. 18 | * Note that because of the limitations of categories this property can get out of sync if you create another instance with CGImage or other methods. 19 | * AppKit: 20 | * NSImage currently only support animated via GIF imageRep unlike UIImage. 21 | * The getter of this property will get the loop count from GIF imageRep 22 | * The setter of this property will set the loop count from GIF imageRep 23 | */ 24 | @property (nonatomic, assign) NSUInteger sd_imageLoopCount; 25 | 26 | + (nullable UIImage *)sd_imageWithData:(nullable NSData *)data; 27 | - (nullable NSData *)sd_imageData; 28 | - (nullable NSData *)sd_imageDataAsFormat:(SDImageFormat)imageFormat; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIImageView+HighlightedWebCache.m: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "UIImageView+HighlightedWebCache.h" 10 | 11 | #if SD_UIKIT 12 | 13 | #import "UIView+WebCacheOperation.h" 14 | #import "UIView+WebCache.h" 15 | 16 | @implementation UIImageView (HighlightedWebCache) 17 | 18 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url { 19 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:nil]; 20 | } 21 | 22 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options { 23 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:nil]; 24 | } 25 | 26 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url completed:(nullable SDExternalCompletionBlock)completedBlock { 27 | [self sd_setHighlightedImageWithURL:url options:0 progress:nil completed:completedBlock]; 28 | } 29 | 30 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url options:(SDWebImageOptions)options completed:(nullable SDExternalCompletionBlock)completedBlock { 31 | [self sd_setHighlightedImageWithURL:url options:options progress:nil completed:completedBlock]; 32 | } 33 | 34 | - (void)sd_setHighlightedImageWithURL:(nullable NSURL *)url 35 | options:(SDWebImageOptions)options 36 | progress:(nullable SDWebImageDownloaderProgressBlock)progressBlock 37 | completed:(nullable SDExternalCompletionBlock)completedBlock { 38 | __weak typeof(self)weakSelf = self; 39 | [self sd_internalSetImageWithURL:url 40 | placeholderImage:nil 41 | options:options 42 | operationKey:@"UIImageViewImageOperationHighlighted" 43 | setImageBlock:^(UIImage *image, NSData *imageData) { 44 | weakSelf.highlightedImage = image; 45 | } 46 | progress:progressBlock 47 | completed:completedBlock]; 48 | } 49 | 50 | @end 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /Example/Pods/SDWebImage/SDWebImage/UIView+WebCacheOperation.h: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the SDWebImage package. 3 | * (c) Olivier Poitrey 4 | * 5 | * For the full copyright and license information, please view the LICENSE 6 | * file that was distributed with this source code. 7 | */ 8 | 9 | #import "SDWebImageCompat.h" 10 | 11 | #if SD_UIKIT || SD_MAC 12 | 13 | #import "SDWebImageManager.h" 14 | 15 | @interface UIView (WebCacheOperation) 16 | 17 | /** 18 | * Set the image load operation (storage in a UIView based dictionary) 19 | * 20 | * @param operation the operation 21 | * @param key key for storing the operation 22 | */ 23 | - (void)sd_setImageLoadOperation:(nullable id)operation forKey:(nullable NSString *)key; 24 | 25 | /** 26 | * Cancel all operations for the current UIView and key 27 | * 28 | * @param key key for identifying the operations 29 | */ 30 | - (void)sd_cancelImageLoadOperationWithKey:(nullable NSString *)key; 31 | 32 | /** 33 | * Just remove the operations corresponding to the current UIView and key without cancelling them 34 | * 35 | * @param key key for identifying the operations 36 | */ 37 | - (void)sd_removeImageLoadOperationWithKey:(nullable NSString *)key; 38 | 39 | @end 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/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 | FMWK 17 | CFBundleShortVersionString 18 | 3.1.15 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/MJRefresh-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_MJRefresh : NSObject 3 | @end 4 | @implementation PodsDummy_MJRefresh 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/MJRefresh-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/MJRefresh-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "MJRefreshAutoFooter.h" 14 | #import "MJRefreshBackFooter.h" 15 | #import "MJRefreshComponent.h" 16 | #import "MJRefreshFooter.h" 17 | #import "MJRefreshHeader.h" 18 | #import "MJRefreshAutoGifFooter.h" 19 | #import "MJRefreshAutoNormalFooter.h" 20 | #import "MJRefreshAutoStateFooter.h" 21 | #import "MJRefreshBackGifFooter.h" 22 | #import "MJRefreshBackNormalFooter.h" 23 | #import "MJRefreshBackStateFooter.h" 24 | #import "MJRefreshGifHeader.h" 25 | #import "MJRefreshNormalHeader.h" 26 | #import "MJRefreshStateHeader.h" 27 | #import "MJRefresh.h" 28 | #import "MJRefreshConst.h" 29 | #import "NSBundle+MJRefresh.h" 30 | #import "UIScrollView+MJExtension.h" 31 | #import "UIScrollView+MJRefresh.h" 32 | #import "UIView+MJExtension.h" 33 | 34 | FOUNDATION_EXPORT double MJRefreshVersionNumber; 35 | FOUNDATION_EXPORT const unsigned char MJRefreshVersionString[]; 36 | 37 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/MJRefresh.modulemap: -------------------------------------------------------------------------------- 1 | framework module MJRefresh { 2 | umbrella header "MJRefresh-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/MJRefresh/MJRefresh.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/MJRefresh 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 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}/MJRefresh 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/Pods-TokenHybrid-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Pods_TokenHybrid : NSObject 3 | @end 4 | @implementation PodsDummy_Pods_TokenHybrid 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/Pods-TokenHybrid-umbrella.h: -------------------------------------------------------------------------------- 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 | 14 | FOUNDATION_EXPORT double Pods_TokenHybridVersionNumber; 15 | FOUNDATION_EXPORT const unsigned char Pods_TokenHybridVersionString[]; 16 | 17 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/Pods-TokenHybrid.debug.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/TokenNetworking" "$PODS_CONFIGURATION_BUILD_DIR/UITableView+FDTemplateLayoutCell" "$PODS_CONFIGURATION_BUILD_DIR/Yoga" "$PODS_CONFIGURATION_BUILD_DIR/YogaKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TokenNetworking/TokenNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/UITableView+FDTemplateLayoutCell/UITableView_FDTemplateLayoutCell.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Yoga/yoga.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/YogaKit/YogaKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "MJRefresh" -framework "SDWebImage" -framework "TokenNetworking" -framework "UITableView_FDTemplateLayoutCell" -framework "YogaKit" -framework "yoga" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/Pods-TokenHybrid.modulemap: -------------------------------------------------------------------------------- 1 | framework module Pods_TokenHybrid { 2 | umbrella header "Pods-TokenHybrid-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Pods-TokenHybrid/Pods-TokenHybrid.release.xcconfig: -------------------------------------------------------------------------------- 1 | EMBEDDED_CONTENT_CONTAINS_SWIFT = YES 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh" "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage" "$PODS_CONFIGURATION_BUILD_DIR/TokenNetworking" "$PODS_CONFIGURATION_BUILD_DIR/UITableView+FDTemplateLayoutCell" "$PODS_CONFIGURATION_BUILD_DIR/Yoga" "$PODS_CONFIGURATION_BUILD_DIR/YogaKit" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | LD_RUNPATH_SEARCH_PATHS = $(inherited) '@executable_path/Frameworks' '@loader_path/Frameworks' 5 | OTHER_CFLAGS = $(inherited) -iquote "$PODS_CONFIGURATION_BUILD_DIR/MJRefresh/MJRefresh.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/SDWebImage/SDWebImage.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/TokenNetworking/TokenNetworking.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/UITableView+FDTemplateLayoutCell/UITableView_FDTemplateLayoutCell.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/Yoga/yoga.framework/Headers" -iquote "$PODS_CONFIGURATION_BUILD_DIR/YogaKit/YogaKit.framework/Headers" 6 | OTHER_LDFLAGS = $(inherited) -framework "MJRefresh" -framework "SDWebImage" -framework "TokenNetworking" -framework "UITableView_FDTemplateLayoutCell" -framework "YogaKit" -framework "yoga" 7 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" 8 | PODS_BUILD_DIR = $BUILD_DIR 9 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 10 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/. 11 | PODS_ROOT = ${SRCROOT}/Pods 12 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/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 | FMWK 17 | CFBundleShortVersionString 18 | 4.2.2 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_SDWebImage : NSObject 3 | @end 4 | @implementation PodsDummy_SDWebImage 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-prefix.pch: -------------------------------------------------------------------------------- 1 | #ifdef __OBJC__ 2 | #import 3 | #else 4 | #ifndef FOUNDATION_EXPORT 5 | #if defined(__cplusplus) 6 | #define FOUNDATION_EXPORT extern "C" 7 | #else 8 | #define FOUNDATION_EXPORT extern 9 | #endif 10 | #endif 11 | #endif 12 | 13 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "NSData+ImageContentType.h" 14 | #import "NSImage+WebCache.h" 15 | #import "SDImageCache.h" 16 | #import "SDImageCacheConfig.h" 17 | #import "SDWebImageCoder.h" 18 | #import "SDWebImageCoderHelper.h" 19 | #import "SDWebImageCodersManager.h" 20 | #import "SDWebImageCompat.h" 21 | #import "SDWebImageDownloader.h" 22 | #import "SDWebImageDownloaderOperation.h" 23 | #import "SDWebImageFrame.h" 24 | #import "SDWebImageGIFCoder.h" 25 | #import "SDWebImageImageIOCoder.h" 26 | #import "SDWebImageManager.h" 27 | #import "SDWebImageOperation.h" 28 | #import "SDWebImagePrefetcher.h" 29 | #import "UIButton+WebCache.h" 30 | #import "UIImage+ForceDecode.h" 31 | #import "UIImage+GIF.h" 32 | #import "UIImage+MultiFormat.h" 33 | #import "UIImageView+HighlightedWebCache.h" 34 | #import "UIImageView+WebCache.h" 35 | #import "UIView+WebCache.h" 36 | #import "UIView+WebCacheOperation.h" 37 | 38 | FOUNDATION_EXPORT double SDWebImageVersionNumber; 39 | FOUNDATION_EXPORT const unsigned char SDWebImageVersionString[]; 40 | 41 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage.modulemap: -------------------------------------------------------------------------------- 1 | framework module SDWebImage { 2 | umbrella header "SDWebImage-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/SDWebImage/SDWebImage.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/SDWebImage 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 4 | OTHER_LDFLAGS = -framework "ImageIO" 5 | PODS_BUILD_DIR = $BUILD_DIR 6 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 7 | PODS_ROOT = ${SRCROOT} 8 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/SDWebImage 9 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 10 | SKIP_INSTALL = YES 11 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.0.1 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/TokenNetworking-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_TokenNetworking : NSObject 3 | @end 4 | @implementation PodsDummy_TokenNetworking 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/TokenNetworking-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/TokenNetworking-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "TokenNetworking.h" 14 | #import "TokenNetworkingCategories.h" 15 | 16 | FOUNDATION_EXPORT double TokenNetworkingVersionNumber; 17 | FOUNDATION_EXPORT const unsigned char TokenNetworkingVersionString[]; 18 | 19 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/TokenNetworking.modulemap: -------------------------------------------------------------------------------- 1 | framework module TokenNetworking { 2 | umbrella header "TokenNetworking-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/TokenNetworking/TokenNetworking.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/TokenNetworking 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 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}/TokenNetworking 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_UITableView_FDTemplateLayoutCell : NSObject 3 | @end 4 | @implementation PodsDummy_UITableView_FDTemplateLayoutCell 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "UITableView+FDIndexPathHeightCache.h" 14 | #import "UITableView+FDKeyedHeightCache.h" 15 | #import "UITableView+FDTemplateLayoutCell.h" 16 | #import "UITableView+FDTemplateLayoutCellDebug.h" 17 | 18 | FOUNDATION_EXPORT double UITableView_FDTemplateLayoutCellVersionNumber; 19 | FOUNDATION_EXPORT const unsigned char UITableView_FDTemplateLayoutCellVersionString[]; 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell.modulemap: -------------------------------------------------------------------------------- 1 | framework module UITableView_FDTemplateLayoutCell { 2 | umbrella header "UITableView+FDTemplateLayoutCell-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/UITableView+FDTemplateLayoutCell/UITableView+FDTemplateLayoutCell.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/UITableView+FDTemplateLayoutCell 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 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}/UITableView+FDTemplateLayoutCell 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/Yoga-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_Yoga : NSObject 3 | @end 4 | @implementation PodsDummy_Yoga 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/Yoga-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/Yoga-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "YGEnums.h" 14 | #import "YGMacros.h" 15 | #import "YGNodeList.h" 16 | #import "Yoga.h" 17 | 18 | FOUNDATION_EXPORT double yogaVersionNumber; 19 | FOUNDATION_EXPORT const unsigned char yogaVersionString[]; 20 | 21 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/Yoga.modulemap: -------------------------------------------------------------------------------- 1 | framework module yoga { 2 | umbrella header "Yoga-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/Yoga/Yoga.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/Yoga 2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 3 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 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}/Yoga 8 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 9 | SKIP_INSTALL = YES 10 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/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 | FMWK 17 | CFBundleShortVersionString 18 | 1.6.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | ${CURRENT_PROJECT_VERSION} 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/YogaKit-dummy.m: -------------------------------------------------------------------------------- 1 | #import 2 | @interface PodsDummy_YogaKit : NSObject 3 | @end 4 | @implementation PodsDummy_YogaKit 5 | @end 6 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/YogaKit-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 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/YogaKit-umbrella.h: -------------------------------------------------------------------------------- 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 | #import "UIView+Yoga.h" 14 | #import "YGLayout.h" 15 | 16 | FOUNDATION_EXPORT double YogaKitVersionNumber; 17 | FOUNDATION_EXPORT const unsigned char YogaKitVersionString[]; 18 | 19 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/YogaKit.modulemap: -------------------------------------------------------------------------------- 1 | framework module YogaKit { 2 | umbrella header "YogaKit-umbrella.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Example/Pods/Target Support Files/YogaKit/YogaKit.xcconfig: -------------------------------------------------------------------------------- 1 | CONFIGURATION_BUILD_DIR = $PODS_CONFIGURATION_BUILD_DIR/YogaKit 2 | FRAMEWORK_SEARCH_PATHS = $(inherited) "$PODS_CONFIGURATION_BUILD_DIR/Yoga" 3 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 4 | HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers/Private" "${PODS_ROOT}/Headers/Public" 5 | OTHER_LDFLAGS = -framework "UIKit" 6 | OTHER_SWIFT_FLAGS = $(inherited) "-D" "COCOAPODS" "-suppress-warnings" 7 | PODS_BUILD_DIR = $BUILD_DIR 8 | PODS_CONFIGURATION_BUILD_DIR = $PODS_BUILD_DIR/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME) 9 | PODS_ROOT = ${SRCROOT} 10 | PODS_TARGET_SRCROOT = ${PODS_ROOT}/YogaKit 11 | PRODUCT_BUNDLE_IDENTIFIER = org.cocoapods.${PRODUCT_NAME:rfc1034identifier} 12 | SKIP_INSTALL = YES 13 | -------------------------------------------------------------------------------- /Example/Pods/TokenNetworking/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 XiongChen 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 | -------------------------------------------------------------------------------- /Example/Pods/UITableView+FDTemplateLayoutCell/Classes/UITableView+FDKeyedHeightCache.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog ) 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 | 23 | #import 24 | 25 | @interface FDKeyedHeightCache : NSObject 26 | 27 | - (BOOL)existsHeightForKey:(id)key; 28 | - (void)cacheHeight:(CGFloat)height byKey:(id)key; 29 | - (CGFloat)heightForKey:(id)key; 30 | 31 | // Invalidation 32 | - (void)invalidateHeightForKey:(id)key; 33 | - (void)invalidateAllHeightCache; 34 | @end 35 | 36 | @interface UITableView (FDKeyedHeightCache) 37 | 38 | /// Height cache by key. Generally, you don't need to use it directly. 39 | @property (nonatomic, strong, readonly) FDKeyedHeightCache *fd_keyedHeightCache; 40 | @end 41 | -------------------------------------------------------------------------------- /Example/Pods/UITableView+FDTemplateLayoutCell/Classes/UITableView+FDTemplateLayoutCellDebug.h: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog ) 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 | 23 | #import 24 | 25 | @interface UITableView (FDTemplateLayoutCellDebug) 26 | 27 | /// Helps to debug or inspect what is this "FDTemplateLayoutCell" extention doing, 28 | /// turning on to print logs when "creating", "calculating", "precaching" or "hitting cache". 29 | /// 30 | /// Default to NO, log by NSLog. 31 | /// 32 | @property (nonatomic, assign) BOOL fd_debugLogEnabled; 33 | 34 | /// Debug log controlled by "fd_debugLogEnabled". 35 | - (void)fd_debugLog:(NSString *)message; 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /Example/Pods/UITableView+FDTemplateLayoutCell/Classes/UITableView+FDTemplateLayoutCellDebug.m: -------------------------------------------------------------------------------- 1 | // The MIT License (MIT) 2 | // 3 | // Copyright (c) 2015-2016 forkingdog ( https://github.com/forkingdog ) 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 | 23 | #import "UITableView+FDTemplateLayoutCellDebug.h" 24 | #import 25 | 26 | @implementation UITableView (FDTemplateLayoutCellDebug) 27 | 28 | - (BOOL)fd_debugLogEnabled { 29 | return [objc_getAssociatedObject(self, _cmd) boolValue]; 30 | } 31 | 32 | - (void)setFd_debugLogEnabled:(BOOL)debugLogEnabled { 33 | objc_setAssociatedObject(self, @selector(fd_debugLogEnabled), @(debugLogEnabled), OBJC_ASSOCIATION_RETAIN); 34 | } 35 | 36 | - (void)fd_debugLog:(NSString *)message { 37 | if (self.fd_debugLogEnabled) { 38 | NSLog(@"** FDTemplateLayoutCell ** %@", message); 39 | } 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /Example/Pods/UITableView+FDTemplateLayoutCell/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 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 | 23 | -------------------------------------------------------------------------------- /Example/Pods/Yoga/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For yoga software 4 | 5 | Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /Example/Pods/Yoga/LICENSE-examples: -------------------------------------------------------------------------------- 1 | The examples provided by Facebook are for non-commercial testing and evaluation 2 | purposes only. Facebook reserves all rights not expressly granted. 3 | 4 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 6 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 7 | FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 8 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 9 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Example/Pods/Yoga/yoga/YGMacros.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #pragma once 11 | 12 | #ifdef __cplusplus 13 | #define YG_EXTERN_C_BEGIN extern "C" { 14 | #define YG_EXTERN_C_END } 15 | #else 16 | #define YG_EXTERN_C_BEGIN 17 | #define YG_EXTERN_C_END 18 | #endif 19 | 20 | #ifdef _WINDLL 21 | #define WIN_EXPORT __declspec(dllexport) 22 | #else 23 | #define WIN_EXPORT 24 | #endif 25 | 26 | #ifdef WINARMDLL 27 | #define WIN_STRUCT(type) type * 28 | #define WIN_STRUCT_REF(value) &value 29 | #else 30 | #define WIN_STRUCT(type) type 31 | #define WIN_STRUCT_REF(value) value 32 | #endif 33 | 34 | #ifndef FB_ASSERTIONS_ENABLED 35 | #define FB_ASSERTIONS_ENABLED 1 36 | #endif 37 | 38 | #ifdef NS_ENUM 39 | // Cannot use NSInteger as NSInteger has a different size than int (which is the default type of a 40 | // enum). 41 | // Therefor when linking the Yoga C library into obj-c the header is a missmatch for the Yoga ABI. 42 | #define YG_ENUM_BEGIN(name) NS_ENUM(int, name) 43 | #define YG_ENUM_END(name) 44 | #else 45 | #define YG_ENUM_BEGIN(name) enum name 46 | #define YG_ENUM_END(name) name 47 | #endif 48 | -------------------------------------------------------------------------------- /Example/Pods/Yoga/yoga/YGNodeList.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #pragma once 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | #include "YGMacros.h" 18 | #include "Yoga.h" 19 | 20 | YG_EXTERN_C_BEGIN 21 | 22 | typedef struct YGNodeList *YGNodeListRef; 23 | 24 | YGNodeListRef YGNodeListNew(const uint32_t initialCapacity); 25 | void YGNodeListFree(const YGNodeListRef list); 26 | uint32_t YGNodeListCount(const YGNodeListRef list); 27 | void YGNodeListAdd(YGNodeListRef *listp, const YGNodeRef node); 28 | void YGNodeListInsert(YGNodeListRef *listp, const YGNodeRef node, const uint32_t index); 29 | YGNodeRef YGNodeListRemove(const YGNodeListRef list, const uint32_t index); 30 | YGNodeRef YGNodeListDelete(const YGNodeListRef list, const YGNodeRef node); 31 | YGNodeRef YGNodeListGet(const YGNodeListRef list, const uint32_t index); 32 | 33 | YG_EXTERN_C_END 34 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/LICENSE: -------------------------------------------------------------------------------- 1 | BSD License 2 | 3 | For yoga software 4 | 5 | Copyright (c) 2014-present, Facebook, Inc. All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without modification, 8 | are permitted provided that the following conditions are met: 9 | 10 | * Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | * Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | * Neither the name Facebook nor the names of its contributors may be used to 18 | endorse or promote products derived from this software without specific 19 | prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR 25 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 28 | ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/LICENSE-examples: -------------------------------------------------------------------------------- 1 | The examples provided by Facebook are for non-commercial testing and evaluation 2 | purposes only. Facebook reserves all rights not expressly granted. 3 | 4 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 5 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 6 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 7 | FACEBOOK BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN 8 | ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 9 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 10 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/YogaKit/Source/UIView+Yoga.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "YGLayout.h" 11 | #import 12 | 13 | NS_ASSUME_NONNULL_BEGIN 14 | 15 | typedef void (^YGLayoutConfigurationBlock)(YGLayout *); 16 | 17 | @interface UIView (Yoga) 18 | 19 | /** 20 | The YGLayout that is attached to this view. It is lazily created. 21 | */ 22 | @property (nonatomic, readonly, strong) YGLayout *yoga; 23 | 24 | /** 25 | In ObjC land, every time you access `view.yoga.*` you are adding another `objc_msgSend` 26 | to your code. If you plan on making multiple changes to YGLayout, it's more performant 27 | to use this method, which uses a single objc_msgSend call. 28 | */ 29 | - (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block 30 | NS_SWIFT_NAME(configureLayout(block:)); 31 | 32 | @end 33 | 34 | NS_ASSUME_NONNULL_END 35 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/YogaKit/Source/UIView+Yoga.m: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "UIView+Yoga.h" 11 | #import "YGLayout+Private.h" 12 | #import 13 | 14 | static const void *kYGYogaAssociatedKey = &kYGYogaAssociatedKey; 15 | 16 | @implementation UIView (YogaKit) 17 | 18 | - (YGLayout *)yoga 19 | { 20 | YGLayout *yoga = objc_getAssociatedObject(self, kYGYogaAssociatedKey); 21 | if (!yoga) { 22 | yoga = [[YGLayout alloc] initWithView:self]; 23 | objc_setAssociatedObject(self, kYGYogaAssociatedKey, yoga, OBJC_ASSOCIATION_RETAIN_NONATOMIC); 24 | } 25 | 26 | return yoga; 27 | } 28 | 29 | - (void)configureLayoutWithBlock:(YGLayoutConfigurationBlock)block 30 | { 31 | if (block != nil) { 32 | block(self.yoga); 33 | } 34 | } 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/YogaKit/Source/YGLayout+Private.h: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | #import "YGLayout.h" 11 | #import 12 | 13 | @interface YGLayout () 14 | 15 | @property (nonatomic, assign, readonly) YGNodeRef node; 16 | 17 | - (instancetype)initWithView:(UIView *)view; 18 | 19 | @end 20 | -------------------------------------------------------------------------------- /Example/Pods/YogaKit/YogaKit/Source/YGLayoutExtensions.swift: -------------------------------------------------------------------------------- 1 | /** 2 | * Copyright (c) 2014-present, Facebook, Inc. 3 | * All rights reserved. 4 | * 5 | * This source code is licensed under the BSD-style license found in the 6 | * LICENSE file in the root directory of this source tree. An additional grant 7 | * of patent rights can be found in the PATENTS file in the same directory. 8 | */ 9 | 10 | postfix operator % 11 | 12 | extension Int { 13 | public static postfix func %(value: Int) -> YGValue { 14 | return YGValue(value: Float(value), unit: .percent) 15 | } 16 | } 17 | 18 | extension Float { 19 | public static postfix func %(value: Float) -> YGValue { 20 | return YGValue(value: value, unit: .percent) 21 | } 22 | } 23 | 24 | extension CGFloat { 25 | public static postfix func %(value: CGFloat) -> YGValue { 26 | return YGValue(value: Float(value), unit: .percent) 27 | } 28 | } 29 | 30 | extension YGValue : ExpressibleByIntegerLiteral, ExpressibleByFloatLiteral { 31 | public init(integerLiteral value: Int) { 32 | self = YGValue(value: Float(value), unit: .point) 33 | } 34 | 35 | public init(floatLiteral value: Float) { 36 | self = YGValue(value: value, unit: .point) 37 | } 38 | 39 | public init(_ value: Float) { 40 | self = YGValue(value: value, unit: .point) 41 | } 42 | 43 | public init(_ value: CGFloat) { 44 | self = YGValue(value: Float(value), unit: .point) 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Example/Source/JavaScriptSupport/TokenHybridDefine.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridDefine.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #ifdef DEBUG // 调试状态, 打开LOG功能 10 | #define HybridLog(...) NSLog(__VA_ARGS__) 11 | #else // 发布状态, 关闭LOG功能 12 | #define HybridLog(...) 13 | #endif 14 | 15 | #ifndef dispatch_queue_async_safe 16 | #define dispatch_queue_async_safe(queue, block)\ 17 | if (strcmp(dispatch_queue_get_label(DISPATCH_CURRENT_QUEUE_LABEL), dispatch_queue_get_label(queue)) == 0) {\ 18 | block();\ 19 | } else {\ 20 | dispatch_async(queue, block);\ 21 | } 22 | #endif 23 | 24 | #ifndef dispatch_main_async_safe 25 | #define dispatch_main_async_safe(block) dispatch_queue_async_safe(dispatch_get_main_queue(), block) 26 | #endif 27 | 28 | -------------------------------------------------------------------------------- /Example/Source/JavaScriptSupport/TokenJSContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenJSContext.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/24. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenEvent,TokenJSContext,TokenAssociateContext; 12 | @import UIKit; 13 | @protocol TokenJSContextDelegate 14 | @optional 15 | -(void)context:(TokenJSContext *)context didReceiveLogInfo:(NSString *)info; 16 | -(void)context:(TokenJSContext *)context setPriviousExtension:(NSDictionary *)extension; 17 | -(TokenAssociateContext *)contextGetAssociateContext; 18 | @end 19 | 20 | @interface TokenJSContext : JSContext 21 | @property(nonatomic ,weak) id delegate; 22 | -(UIViewController *)getContainerController; 23 | -(NSUserDefaults *)getCurrentPageUserDefaults; 24 | -(Class)getViewPushedControllerClass; 25 | -(void)keepEventValueAlive:(JSValue *)value; 26 | -(void)pageShow; 27 | -(void)pageClose; 28 | -(void)pageRefresh; 29 | @end 30 | -------------------------------------------------------------------------------- /Example/Source/JavaScriptSupport/TokenTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // Token.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/18. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import JavaScriptCore; 12 | @import UIKit; 13 | @class TokenJSContext; 14 | @protocol TokenAPIExport 15 | @optional 16 | //storage 17 | JSExportAs(request, -(void)requestWithValue:(JSValue *)requestValue); 18 | JSExportAs(getLocation, -(void)getLocation:(JSValue *)callBack); 19 | -(id)getStorage:(JSValue *)key; 20 | -(void)setStorage:(JSValue *)dicValue; 21 | -(void)clearAllStorage; 22 | -(void)setGlobleStorage:(JSValue *)dicValue; 23 | -(id)getGlobleStorage:(JSValue *)key; 24 | -(void)clearGlobleStorage; 25 | -(void)makePhoneCall:(NSString *)number; 26 | // 27 | JSExportAs(log, -(void)log:(NSString *)msg); 28 | //imageValue {"url","success","failure"} 29 | JSExportAs(saveImage, -(void)saveImageWithJSValue:(JSValue *)imageValue); 30 | JSExportAs(alert, -(void)alertWithTitle:(NSString *)title msg:(NSString *)msg); 31 | JSExportAs(alertTitles, -(void)alertWithWithJSValue:(JSValue *)alertValue); 32 | JSExportAs(alertInput, -(void)alertInput:(JSValue *)alertValue); 33 | JSExportAs(showSheetView, -(void)showSheetViewWithJSValue:(JSValue *)sheetValue); 34 | JSExportAs(pickData, -(void)pickData:(JSValue *)pickValue); 35 | //(code ,desc) 36 | JSExportAs(requestTouchID, -(void)requestTouchIDWithTitle:(JSValue *)title callBack:(JSValue *)callBack); 37 | JSExportAs(setMainTimeOut, -(void)setMainTimeOutWithCallBack:(JSValue *)callBack interval:(JSValue *)interval); 38 | JSExportAs(setTimeOut, -(void)setTimeOutWithCallBack:(JSValue *)callBack interval:(JSValue *)interval); 39 | -(NSNumber *)screenWidth; 40 | -(NSNumber *)screenHeight; 41 | @end 42 | 43 | @interface TokenTool : NSObject 44 | @property(nonatomic ,strong) NSUserDefaults *globleDefaultes; 45 | @property(nonatomic ,weak ) TokenJSContext *jsContext; 46 | @end 47 | -------------------------------------------------------------------------------- /Example/Source/TokenExtension/NSUserDefaults+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+Token.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/25. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NSUserDefaults *(^TokenUserDefaultsInitBlock)(NSString *suiteName); 12 | typedef NSUserDefaults *(^TokenUserDefaultsRemoveBlock)(NSString *domainName); 13 | typedef NSUserDefaults *(^TokenUserDefaultsSetObjectBlock)(NSString *key,id object); 14 | typedef NSUserDefaults *(^TokenUserDefaultsSetLimitTimeTypeObjectBlock)(NSString *key,id object,NSTimeInterval limitTime); 15 | typedef id (^TokenUserDefaultsGetObjectBlock)(NSString *key); 16 | typedef id (^TokenUserDefaultsGetTimeLimitTypeObjectBlock)(NSString *key); 17 | 18 | @interface NSUserDefaults (Token) 19 | @property(nonatomic ,copy,class,readonly) TokenUserDefaultsInitBlock token_initWithSuiteName; 20 | @property(nonatomic ,copy,readonly) TokenUserDefaultsSetObjectBlock token_setObjectForKey; 21 | @property(nonatomic ,copy,readonly) TokenUserDefaultsRemoveBlock token_removePersistentDomainForName; 22 | @property(nonatomic ,copy,readonly) TokenUserDefaultsGetObjectBlock token_objectForKey; 23 | @property(nonatomic ,copy,readonly) TokenUserDefaultsSetLimitTimeTypeObjectBlock token_setTimeLimitTypeObjectForKey; 24 | @property(nonatomic ,copy,readonly) TokenUserDefaultsGetObjectBlock token_timeLimitTypeObjectForKey; 25 | @end 26 | -------------------------------------------------------------------------------- /Example/Source/TokenExtension/TokenExtensionHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenExtensionHeader.h 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #ifndef TokenExtensionHeader_h 10 | #define TokenExtensionHeader_h 11 | 12 | #import "UIView+Token.h" 13 | #import "UIColor+Token.h" 14 | #import "NSString+Token.h" 15 | 16 | #import "NSUserDefaults+Token.h" 17 | #import "UIColor+SSRender.h" 18 | #endif /* TokenExtensionHeader_h */ 19 | -------------------------------------------------------------------------------- /Example/Source/TokenExtension/UIColor+SSRender.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+FSAdd.h 3 | // JSONRenderKit 4 | // 5 | // Created by 陈雄 on 16/7/1. 6 | // Copyright © 2016年 com.feelings. All rights reserved. 7 | 8 | #import 9 | 10 | @interface UIColor (SSRender) 11 | +(instancetype)ss_colorWithHexString:(NSString *)hexStr; 12 | +(instancetype)ss_colorWithRGBString:(NSString *)rgbString; 13 | +(instancetype)ss_colorWithString:(NSString *)string; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Source/TokenExtension/UIColor+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Token.h 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef UIColor *(^TokenRandomColorBlock)(void); 12 | typedef UIColor *(^TokenStringColorBlock)(void); 13 | typedef UIColor *(^TokenColorCGFloat3Block)(CGFloat value1 ,CGFloat value2 ,CGFloat value3); 14 | typedef UIColor *(^TokenColorCGFloat4Block)(CGFloat value1 ,CGFloat value2 ,CGFloat value3 ,CGFloat value4); 15 | 16 | @interface UIColor (Token) 17 | @property(nonatomic ,copy ,readonly ,class) TokenColorCGFloat4Block token_RGBA; 18 | @property(nonatomic ,copy ,readonly ,class) TokenColorCGFloat3Block token_RGB; 19 | @property(nonatomic ,copy ,readonly ,class) TokenRandomColorBlock token_randomColor; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Source/TokenExtension/UIColor+Token.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Token.m 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Token.h" 10 | 11 | @implementation UIColor (Token) 12 | +(TokenColorCGFloat3Block)token_RGB{ 13 | return ^UIColor *(CGFloat value1, CGFloat value2, CGFloat value3) { 14 | return [UIColor colorWithRed:value1/255 green:value2/255 blue:value3/255 alpha:1]; 15 | }; 16 | } 17 | 18 | +(TokenColorCGFloat4Block)token_RGBA{ 19 | return ^UIColor *(CGFloat value1, CGFloat value2, CGFloat value3 ,CGFloat value4) { 20 | return [UIColor colorWithRed:value1/255 green:value2/255 blue:value3/255 alpha:value4]; 21 | }; 22 | } 23 | 24 | +(TokenRandomColorBlock)token_randomColor{ 25 | return ^UIColor *(void) { 26 | return [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:1.0]; 27 | }; 28 | } 29 | @end 30 | -------------------------------------------------------------------------------- /Example/Source/category/JSValue+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSValue+Token.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/3. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JSValue (Token) 12 | -(BOOL)token_isNilObject; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/category/JSValue+Token.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSValue+Token.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/3. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "JSValue+Token.h" 10 | 11 | @implementation JSValue (Token) 12 | - (BOOL)token_isNilObject { 13 | return self.isNull || self.isUndefined; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /Example/Source/category/NSDictionary+chainScript.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+chainScript.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary (chainScript) 12 | -(id)token_chainScript:(NSString *)chainScript 13 | itemKey:(NSString *)itemKey 14 | idxKey:(NSString *)idxKey 15 | forLoopIndex:(NSInteger)loopIndex; 16 | 17 | -(id)token_chainScript:(NSString *)chainScript 18 | itemKey:(NSString *)itemKey 19 | idxKey:(NSString *)idxKey 20 | sectionKey:(NSString *)sectionKey 21 | indexPath:(NSIndexPath *)indexPath; 22 | @end 23 | -------------------------------------------------------------------------------- /Example/Source/category/NSString+TokenHybrid.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TokenHybrid.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (TokenHybrid) 12 | +(NSString *)token_completeRelativeURLString:(NSString *)relativeString 13 | withAbsoluteURLString:(NSString *)absoluteString; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Source/category/NSString+TokenHybrid.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TokenHybrid.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "NSString+TokenHybrid.h" 10 | 11 | @implementation NSString (TokenHybrid) 12 | +(NSString *)token_completeRelativeURLString:(NSString *)relativeString 13 | withAbsoluteURLString:(NSString *)absoluteString 14 | { 15 | if ([relativeString hasPrefix:@"http"]) { return relativeString;} 16 | NSURL *absoluteURL = [NSURL URLWithString:absoluteString]; 17 | if (absoluteURL.scheme == nil) { return relativeString;} 18 | 19 | NSInteger backtrackingCount = 0; 20 | NSString *tempString = relativeString; 21 | NSMutableArray *pathComponents = [NSMutableArray arrayWithArray:absoluteString.pathComponents]; 22 | while ([tempString containsString:@"../"]) { 23 | backtrackingCount += 1; 24 | NSRange replaceRange = [tempString rangeOfString:@".." options:(NSBackwardsSearch)]; 25 | NSInteger addPathIndex = (pathComponents.count - 1) - (backtrackingCount + 1); 26 | if (pathComponents.count - 1 > addPathIndex) { 27 | tempString = [tempString stringByReplacingCharactersInRange:replaceRange withString:pathComponents[addPathIndex]]; 28 | } 29 | } 30 | 31 | NSInteger location = pathComponents.count-tempString.pathComponents.count; 32 | NSMutableString *finalURLString = [NSMutableString stringWithString:absoluteURL.scheme]; 33 | if (location >= 0 && tempString.pathComponents.count <= pathComponents.count) { 34 | [pathComponents replaceObjectsInRange:NSMakeRange(pathComponents.count-tempString.pathComponents.count, tempString.pathComponents.count) withObjectsFromArray:tempString.pathComponents]; 35 | [pathComponents removeObjectAtIndex:0]; 36 | 37 | NSString *finalPathString = [NSString pathWithComponents:pathComponents]; 38 | [finalURLString appendString:@"://"]; 39 | if (absoluteURL.port) { 40 | [finalURLString appendFormat:@":%@",absoluteURL.port]; 41 | } 42 | [finalURLString appendString:finalPathString]; 43 | return finalURLString; 44 | } 45 | return finalURLString; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /Example/Source/category/TokenComponent+pullRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenComponent+TokenHybrid.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/28. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenTableComponent.h" 10 | #import "TokenScrollComponent.h" 11 | #import "TokenWebViewComponent.h" 12 | 13 | @protocol TokenPullRefreshProtocol 14 | @optional 15 | -(void)openHeaderRefresh; 16 | -(void)stopHeaderRefresh; 17 | -(void)hiddenHeaderRefresh; 18 | -(void)openFooterRefresh; 19 | -(void)stopFooterRefresh; 20 | -(void)hiddenFooterRefresh; 21 | @end 22 | 23 | @interface TokenTableComponent (TokenHybrid) 24 | 25 | @end 26 | 27 | @interface TokenScrollComponent (TokenHybrid) 28 | 29 | @end 30 | 31 | @interface TokenWebViewComponent (TokenHybrid) 32 | 33 | @end 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Example/Source/category/UIView+Attributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Attributes.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode; 12 | typedef void(^UIViewEnumerateBlock)(__kindof UIView *view,BOOL *stop); 13 | @interface UIView (Attributes) 14 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes; 15 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary; 16 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes 17 | shouldLayout:(BOOL)shouldLayout; 18 | +(void)token_enumerateViewFromRootToChildWithRootView:(UIView *)rootView 19 | block:(UIViewEnumerateBlock)block; 20 | +(__kindof UIView *)token_produceViewWithNode:(TokenXMLNode *)node; 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Source/category/UIView+TokenFlexLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TokenFlexLayout.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (TokenFlexLayout) 12 | -(void)token_layoutWithAttributes:(NSDictionary *)attributes; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TableView/TokenDataItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenDataItem.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TokenDataItem : NSObject 12 | @property(nonatomic ,copy) NSString *identify; 13 | @property(nonatomic ,strong) NSDictionary *dataObj; 14 | @property(nonatomic ,strong) NSDictionary *customForLoop; 15 | +(instancetype)itemWithDataObj:(NSDictionary *)obj 16 | customForLoop:(NSDictionary *)customForLoop; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Source/component/TableView/TokenDataItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenDataItem.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenDataItem.h" 10 | 11 | @implementation TokenDataItem 12 | +(instancetype)itemWithDataObj:(NSDictionary *)obj 13 | customForLoop:(NSDictionary *)customForLoop{ 14 | TokenDataItem *item = [[TokenDataItem alloc] init]; 15 | item.dataObj = obj; 16 | item.customForLoop = customForLoop; 17 | return item; 18 | } 19 | 20 | - (NSString *)description 21 | { 22 | return [NSString stringWithFormat:@"TokenDataItem - [\n%@\n%@\n%@]", self.dataObj,self.customForLoop,self.identify]; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Source/component/TableView/TokenTableCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableCell.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenDataItem; 12 | @interface TokenTableCell : UITableViewCell 13 | @property(nonatomic ,strong) NSIndexPath *indexPath; 14 | @property(nonatomic ,strong) TokenDataItem *dataItem; 15 | +(NSString *)reuseIdentifier; 16 | -(void)configHierarchyWithNode:(TokenXMLNode *)node; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Source/component/TableView/TokenTableComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenTableNode; 12 | @interface TokenTableComponent : UIView 13 | @property(nonatomic ,strong) TokenTableNode *associatedNode; 14 | @property(nonatomic ,strong) UITableView *tableView; 15 | -(instancetype)initWithConfigNode:(TokenXMLNode *)configNode; 16 | -(void)reloadData:(NSArray *)dataArray; 17 | -(void)scrollToTop:(BOOL)animate; 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Source/component/TableView/TokenTableSectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableSectionView.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenPureNode,TokenDataItem; 12 | @interface TokenTableSectionView : UITableViewHeaderFooterView 13 | @property(nonatomic ,assign) NSInteger section; 14 | @property(nonatomic ,strong) TokenDataItem *dataItem; 15 | @property(nonatomic ,weak ) TokenPureNode *associatedNode; 16 | +(NSString *)reuseIdentifier; 17 | -(void)configHierarchyWithNode:(TokenXMLNode *)node; 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Source/component/TokenButtonComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenButtonComponent.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/24. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenButtonNode; 11 | @interface TokenButtonComponent : UIButton 12 | @property(nonatomic ,weak ) TokenButtonNode *associatedNode; 13 | @property(nonatomic ,strong) NSString *componentID; 14 | @property(nonatomic ,strong) NSIndexPath *indexPath; 15 | @property(nonatomic ,strong) UIColor *selectedBackgroundColor; 16 | +(instancetype)buttonWithTypeString:(NSString *)type 17 | title:(NSString *)title; 18 | @end 19 | -------------------------------------------------------------------------------- /Example/Source/component/TokenHybridRenderController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSSRenderController.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TokenViewBuilder.h" 11 | #import "TokenJSContext.h" 12 | 13 | @interface TokenHybridRenderController : UIViewController 14 | @property(nonatomic ,assign) BOOL hiddenTitle; 15 | @property(nonatomic ,assign) BOOL allowDebug; 16 | @property(nonatomic, copy ) NSString *htmlURL; 17 | @property(nonatomic, copy ) NSString *htmlPath; 18 | @property(nonatomic ,strong) NSDictionary *extension; 19 | @property(nonatomic ,strong) TokenViewBuilder *viewBuilder; 20 | @property(nonatomic ,weak ) TokenHybridRenderController *previousController; 21 | 22 | -(instancetype)initWithHTMLURL:(NSString *)htmlURL; 23 | @end 24 | -------------------------------------------------------------------------------- /Example/Source/component/TokenHybridRenderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridRenderView.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/12. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPureComponent.h" 10 | #import "TokenViewBuilder.h" 11 | #import "TokenJSContext.h" 12 | 13 | @interface TokenHybridRenderView : TokenPureComponent 14 | @property(nonatomic ,weak) UIViewController *associatedController; 15 | @property(nonatomic, copy) NSString *sourceURL; 16 | 17 | /** 18 | 根据URL构建原生视图 19 | 20 | @param url 远程URL 21 | @param controller 当前view所在的视图 22 | @param childClass 推送到下一个试图控制器,必须是TokenHybridRenderController的子类 23 | */ 24 | -(void)buildViewWithSourceURL:(NSString *)url 25 | containerViewController:(UIViewController *)controller 26 | childRenderControlllerClass:(__unsafe_unretained Class)childClass; 27 | @end 28 | -------------------------------------------------------------------------------- /Example/Source/component/TokenImageComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenImageView.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenLabelNode; 12 | @interface TokenImageComponent : UIImageView 13 | @property(nonatomic ,strong) NSString *componentID; 14 | @property(nonatomic ,strong) NSIndexPath *indexPath; 15 | @property(nonatomic ,weak ) TokenLabelNode *associatedNode; 16 | -(void)addTapGestureRecognizer; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Source/component/TokenInputComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenInputComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/17. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenInputNode; 12 | @interface TokenInputComponent : UITextField 13 | @property(nonatomic ,weak ) TokenInputNode *associatedNode; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Source/component/TokenLabelComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenLabelComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenLabelNode; 11 | @interface TokenLabelComponent : UILabel 12 | @property(nonatomic ,strong) NSString *componentID; 13 | @property(nonatomic ,strong) NSIndexPath *indexPath; 14 | @property(nonatomic ,weak ) TokenLabelNode *associatedNode; 15 | -(void)addTapGestureRecognizer; 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Source/component/TokenPageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPageControl.h 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/11/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenDotsNode; 11 | @interface TokenPageControl : UIPageControl 12 | @property(nonatomic ,weak) TokenDotsNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TokenPageControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPageControl.m 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/11/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPageControl.h" 10 | #import "UIColor+SSRender.h" 11 | #import "NSString+Token.h" 12 | #import "TokenHybridConstant.h" 13 | #import "UIView+Attributes.h" 14 | #import "TokenXMLNode.h" 15 | 16 | @import JavaScriptCore; 17 | @implementation TokenPageControl 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | [self addTarget:self action:@selector(dotValueChanged) forControlEvents:(UIControlEventValueChanged)]; 24 | } 25 | return self; 26 | } 27 | 28 | -(void)dotValueChanged{ 29 | if (self.associatedNode) { 30 | [self.associatedNode.onClick.value callWithArguments:@[@(self.currentPage)]]; 31 | } 32 | } 33 | 34 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 35 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 36 | NSDictionary *d = dictionary; 37 | if (d[@"dotColor"]) { 38 | self.pageIndicatorTintColor = [UIColor ss_colorWithString:d[@"dotColor"]]; 39 | } 40 | if (d[@"onDotColor"]) { 41 | self.currentPageIndicatorTintColor = [UIColor ss_colorWithString:d[@"onDotColor"]]; 42 | } 43 | if (d[@"number"]) { 44 | self.numberOfPages = [d[@"number"] integerValue]; 45 | } 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Example/Source/component/TokenPickerComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPickerComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/30. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^TokenPickerComponentSureBlock)(NSDictionary *result); 12 | @interface TokenPickerComponent : UIView 13 | +(void)showInView:(UIView *)superView 14 | data:(NSDictionary *)data 15 | sureBlock:(TokenPickerComponentSureBlock)sureBlock; 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Source/component/TokenPureComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPureComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenXMLNode; 11 | @interface TokenPureComponent : UIView 12 | @property(nonatomic ,weak) TokenXMLNode *associatedNode; 13 | -(void)applyFlexLayout; 14 | -(void)didApplyAllAttributs; 15 | @end 16 | 17 | @interface TokenTableHeaderComponent : TokenPureComponent 18 | @end 19 | 20 | @interface TokenTableFooterComponent : TokenPureComponent 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Source/component/TokenPureComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPureComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPureComponent.h" 10 | #import "TokenHybridConstant.h" 11 | #import 12 | 13 | typedef void(^TokenComponentEnumerateBlock)(__kindof UIView *view); 14 | 15 | @implementation TokenPureComponent 16 | 17 | -(void)didApplyAllAttributs{ 18 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridComponentDidApplyLayoutNotification object:nil]; 19 | } 20 | 21 | -(void)applyFlexLayout{ 22 | self.yoga.isEnabled = YES; 23 | [self.yoga applyLayoutPreservingOrigin:YES]; 24 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridComponentDidApplyLayoutNotification object:nil]; 25 | } 26 | 27 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 28 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridEndEditingNotification object:nil]; 29 | } 30 | 31 | @end 32 | 33 | @implementation TokenTableHeaderComponent 34 | @end 35 | 36 | @implementation TokenTableFooterComponent 37 | @end 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/Source/component/TokenScrollComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenScrollComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenScrollNode; 11 | @interface TokenScrollComponent : UIScrollView 12 | @property(nonatomic ,weak) TokenScrollNode *associatedNode; 13 | -(void)updateContentSize; 14 | @end 15 | -------------------------------------------------------------------------------- /Example/Source/component/TokenSearchBarComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSearchBarComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/30. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSearchBarNode; 11 | @interface TokenSearchBarComponent : UISearchBar 12 | @property(nonatomic ,weak) TokenSearchBarNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TokenSegmentedComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSegmentedComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSegmentNode; 11 | @interface TokenSegmentedComponent : UISegmentedControl 12 | @property(nonatomic ,weak) TokenSegmentNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TokenSegmentedComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSegmentedComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenSegmentedComponent.h" 10 | #import "TokenXMLNode.h" 11 | #import "UIColor+SSRender.h" 12 | #import "UIView+Attributes.h" 13 | 14 | @implementation TokenSegmentedComponent 15 | 16 | -(instancetype)initWithItems:(NSArray *)items{ 17 | if (self = [super initWithItems:items]) { 18 | [self addTarget:self action:@selector(segmentValueChanged) forControlEvents:UIControlEventValueChanged]; 19 | } 20 | return self; 21 | } 22 | 23 | -(void)segmentValueChanged{ 24 | [self.associatedNode.onClick.value callWithArguments:@[@(self.selectedSegmentIndex)]]; 25 | } 26 | 27 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes shouldLayout:(BOOL)shouldLayout{ 28 | NSString *color = attributes[@"color"]; 29 | if (color) { 30 | self.tintColor = [UIColor ss_colorWithString:color]; 31 | } 32 | [super token_updateAppearanceWithCSSAttributes:attributes shouldLayout:shouldLayout]; 33 | } 34 | 35 | 36 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 37 | NSString *color = dictionary[@"color"]; 38 | if (color) { 39 | self.tintColor = [UIColor ss_colorWithString:color]; 40 | } 41 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /Example/Source/component/TokenSwitchComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSwitchComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSwitchNode; 11 | @interface TokenSwitchComponent : UISwitch 12 | @property(nonatomic ,weak) TokenSwitchNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TokenSwitchComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSwitchComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenSwitchComponent.h" 10 | #import "TokenXMLNode.h" 11 | #import "UIColor+SSRender.h" 12 | #import "UIView+Attributes.h" 13 | 14 | @implementation TokenSwitchComponent 15 | 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | [self addTarget:self action:@selector(onValueChanged) forControlEvents:UIControlEventValueChanged]; 21 | } 22 | return self; 23 | } 24 | 25 | -(void)onValueChanged{ 26 | [self.associatedNode.onClick.value callWithArguments:@[@(self.isOn)]]; 27 | } 28 | 29 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes shouldLayout:(BOOL)shouldLayout{ 30 | NSDictionary *d = attributes; 31 | NSString *color = d[@"color"]; 32 | if (color) { self.tintColor = [UIColor ss_colorWithString:color];} 33 | [super token_updateAppearanceWithCSSAttributes:d shouldLayout:shouldLayout]; 34 | } 35 | 36 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 37 | NSDictionary *d = dictionary; 38 | NSString *color = d[@"color"]; 39 | if (color) { self.tintColor = [UIColor ss_colorWithString:color];} 40 | NSString *onColor = d[@"onColor"]; 41 | if (onColor) { self.onTintColor = [UIColor ss_colorWithString:onColor];} 42 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /Example/Source/component/TokenTextAreaComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTextAreaComponent.h 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/10/25. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenTextAreaNode; 11 | @interface TokenTextAreaComponent : UITextView 12 | @property(nonatomic ,weak) TokenTextAreaNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/component/TokenWebViewComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenWebViewComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/5. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import WebKit; 11 | @class TokenWebViewNode; 12 | @interface TokenWebViewComponent : UIView 13 | @property(nonatomic ,weak ) TokenWebViewNode *associatedNode; 14 | @property(nonatomic ,strong) WKWebView *webView; 15 | -(void)loadURL:(NSString *)url; 16 | -(void)goBack; 17 | -(void)goForward; 18 | -(void)reload; 19 | -(void)stopLoading; 20 | -(void)setUA:(NSString *)UA; 21 | @end 22 | -------------------------------------------------------------------------------- /Example/Source/model/TokenAssociateContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenAssociateContext.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenHybridRenderController,TokenHybridRenderView,TokenJSContext,TokenViewBuilder; 12 | @interface TokenAssociateContext : NSObject 13 | @property(nonatomic ,weak ) TokenHybridRenderController *currentAssociateController; 14 | @property(nonatomic ,weak ) TokenHybridRenderView *currentAssociateView; 15 | @property(nonatomic ,weak ) TokenViewBuilder *currentAssociateViewBuilder; 16 | @property(nonatomic ,assign) Class associateViewPushControllerClass; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Source/model/TokenAssociateContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenAssociateContext.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenAssociateContext.h" 10 | 11 | @implementation TokenAssociateContext 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/Source/model/TokenDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHTMLDocument.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenJSContext; 12 | @interface TokenDocument : NSObject 13 | @property(nonatomic ,copy ) NSString *html; 14 | @property(nonatomic ,copy ) NSString *sourceURL; 15 | @property(nonatomic ,strong) TokenXMLNode *rootNode; 16 | @property(nonatomic ,strong) NSArray *cssRules; 17 | @property(nonatomic ,strong) NSArray *scripts; 18 | @property(nonatomic ,strong) NSArray *downloadFailCSSURLs; 19 | @property(nonatomic ,strong) NSArray *downloadFailScriptURLs; 20 | 21 | @property(nonatomic ,weak) TokenXMLNode *bodyNode; 22 | @property(nonatomic ,weak) TokenXMLNode *headNode; 23 | @property(nonatomic ,weak) TokenXMLNode *titleNode; 24 | @property(nonatomic ,weak) TokenXMLNode *navigationBarNode; 25 | 26 | @property(nonatomic ,weak) TokenJSContext *jsContext; 27 | 28 | -(void)addCSSRuels:(NSDictionary *)rules; 29 | -(void)addJavaScript:(NSString *)script; 30 | -(void)addFailedCSSURL:(NSString *)url; 31 | -(void)addFailedScriptURL:(NSString *)url; 32 | @end 33 | -------------------------------------------------------------------------------- /Example/Source/parser/TokenCSSParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenCSSParser.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import UIKit; 11 | @class TokenXMLNode; 12 | @interface TokenCSSParser : NSObject 13 | +(NSDictionary *)converAttrStringToDictionary:(NSString *)attrString 14 | containerViewWidth:(CGFloat)containerViewWidth 15 | containerViewHeight:(CGFloat)containerViewHeight; 16 | 17 | +(NSDictionary *)parserCSSWithString:(NSString *)cssString 18 | containerViewWidth:(CGFloat)containerViewWidth 19 | containerViewHeight:(CGFloat)containerViewHeight; 20 | 21 | //将CSS 选择器和 node进行匹配 22 | +(NSSet *)matchNodesWithRootNode:(TokenXMLNode *)node 23 | selector:(NSString *)selector; 24 | @end 25 | -------------------------------------------------------------------------------- /Example/Source/parser/TokenXMLParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenXMLParser.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import UIKit; 12 | @class TokenXMLParser,TokenXMLNode; 13 | @protocol TokenXMLParserDelegate 14 | @optional 15 | -(void)parserDidStart; 16 | -(void)parser:(TokenXMLParser *)parser didStartNodeWithinBodyNode:(TokenXMLNode *)node; 17 | -(void)parser:(TokenXMLParser *)parser didEndNodeWithinBodyNode:(TokenXMLNode *)node; 18 | -(void)parser:(TokenXMLParser *)parser didCreatHeadNode:(TokenXMLNode *)node; 19 | -(void)parser:(TokenXMLParser *)parser didCreatTitleNode:(TokenXMLNode *)node; 20 | -(void)parser:(TokenXMLParser *)parser didCreatNavigationBarNode:(TokenXMLNode *)node; 21 | -(void)parser:(TokenXMLParser *)parser didCreatRootNode:(TokenXMLNode *)node; 22 | -(void)parser:(TokenXMLParser *)parser nodeContainInnerCSSStyle:(NSSet *)nodes; 23 | -(void)parserDidEnd; 24 | -(void)parserErrorOccurred:(NSError *)error; 25 | @end 26 | 27 | @interface TokenXMLParser : NSObject 28 | @property(nonatomic ,weak) id delegate; 29 | @property(nonatomic ,copy) NSString *identifier; 30 | @property(nonatomic ,assign) CGRect bodyViewFrame; 31 | -(instancetype)init NS_UNAVAILABLE; 32 | -(instancetype)initWithBodyViewFrame:(CGRect)frame; 33 | -(void)parserHTML:(NSString *)html; 34 | -(void)stopParsing; 35 | @end 36 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenHybridConstant.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridConstant.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXTERN NSString * const TokenHybridComponentDidApplyLayoutNotification; 12 | FOUNDATION_EXTERN NSString * const TokenHybridEndEditingNotification; 13 | FOUNDATION_EXTERN NSString * const TokenHybridPageDisappearNotification; 14 | 15 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenHybridConstant.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridConstant.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenHybridConstant.h" 10 | 11 | NSString *const TokenHybridComponentDidApplyLayoutNotification = @"TokenHybridComponentDidApplyLayoutNotification"; 12 | NSString *const TokenHybridEndEditingNotification = @"TokenHybridEndEditingNotification"; 13 | NSString *const TokenHybridPageDisappearNotification = @"TokenHybridPageDisappearNotification"; 14 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenHybridOrganizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridOrganizer.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenNodeComponentRegister; 11 | @import UIKit; 12 | @interface TokenHybridOrganizer : NSObject 13 | @property(nonatomic ,strong) TokenNodeComponentRegister *nodeComponentRegister; 14 | +(TokenHybridOrganizer *)sharedOrganizer; 15 | -(void)addPageDefaultWithSuiteName:(NSString *)name; 16 | -(void)clearAllPageDefaultsData; 17 | @end 18 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenHybridStack.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridStack.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TokenHybridStack: NSObject 12 | @property(nonatomic ,assign,readonly) NSInteger count; 13 | -(void)push:(id)obj; 14 | -(id)pop; 15 | -(id)top; 16 | @end 17 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenHybridStack.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridStack.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenHybridStack.h" 10 | 11 | @interface TokenHybridStack() 12 | @property(nonatomic ,strong) NSMutableArray *array; 13 | @end 14 | 15 | @implementation TokenHybridStack 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | _array = @[].mutableCopy; 21 | } 22 | return self; 23 | } 24 | 25 | -(void)push:(id)obj{ 26 | [_array addObject:obj]; 27 | } 28 | 29 | -(id)pop{ 30 | id obj; 31 | if (_array.count) { 32 | obj = [_array lastObject]; 33 | [_array removeLastObject]; 34 | } 35 | return obj; 36 | } 37 | 38 | -(id)top{ 39 | return [_array lastObject]; 40 | } 41 | 42 | -(NSInteger)count{ 43 | return _array.count; 44 | } 45 | @end 46 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenNodeComponentRegister.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenNodeComponentRegister.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/5. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import UIKit; 12 | @class TokenXMLNode; 13 | 14 | typedef __kindof UIView *(^TokenHybridComponentCreatBlock)(__kindof TokenXMLNode *node); 15 | 16 | @interface TokenHybridRegisterModel : NSObject 17 | @property(nonatomic ,copy ) NSString *nodeTagName; 18 | @property(nonatomic ,copy ) NSString *nodeClassName; 19 | @property(nonatomic ,assign) NSString *nativeComponentClassName; 20 | @property(nonatomic ,assign) BOOL customInit; 21 | @property(nonatomic ,copy ) TokenHybridComponentCreatBlock creatProcess; 22 | 23 | -(instancetype)initWithNodeTagName:(NSString *)nodeTagName 24 | nodeClassName:(NSString *)nodeClassName 25 | nativeComponentClassName:(NSString *)nativeComponentClassName 26 | creatProcess:(TokenHybridComponentCreatBlock)creatProcess; 27 | -(__kindof TokenXMLNode *)creatNode; 28 | -(__kindof UIView *)creatNativeComponentWithNode:(__kindof TokenXMLNode *)node; 29 | @end 30 | 31 | @interface TokenNodeComponentRegister : NSObject 32 | -(void)registDefault; 33 | -(void)registComponentWithModel:(TokenHybridRegisterModel *)model; 34 | -(TokenHybridRegisterModel *)getRegisterModelWithNodeTagName:(NSString *)nodeTagName; 35 | @end 36 | -------------------------------------------------------------------------------- /Example/Source/tool/TokenViewBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenViewBuilder.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import UIKit; 11 | @class TokenDocument, 12 | TokenXMLNode, 13 | TokenPureComponent, 14 | TokenViewBuilder, 15 | TokenJSContext; 16 | 17 | @protocol TokenViewBuilderDelegate 18 | @optional 19 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didFetchTitle:(NSString *)title; 20 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder parserErrorOccurred:(NSError *)error; 21 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didCreatNavigationBarNode:(TokenXMLNode *)node; 22 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didCreatBodyView:(TokenPureComponent *)view; 23 | -(void)viewBuilderWillRunScript; 24 | @end 25 | 26 | @interface TokenViewBuilder : NSObject 27 | @property(nonatomic ,strong) TokenDocument *document; 28 | @property(nonatomic ,strong) TokenPureComponent *bodyView; 29 | @property(nonatomic ,strong) TokenJSContext *jsContext; 30 | @property(nonatomic ,strong) NSUserDefaults *currentPageDefaults; 31 | @property(nonatomic ,weak ) id delegate; 32 | @property(nonatomic ,assign) BOOL useCache; 33 | @property(nonatomic ,assign) CGRect bodyViewFrame; 34 | -(instancetype)init NS_UNAVAILABLE; 35 | -(instancetype)initWithBodyViewFrame:(CGRect)frame; 36 | -(void)buildViewWithSourceURL:(NSString *)url; 37 | -(void)refreshView; 38 | @end 39 | -------------------------------------------------------------------------------- /Example/TokenHybrid.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/TokenHybrid.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/TokenHybrid/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. 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 | -------------------------------------------------------------------------------- /Example/TokenHybrid/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import 11 | 12 | @interface AppDelegate () 13 | 14 | @end 15 | 16 | @implementation AppDelegate 17 | 18 | 19 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { 20 | // Override point for customization after application launch. 21 | return YES; 22 | } 23 | 24 | - (void)applicationWillResignActive:(UIApplication *)application { 25 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. 26 | // Use this method to pause ongoing tasks, disable timers, and invalidate graphics rendering callbacks. Games should use this method to pause the game. 27 | } 28 | 29 | 30 | - (void)applicationDidEnterBackground:(UIApplication *)application { 31 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. 32 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 33 | } 34 | 35 | 36 | - (void)applicationWillEnterForeground:(UIApplication *)application { 37 | // Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. 38 | } 39 | 40 | 41 | - (void)applicationDidBecomeActive:(UIApplication *)application { 42 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. 43 | } 44 | 45 | 46 | - (void)applicationWillTerminate:(UIApplication *)application { 47 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 48 | } 49 | 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Example/TokenHybrid/Assets.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "20x20", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "20x20", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "29x29", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "29x29", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "40x40", 66 | "scale" : "1x" 67 | }, 68 | { 69 | "idiom" : "ipad", 70 | "size" : "40x40", 71 | "scale" : "2x" 72 | }, 73 | { 74 | "idiom" : "ipad", 75 | "size" : "76x76", 76 | "scale" : "1x" 77 | }, 78 | { 79 | "idiom" : "ipad", 80 | "size" : "76x76", 81 | "scale" : "2x" 82 | }, 83 | { 84 | "idiom" : "ipad", 85 | "size" : "83.5x83.5", 86 | "scale" : "2x" 87 | } 88 | ], 89 | "info" : { 90 | "version" : 1, 91 | "author" : "xcode" 92 | } 93 | } -------------------------------------------------------------------------------- /Example/TokenHybrid/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 | -------------------------------------------------------------------------------- /Example/TokenHybrid/CustomViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // CustomViewController.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2018/1/4. 6 | // Copyright © 2018年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface CustomViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Example/TokenHybrid/CustomViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // CustomViewController.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2018/1/4. 6 | // Copyright © 2018年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "CustomViewController.h" 10 | #import "TokenHybridRenderView.h" 11 | @interface CustomViewController () 12 | @property(nonatomic,strong) TokenHybridRenderView *renderView; 13 | @end 14 | 15 | @implementation CustomViewController 16 | 17 | - (void)viewDidLoad { 18 | [super viewDidLoad]; 19 | self.title = @"校园卡"; 20 | self.view.backgroundColor = [UIColor whiteColor]; 21 | CGRect newRect = CGRectInset(self.view.bounds, 20, 80); 22 | newRect.origin = CGPointMake(20, 40); 23 | self.renderView = [[TokenHybridRenderView alloc] initWithFrame:newRect]; 24 | self.renderView.backgroundColor = [UIColor darkGrayColor]; 25 | [self.view addSubview:self.renderView]; 26 | self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"开始" style:(UIBarButtonItemStylePlain) target:self action:@selector(start)]; 27 | } 28 | 29 | 30 | -(void)start{ 31 | NSString *url = @"https://raw.githubusercontent.com/cx478815108/TokenHybridHTML/master/tokenapp/card/card.html"; 32 | [self.renderView buildViewWithSourceURL:url containerViewController:self childRenderControlllerClass:nil]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Example/TokenHybrid/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.1 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | NSAppTransportSecurity 24 | 25 | NSAllowsArbitraryLoads 26 | 27 | 28 | NSLocationUsageDescription 29 | 在您使用和地理位置相关的功能时,需要您开启理理位置权限 30 | NSLocationWhenInUseUsageDescription 31 | 在您使用和地理位置相关的功能时,需要您开启理理位置权限 32 | NSPhotoLibraryUsageDescription 33 | 在您操作图片时,需要访问您的相册 34 | UILaunchStoryboardName 35 | LaunchScreen 36 | UIMainStoryboardFile 37 | Main 38 | UIRequiredDeviceCapabilities 39 | 40 | armv7 41 | 42 | UISupportedInterfaceOrientations 43 | 44 | UIInterfaceOrientationPortrait 45 | 46 | UISupportedInterfaceOrientations~ipad 47 | 48 | UIInterfaceOrientationPortrait 49 | UIInterfaceOrientationPortraitUpsideDown 50 | UIInterfaceOrientationLandscapeLeft 51 | UIInterfaceOrientationLandscapeRight 52 | 53 | UIViewControllerBasedStatusBarAppearance 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /Example/TokenHybrid/ViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ViewController : UITableViewController 12 | 13 | 14 | @end 15 | 16 | -------------------------------------------------------------------------------- /Example/TokenHybrid/ViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "ViewController.h" 10 | #import "TokenHybridRenderController.h" 11 | #import "TokenHybridOrganizer.h" 12 | #import "CustomViewController.h" 13 | #import "UIColor+Token.h" 14 | 15 | @interface ViewController () 16 | @end 17 | 18 | @implementation ViewController 19 | 20 | - (void)viewDidLoad { 21 | [super viewDidLoad]; 22 | self.title = @"Funny"; 23 | self.navigationController.navigationBar.translucent = NO; 24 | self.navigationController.navigationBar.barTintColor = UIColor.token_RGB(70,200,220); 25 | [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName:UIColor.whiteColor}]; 26 | [self.navigationController.navigationBar setTintColor:UIColor.whiteColor]; 27 | [UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleLightContent; 28 | 29 | } 30 | 31 | -(void)viewWillAppear:(BOOL)animated{ 32 | [super viewWillAppear:animated]; 33 | } 34 | 35 | -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ 36 | if (indexPath.row == 0) { 37 | NSString *url = @"https://raw.githubusercontent.com/cx478815108/TokenHybridHTML/master/examsEnter/examples.html"; 38 | TokenHybridRenderController *obj = [[TokenHybridRenderController alloc] initWithHTMLURL:url]; 39 | [self.navigationController pushViewController:obj animated:YES]; 40 | } 41 | else if (indexPath.row == 1) { 42 | CustomViewController *obj = [[CustomViewController alloc] init]; 43 | [self.navigationController pushViewController:obj animated:YES]; 44 | } 45 | else if (indexPath.row == 2) { 46 | [[TokenHybridOrganizer sharedOrganizer] clearAllPageDefaultsData]; 47 | } 48 | } 49 | 50 | @end 51 | -------------------------------------------------------------------------------- /Example/TokenHybrid/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. 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 | -------------------------------------------------------------------------------- /Example/TokenHybridTests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Example/TokenHybridTests/TokenHybridTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridTests.m 3 | // TokenHybridTests 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TokenHybridTests : XCTestCase 12 | 13 | @end 14 | 15 | @implementation TokenHybridTests 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 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2015 TokenHybrid (https://github.com/cx478815108/TokenHybrid) 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /Source/JavaScriptSupport/Scripts/TokenBase.js: -------------------------------------------------------------------------------- 1 | class Window{ 2 | 3 | constructor(){ 4 | this.extension = null; 5 | } 6 | 7 | keepEventValueAlive(id,value){ 8 | if(this.managedValue == undefined){ 9 | this.managedValue = new Map(); 10 | } 11 | this.managedValue.set(id,value); 12 | } 13 | 14 | setPriviousPageExtension(value){ 15 | setPriviousPageExtension(value); 16 | } 17 | } 18 | 19 | var window = new Window(); 20 | 21 | 22 | function setExtension(value){ 23 | window.extension = value; 24 | } 25 | 26 | function __typeof__(objClass) 27 | { 28 | if ( objClass && objClass.constructor ) 29 | { 30 | var strFun = objClass.constructor.toString(); 31 | var className = strFun.substr(0, strFun.indexOf('(')); 32 | className = className.replace('function', ''); 33 | return className.replace(/(^\s*)|(\s*$)/ig, ''); 34 | } 35 | return typeof(objClass); 36 | } 37 | 38 | function dumpObj(obj, depth) { 39 | 40 | if (depth == null || depth == undefined) { 41 | depth = 1; 42 | } 43 | if (typeof obj != "function" && typeof obj != "object") { 44 | return '('+__typeof__(obj)+')' + obj.toString(); 45 | } 46 | 47 | var tab = ' '; 48 | var tabs = ''; 49 | for (var i = 0; i 10 | 11 | @class TokenXMLNode,TokenEvent,TokenJSContext,TokenAssociateContext; 12 | @import UIKit; 13 | @protocol TokenJSContextDelegate 14 | @optional 15 | -(void)context:(TokenJSContext *)context didReceiveLogInfo:(NSString *)info; 16 | -(void)context:(TokenJSContext *)context setPriviousExtension:(NSDictionary *)extension; 17 | -(TokenAssociateContext *)contextGetAssociateContext; 18 | @end 19 | 20 | @interface TokenJSContext : JSContext 21 | @property(nonatomic ,weak) id delegate; 22 | -(UIViewController *)getContainerController; 23 | -(NSUserDefaults *)getCurrentPageUserDefaults; 24 | -(Class)getViewPushedControllerClass; 25 | -(void)keepEventValueAlive:(JSValue *)value; 26 | -(void)pageShow; 27 | -(void)pageClose; 28 | -(void)pageRefresh; 29 | @end 30 | -------------------------------------------------------------------------------- /Source/JavaScriptSupport/TokenTool.h: -------------------------------------------------------------------------------- 1 | // 2 | // Token.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/18. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import JavaScriptCore; 12 | @import UIKit; 13 | @class TokenJSContext; 14 | @protocol TokenAPIExport 15 | @optional 16 | //storage 17 | JSExportAs(request, -(void)requestWithValue:(JSValue *)requestValue); 18 | JSExportAs(getLocation, -(void)getLocation:(JSValue *)callBack); 19 | -(id)getStorage:(JSValue *)key; 20 | -(void)setStorage:(JSValue *)dicValue; 21 | -(void)clearAllStorage; 22 | -(void)setGlobleStorage:(JSValue *)dicValue; 23 | -(id)getGlobleStorage:(JSValue *)key; 24 | -(void)clearGlobleStorage; 25 | -(void)makePhoneCall:(NSString *)number; 26 | // 27 | JSExportAs(log, -(void)log:(NSString *)msg); 28 | //imageValue {"url","success","failure"} 29 | JSExportAs(saveImage, -(void)saveImageWithJSValue:(JSValue *)imageValue); 30 | JSExportAs(alert, -(void)alertWithTitle:(NSString *)title msg:(NSString *)msg); 31 | JSExportAs(alertTitles, -(void)alertWithWithJSValue:(JSValue *)alertValue); 32 | JSExportAs(alertInput, -(void)alertInput:(JSValue *)alertValue); 33 | JSExportAs(showSheetView, -(void)showSheetViewWithJSValue:(JSValue *)sheetValue); 34 | JSExportAs(pickData, -(void)pickData:(JSValue *)pickValue); 35 | //(code ,desc) 36 | JSExportAs(requestTouchID, -(void)requestTouchIDWithTitle:(JSValue *)title callBack:(JSValue *)callBack); 37 | JSExportAs(setMainTimeOut, -(void)setMainTimeOutWithCallBack:(JSValue *)callBack interval:(JSValue *)interval); 38 | JSExportAs(setTimeOut, -(void)setTimeOutWithCallBack:(JSValue *)callBack interval:(JSValue *)interval); 39 | -(NSNumber *)screenWidth; 40 | -(NSNumber *)screenHeight; 41 | @end 42 | 43 | @interface TokenTool : NSObject 44 | @property(nonatomic ,strong) NSUserDefaults *globleDefaultes; 45 | @property(nonatomic ,weak ) TokenJSContext *jsContext; 46 | @end 47 | -------------------------------------------------------------------------------- /Source/TokenExtension/NSUserDefaults+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSUserDefaults+Token.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/25. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef NSUserDefaults *(^TokenUserDefaultsInitBlock)(NSString *suiteName); 12 | typedef NSUserDefaults *(^TokenUserDefaultsRemoveBlock)(NSString *domainName); 13 | typedef NSUserDefaults *(^TokenUserDefaultsSetObjectBlock)(NSString *key,id object); 14 | typedef NSUserDefaults *(^TokenUserDefaultsSetLimitTimeTypeObjectBlock)(NSString *key,id object,NSTimeInterval limitTime); 15 | typedef id (^TokenUserDefaultsGetObjectBlock)(NSString *key); 16 | typedef id (^TokenUserDefaultsGetTimeLimitTypeObjectBlock)(NSString *key); 17 | 18 | @interface NSUserDefaults (Token) 19 | @property(nonatomic ,copy,class,readonly) TokenUserDefaultsInitBlock token_initWithSuiteName; 20 | @property(nonatomic ,copy,readonly) TokenUserDefaultsSetObjectBlock token_setObjectForKey; 21 | @property(nonatomic ,copy,readonly) TokenUserDefaultsRemoveBlock token_removePersistentDomainForName; 22 | @property(nonatomic ,copy,readonly) TokenUserDefaultsGetObjectBlock token_objectForKey; 23 | @property(nonatomic ,copy,readonly) TokenUserDefaultsSetLimitTimeTypeObjectBlock token_setTimeLimitTypeObjectForKey; 24 | @property(nonatomic ,copy,readonly) TokenUserDefaultsGetObjectBlock token_timeLimitTypeObjectForKey; 25 | @end 26 | -------------------------------------------------------------------------------- /Source/TokenExtension/TokenExtensionHeader.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenExtensionHeader.h 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #ifndef TokenExtensionHeader_h 10 | #define TokenExtensionHeader_h 11 | 12 | #import "UIView+Token.h" 13 | #import "UIColor+Token.h" 14 | #import "NSString+Token.h" 15 | 16 | #import "NSUserDefaults+Token.h" 17 | #import "UIColor+SSRender.h" 18 | #endif /* TokenExtensionHeader_h */ 19 | -------------------------------------------------------------------------------- /Source/TokenExtension/UIColor+SSRender.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+FSAdd.h 3 | // JSONRenderKit 4 | // 5 | // Created by 陈雄 on 16/7/1. 6 | // Copyright © 2016年 com.feelings. All rights reserved. 7 | 8 | #import 9 | 10 | @interface UIColor (SSRender) 11 | +(instancetype)ss_colorWithHexString:(NSString *)hexStr; 12 | +(instancetype)ss_colorWithRGBString:(NSString *)rgbString; 13 | +(instancetype)ss_colorWithString:(NSString *)string; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/TokenExtension/UIColor+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Token.h 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef UIColor *(^TokenRandomColorBlock)(void); 12 | typedef UIColor *(^TokenStringColorBlock)(void); 13 | typedef UIColor *(^TokenColorCGFloat3Block)(CGFloat value1 ,CGFloat value2 ,CGFloat value3); 14 | typedef UIColor *(^TokenColorCGFloat4Block)(CGFloat value1 ,CGFloat value2 ,CGFloat value3 ,CGFloat value4); 15 | 16 | @interface UIColor (Token) 17 | @property(nonatomic ,copy ,readonly ,class) TokenColorCGFloat4Block token_RGBA; 18 | @property(nonatomic ,copy ,readonly ,class) TokenColorCGFloat3Block token_RGB; 19 | @property(nonatomic ,copy ,readonly ,class) TokenRandomColorBlock token_randomColor; 20 | 21 | @end 22 | -------------------------------------------------------------------------------- /Source/TokenExtension/UIColor+Token.m: -------------------------------------------------------------------------------- 1 | // 2 | // UIColor+Token.m 3 | // 掌理教务处 4 | // 5 | // Created by 陈雄 on 2017/9/13. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "UIColor+Token.h" 10 | 11 | @implementation UIColor (Token) 12 | +(TokenColorCGFloat3Block)token_RGB{ 13 | return ^UIColor *(CGFloat value1, CGFloat value2, CGFloat value3) { 14 | return [UIColor colorWithRed:value1/255 green:value2/255 blue:value3/255 alpha:1]; 15 | }; 16 | } 17 | 18 | +(TokenColorCGFloat4Block)token_RGBA{ 19 | return ^UIColor *(CGFloat value1, CGFloat value2, CGFloat value3 ,CGFloat value4) { 20 | return [UIColor colorWithRed:value1/255 green:value2/255 blue:value3/255 alpha:value4]; 21 | }; 22 | } 23 | 24 | +(TokenRandomColorBlock)token_randomColor{ 25 | return ^UIColor *(void) { 26 | return [UIColor colorWithRed:arc4random()%255/255.0 green:arc4random()%255/255.0 blue:arc4random()%255/255.0 alpha:1.0]; 27 | }; 28 | } 29 | @end 30 | -------------------------------------------------------------------------------- /Source/category/JSValue+Token.h: -------------------------------------------------------------------------------- 1 | // 2 | // JSValue+Token.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/3. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface JSValue (Token) 12 | -(BOOL)token_isNilObject; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/category/JSValue+Token.m: -------------------------------------------------------------------------------- 1 | // 2 | // JSValue+Token.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/3. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "JSValue+Token.h" 10 | 11 | @implementation JSValue (Token) 12 | - (BOOL)token_isNilObject { 13 | return self.isNull || self.isUndefined; 14 | } 15 | @end 16 | -------------------------------------------------------------------------------- /Source/category/NSDictionary+chainScript.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSDictionary+chainScript.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSDictionary (chainScript) 12 | -(id)token_chainScript:(NSString *)chainScript 13 | itemKey:(NSString *)itemKey 14 | idxKey:(NSString *)idxKey 15 | forLoopIndex:(NSInteger)loopIndex; 16 | 17 | -(id)token_chainScript:(NSString *)chainScript 18 | itemKey:(NSString *)itemKey 19 | idxKey:(NSString *)idxKey 20 | sectionKey:(NSString *)sectionKey 21 | indexPath:(NSIndexPath *)indexPath; 22 | @end 23 | -------------------------------------------------------------------------------- /Source/category/NSString+TokenHybrid.h: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TokenHybrid.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface NSString (TokenHybrid) 12 | +(NSString *)token_completeRelativeURLString:(NSString *)relativeString 13 | withAbsoluteURLString:(NSString *)absoluteString; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/category/NSString+TokenHybrid.m: -------------------------------------------------------------------------------- 1 | // 2 | // NSString+TokenHybrid.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "NSString+TokenHybrid.h" 10 | 11 | @implementation NSString (TokenHybrid) 12 | +(NSString *)token_completeRelativeURLString:(NSString *)relativeString 13 | withAbsoluteURLString:(NSString *)absoluteString 14 | { 15 | if ([relativeString hasPrefix:@"http"]) { return relativeString;} 16 | NSURL *absoluteURL = [NSURL URLWithString:absoluteString]; 17 | if (absoluteURL.scheme == nil) { return relativeString;} 18 | 19 | NSInteger backtrackingCount = 0; 20 | NSString *tempString = relativeString; 21 | NSMutableArray *pathComponents = [NSMutableArray arrayWithArray:absoluteString.pathComponents]; 22 | while ([tempString containsString:@"../"]) { 23 | backtrackingCount += 1; 24 | NSRange replaceRange = [tempString rangeOfString:@".." options:(NSBackwardsSearch)]; 25 | NSInteger addPathIndex = (pathComponents.count - 1) - (backtrackingCount + 1); 26 | if (pathComponents.count - 1 > addPathIndex) { 27 | tempString = [tempString stringByReplacingCharactersInRange:replaceRange withString:pathComponents[addPathIndex]]; 28 | } 29 | } 30 | 31 | NSInteger location = pathComponents.count-tempString.pathComponents.count; 32 | NSMutableString *finalURLString = [NSMutableString stringWithString:absoluteURL.scheme]; 33 | if (location >= 0 && tempString.pathComponents.count <= pathComponents.count) { 34 | [pathComponents replaceObjectsInRange:NSMakeRange(pathComponents.count-tempString.pathComponents.count, tempString.pathComponents.count) withObjectsFromArray:tempString.pathComponents]; 35 | [pathComponents removeObjectAtIndex:0]; 36 | 37 | NSString *finalPathString = [NSString pathWithComponents:pathComponents]; 38 | [finalURLString appendString:@"://"]; 39 | if (absoluteURL.port) { 40 | [finalURLString appendFormat:@":%@",absoluteURL.port]; 41 | } 42 | [finalURLString appendString:finalPathString]; 43 | return finalURLString; 44 | } 45 | return finalURLString; 46 | } 47 | @end 48 | -------------------------------------------------------------------------------- /Source/category/TokenComponent+pullRefresh.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenComponent+TokenHybrid.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/28. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenTableComponent.h" 10 | #import "TokenScrollComponent.h" 11 | #import "TokenWebViewComponent.h" 12 | 13 | @protocol TokenPullRefreshProtocol 14 | @optional 15 | -(void)openHeaderRefresh; 16 | -(void)stopHeaderRefresh; 17 | -(void)hiddenHeaderRefresh; 18 | -(void)openFooterRefresh; 19 | -(void)stopFooterRefresh; 20 | -(void)hiddenFooterRefresh; 21 | @end 22 | 23 | @interface TokenTableComponent (TokenHybrid) 24 | 25 | @end 26 | 27 | @interface TokenScrollComponent (TokenHybrid) 28 | 29 | @end 30 | 31 | @interface TokenWebViewComponent (TokenHybrid) 32 | 33 | @end 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /Source/category/UIView+Attributes.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+Attributes.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode; 12 | typedef void(^UIViewEnumerateBlock)(__kindof UIView *view,BOOL *stop); 13 | @interface UIView (Attributes) 14 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes; 15 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary; 16 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes 17 | shouldLayout:(BOOL)shouldLayout; 18 | +(void)token_enumerateViewFromRootToChildWithRootView:(UIView *)rootView 19 | block:(UIViewEnumerateBlock)block; 20 | +(__kindof UIView *)token_produceViewWithNode:(TokenXMLNode *)node; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/category/UIView+TokenFlexLayout.h: -------------------------------------------------------------------------------- 1 | // 2 | // UIView+TokenFlexLayout.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface UIView (TokenFlexLayout) 12 | -(void)token_layoutWithAttributes:(NSDictionary *)attributes; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TableView/TokenDataItem.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenDataItem.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TokenDataItem : NSObject 12 | @property(nonatomic ,copy) NSString *identify; 13 | @property(nonatomic ,strong) NSDictionary *dataObj; 14 | @property(nonatomic ,strong) NSDictionary *customForLoop; 15 | +(instancetype)itemWithDataObj:(NSDictionary *)obj 16 | customForLoop:(NSDictionary *)customForLoop; 17 | @end 18 | -------------------------------------------------------------------------------- /Source/component/TableView/TokenDataItem.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenDataItem.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenDataItem.h" 10 | 11 | @implementation TokenDataItem 12 | +(instancetype)itemWithDataObj:(NSDictionary *)obj 13 | customForLoop:(NSDictionary *)customForLoop{ 14 | TokenDataItem *item = [[TokenDataItem alloc] init]; 15 | item.dataObj = obj; 16 | item.customForLoop = customForLoop; 17 | return item; 18 | } 19 | 20 | - (NSString *)description 21 | { 22 | return [NSString stringWithFormat:@"TokenDataItem - [\n%@\n%@\n%@]", self.dataObj,self.customForLoop,self.identify]; 23 | } 24 | @end 25 | -------------------------------------------------------------------------------- /Source/component/TableView/TokenTableCell.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableCell.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenDataItem; 12 | @interface TokenTableCell : UITableViewCell 13 | @property(nonatomic ,strong) NSIndexPath *indexPath; 14 | @property(nonatomic ,strong) TokenDataItem *dataItem; 15 | +(NSString *)reuseIdentifier; 16 | -(void)configHierarchyWithNode:(TokenXMLNode *)node; 17 | @end 18 | -------------------------------------------------------------------------------- /Source/component/TableView/TokenTableComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenTableNode; 12 | @interface TokenTableComponent : UIView 13 | @property(nonatomic ,strong) TokenTableNode *associatedNode; 14 | @property(nonatomic ,strong) UITableView *tableView; 15 | -(instancetype)initWithConfigNode:(TokenXMLNode *)configNode; 16 | -(void)reloadData:(NSArray *)dataArray; 17 | -(void)scrollToTop:(BOOL)animate; 18 | @end 19 | -------------------------------------------------------------------------------- /Source/component/TableView/TokenTableSectionView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTableSectionView.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/27. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenPureNode,TokenDataItem; 12 | @interface TokenTableSectionView : UITableViewHeaderFooterView 13 | @property(nonatomic ,assign) NSInteger section; 14 | @property(nonatomic ,strong) TokenDataItem *dataItem; 15 | @property(nonatomic ,weak ) TokenPureNode *associatedNode; 16 | +(NSString *)reuseIdentifier; 17 | -(void)configHierarchyWithNode:(TokenXMLNode *)node; 18 | @end 19 | -------------------------------------------------------------------------------- /Source/component/TokenButtonComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenButtonComponent.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/24. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenButtonNode; 11 | @interface TokenButtonComponent : UIButton 12 | @property(nonatomic ,weak ) TokenButtonNode *associatedNode; 13 | @property(nonatomic ,strong) NSString *componentID; 14 | @property(nonatomic ,strong) NSIndexPath *indexPath; 15 | @property(nonatomic ,strong) UIColor *selectedBackgroundColor; 16 | +(instancetype)buttonWithTypeString:(NSString *)type 17 | title:(NSString *)title; 18 | @end 19 | -------------------------------------------------------------------------------- /Source/component/TokenHybridRenderController.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSSRenderController.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | #import "TokenViewBuilder.h" 11 | #import "TokenJSContext.h" 12 | 13 | @interface TokenHybridRenderController : UIViewController 14 | @property(nonatomic ,assign) BOOL hiddenTitle; 15 | @property(nonatomic ,assign) BOOL allowDebug; 16 | @property(nonatomic, copy ) NSString *htmlURL; 17 | @property(nonatomic, copy ) NSString *htmlPath; 18 | @property(nonatomic ,strong) NSDictionary *extension; 19 | @property(nonatomic ,strong) TokenViewBuilder *viewBuilder; 20 | @property(nonatomic ,weak ) TokenHybridRenderController *previousController; 21 | 22 | -(instancetype)initWithHTMLURL:(NSString *)htmlURL; 23 | @end 24 | -------------------------------------------------------------------------------- /Source/component/TokenHybridRenderView.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridRenderView.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/12. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPureComponent.h" 10 | #import "TokenViewBuilder.h" 11 | #import "TokenJSContext.h" 12 | 13 | @interface TokenHybridRenderView : TokenPureComponent 14 | @property(nonatomic ,weak) UIViewController *associatedController; 15 | @property(nonatomic, copy) NSString *sourceURL; 16 | 17 | /** 18 | 根据URL构建原生视图 19 | 20 | @param url 远程URL 21 | @param controller 当前view所在的视图 22 | @param childClass 推送到下一个试图控制器,必须是TokenHybridRenderController的子类 23 | */ 24 | -(void)buildViewWithSourceURL:(NSString *)url 25 | containerViewController:(UIViewController *)controller 26 | childRenderControlllerClass:(__unsafe_unretained Class)childClass; 27 | @end 28 | -------------------------------------------------------------------------------- /Source/component/TokenImageComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenImageView.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenLabelNode; 12 | @interface TokenImageComponent : UIImageView 13 | @property(nonatomic ,strong) NSString *componentID; 14 | @property(nonatomic ,strong) NSIndexPath *indexPath; 15 | @property(nonatomic ,weak ) TokenLabelNode *associatedNode; 16 | -(void)addTapGestureRecognizer; 17 | @end 18 | -------------------------------------------------------------------------------- /Source/component/TokenInputComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenInputComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/17. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenInputNode; 12 | @interface TokenInputComponent : UITextField 13 | @property(nonatomic ,weak ) TokenInputNode *associatedNode; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/component/TokenLabelComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenLabelComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenLabelNode; 11 | @interface TokenLabelComponent : UILabel 12 | @property(nonatomic ,strong) NSString *componentID; 13 | @property(nonatomic ,strong) NSIndexPath *indexPath; 14 | @property(nonatomic ,weak ) TokenLabelNode *associatedNode; 15 | -(void)addTapGestureRecognizer; 16 | @end 17 | -------------------------------------------------------------------------------- /Source/component/TokenPageControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPageControl.h 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/11/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenDotsNode; 11 | @interface TokenPageControl : UIPageControl 12 | @property(nonatomic ,weak) TokenDotsNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TokenPageControl.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPageControl.m 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/11/23. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPageControl.h" 10 | #import "UIColor+SSRender.h" 11 | #import "NSString+Token.h" 12 | #import "TokenHybridConstant.h" 13 | #import "UIView+Attributes.h" 14 | #import "TokenXMLNode.h" 15 | 16 | @import JavaScriptCore; 17 | @implementation TokenPageControl 18 | 19 | - (instancetype)initWithFrame:(CGRect)frame 20 | { 21 | self = [super initWithFrame:frame]; 22 | if (self) { 23 | [self addTarget:self action:@selector(dotValueChanged) forControlEvents:(UIControlEventValueChanged)]; 24 | } 25 | return self; 26 | } 27 | 28 | -(void)dotValueChanged{ 29 | if (self.associatedNode) { 30 | [self.associatedNode.onClick.value callWithArguments:@[@(self.currentPage)]]; 31 | } 32 | } 33 | 34 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 35 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 36 | NSDictionary *d = dictionary; 37 | if (d[@"dotColor"]) { 38 | self.pageIndicatorTintColor = [UIColor ss_colorWithString:d[@"dotColor"]]; 39 | } 40 | if (d[@"onDotColor"]) { 41 | self.currentPageIndicatorTintColor = [UIColor ss_colorWithString:d[@"onDotColor"]]; 42 | } 43 | if (d[@"number"]) { 44 | self.numberOfPages = [d[@"number"] integerValue]; 45 | } 46 | } 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /Source/component/TokenPickerComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPickerComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/30. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | typedef void(^TokenPickerComponentSureBlock)(NSDictionary *result); 12 | @interface TokenPickerComponent : UIView 13 | +(void)showInView:(UIView *)superView 14 | data:(NSDictionary *)data 15 | sureBlock:(TokenPickerComponentSureBlock)sureBlock; 16 | @end 17 | -------------------------------------------------------------------------------- /Source/component/TokenPureComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPureComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenXMLNode; 11 | @interface TokenPureComponent : UIView 12 | @property(nonatomic ,weak) TokenXMLNode *associatedNode; 13 | -(void)applyFlexLayout; 14 | -(void)didApplyAllAttributs; 15 | @end 16 | 17 | @interface TokenTableHeaderComponent : TokenPureComponent 18 | @end 19 | 20 | @interface TokenTableFooterComponent : TokenPureComponent 21 | @end 22 | -------------------------------------------------------------------------------- /Source/component/TokenPureComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenPureComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/9. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenPureComponent.h" 10 | #import "TokenHybridConstant.h" 11 | #import 12 | 13 | typedef void(^TokenComponentEnumerateBlock)(__kindof UIView *view); 14 | 15 | @implementation TokenPureComponent 16 | 17 | -(void)didApplyAllAttributs{ 18 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridComponentDidApplyLayoutNotification object:nil]; 19 | } 20 | 21 | -(void)applyFlexLayout{ 22 | self.yoga.isEnabled = YES; 23 | [self.yoga applyLayoutPreservingOrigin:YES]; 24 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridComponentDidApplyLayoutNotification object:nil]; 25 | } 26 | 27 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ 28 | [[NSNotificationCenter defaultCenter] postNotificationName:TokenHybridEndEditingNotification object:nil]; 29 | } 30 | 31 | @end 32 | 33 | @implementation TokenTableHeaderComponent 34 | @end 35 | 36 | @implementation TokenTableFooterComponent 37 | @end 38 | 39 | 40 | -------------------------------------------------------------------------------- /Source/component/TokenScrollComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenScrollComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/10. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenScrollNode; 11 | @interface TokenScrollComponent : UIScrollView 12 | @property(nonatomic ,weak) TokenScrollNode *associatedNode; 13 | -(void)updateContentSize; 14 | @end 15 | -------------------------------------------------------------------------------- /Source/component/TokenSearchBarComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSearchBarComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/30. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSearchBarNode; 11 | @interface TokenSearchBarComponent : UISearchBar 12 | @property(nonatomic ,weak) TokenSearchBarNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TokenSegmentedComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSegmentedComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSegmentNode; 11 | @interface TokenSegmentedComponent : UISegmentedControl 12 | @property(nonatomic ,weak) TokenSegmentNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TokenSegmentedComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSegmentedComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenSegmentedComponent.h" 10 | #import "TokenXMLNode.h" 11 | #import "UIColor+SSRender.h" 12 | #import "UIView+Attributes.h" 13 | 14 | @implementation TokenSegmentedComponent 15 | 16 | -(instancetype)initWithItems:(NSArray *)items{ 17 | if (self = [super initWithItems:items]) { 18 | [self addTarget:self action:@selector(segmentValueChanged) forControlEvents:UIControlEventValueChanged]; 19 | } 20 | return self; 21 | } 22 | 23 | -(void)segmentValueChanged{ 24 | [self.associatedNode.onClick.value callWithArguments:@[@(self.selectedSegmentIndex)]]; 25 | } 26 | 27 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes shouldLayout:(BOOL)shouldLayout{ 28 | NSString *color = attributes[@"color"]; 29 | if (color) { 30 | self.tintColor = [UIColor ss_colorWithString:color]; 31 | } 32 | [super token_updateAppearanceWithCSSAttributes:attributes shouldLayout:shouldLayout]; 33 | } 34 | 35 | 36 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 37 | NSString *color = dictionary[@"color"]; 38 | if (color) { 39 | self.tintColor = [UIColor ss_colorWithString:color]; 40 | } 41 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 42 | } 43 | @end 44 | -------------------------------------------------------------------------------- /Source/component/TokenSwitchComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSwitchComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenSwitchNode; 11 | @interface TokenSwitchComponent : UISwitch 12 | @property(nonatomic ,weak) TokenSwitchNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TokenSwitchComponent.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenSwitchComponent.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/29. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenSwitchComponent.h" 10 | #import "TokenXMLNode.h" 11 | #import "UIColor+SSRender.h" 12 | #import "UIView+Attributes.h" 13 | 14 | @implementation TokenSwitchComponent 15 | 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | [self addTarget:self action:@selector(onValueChanged) forControlEvents:UIControlEventValueChanged]; 21 | } 22 | return self; 23 | } 24 | 25 | -(void)onValueChanged{ 26 | [self.associatedNode.onClick.value callWithArguments:@[@(self.isOn)]]; 27 | } 28 | 29 | -(void)token_updateAppearanceWithCSSAttributes:(NSDictionary *)attributes shouldLayout:(BOOL)shouldLayout{ 30 | NSDictionary *d = attributes; 31 | NSString *color = d[@"color"]; 32 | if (color) { self.tintColor = [UIColor ss_colorWithString:color];} 33 | [super token_updateAppearanceWithCSSAttributes:d shouldLayout:shouldLayout]; 34 | } 35 | 36 | -(void)token_updateAppearanceWithNormalDictionary:(NSDictionary *)dictionary{ 37 | NSDictionary *d = dictionary; 38 | NSString *color = d[@"color"]; 39 | if (color) { self.tintColor = [UIColor ss_colorWithString:color];} 40 | NSString *onColor = d[@"onColor"]; 41 | if (onColor) { self.onTintColor = [UIColor ss_colorWithString:onColor];} 42 | [super token_updateAppearanceWithNormalDictionary:dictionary]; 43 | } 44 | @end 45 | -------------------------------------------------------------------------------- /Source/component/TokenTextAreaComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenTextAreaComponent.h 3 | // MyWHUT 4 | // 5 | // Created by 陈雄 on 2017/10/25. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenTextAreaNode; 11 | @interface TokenTextAreaComponent : UITextView 12 | @property(nonatomic ,weak) TokenTextAreaNode *associatedNode; 13 | @end 14 | -------------------------------------------------------------------------------- /Source/component/TokenWebViewComponent.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenWebViewComponent.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/5. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import WebKit; 11 | @class TokenWebViewNode; 12 | @interface TokenWebViewComponent : UIView 13 | @property(nonatomic ,weak ) TokenWebViewNode *associatedNode; 14 | @property(nonatomic ,strong) WKWebView *webView; 15 | -(void)loadURL:(NSString *)url; 16 | -(void)goBack; 17 | -(void)goForward; 18 | -(void)reload; 19 | -(void)stopLoading; 20 | -(void)setUA:(NSString *)UA; 21 | @end 22 | -------------------------------------------------------------------------------- /Source/model/TokenAssociateContext.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenAssociateContext.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenHybridRenderController,TokenHybridRenderView,TokenJSContext,TokenViewBuilder; 12 | @interface TokenAssociateContext : NSObject 13 | @property(nonatomic ,weak ) TokenHybridRenderController *currentAssociateController; 14 | @property(nonatomic ,weak ) TokenHybridRenderView *currentAssociateView; 15 | @property(nonatomic ,weak ) TokenViewBuilder *currentAssociateViewBuilder; 16 | @property(nonatomic ,assign) Class associateViewPushControllerClass; 17 | @end 18 | -------------------------------------------------------------------------------- /Source/model/TokenAssociateContext.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenAssociateContext.m 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/12/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenAssociateContext.h" 10 | 11 | @implementation TokenAssociateContext 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /Source/model/TokenDocument.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHTMLDocument.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @class TokenXMLNode,TokenJSContext; 12 | @interface TokenDocument : NSObject 13 | @property(nonatomic ,copy ) NSString *html; 14 | @property(nonatomic ,copy ) NSString *sourceURL; 15 | @property(nonatomic ,strong) TokenXMLNode *rootNode; 16 | @property(nonatomic ,strong) NSArray *cssRules; 17 | @property(nonatomic ,strong) NSArray *scripts; 18 | @property(nonatomic ,strong) NSArray *downloadFailCSSURLs; 19 | @property(nonatomic ,strong) NSArray *downloadFailScriptURLs; 20 | 21 | @property(nonatomic ,weak) TokenXMLNode *bodyNode; 22 | @property(nonatomic ,weak) TokenXMLNode *headNode; 23 | @property(nonatomic ,weak) TokenXMLNode *titleNode; 24 | @property(nonatomic ,weak) TokenXMLNode *navigationBarNode; 25 | 26 | @property(nonatomic ,weak) TokenJSContext *jsContext; 27 | 28 | -(void)addCSSRuels:(NSDictionary *)rules; 29 | -(void)addJavaScript:(NSString *)script; 30 | -(void)addFailedCSSURL:(NSString *)url; 31 | -(void)addFailedScriptURL:(NSString *)url; 32 | @end 33 | -------------------------------------------------------------------------------- /Source/parser/TokenCSSParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenCSSParser.h 3 | // TokenHTMLRender 4 | // 5 | // Created by 陈雄 on 2017/9/19. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import UIKit; 11 | @class TokenXMLNode; 12 | @interface TokenCSSParser : NSObject 13 | +(NSDictionary *)converAttrStringToDictionary:(NSString *)attrString 14 | containerViewWidth:(CGFloat)containerViewWidth 15 | containerViewHeight:(CGFloat)containerViewHeight; 16 | 17 | +(NSDictionary *)parserCSSWithString:(NSString *)cssString 18 | containerViewWidth:(CGFloat)containerViewWidth 19 | containerViewHeight:(CGFloat)containerViewHeight; 20 | 21 | //将CSS 选择器和 node进行匹配 22 | +(NSSet *)matchNodesWithRootNode:(TokenXMLNode *)node 23 | selector:(NSString *)selector; 24 | @end 25 | -------------------------------------------------------------------------------- /Source/parser/TokenXMLParser.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenXMLParser.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import UIKit; 12 | @class TokenXMLParser,TokenXMLNode; 13 | @protocol TokenXMLParserDelegate 14 | @optional 15 | -(void)parserDidStart; 16 | -(void)parser:(TokenXMLParser *)parser didStartNodeWithinBodyNode:(TokenXMLNode *)node; 17 | -(void)parser:(TokenXMLParser *)parser didEndNodeWithinBodyNode:(TokenXMLNode *)node; 18 | -(void)parser:(TokenXMLParser *)parser didCreatHeadNode:(TokenXMLNode *)node; 19 | -(void)parser:(TokenXMLParser *)parser didCreatTitleNode:(TokenXMLNode *)node; 20 | -(void)parser:(TokenXMLParser *)parser didCreatNavigationBarNode:(TokenXMLNode *)node; 21 | -(void)parser:(TokenXMLParser *)parser didCreatRootNode:(TokenXMLNode *)node; 22 | -(void)parser:(TokenXMLParser *)parser nodeContainInnerCSSStyle:(NSSet *)nodes; 23 | -(void)parserDidEnd; 24 | -(void)parserErrorOccurred:(NSError *)error; 25 | @end 26 | 27 | @interface TokenXMLParser : NSObject 28 | @property(nonatomic ,weak) id delegate; 29 | @property(nonatomic ,copy) NSString *identifier; 30 | @property(nonatomic ,assign) CGRect bodyViewFrame; 31 | -(instancetype)init NS_UNAVAILABLE; 32 | -(instancetype)initWithBodyViewFrame:(CGRect)frame; 33 | -(void)parserHTML:(NSString *)html; 34 | -(void)stopParsing; 35 | @end 36 | -------------------------------------------------------------------------------- /Source/tool/TokenHybridConstant.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridConstant.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | FOUNDATION_EXTERN NSString * const TokenHybridComponentDidApplyLayoutNotification; 12 | FOUNDATION_EXTERN NSString * const TokenHybridEndEditingNotification; 13 | FOUNDATION_EXTERN NSString * const TokenHybridPageDisappearNotification; 14 | 15 | -------------------------------------------------------------------------------- /Source/tool/TokenHybridConstant.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridConstant.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/10/14. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenHybridConstant.h" 10 | 11 | NSString *const TokenHybridComponentDidApplyLayoutNotification = @"TokenHybridComponentDidApplyLayoutNotification"; 12 | NSString *const TokenHybridEndEditingNotification = @"TokenHybridEndEditingNotification"; 13 | NSString *const TokenHybridPageDisappearNotification = @"TokenHybridPageDisappearNotification"; 14 | -------------------------------------------------------------------------------- /Source/tool/TokenHybridOrganizer.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridOrganizer.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @class TokenNodeComponentRegister; 11 | @import UIKit; 12 | @interface TokenHybridOrganizer : NSObject 13 | @property(nonatomic ,strong) TokenNodeComponentRegister *nodeComponentRegister; 14 | +(TokenHybridOrganizer *)sharedOrganizer; 15 | -(void)addPageDefaultWithSuiteName:(NSString *)name; 16 | -(void)clearAllPageDefaultsData; 17 | @end 18 | -------------------------------------------------------------------------------- /Source/tool/TokenHybridStack.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridStack.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface TokenHybridStack: NSObject 12 | @property(nonatomic ,assign,readonly) NSInteger count; 13 | -(void)push:(id)obj; 14 | -(id)pop; 15 | -(id)top; 16 | @end 17 | -------------------------------------------------------------------------------- /Source/tool/TokenHybridStack.m: -------------------------------------------------------------------------------- 1 | // 2 | // TokenHybridStack.m 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/9/26. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import "TokenHybridStack.h" 10 | 11 | @interface TokenHybridStack() 12 | @property(nonatomic ,strong) NSMutableArray *array; 13 | @end 14 | 15 | @implementation TokenHybridStack 16 | - (instancetype)init 17 | { 18 | self = [super init]; 19 | if (self) { 20 | _array = @[].mutableCopy; 21 | } 22 | return self; 23 | } 24 | 25 | -(void)push:(id)obj{ 26 | [_array addObject:obj]; 27 | } 28 | 29 | -(id)pop{ 30 | id obj; 31 | if (_array.count) { 32 | obj = [_array lastObject]; 33 | [_array removeLastObject]; 34 | } 35 | return obj; 36 | } 37 | 38 | -(id)top{ 39 | return [_array lastObject]; 40 | } 41 | 42 | -(NSInteger)count{ 43 | return _array.count; 44 | } 45 | @end 46 | -------------------------------------------------------------------------------- /Source/tool/TokenNodeComponentRegister.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenNodeComponentRegister.h 3 | // HybridDemo 4 | // 5 | // Created by 陈雄 on 2017/11/5. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @import UIKit; 12 | @class TokenXMLNode; 13 | 14 | typedef __kindof UIView *(^TokenHybridComponentCreatBlock)(__kindof TokenXMLNode *node); 15 | 16 | @interface TokenHybridRegisterModel : NSObject 17 | @property(nonatomic ,copy ) NSString *nodeTagName; 18 | @property(nonatomic ,copy ) NSString *nodeClassName; 19 | @property(nonatomic ,assign) NSString *nativeComponentClassName; 20 | @property(nonatomic ,assign) BOOL customInit; 21 | @property(nonatomic ,copy ) TokenHybridComponentCreatBlock creatProcess; 22 | 23 | -(instancetype)initWithNodeTagName:(NSString *)nodeTagName 24 | nodeClassName:(NSString *)nodeClassName 25 | nativeComponentClassName:(NSString *)nativeComponentClassName 26 | creatProcess:(TokenHybridComponentCreatBlock)creatProcess; 27 | -(__kindof TokenXMLNode *)creatNode; 28 | -(__kindof UIView *)creatNativeComponentWithNode:(__kindof TokenXMLNode *)node; 29 | @end 30 | 31 | @interface TokenNodeComponentRegister : NSObject 32 | -(void)registDefault; 33 | -(void)registComponentWithModel:(TokenHybridRegisterModel *)model; 34 | -(TokenHybridRegisterModel *)getRegisterModelWithNodeTagName:(NSString *)nodeTagName; 35 | @end 36 | -------------------------------------------------------------------------------- /Source/tool/TokenViewBuilder.h: -------------------------------------------------------------------------------- 1 | // 2 | // TokenViewBuilder.h 3 | // TokenHybrid 4 | // 5 | // Created by 陈雄 on 2017/11/8. 6 | // Copyright © 2017年 com.feelings. All rights reserved. 7 | // 8 | 9 | #import 10 | @import UIKit; 11 | @class TokenDocument, 12 | TokenXMLNode, 13 | TokenPureComponent, 14 | TokenViewBuilder, 15 | TokenJSContext; 16 | 17 | @protocol TokenViewBuilderDelegate 18 | @optional 19 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didFetchTitle:(NSString *)title; 20 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder parserErrorOccurred:(NSError *)error; 21 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didCreatNavigationBarNode:(TokenXMLNode *)node; 22 | -(void)viewBuilder:(TokenViewBuilder *)viewBuilder didCreatBodyView:(TokenPureComponent *)view; 23 | -(void)viewBuilderWillRunScript; 24 | @end 25 | 26 | @interface TokenViewBuilder : NSObject 27 | @property(nonatomic ,strong) TokenDocument *document; 28 | @property(nonatomic ,strong) TokenPureComponent *bodyView; 29 | @property(nonatomic ,strong) TokenJSContext *jsContext; 30 | @property(nonatomic ,strong) NSUserDefaults *currentPageDefaults; 31 | @property(nonatomic ,weak ) id delegate; 32 | @property(nonatomic ,assign) BOOL useCache; 33 | @property(nonatomic ,assign) CGRect bodyViewFrame; 34 | -(instancetype)init NS_UNAVAILABLE; 35 | -(instancetype)initWithBodyViewFrame:(CGRect)frame; 36 | -(void)buildViewWithSourceURL:(NSString *)url; 37 | -(void)refreshView; 38 | @end 39 | -------------------------------------------------------------------------------- /TokenHybrid.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "TokenHybrid" 3 | s.version = "1.0.7" 4 | s.summary = "A tool to build hybrid app" 5 | s.description = "A tool help you build native app with html,css,js and build hybrid app without a server for independent developer" 6 | s.homepage = 'https://github.com/cx478815108/TokenHybrid' 7 | s.license = { :type => 'MIT', :file => 'LICENSE' } 8 | s.author = { 'chenxiong' => 'feelings0811@wutnews.net' } 9 | s.source = { :git => 'https://github.com/cx478815108/TokenHybrid.git', :tag => 'v1.0.7' } 10 | 11 | s.ios.deployment_target = '9.0' 12 | s.requires_arc = true 13 | 14 | s.source_files = "Source/**/*.{h,m}" 15 | s.resources = 'Source/JavaScriptSupport/Scripts/TokenBase.js' 16 | s.frameworks = 'Foundation', 'UIKit', 'JavaScriptCore' 17 | s.dependency "YogaKit" 18 | s.dependency "SDWebImage" 19 | s.dependency "MJRefresh" 20 | s.dependency "UITableView+FDTemplateLayoutCell" 21 | s.dependency "TokenNetworking" 22 | end 23 | -------------------------------------------------------------------------------- /screenshots/code.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cx478815108/TokenHybrid/e63b6d6613777804edb1720d8387aa1f59a1170a/screenshots/code.png -------------------------------------------------------------------------------- /screenshots/example.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/cx478815108/TokenHybrid/e63b6d6613777804edb1720d8387aa1f59a1170a/screenshots/example.gif --------------------------------------------------------------------------------