├── .gitignore
├── OpenICloud
├── LICENSE
├── README.md
├── fileOpen.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── fileOpen
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Document.h
│ ├── Document.m
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ ├── fileOpen.entitlements
│ ├── iCloudManager.h
│ ├── iCloudManager.m
│ └── main.m
├── PIPVideo
└── PIPVideo
│ ├── PIPVideo.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── PIPVideo
│ ├── 282.mp4
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ └── Slider
│ │ ├── Contents.json
│ │ ├── iconfont-back.imageset
│ │ ├── Contents.json
│ │ └── iconfont-back.png
│ │ ├── iconfont-yuan1.imageset
│ │ ├── Contents.json
│ │ └── iconfont-yuan1@2x.png
│ │ ├── nextPlayer.imageset
│ │ ├── Contents.json
│ │ └── nextPlayer.png
│ │ ├── pauseBtn.imageset
│ │ ├── Contents.json
│ │ └── pauseBtn.png
│ │ └── playBtn.imageset
│ │ ├── Contents.json
│ │ └── playBtn@2x.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── VideoView
│ ├── ControlNavigation
│ │ ├── VideoNaviView.h
│ │ └── VideoNaviView.m
│ ├── ControlView
│ │ ├── VideoControlView.h
│ │ ├── VideoControlView.m
│ │ ├── VideoSliderView.h
│ │ └── VideoSliderView.m
│ ├── PIPControllerDelegate
│ │ ├── VideoPIPViewControllerDelegate.h
│ │ └── VideoPIPViewControllerDelegate.m
│ ├── VideoHandler
│ │ ├── VideoTaphandler.h
│ │ └── VideoTaphandler.m
│ ├── VideoPlayerController.h
│ ├── VideoPlayerController.m
│ ├── VideoUtilities.h
│ └── VideoView
│ │ ├── VideoView.h
│ │ └── VideoView.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── UIColllectionView
└── UICollectionView
│ ├── UICollectionView.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── UICollectionView
│ ├── Animate
│ ├── AnimateFlowLayout.h
│ ├── AnimateFlowLayout.m
│ ├── AnimateViewController.h
│ └── AnimateViewController.m
│ ├── Assets.xcassets
│ ├── 01.imageset
│ │ ├── 01.jpg
│ │ └── Contents.json
│ ├── 02.imageset
│ │ ├── 02.jpg
│ │ └── Contents.json
│ ├── 03.imageset
│ │ ├── 03.jpg
│ │ └── Contents.json
│ ├── 04.imageset
│ │ ├── 04.jpg
│ │ └── Contents.json
│ ├── 05.imageset
│ │ ├── 05.jpg
│ │ └── Contents.json
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── currentPage.imageset
│ │ ├── Contents.json
│ │ └── currentPage.jpg
│ └── otherPage.imageset
│ │ ├── Contents.json
│ │ └── otherPage.jpg
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Basic
│ ├── AppDelegate.h
│ └── AppDelegate.m
│ ├── CollectionViewAnimate
│ ├── OSCardViewLayout.h
│ └── OSCardViewLayout.m
│ ├── DrawCollection
│ ├── DrawCollectionViewController.h
│ ├── DrawCollectionViewController.m
│ ├── ShuffingFlowLayout.h
│ ├── ShuffingFlowLayout.m
│ ├── ShufflingView.h
│ └── ShufflingView.m
│ ├── Info.plist
│ ├── UICollectionScrollHeader
│ ├── GZIMCarousel.h
│ ├── GZIMCarousel.m
│ ├── GZIMCarouselHeader.h
│ ├── GZIMCarouselProtocol.h
│ ├── GZIMFlowLayout.h
│ └── GZIMFlowLayout.m
│ ├── UICollectionView
│ ├── Cell
│ │ ├── GZIMWorkspaceHeader.h
│ │ ├── GZIMWorkspaceHeader.m
│ │ ├── GZIMWorkspaceItemCell.h
│ │ ├── GZIMWorkspaceItemCell.m
│ │ ├── GZIMWorkspaceSectionFoot.h
│ │ └── GZIMWorkspaceSectionFoot.m
│ ├── CollectionViewController.h
│ ├── CollectionViewController.m
│ ├── GZIMCollectionViewController.h
│ ├── GZIMCollectionViewController.m
│ ├── MainViewController.h
│ ├── MainViewController.m
│ ├── UIScrollHeaderViewController.h
│ └── UIScrollHeaderViewController.m
│ ├── UIPageControl
│ ├── CustomPageControl.h
│ ├── CustomPageControl.m
│ ├── GZIMAnimatedPageControl.h
│ ├── GZIMAnimatedPageControl.m
│ ├── GZIMPageControl.h
│ ├── GZIMPageControl.m
│ ├── UIView+GZCSAddition.h
│ └── UIView+GZCSAddition.m
│ └── main.m
├── UIScrollViewScrollTop
├── UIScrollViewScrollTop.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── UIScrollViewScrollTop
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── GZCCarDetailScrollTop.h
│ ├── GZCCarDetailScrollTop.m
│ ├── Info.plist
│ ├── NSString+GZIMEncode.h
│ ├── NSString+GZIMEncode.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── UNRecognisedSelector
└── UNRecognisedSelector
│ ├── UNRecognisedSelector.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── UNRecognisedSelector
│ ├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Basic
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── ViewController.h
│ └── ViewController.m
│ ├── Enity
│ ├── Father.h
│ ├── Father.m
│ ├── Fuck.h
│ ├── Fuck.m
│ ├── Son.h
│ └── Son.m
│ ├── Info.plist
│ ├── Main
│ ├── MainViewController.h
│ └── MainViewController.m
│ └── main.m
├── WKWebView
├── Podfile
├── WKWebView.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
└── WKWebView
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ ├── Contents.json
│ ├── More
│ │ ├── Contents.json
│ │ ├── more_open_collection.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_collection@2x.png
│ │ │ └── more_open_collection@3x.png
│ │ ├── more_open_copy.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_copy@2x.png
│ │ │ └── more_open_copy@3x.png
│ │ ├── more_open_friend.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_friend@2x.png
│ │ │ └── more_open_friend@3x.png
│ │ ├── more_open_gg.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_gg@2x.png
│ │ │ └── more_open_gg@3x.png
│ │ ├── more_open_refresh.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_refresh@2x.png
│ │ │ └── more_open_refresh@3x.png
│ │ ├── more_open_safari.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_safari@2x.png
│ │ │ └── more_open_safari@3x.png
│ │ └── more_open_wechat.imageset
│ │ │ ├── Contents.json
│ │ │ ├── more_open_wechat@2x.png
│ │ │ └── more_open_wechat@3x.png
│ ├── foot_forward_normal.imageset
│ │ ├── Contents.json
│ │ ├── foot_forward_normal@2x.png
│ │ └── foot_forward_normal@3x.png
│ ├── foot_forward_selected.imageset
│ │ ├── Contents.json
│ │ ├── foot_forward_selected@2x.png
│ │ └── foot_forward_selected@3x.png
│ ├── foot_goback_normal.imageset
│ │ ├── Contents.json
│ │ ├── foot_goback_normal@2x.png
│ │ └── foot_goback_normal@3x.png
│ ├── foot_goback_selected.imageset
│ │ ├── Contents.json
│ │ ├── foot_goback_selected@2x.png
│ │ └── foot_goback_selected@3x.png
│ ├── nav_close_icon.imageset
│ │ ├── Contents.json
│ │ └── nav_close_icon@2x.png
│ └── nav_more_icon.imageset
│ │ ├── Contents.json
│ │ ├── nav_more_icon@2x.png
│ │ └── nav_more_icon@3x.png
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── BottomTabBar
│ ├── GZIMFootNavigationView.h
│ ├── GZIMFootNavigationView.m
│ ├── WKWebViewController.h
│ └── WKWebViewController.m
│ ├── Info.plist
│ ├── MainViewController.h
│ ├── MainViewController.m
│ ├── MoreTable
│ ├── GZIMSheetOpenCell.h
│ ├── GZIMSheetOpenCell.m
│ ├── GZIMSheetOpenEntity.h
│ ├── GZIMSheetOpenEntity.m
│ ├── GZIMSheetOpenView.h
│ └── GZIMSheetOpenView.m
│ ├── NavigationViewController.h
│ ├── NavigationViewController.m
│ ├── UIViewController+GZIMNavigationPopHandler.h
│ ├── UIViewController+GZIMNavigationPopHandler.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── edit-uitableview
└── edit-uitableview
│ ├── edit-uitableview.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── edit-uitableview
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
├── push
└── bash_profile_self
│ ├── alias.sh
│ ├── gpush
│ └── test.sh
├── rate-screen-旋转
└── rate-screen
│ ├── rate-screen.xcodeproj
│ ├── project.pbxproj
│ └── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ └── IDEWorkspaceChecks.plist
│ └── rate-screen
│ ├── 123.mp4
│ ├── AppDelegate.h
│ ├── AppDelegate.m
│ ├── Assets.xcassets
│ ├── AppIcon.appiconset
│ │ └── Contents.json
│ └── Contents.json
│ ├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
│ ├── Info.plist
│ ├── MainViewController.h
│ ├── MainViewController.m
│ ├── VideoView.h
│ ├── VideoView.m
│ ├── ViewController.h
│ ├── ViewController.m
│ └── main.m
└── wechatShare
└── wechatShare
├── Podfile
├── Podfile.lock
├── Pods
├── Headers
│ ├── Private
│ │ └── WechatOpenSDK
│ │ │ ├── WXApi.h
│ │ │ ├── WXApiObject.h
│ │ │ └── WechatAuthSDK.h
│ └── Public
│ │ ├── TencentOpenAPI
│ │ └── TencentOpenAPI
│ │ │ ├── QQApiInterface.h
│ │ │ ├── QQApiInterfaceObject.h
│ │ │ ├── TencentApiInterface.h
│ │ │ ├── TencentMessageObject.h
│ │ │ ├── TencentOAuth.h
│ │ │ ├── TencentOAuthObject.h
│ │ │ └── sdkdef.h
│ │ └── WechatOpenSDK
│ │ ├── WXApi.h
│ │ ├── WXApiObject.h
│ │ └── WechatAuthSDK.h
├── Manifest.lock
├── Pods.xcodeproj
│ └── project.pbxproj
├── Target Support Files
│ └── Pods-wechatShare
│ │ ├── Pods-wechatShare-acknowledgements.markdown
│ │ ├── Pods-wechatShare-acknowledgements.plist
│ │ ├── Pods-wechatShare-dummy.m
│ │ ├── Pods-wechatShare-frameworks.sh
│ │ ├── Pods-wechatShare-resources.sh
│ │ ├── Pods-wechatShare.debug.xcconfig
│ │ └── Pods-wechatShare.release.xcconfig
├── TencentOpenAPI
│ ├── LICENSE
│ ├── README.md
│ ├── TencentOpenAPI.framework
│ │ ├── Headers
│ │ │ ├── QQApiInterface.h
│ │ │ ├── QQApiInterfaceObject.h
│ │ │ ├── TencentApiInterface.h
│ │ │ ├── TencentMessageObject.h
│ │ │ ├── TencentOAuth.h
│ │ │ ├── TencentOAuthObject.h
│ │ │ └── sdkdef.h
│ │ ├── Resources
│ │ │ └── ios_open_sdk_3.2.2.500_iphone_release
│ │ └── TencentOpenAPI
│ └── TencentOpenApi_IOS_Bundle.bundle
│ │ ├── Info.plist
│ │ ├── error.png
│ │ ├── local.html
│ │ ├── qqicon.png
│ │ └── success.png
└── WechatOpenSDK
│ └── WeChatSDK1.8.3
│ ├── WXApi.h
│ ├── WXApiObject.h
│ ├── WechatAuthSDK.h
│ └── libWeChatSDK.a
├── wechatShare.xcodeproj
├── project.pbxproj
└── project.xcworkspace
│ └── contents.xcworkspacedata
├── wechatShare.xcworkspace
└── contents.xcworkspacedata
└── wechatShare
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
├── 123.imageset
│ ├── 123@2x.png
│ └── Contents.json
├── AppIcon.appiconset
│ └── Contents.json
├── Contents.json
└── world.imageset
│ ├── Contents.json
│ └── world.jpg
├── Base.lproj
├── LaunchScreen.storyboard
└── Main.storyboard
├── Info.plist
├── ViewController.h
├── ViewController.m
├── info
├── OSQQShareSDK.h
├── OSQQShareSDK.m
├── OSShareHelper.h
├── OSShareHelper.m
├── OSWeChatShareSDK.h
└── OSWeChatShareSDK.m
└── main.m
/.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/**/*.png
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 |
--------------------------------------------------------------------------------
/OpenICloud/README.md:
--------------------------------------------------------------------------------
1 | # iOS-openICloud
2 | 第三方应用打开文件app
3 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
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 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/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 | }
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/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 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/Document.h:
--------------------------------------------------------------------------------
1 | //
2 | // Document.h
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Document : UIDocument
12 | @property (nonatomic, strong) NSData *data;
13 | @end
14 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/Document.m:
--------------------------------------------------------------------------------
1 | //
2 | // Document.m
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "Document.h"
10 |
11 | @implementation Document
12 | - (BOOL)loadFromContents:(id)contents ofType:(NSString *)typeName error:(NSError * _Nullable __autoreleasing *)outError {
13 |
14 | self.data = contents;
15 |
16 | return YES;
17 | }
18 | @end
19 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | LSSupportsOpeningDocumentsInPlace
24 |
25 | UIFileSharingEnabled
26 |
27 | UILaunchStoryboardName
28 | LaunchScreen
29 | UIMainStoryboardFile
30 | Main
31 | UIRequiredDeviceCapabilities
32 |
33 | armv7
34 |
35 | UISupportedInterfaceOrientations
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | UISupportedInterfaceOrientations~ipad
42 |
43 | UIInterfaceOrientationPortrait
44 | UIInterfaceOrientationPortraitUpsideDown
45 | UIInterfaceOrientationLandscapeLeft
46 | UIInterfaceOrientationLandscapeRight
47 |
48 |
49 |
50 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/fileOpen.entitlements:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | aps-environment
6 | development
7 | com.apple.developer.icloud-container-identifiers
8 |
9 | iCloud.$(CFBundleIdentifier)
10 |
11 | com.apple.developer.icloud-services
12 |
13 | CloudDocuments
14 | CloudKit
15 |
16 | com.apple.developer.ubiquity-container-identifiers
17 |
18 | iCloud.$(CFBundleIdentifier)
19 |
20 | com.apple.developer.ubiquity-kvstore-identifier
21 | $(TeamIdentifierPrefix)$(CFBundleIdentifier)
22 |
23 |
24 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/iCloudManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // iCloudManager.h
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef void(^downloadBlock)(id obj);
12 |
13 | @interface iCloudManager : NSObject
14 |
15 | + (BOOL)iCloudEnable;
16 |
17 | + (void)downloadWithDocumentURL:(NSURL*)url callBack:(downloadBlock)block;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/iCloudManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // iCloudManager.m
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "iCloudManager.h"
10 | #import "Document.h"
11 |
12 | @implementation iCloudManager
13 |
14 | + (BOOL)iCloudEnable {
15 | NSFileManager *manager = [NSFileManager defaultManager];
16 | NSURL *url = [manager URLForUbiquityContainerIdentifier:nil];
17 | if (url != nil) {
18 | return YES;
19 | }
20 | NSLog(@"iCloud 不可用");
21 | UIAlertView * alert = [[UIAlertView alloc] initWithTitle:@"icloud" message:@"iCloud 不可用" delegate:nil cancelButtonTitle:@"取消" otherButtonTitles:@"确定", nil];
22 | [alert show];
23 | return NO;
24 | }
25 |
26 | + (void)downloadWithDocumentURL:(NSURL*)url callBack:(downloadBlock)block {
27 | Document *iCloudDoc = [[Document alloc]initWithFileURL:url];
28 |
29 | [iCloudDoc openWithCompletionHandler:^(BOOL success) {
30 | if (success) {
31 |
32 | [iCloudDoc closeWithCompletionHandler:^(BOOL success) {
33 | NSLog(@"关闭成功");
34 | }];
35 |
36 | if (block) {
37 | block(iCloudDoc.data);
38 | }
39 |
40 | }
41 | }];
42 | }
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/OpenICloud/fileOpen/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // fileOpen
4 | //
5 | // Created by zzg on 2018/11/6.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/282.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/282.mp4
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
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 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-back.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "iconfont-back.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-back.imageset/iconfont-back.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-back.imageset/iconfont-back.png
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-yuan1.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "iconfont-yuan1@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-yuan1.imageset/iconfont-yuan1@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/iconfont-yuan1.imageset/iconfont-yuan1@2x.png
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/nextPlayer.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "nextPlayer.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/nextPlayer.imageset/nextPlayer.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/nextPlayer.imageset/nextPlayer.png
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/pauseBtn.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "pauseBtn.png",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/pauseBtn.imageset/pauseBtn.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/pauseBtn.imageset/pauseBtn.png
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/playBtn.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "playBtn@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/playBtn.imageset/playBtn@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/PIPVideo/PIPVideo/PIPVideo/Assets.xcassets/Slider/playBtn.imageset/playBtn@2x.png
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/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 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleDisplayName
8 | 画中画
9 | CFBundleExecutable
10 | $(EXECUTABLE_NAME)
11 | CFBundleIdentifier
12 | $(PRODUCT_BUNDLE_IDENTIFIER)
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | $(PRODUCT_NAME)
17 | CFBundlePackageType
18 | APPL
19 | CFBundleShortVersionString
20 | 1.0
21 | CFBundleVersion
22 | 1
23 | LSRequiresIPhoneOS
24 |
25 | UIBackgroundModes
26 |
27 | audio
28 |
29 | UILaunchStoryboardName
30 | LaunchScreen
31 | UIMainStoryboardFile
32 | Main
33 | UIRequiredDeviceCapabilities
34 |
35 | armv7
36 |
37 | UISupportedInterfaceOrientations
38 |
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 | UIInterfaceOrientationPortrait
42 |
43 | UISupportedInterfaceOrientations~ipad
44 |
45 | UIInterfaceOrientationPortrait
46 | UIInterfaceOrientationPortraitUpsideDown
47 | UIInterfaceOrientationLandscapeLeft
48 | UIInterfaceOrientationLandscapeRight
49 |
50 |
51 |
52 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/ControlNavigation/VideoNaviView.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoNaviView.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface VideoNaviView : UIView
12 |
13 | @property (nonatomic, strong) NSString *title;
14 |
15 | @property (nonatomic, strong) UIButton *backButton;
16 |
17 | @property (nonatomic, strong) UIButton *pipButton;
18 |
19 |
20 | @end
21 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/ControlView/VideoControlView.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoControlView.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | /* 底部操作台 */
10 | #import
11 | #import "VideoSliderView.h"
12 |
13 |
14 | #define kVideoControlHeight 55
15 | #define kVideoSlideHeight 6.0
16 |
17 | @interface VideoControlView : UIView
18 |
19 | @property (nonatomic, assign) NSTimeInterval currentTime;
20 | @property (nonatomic, assign) NSTimeInterval duration;
21 |
22 | @property (nonatomic, strong) VideoSliderView * slideView;
23 | @property (nonatomic, strong) UILabel * currentTimeLabel;
24 |
25 | @property (nonatomic, strong) UIButton * playButton;
26 | @property (nonatomic, strong) UIButton * forwardButton;
27 | @property (nonatomic, strong) UIProgressView * progress; //缓冲
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/ControlView/VideoSliderView.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoSliderView.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @class VideoSliderView;
13 |
14 | @protocol VideoSliderViewDelegate
15 |
16 | @optional
17 |
18 | - (void)videoSlideViewDidTap:(VideoSliderView *)slideView;
19 |
20 | /**
21 | 开始
22 |
23 | @param slideView VideoSliderView
24 | */
25 | - (void)videoSlideViewDidBeginDragging:(VideoSliderView *)slideView;
26 |
27 | /**
28 | 正在
29 |
30 | @param slideView VideoSliderView
31 | */
32 | - (void)videoSlideViewDidDragging:(VideoSliderView *)slideView;
33 |
34 | /**
35 | 结束
36 |
37 | @param slideView VideoSliderView
38 | */
39 | - (void)videoSlideViewDidEndDragging:(VideoSliderView *)slideView;
40 |
41 | @end
42 |
43 | @interface VideoSliderView : UIView
44 |
45 | /* slider对象 */
46 | @property (nonatomic, strong) UISlider * slider;
47 |
48 | @property (nonatomic, assign) CGFloat value;
49 |
50 | @property (nonatomic, weak) id delegate;
51 |
52 |
53 | - (void)setMaximumTrackImage:(UIImage *)image forState:(UIControlState)state;
54 |
55 | @end
56 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/PIPControllerDelegate/VideoPIPViewControllerDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoPIPViewControllerDelegate.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/15.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 | #import "VideoView.h"
12 |
13 | @interface VideoPIPViewControllerDelegate : NSObject
14 |
15 | @property (nonatomic, strong) VideoView * view;
16 |
17 |
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/VideoHandler/VideoTaphandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoTaphandler.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/15.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | @class VideoView;
11 |
12 | @interface VideoTaphandler : NSObject
13 |
14 | @property (nonatomic, readonly) VideoView * view;
15 |
16 | - (instancetype)initTapHandlerWithView:(VideoView *)view;
17 |
18 | - (void)invalidate;
19 | @end
20 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/VideoHandler/VideoTaphandler.m:
--------------------------------------------------------------------------------
1 | //
2 | // VideoTaphandler.m
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/15.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "VideoTaphandler.h"
10 | #import "VideoView.h"
11 |
12 | @interface VideoTaphandler()
13 |
14 | @property (nonatomic) UITapGestureRecognizer *singleTap;
15 |
16 | @property (nonatomic) UITapGestureRecognizer *doubleTap;
17 |
18 | @end
19 |
20 | @implementation VideoTaphandler
21 |
22 | - (instancetype)initTapHandlerWithView:(VideoView *)view
23 | {
24 | self = [super init];
25 | if (self) {
26 | _view = view;
27 |
28 | _singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapAction:)];
29 | _doubleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapAction:)];
30 |
31 | _singleTap.delegate = self;
32 | _doubleTap.delegate = self;
33 |
34 | [_singleTap requireGestureRecognizerToFail:_doubleTap];
35 | _doubleTap.numberOfTapsRequired = 2;
36 | [_view addGestureRecognizer:_singleTap];
37 | [_view addGestureRecognizer:_doubleTap];
38 | }
39 | return self;
40 | }
41 |
42 | #pragma mark 设置手势事件
43 | - (void)singleTapAction:(UITapGestureRecognizer *)sender {
44 | [_view showActionView];
45 | NSLog(@"----tapAction");
46 | }
47 |
48 | - (void)doubleTapAction:(UITapGestureRecognizer *)sender {
49 | [_view playOrPause];
50 | NSLog(@"----doubleTapAction");
51 | }
52 |
53 | - (void)invalidate {
54 | _singleTap.delegate = nil;
55 | _doubleTap.delegate = nil;
56 |
57 | [_view removeGestureRecognizer:_singleTap];
58 | [_view removeGestureRecognizer:_doubleTap];
59 | }
60 |
61 | #pragma mark -
62 | #pragma mark UIGestureRecognizerDelegate
63 |
64 | - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
65 | CGPoint point = [gestureRecognizer locationInView:self.view];
66 | BOOL inControlView = CGRectContainsPoint(_view.controlView.frame, point);
67 | BOOL inNaviView = CGRectContainsPoint(_view.naviBack.frame, point);
68 | return !(inControlView) && !(inNaviView);
69 | }
70 |
71 |
72 | @end
73 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/VideoPlayerController.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoPlayerContrller.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | #import "ViewController.h"
12 |
13 | @interface VideoPlayerController : UIViewController
14 |
15 |
16 | /* 父视图 */
17 | @property (nonatomic, assign) ViewController *vc;
18 |
19 | @end
20 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/VideoPlayerController.m:
--------------------------------------------------------------------------------
1 | //
2 | // VideoPlayerContrller.m
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "VideoPlayerController.h"
10 | #import "VideoView.h"
11 |
12 | @interface VideoPlayerController ()
13 |
14 | @property (nonatomic, strong) VideoView *zView;
15 |
16 | @end
17 |
18 | @implementation VideoPlayerController
19 |
20 |
21 | - (void)viewDidLoad {
22 | [super viewDidLoad];
23 |
24 | self.zView = [[VideoView alloc] initWithFrame:[UIScreen mainScreen].bounds];
25 | [self.view addSubview:_zView];
26 | NSString *path = [[NSBundle mainBundle] pathForResource:@"282" ofType:@"mp4"];
27 | [self.zView setPath:path];
28 | [self.zView setTitle:@"视频播放"];
29 | self.zView.VideoBackgroundColor = [UIColor blackColor];
30 | self.zView.supportPictureInpicture = YES; // 支持画中画,则不支持后台暂停,反之。。。
31 |
32 | [self.zView play];
33 |
34 | self.zView.delegate = self;
35 |
36 | }
37 |
38 | - (void)pictureInPictureControllerDidStartPictureInPicture:(AVPictureInPictureController *)pictureInPictureController {
39 | NSLog(@"开始");
40 | [self dismissViewControllerAnimated:YES completion:nil];
41 | }
42 |
43 | - (void)pictureInPictureController:(AVPictureInPictureController *)pictureInPictureController restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:(void (^)(BOOL))completionHandler {
44 | NSLog(@"还原");
45 | [_vc presentViewController:self animated:YES completion:nil];
46 | [_zView play];
47 | completionHandler(YES);
48 | }
49 |
50 | - (void)dealloc
51 | {
52 | _zView.delegate = nil;
53 | _zView = nil;
54 | }
55 |
56 |
57 | @end
58 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/VideoView/VideoUtilities.h:
--------------------------------------------------------------------------------
1 | //
2 | // ZVideoUtilities.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #ifndef ZVideoUtilities_h
10 | #define ZVideoUtilities_h
11 |
12 |
13 | NS_INLINE NSString * TimeStringWithSeconds(NSInteger seconds) {
14 | if (seconds < 0) {
15 | return @"-:-:-";
16 | }
17 |
18 | NSInteger s = seconds % 60;
19 | NSInteger m = ((seconds - s) / 60) % 60;
20 | NSInteger h = ((seconds - s - m * 60) / 60) / 60;
21 |
22 | if (h == 0) {
23 | return [NSString stringWithFormat:@"%02ld:%02ld", (long)m, (long)s];
24 | }
25 | else {
26 | return [NSString stringWithFormat:@"%02ld:%02ld:%02ld", (long)h, (long)m, (long)s];
27 | }
28 | }
29 |
30 | #endif /* ZVideoUtilities_h */
31 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/PIPVideo/PIPVideo/PIPVideo/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // PIPVideo
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Animate/AnimateFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // AnimateFlowLayout.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AnimateFlowLayout : UICollectionViewFlowLayout
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Animate/AnimateViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // AnimateViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/11.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AnimateViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/01.imageset/01.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/01.imageset/01.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/01.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "01.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/02.imageset/02.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/02.imageset/02.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/02.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "02.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/03.imageset/03.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/03.imageset/03.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/03.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "03.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/04.imageset/04.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/04.imageset/04.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/04.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "04.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/05.imageset/05.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/05.imageset/05.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/05.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "05.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/currentPage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "currentPage.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/currentPage.imageset/currentPage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/currentPage.imageset/currentPage.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/otherPage.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "otherPage.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/otherPage.imageset/otherPage.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/UIColllectionView/UICollectionView/UICollectionView/Assets.xcassets/otherPage.imageset/otherPage.jpg
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/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 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Basic/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/CollectionViewAnimate/OSCardViewLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // BJCardViewLayout.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/11.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface OSCardViewLayout : UICollectionViewFlowLayout
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/DrawCollection/DrawCollectionViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DrawCollectionViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 |
13 | @interface DrawCollectionViewController : UIViewController
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/DrawCollection/DrawCollectionViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DrawCollectionViewController.m
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "DrawCollectionViewController.h"
10 | #import "ShufflingView.h"
11 | #import "ShuffingFlowLayout.h"
12 |
13 |
14 | @interface DrawCollectionViewController ()
15 |
16 | @end
17 |
18 | @implementation DrawCollectionViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 |
23 | ShuffingFlowLayout * flowLayout = [[ShuffingFlowLayout alloc] init];
24 | ShufflingView * cars = [[ShufflingView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 300) flowLayout:flowLayout];
25 | [self.view addSubview:cars];
26 | }
27 |
28 |
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/DrawCollection/ShuffingFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShuffingFlowLayout.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ShuffingFlowLayout : UICollectionViewFlowLayout
12 |
13 |
14 | @property (nonatomic, assign) CGFloat itemWidth;
15 |
16 | @property (nonatomic, assign) CGFloat maxScale;
17 |
18 | @end
19 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/DrawCollection/ShufflingView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShufflingView.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/12.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "ShuffingFlowLayout.h"
11 |
12 | @interface ShufflingView : UIView
13 |
14 | /**
15 | 布局自定义layout
16 | */
17 | @property (nonatomic, strong, readonly) ShuffingFlowLayout * _Nonnull flowLayout;
18 |
19 |
20 | - (instancetype _Nullable )initWithFrame:(CGRect)frame
21 | flowLayout:(nonnull ShuffingFlowLayout *)flowLayout;
22 |
23 |
24 | @end
25 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIRequiredDeviceCapabilities
26 |
27 | armv7
28 |
29 | UISupportedInterfaceOrientations
30 |
31 | UIInterfaceOrientationPortrait
32 | UIInterfaceOrientationLandscapeLeft
33 | UIInterfaceOrientationLandscapeRight
34 |
35 | UISupportedInterfaceOrientations~ipad
36 |
37 | UIInterfaceOrientationPortrait
38 | UIInterfaceOrientationPortraitUpsideDown
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionScrollHeader/GZIMCarouselHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // CWCarouselHeader.h
3 | // CWCarousel
4 | //
5 | // Created by WangChen on 2018/4/3.
6 | // Copyright © 2018年 ChenWang. All rights reserved.
7 | //
8 |
9 | #ifndef CWCarouselHeader_h
10 | #define CWCarouselHeader_h
11 |
12 | #import "GZIMCarousel.h"
13 | #import "GZIMCarouselProtocol.h"
14 |
15 | #endif /* CWCarouselHeader_h */
16 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionScrollHeader/GZIMCarouselProtocol.h:
--------------------------------------------------------------------------------
1 | //
2 | // CWCarouselProtocol.h
3 | // CWCarousel
4 | //
5 | // Created by WangChen on 2018/4/3.
6 | // Copyright © 2018年 ChenWang. All rights reserved.
7 | //
8 |
9 | #ifndef CWCarouselProtocol_h
10 | #define CWCarouselProtocol_h
11 |
12 | @class GZIMCarousel;
13 | @protocol GZIMCarouselDelegate
14 | /**
15 | 轮播图点击代理
16 |
17 | @param carousel 轮播图实例对象
18 | @param index 被点击的下标
19 | */
20 | - (void)GZIMCarousel:(GZIMCarousel *)carousel didSelectedAtIndex:(NSInteger)index;
21 | @end
22 |
23 | @protocol GZIMCarouselDatasource
24 | /**
25 | 轮播图数量
26 |
27 | @return 轮播图展示个数
28 | */
29 | - (NSInteger)numbersForCarousel;
30 | /**
31 | 自定义每个轮播图视图
32 |
33 | @param carousel 轮播图控件
34 | @param indexPath 轮播图cell实际下标
35 | @param index 业务逻辑需要的下标
36 | @return 自定义视图
37 | */
38 | - (UICollectionViewCell *)viewForCarousel:(GZIMCarousel *)carousel indexPath:(NSIndexPath *)indexPath index:(NSInteger)index;
39 | @end
40 |
41 |
42 | @protocol GZIMCarouselPageControlProtocol
43 | @required
44 | /**
45 | 总页数
46 | */
47 | @property (nonatomic, assign) NSInteger pageNumbers;
48 | /**
49 | 当前页
50 | */
51 | @property (nonatomic, assign) NSInteger currentPage;
52 |
53 | - (void)setCurrentPage:(NSInteger)currentPage;
54 | - (void)setPageNumbers:(NSInteger)pageNumbers;
55 | @end
56 | #endif /* CWCarouselProtocol_h */
57 |
58 |
59 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionScrollHeader/GZIMFlowLayout.h:
--------------------------------------------------------------------------------
1 | //
2 | // CWFlowLayout.h
3 | // CWCarousel
4 | //
5 | // Created by WangChen on 2018/4/3.
6 | // Copyright © 2018年 ChenWang. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | typedef NS_ENUM(NSUInteger, GZIMCarouselStyle) {
12 | CWCarouselStyle_Unknow = 0, ///<未知样式
13 | CWCarouselStyle_Normal, ///<普通样式,一张图占用整个屏幕宽度
14 | CWCarouselStyle_H_1, ///<自定义样式一, 中间一张居中,前后2张图有部分内容在屏幕内可以预览到
15 | CWCarouselStyle_H_2, ///<自定义样式二, 中间一张居中,前后2张图有部分内容在屏幕内可以预览到,并且中间一张图正常大小,前后2张图会缩放
16 | CWCarouselStyle_H_3, ///<自定义样式三, 中间一张居中,前后2张图有部分内容在屏幕内可以预览到,中间一张有放大效果,前后2张正常大小
17 | };
18 |
19 | @interface GZIMFlowLayout : UICollectionViewFlowLayout
20 | /**
21 | 影响轮播图风格
22 | */
23 | @property (nonatomic, assign) GZIMCarouselStyle style;
24 |
25 | /**
26 | * 横向滚动时,每张轮播图之间的间距
27 | * CWCarouselStyle_H_3 样式时设置无效
28 | */
29 | @property (nonatomic, assign) CGFloat itemSpace_H;
30 |
31 | /**
32 | * 横向滚动时,每张轮播图的宽度
33 | * style = CWCarouselStyle_Normal 时设置无效
34 | */
35 | @property (nonatomic, assign) CGFloat itemWidth;
36 |
37 | /**
38 | * style = CWCarouselStyle_H_2 有效
39 | * 前后2张图的缩小比例 (0.0 ~ 1.0)
40 | * 默认: 0.8
41 | */
42 | @property (nonatomic, assign) CGFloat minScale;
43 |
44 | /**
45 | * style = CWCarouselStyle_H_3 有效
46 | * 中间一张图放大比例
47 | * 默认: 1.2
48 | * 1.1.0版本后,无论设置多少,中间一张的cell的比例始终是原始size, 这个比例是相对两边cell的size的相对比例
49 | 也就是说,该值越大,那么两边的cell就会相对越小.反之越大.
50 | */
51 | @property (nonatomic, assign) CGFloat maxScale;
52 |
53 | /**
54 | 纵向滚动时,每张轮播图之间的间距(暂未实现)
55 | */
56 | @property (nonatomic, assign) CGFloat itemSpace_V;
57 |
58 |
59 | /**
60 | 构造方法
61 |
62 | @param style 轮播图风格
63 | @return 实例对象
64 | */
65 | - (instancetype)initWithStyle:(GZIMCarouselStyle)style;
66 | @end
67 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/Cell/GZIMWorkspaceHeader.h:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMWorkspaceHeader.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface GZIMWorkspaceHeader : UICollectionReusableView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/Cell/GZIMWorkspaceHeader.m:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMWorkspaceHeader.m
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "GZIMWorkspaceHeader.h"
10 |
11 | @implementation GZIMWorkspaceHeader
12 | - (instancetype)initWithFrame:(CGRect)frame
13 | {
14 | self = [super initWithFrame:frame];
15 | if (self) {
16 | [self configUI];
17 | }
18 | return self;
19 | }
20 |
21 |
22 | - (void)configUI {
23 | UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(12, 0, self.viewForLastBaselineLayout.frame.size.width - 24, 0.5)];
24 | [lineView setBackgroundColor:[UIColor redColor]];
25 | [self addSubview:lineView];
26 | }
27 | @end
28 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/Cell/GZIMWorkspaceItemCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMWorkspaceItemCell.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | @class GZIMWorkspaceItemCell;
11 |
12 | @protocol CustomCollectionViewDelete
13 | @optional
14 | - (void)modelCellEvent:(GZIMWorkspaceItemCell *)cell;
15 | @end
16 |
17 | @interface GZIMWorkspaceItemCell : UICollectionViewCell
18 |
19 | - (void)setItemText:(NSString *)item;
20 |
21 | - (void)setBackColor:(NSString *)item;
22 |
23 | @property (nonatomic, weak) id deleteDelegate;
24 | @end
25 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/Cell/GZIMWorkspaceSectionFoot.h:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMWorkspaceSectionFoot.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface GZIMWorkspaceSectionFoot : UICollectionReusableView
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/Cell/GZIMWorkspaceSectionFoot.m:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMWorkspaceSectionFoot.m
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "GZIMWorkspaceSectionFoot.h"
10 |
11 | @implementation GZIMWorkspaceSectionFoot
12 |
13 | - (instancetype)initWithFrame:(CGRect)frame
14 | {
15 | self = [super initWithFrame:frame];
16 | if (self) {
17 | [self configUI];
18 | }
19 | return self;
20 | }
21 |
22 |
23 | - (void)configUI {
24 | UIView * lineView = [[UIView alloc] initWithFrame:CGRectMake(12, 0, self.viewForLastBaselineLayout.frame.size.width - 24, 0.5)];
25 | [lineView setBackgroundColor:[UIColor greenColor]];
26 | [self addSubview:lineView];
27 | }
28 | @end
29 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/CollectionViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // CollectionViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/12/3.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GZIMAnimatedPageControl.h"
11 |
12 | @interface CollectionViewController : UIViewController
13 |
14 | @property (nonatomic, strong) GZIMAnimatedPageControl * pageController;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/GZIMCollectionViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // GZIMCollectionViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 |
10 |
11 |
12 | #define kGZIM_SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
13 | #define kGZIM_SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
14 |
15 | #import
16 |
17 |
18 | FOUNDATION_EXPORT NSString * const GZIMCollectionViewHeaderIdentifier;
19 | FOUNDATION_EXPORT NSString * const GZIMCollectionViewFooterIdentifier;
20 |
21 | @interface GZIMCollectionViewController : UIViewController
22 |
23 | @property (nonatomic, strong, readonly) UICollectionView *collectionView;
24 |
25 | // impl by subclass
26 | - (UICollectionViewFlowLayout *)collectionViewFlowLayout;
27 |
28 |
29 | @property (nonatomic, strong) UIScrollView * scrollView;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/MainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GZIMCollectionViewController.h"
11 |
12 | @interface MainViewController : GZIMCollectionViewController
13 |
14 | @end
15 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UICollectionView/UIScrollHeaderViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIScrollHeaderViewController.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/30.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface UIScrollHeaderViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UIPageControl/CustomPageControl.h:
--------------------------------------------------------------------------------
1 | //
2 | // CustomPageControl.h
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/30.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GZIMCarouselProtocol.h"
11 |
12 |
13 |
14 |
15 | @interface CustomPageControl : UIView
16 | /**
17 | 总页数
18 | */
19 | @property (nonatomic, assign) NSInteger pageNumbers;
20 | /**
21 | 当前页
22 | */
23 | @property (nonatomic, assign) NSInteger currentPage;
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UIPageControl/CustomPageControl.m:
--------------------------------------------------------------------------------
1 | //
2 | // CustomPageControl.m
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/30.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "CustomPageControl.h"
10 | //#import "GZIMPageControl.h"
11 | #import "UIView+GZCSAddition.h"
12 | #import "GZIMAnimatedPageControl.h"
13 |
14 | @interface CustomPageControl()
15 | //@property (nonatomic, strong) GZIMPageControl * cusPageController;
16 | @property (nonatomic, strong) GZIMAnimatedPageControl * cusPageController;
17 | @end
18 |
19 | @implementation CustomPageControl
20 |
21 | - (instancetype)initWithFrame:(CGRect)frame
22 | {
23 | self = [super initWithFrame:frame];
24 | if (self) {
25 | [self configUI];
26 | }
27 | return self;
28 | }
29 | - (void)configUI {
30 |
31 | [self addSubview:self.cusPageController];
32 |
33 | }
34 |
35 | -(GZIMAnimatedPageControl *)cusPageController {
36 | if (!_cusPageController) {
37 | _cusPageController = [[GZIMAnimatedPageControl alloc] initWithFrame:self.frame];
38 | _cusPageController.numberOfPages = 5;
39 |
40 |
41 | [_cusPageController prepareShow];
42 | _cusPageController.backgroundColor = [UIColor grayColor];
43 | [_cusPageController addTarget:self action:@selector(s_pageControlChanged:) forControlEvents:UIControlEventValueChanged];
44 | }
45 | return _cusPageController;
46 | }
47 |
48 |
49 |
50 | - (void) s_pageControlChanged:(UIPageControl *)pageControl {
51 |
52 | }
53 |
54 | -(void)setCurrentPage:(NSInteger)currentPage {
55 | NSLog(@"1--->>setCurrentPage:%ld",currentPage);
56 | _currentPage = currentPage;
57 |
58 | }
59 | - (void)setPageNumbers:(NSInteger)pageNumbers {
60 | NSLog(@"2:--->>.setPageNumbers:%ld",pageNumbers);
61 | _pageNumbers = pageNumbers;
62 | self.cusPageController.numberOfPages = pageNumbers;
63 | }
64 |
65 | @end
66 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UIPageControl/GZIMAnimatedPageControl.h:
--------------------------------------------------------------------------------
1 | //
2 | // LCAnimatedPageControl.h
3 | // LCAnimatedPageControl
4 | //
5 | // Created by beike on 6/17/15.
6 | // Copyright (c) 2015 beike. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | @interface GZIMAnimatedPageControl : UIControl
13 |
14 |
15 | @property (nonatomic, strong) UIScrollView *sourceScrollView;
16 |
17 | @property (nonatomic, assign) NSInteger numberOfPages;
18 | @property (nonatomic, assign) NSInteger currentOfPage;
19 |
20 | @property (nonatomic, assign) CGFloat indicatorDiameter;
21 | @property (nonatomic, assign) CGFloat indicatorMultiple;
22 | @property (nonatomic, assign) CGFloat indicatorMargin;
23 |
24 | - (void)prepareShow;
25 | - (void)clearIndicators;
26 |
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UIPageControl/GZIMPageControl.h:
--------------------------------------------------------------------------------
1 | //
2 | // LLPageControl.h
3 | // RongXiangYD
4 | //
5 | // Created by 嘚嘚以嘚嘚 on 2018/7/2.
6 | // Copyright © 2018年 嘚嘚以嘚嘚. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface GZIMPageControl : UIPageControl
12 | @property(nonatomic,strong)UIImage *currentImage;
13 | @property(nonatomic,strong)UIImage *otherImage;
14 | @end
15 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/UIPageControl/GZIMPageControl.m:
--------------------------------------------------------------------------------
1 | //
2 | // LLPageControl.m
3 | // RongXiangYD
4 | //
5 | // Created by 嘚嘚以嘚嘚 on 2018/7/2.
6 | // Copyright © 2018年 嘚嘚以嘚嘚. All rights reserved.
7 | //
8 |
9 | #import "GZIMPageControl.h"
10 |
11 | @implementation GZIMPageControl
12 |
13 | -(id) initWithFrame:(CGRect)frame {
14 |
15 | self = [super initWithFrame:frame];
16 |
17 | return self;
18 |
19 | }
20 | - (void)setCurrentImage:(UIImage *)currentImage {
21 | if (currentImage) {
22 | _currentImage = currentImage;
23 | }
24 | }
25 | - (void)setOtherImage:(UIImage *)otherImage {
26 | if (otherImage) {
27 | _otherImage = otherImage;
28 | }
29 | }
30 | -(void) updateDots {
31 |
32 |
33 | for (int i=0; i<[self.subviews count]; i++) {
34 | //圆点
35 | UIView* dot = [self.subviews objectAtIndex:i];
36 | //添加imageView
37 | if ([dot.subviews count] == 0) {
38 | UIImageView * view = [[UIImageView alloc]initWithFrame:dot.bounds];
39 | [dot addSubview:view];
40 | };
41 |
42 | //配置imageView
43 | UIImageView * view = dot.subviews[0];
44 |
45 | if (i==self.currentPage) {
46 | if (self.currentImage) {
47 | view.image=self.currentImage;
48 | dot.backgroundColor = [UIColor clearColor];
49 | }
50 |
51 | }else {
52 |
53 | if (self.otherImage) {
54 | view.image=self.otherImage;
55 | dot.backgroundColor = [UIColor clearColor];
56 | }
57 | }
58 | }
59 |
60 |
61 |
62 | }
63 |
64 | -(void)setCurrentPage:(NSInteger)page
65 | {
66 |
67 | [super setCurrentPage:page];
68 |
69 | [self updateDots];
70 |
71 | }
72 |
73 | @end
74 |
--------------------------------------------------------------------------------
/UIColllectionView/UICollectionView/UICollectionView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // UICollectionView
4 | //
5 | // Created by zzg on 2018/11/13.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
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 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/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 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/GZCCarDetailScrollTop.h:
--------------------------------------------------------------------------------
1 | //
2 | // GZCCarDetailScrollTop.h
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface GZCCarDetailScrollTop : UIView
14 |
15 |
16 |
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/GZCCarDetailScrollTop.m:
--------------------------------------------------------------------------------
1 | //
2 | // GZCCarDetailScrollTop.m
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "GZCCarDetailScrollTop.h"
10 |
11 | @interface GZCCarDetailScrollTop()
12 |
13 | @property (nonatomic, strong) UIScrollView * scrollViewTop;
14 |
15 | @end
16 |
17 | @implementation GZCCarDetailScrollTop
18 |
19 | - (instancetype)initWithFrame:(CGRect)frame
20 | {
21 | self = [super initWithFrame:frame];
22 | if (self) {
23 |
24 | }
25 | return self;
26 | }
27 |
28 |
29 |
30 | @end
31 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/NSString+GZIMEncode.h:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+GZIMEncode.h
3 | // GZIMClient
4 | //
5 | // Created by fangchenzhen on 2018/12/5.
6 | // Copyright © 2018 呱呱开放平台. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NSString (GZIMEncode)
14 |
15 | - (NSString*)encodeString;
16 | - (NSString *)decodeString;
17 |
18 | @end
19 |
20 | NS_ASSUME_NONNULL_END
21 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/NSString+GZIMEncode.m:
--------------------------------------------------------------------------------
1 | //
2 | // NSString+GZIMEncode.m
3 | // GZIMClient
4 | //
5 | // Created by fangchenzhen on 2018/12/5.
6 | // Copyright © 2018 呱呱开放平台. All rights reserved.
7 | //
8 |
9 | #import "NSString+GZIMEncode.h"
10 |
11 | @implementation NSString (GZIMEncode)
12 |
13 | - (NSString*)encodeString
14 | {
15 | NSString *encodedString = (NSString *)
16 | CFBridgingRelease(CFURLCreateStringByAddingPercentEscapes(kCFAllocatorDefault,
17 | (CFStringRef)self,
18 | NULL,
19 | (CFStringRef)@"!*'();:@&=+$,/?%#[]",
20 | kCFStringEncodingUTF8));
21 |
22 | return encodedString;
23 | }
24 |
25 | - (NSString *)decodeString
26 | {
27 | NSString *decodedString = (__bridge_transfer NSString *)CFURLCreateStringByReplacingPercentEscapesUsingEncoding(NULL,
28 | (__bridge CFStringRef)self,
29 | CFSTR(""),
30 | CFStringConvertNSStringEncodingToEncoding(NSUTF8StringEncoding));
31 | return decodedString;
32 | }
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/UIScrollViewScrollTop/UIScrollViewScrollTop/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // UIScrollViewScrollTop
4 | //
5 | // Created by zzg on 2019/3/29.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/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 | }
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/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 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Basic/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 |
17 | /*
18 |
19 | 总结一下objc_msgSend会做一下几件事情:
20 |
21 | 1:检查target是不是为nil。
22 | 1.1:如果这里有相应的nil的处理函数,就跳转到相应的函数中。
23 | 1.2如果没有处理nil的函数,就自动清理现场并返回。这一点就是为何在OC中给nil发送消息不会崩溃的原因。
24 |
25 | 2:检测这个 selector是不是要忽略的。
26 | 3:确定不是给nil发消息之后,objc_msgSend通过对象的isa指针获取到类的结构体,在该class的缓存中查找方法对应的IMP实现。如果找到,就跳转进去执行。如果没有找到,就在方法分发表里面继续查找。如果以上尝试都失败了,接下来就会循环尝试父类的缓存和方法列表,一直找到NSObject为止(因为NSObject的superclass为nil(还是它自己?),才跳出循环)。一旦定位到selector,函数会就获取到了实现的入口点,并传入相应的参数来执行方法的具体实现;如果最后没有定位到selector,则会走消息转发流程
27 |
28 |
29 | 注:为了加速消息的处理,运行时系统缓存使用过的selector及对应的方法的地址。
30 | */
31 |
32 |
33 | @end
34 |
35 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Basic/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Basic/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | }
21 |
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Father.h:
--------------------------------------------------------------------------------
1 | //
2 | // Father.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Father : NSObject
12 |
13 | - (void)derveCar;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Father.m:
--------------------------------------------------------------------------------
1 | //
2 | // Father.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "Father.h"
10 | #import "Son.h"
11 |
12 | @implementation Father
13 |
14 | - (void)derveCar {
15 | Son * s = [[Son alloc] init];
16 | // 默认Son,没有实现run方法,可以通过performSelector调用,但是会报错。
17 | // 动态添加方法就不会报错
18 | // [s performSelector:@selector(drivePlan)];
19 | [s performSelector:@selector(runS)];
20 | }
21 |
22 | @end
23 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Fuck.h:
--------------------------------------------------------------------------------
1 | //
2 | // Fuck.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/26.
6 | // Copyright © 2018 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface Fuck : NSObject
14 | -(void)fos;
15 |
16 | - (BOOL)addFunc:(SEL)sel;
17 | @end
18 |
19 | NS_ASSUME_NONNULL_END
20 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Fuck.m:
--------------------------------------------------------------------------------
1 | //
2 | // Fuck.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/26.
6 | // Copyright © 2018 zzg. All rights reserved.
7 | //
8 |
9 | #import "Fuck.h"
10 | #import
11 |
12 | void smartFunction()
13 | {
14 | //return 0;
15 | NSLog(@"asssss");
16 | }
17 |
18 |
19 | @implementation Fuck
20 | -(void)fos {
21 | NSLog(@"-------fuck");
22 | }
23 | - (BOOL)addFunc:(SEL)sel {
24 | return class_addMethod([Fuck class], sel, (IMP)smartFunction, "v@:");
25 |
26 | }
27 | @end
28 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Son.h:
--------------------------------------------------------------------------------
1 | //
2 | // Son.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface Son : NSObject
12 |
13 | - (void)drivePlan;
14 |
15 | @end
16 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Enity/Son.m:
--------------------------------------------------------------------------------
1 | //
2 | // Son.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "Son.h"
10 | #import
11 |
12 | #import "Fuck.h"
13 |
14 | /**
15 | 1****:https://www.jianshu.com/p/3a30d5fb2db3?utm_campaign=maleskine&utm_content=note&utm_medium=seo_notes&utm_source=recommendation
16 | 2****:https://www.jianshu.com/p/60c251712df7
17 | 3****:https://www.jianshu.com/p/d072bfbe1a60
18 | */
19 |
20 | @implementation Son
21 |
22 | // 默认方法都有两个隐式参数,
23 | void testRun(id self,SEL sel) {
24 | [[Son new] drivePlan];
25 | NSLog(@"son is drivePlan");
26 | }
27 |
28 | - (void)drivePlan {
29 | NSLog(@"Son>>>>drivePlan");
30 | }
31 |
32 | /**************
33 | ** 1.0 动态方法解析
34 | **************/
35 | // 当一个对象调用未实现的方法,会调用这个方法处理,并且会把对应的方法列表传过来.
36 | // 刚好可以用来判断,未实现的方法是不是我们想要动态添加的方法
37 | //+ (BOOL)resolveInstanceMethod:(SEL)sel {
38 | // NSLog(@"\n\n\n\n---====>>>resolveInstanceMethod");
39 | //// //判断方法是否是run
40 | //// if ([NSStringFromSelector(sel) isEqualToString:@"runS"]) {
41 | //// // 动态添加run方法
42 | ////
43 | //// // 第一个参数:给哪个类添加方法
44 | //// // 第二个参数:添加方法的方法编号
45 | //// // 第三个参数:添加方法的函数实现(函数地址)
46 | //// // 第四个参数:函数的类型,(返回值+参数类型) v:void @:对象->self :表示SEL->_cmd
47 | //// class_addMethod([self class], sel, (IMP)testRun, "v@:@");
48 | //// return YES;
49 | //// }
50 | // return [super resolveInstanceMethod:sel];
51 | //}
52 |
53 | /*
54 | 如果也没有找到IMP的实现,resloveInstanceMethod:返回NO之后,就会进入消息转发阶段。
55 | */
56 |
57 | /**************
58 | ** 2.0 消息转发阶段
59 | **************/
60 | //********* 如果在上一步无法处理消息,则runtime会继续调用以下方法(不重写上一步方法)
61 | /*
62 | -forwardindTargetWithSelctor:方法。在这个方法中,返回的对象就是message的接收者,然后会回到resloveInstanceMethod方法,从新开始消息转发过程,如果返回nil则会进入下一个方法中(-forwardInvocation)去判断是否响应这个消息。
63 | */
64 | - (id)forwardingTargetForSelector:(SEL)aSelector {
65 | BOOL isForward = [self respondsToSelector:aSelector];
66 | NSMethodSignature * signature = [self methodSignatureForSelector:aSelector];
67 | if (isForward || signature) {
68 | return [super forwardingTargetForSelector:aSelector];
69 | } else {
70 | Fuck * f = [[Fuck alloc] init];
71 | [f addFunc:aSelector];
72 | return f;
73 | }
74 |
75 | }
76 | @end
77 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Main/MainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.h
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MainViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/Main/MainViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "MainViewController.h"
10 | #import "Father.h"
11 |
12 | @interface MainViewController ()
13 |
14 | @end
15 |
16 | @implementation MainViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 |
21 |
22 |
23 | //guagua://groupcode/?id=331807746243031042&encryptStr=97AB6DF4F29F8D66496C92D150D07D1FFE619A447EE5A2901A18CDC655187D8E53C52E2DC2D9ECAD9218B6AE56669152750E4009112DF23581E13F0835A52255&time=1545811616855
24 |
25 |
26 |
27 | NSString * joinGroupInfo = @"guagua://groupcode/?id=331807746243031042&encryptStr=97AB6DF4F29F8D66496C92D150D07D1FFE619A447EE5A2901A18CDC655187D8E53C52E2DC2D9ECAD9218B6AE56669152750E4009112DF23581E13F0835A52255&time=1545811616855";
28 |
29 | NSString * charId = [self queryParamters:@"id" webaddress:joinGroupInfo];
30 | NSString * encryptStr = [self queryParamters:@"encryptStr" webaddress:joinGroupInfo];
31 | NSString * time = [self queryParamters:@"time" webaddress:joinGroupInfo];
32 |
33 | NSLog(@"charid--:%@---->>>encryptStr:%@====>>>time:%@",charId,encryptStr,time);
34 |
35 | }
36 |
37 | - (NSString *) queryParamters:(NSString *)paramKey webaddress:(NSString *)urlAddress {
38 | NSError *error;
39 | NSString *regTags=[[NSString alloc] initWithFormat:@"(^|&|\\?)+%@=+([^&]*)(&|$)",paramKey];
40 | NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:regTags
41 | options:NSRegularExpressionCaseInsensitive
42 | error:&error];
43 | NSArray *matches = [regex matchesInString:urlAddress
44 | options:0
45 | range:NSMakeRange(0, [urlAddress length])];
46 | for (NSTextCheckingResult *match in matches) {
47 | NSString *tagValue = [urlAddress substringWithRange:[match rangeAtIndex:2]];
48 | return tagValue;
49 | }
50 | return @"";
51 | }
52 |
53 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
54 | Father * father = [[Father alloc] init];
55 | [father derveCar];
56 | }
57 |
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/UNRecognisedSelector/UNRecognisedSelector/UNRecognisedSelector/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // UNRecognisedSelector
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/WKWebView/Podfile:
--------------------------------------------------------------------------------
1 |
2 |
3 | platform :ios, '8.0'
4 | target 'AWSRuntime_Example' do
5 |
6 | end
7 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_collection.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_collection@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_collection@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_collection.imageset/more_open_collection@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_collection.imageset/more_open_collection@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_collection.imageset/more_open_collection@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_collection.imageset/more_open_collection@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_copy.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_copy@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_copy@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_copy.imageset/more_open_copy@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_copy.imageset/more_open_copy@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_copy.imageset/more_open_copy@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_copy.imageset/more_open_copy@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_friend.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_friend@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_friend@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_friend.imageset/more_open_friend@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_friend.imageset/more_open_friend@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_friend.imageset/more_open_friend@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_friend.imageset/more_open_friend@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_gg.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_gg@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_gg@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_gg.imageset/more_open_gg@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_gg.imageset/more_open_gg@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_gg.imageset/more_open_gg@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_gg.imageset/more_open_gg@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_refresh.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_refresh@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_refresh@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_refresh.imageset/more_open_refresh@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_refresh.imageset/more_open_refresh@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_refresh.imageset/more_open_refresh@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_refresh.imageset/more_open_refresh@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_safari.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_safari@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_safari@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_safari.imageset/more_open_safari@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_safari.imageset/more_open_safari@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_safari.imageset/more_open_safari@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_safari.imageset/more_open_safari@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_wechat.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "more_open_wechat@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "more_open_wechat@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_wechat.imageset/more_open_wechat@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_wechat.imageset/more_open_wechat@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/More/more_open_wechat.imageset/more_open_wechat@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/More/more_open_wechat.imageset/more_open_wechat@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "foot_forward_normal@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "foot_forward_normal@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_normal.imageset/foot_forward_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_forward_normal.imageset/foot_forward_normal@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_normal.imageset/foot_forward_normal@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_forward_normal.imageset/foot_forward_normal@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_selected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "foot_forward_selected@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "foot_forward_selected@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_selected.imageset/foot_forward_selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_forward_selected.imageset/foot_forward_selected@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_forward_selected.imageset/foot_forward_selected@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_forward_selected.imageset/foot_forward_selected@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_normal.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "foot_goback_normal@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "foot_goback_normal@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_normal.imageset/foot_goback_normal@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_goback_normal.imageset/foot_goback_normal@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_normal.imageset/foot_goback_normal@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_goback_normal.imageset/foot_goback_normal@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_selected.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "foot_goback_selected@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "foot_goback_selected@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_selected.imageset/foot_goback_selected@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_goback_selected.imageset/foot_goback_selected@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/foot_goback_selected.imageset/foot_goback_selected@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/foot_goback_selected.imageset/foot_goback_selected@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/nav_close_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "nav_close_icon@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/nav_close_icon.imageset/nav_close_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/nav_close_icon.imageset/nav_close_icon@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/nav_more_icon.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "nav_more_icon@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "filename" : "nav_more_icon@3x.png",
15 | "scale" : "3x"
16 | }
17 | ],
18 | "info" : {
19 | "version" : 1,
20 | "author" : "xcode"
21 | }
22 | }
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/nav_more_icon.imageset/nav_more_icon@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/nav_more_icon.imageset/nav_more_icon@2x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Assets.xcassets/nav_more_icon.imageset/nav_more_icon@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/WKWebView/WKWebView/Assets.xcassets/nav_more_icon.imageset/nav_more_icon@3x.png
--------------------------------------------------------------------------------
/WKWebView/WKWebView/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 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/BottomTabBar/GZIMFootNavigationView.h:
--------------------------------------------------------------------------------
1 | //
2 | // BottomControlView.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface FootNavigationView : UIView
13 |
14 |
15 | - (instancetype)initWithFrame:(CGRect)frame forWKWebView:(WKWebView *)webView;
16 |
17 | /**
18 | 设置向前按钮的状态
19 |
20 | @param state UIControlState
21 | */
22 | - (void)setForWardSelectState:(UIControlState)state;
23 |
24 | /**
25 | 设置返回按钮的状态
26 |
27 | @param state UIControlState
28 | */
29 | - (void)setGoBackSelectState:(UIControlState)state;
30 |
31 | - (void)dismiss;
32 | - (void)show;
33 |
34 | @end
35 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/BottomTabBar/WKWebViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // WKWebViewController.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface WKWebViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | NSAppTransportSecurity
24 |
25 | NSAllowsArbitraryLoads
26 |
27 |
28 | UILaunchStoryboardName
29 | LaunchScreen
30 | UIMainStoryboardFile
31 | Main
32 | UIRequiredDeviceCapabilities
33 |
34 | armv7
35 |
36 | UISupportedInterfaceOrientations
37 |
38 | UIInterfaceOrientationPortrait
39 | UIInterfaceOrientationLandscapeLeft
40 | UIInterfaceOrientationLandscapeRight
41 |
42 | UISupportedInterfaceOrientations~ipad
43 |
44 | UIInterfaceOrientationPortrait
45 | UIInterfaceOrientationPortraitUpsideDown
46 | UIInterfaceOrientationLandscapeLeft
47 | UIInterfaceOrientationLandscapeRight
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface MainViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MainViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "MainViewController.h"
10 | #import "WKWebViewController.h"
11 |
12 | @interface MainViewController ()
13 |
14 | @end
15 |
16 | @implementation MainViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | self.title = @"网页加壳";
21 |
22 | UIButton * btn = [UIButton buttonWithType:UIButtonTypeCustom];
23 | btn.frame = CGRectMake(100, 100, 100, 100);
24 | btn.backgroundColor = [UIColor grayColor];
25 | [btn setTitle:@"加载网页" forState:0];
26 | [btn addTarget:self action:@selector(loadWebClick) forControlEvents:UIControlEventTouchUpInside];
27 | [self.view addSubview:btn];
28 |
29 | }
30 |
31 | - (void)loadWebClick {
32 | WKWebViewController * wk = [[WKWebViewController alloc] init];
33 | [self.navigationController pushViewController:wk animated:YES];
34 | }
35 |
36 | @end
37 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MoreTable/GZIMSheetOpenCell.h:
--------------------------------------------------------------------------------
1 | //
2 | // SheetItemCell.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | @class GZIMSheetOpenEntity;
11 |
12 | @interface GZIMSheetOpenCell : UICollectionViewCell
13 |
14 | - (void)setItemText:(GZIMSheetOpenEntity *)item;
15 |
16 | @end
17 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MoreTable/GZIMSheetOpenCell.m:
--------------------------------------------------------------------------------
1 | //
2 | // SheetItemCell.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "GZIMSheetOpenCell.h"
10 | #import "GZIMSheetOpenEntity.h"
11 |
12 | @interface GZIMSheetOpenCell()
13 |
14 | @property (nonatomic, weak) UILabel * itemLabel;
15 | @property (nonatomic, weak) UIImageView * corverImageView;
16 |
17 | @end
18 |
19 | @implementation GZIMSheetOpenCell
20 |
21 | - (instancetype)initWithFrame:(CGRect)frame
22 | {
23 | self = [super initWithFrame:frame];
24 | if (self) {
25 | [self configUI];
26 | }
27 | return self;
28 | }
29 |
30 | - (void)configUI {
31 | CGFloat itemWidth = self.frame.size.width;
32 | UIImageView * corverImageView = [[UIImageView alloc] initWithFrame:CGRectMake((itemWidth - 60) * 0.5, 0, 60, 60)];
33 | [self.contentView addSubview:corverImageView];
34 | self.corverImageView = corverImageView;
35 |
36 |
37 | UILabel * itemLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, CGRectGetMaxY(corverImageView.frame) + 5, self.frame.size.width, 25)];
38 | itemLabel.textColor = [UIColor colorWithRed:51/255.0 green:59/255.0 blue:65/255.0 alpha:1/1.0];
39 | itemLabel.font = [UIFont systemFontOfSize:10];
40 | itemLabel.numberOfLines = 0;
41 | itemLabel.textAlignment = NSTextAlignmentCenter;
42 | [self.contentView addSubview:itemLabel];
43 | self.itemLabel = itemLabel;
44 | }
45 |
46 |
47 | - (void)setItemText:(GZIMSheetOpenEntity *)item {
48 | self.corverImageView.image = [UIImage imageNamed:item.itemIcon];
49 | [self.itemLabel setText:item.itemName];
50 | }
51 |
52 | @end
53 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MoreTable/GZIMSheetOpenEntity.h:
--------------------------------------------------------------------------------
1 | //
2 | // SheetItem.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 |
12 | typedef enum : NSUInteger {
13 | GZIMShareGUAGUA, // 发送给呱呱同事
14 | GZIMShareWeChatFriend, // 发送给微信好友
15 | GZIMShareWeChatTime, // 分享到微信朋友圈
16 | GZIMShareCollection, // 收藏
17 | GZIMShareSafari, // 在Safari中打开
18 | GZIMShareCopyUrl, // 复制链接
19 | GZIMShareRefresh, // 刷新
20 | } GZIMShareMoreType;
21 |
22 | @interface GZIMSheetOpenEntity : NSObject
23 |
24 | @property (nonatomic, strong) NSString * itemIcon;
25 | @property (nonatomic, strong) NSString * itemName;
26 | @property (nonatomic, assign) GZIMShareMoreType shareType;
27 |
28 | + (instancetype)sheetItem:(NSString *)itemIcon forItemName:(NSString *)itemName forShareType:(GZIMShareMoreType)shareType;
29 | @end
30 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MoreTable/GZIMSheetOpenEntity.m:
--------------------------------------------------------------------------------
1 | //
2 | // SheetItem.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "GZIMSheetOpenEntity.h"
10 |
11 | @implementation GZIMSheetOpenEntity
12 | - (instancetype)initItem:(NSString *)itemIcon forItemName:(NSString *)itemName forShareType:(GZIMShareMoreType)shareType {
13 | self = [super init];
14 | if (self) {
15 | self.itemIcon = itemIcon;
16 | self.itemName = itemName;
17 | self.shareType = shareType;
18 | }
19 | return self;
20 | }
21 |
22 |
23 | + (instancetype)sheetItem:(NSString *)itemIcon forItemName:(NSString *)itemName forShareType:(GZIMShareMoreType)shareType{
24 | return [[self alloc] initItem:itemIcon forItemName:itemName forShareType:shareType];
25 | }
26 |
27 | @end
28 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/MoreTable/GZIMSheetOpenView.h:
--------------------------------------------------------------------------------
1 | //
2 | // ShareView.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/22.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "GZIMSheetOpenEntity.h"
11 |
12 | @class GZIMSheetOpenView;
13 |
14 |
15 |
16 | @protocol GZIMSheetOpenViewDataSource
17 |
18 | @required
19 |
20 | - (NSInteger)SheetShare:(GZIMSheetOpenView *_Nullable)sheetShare numberOfItemsInSection:(NSInteger)section;
21 |
22 | @optional
23 | - (GZIMSheetOpenEntity *_Nullable)SheetShare:(GZIMSheetOpenView *_Nullable)sheetShare cellForIndexPath:(NSIndexPath *_Nullable)indexPath;
24 | @end
25 |
26 |
27 | @protocol GZIMSheetOpenViewDelegate
28 | @optional
29 | - (void)SheetShare:(GZIMSheetOpenView *_Nullable)sheetShare didSelectedIndexPath:(NSIndexPath *_Nullable)indexPath;
30 | @end
31 |
32 |
33 | @interface GZIMSheetOpenView : UIView
34 |
35 | - (instancetype _Nullable )initWithBottomTitle:(NSString *_Nullable)title;
36 | - (void)show;
37 | -(void)dismisView;
38 |
39 | @property (nonatomic, weak, nullable) id dataSource;
40 | @property (nonatomic, weak, nullable) id delegate;
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/NavigationViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // NavigationViewController.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/27.
6 | // Copyright © 2018 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface NavigationViewController : UINavigationController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/NavigationViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // NavigationViewController.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/27.
6 | // Copyright © 2018 zzg. All rights reserved.
7 | //
8 |
9 | #import "NavigationViewController.h"
10 | #import "UIViewController+GZIMNavigationPopHandler.h"
11 |
12 | @interface NavigationViewController ()
13 |
14 | @end
15 |
16 | @implementation NavigationViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 |
21 |
22 | [self initNavigationPopHandler];
23 | }
24 |
25 | @end
26 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/UIViewController+GZIMNavigationPopHandler.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIViewController+GZIMNavigationPopHandler.h
3 | // GZIMClient
4 | //
5 | // Created by zhouxueyun on 2017/8/22.
6 | // Copyright © 2017年 呱呱开放平台. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @protocol GZIMNavigationPopHandlerDelegate
12 |
13 | // 重写下面的方法以拦截NavigationPop事件,返回 YES 则 pop,NO 则不 pop
14 | @optional
15 | - (BOOL)navigationShouldPopOnBackButton;
16 | - (BOOL)navigationShouldPopOnPopGesture;
17 |
18 | - (BOOL)popGestureShouldBegin:(UIGestureRecognizer *)gesture;
19 | - (BOOL)popGestureShouldRecognizeSimultaneouslyWithGesture:(UIGestureRecognizer *)otherGesture;
20 | - (BOOL)popGestureShouldRequireFailureOfGesture:(UIGestureRecognizer *)otherGesture;
21 | - (BOOL)popGestureShouldBeRequiredToFailByGesture:(UIGestureRecognizer *)otherGesture;
22 |
23 | @end
24 |
25 | @interface UIViewController (GZIMNavigationPopHandler)
26 |
27 | @end
28 |
29 | @interface UINavigationController (GZIMNavigationPopHandler)
30 |
31 | - (void)initNavigationPopHandler;
32 |
33 | @end
34 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | }
21 |
22 |
23 | - (void)didReceiveMemoryWarning {
24 | [super didReceiveMemoryWarning];
25 | // Dispose of any resources that can be recreated.
26 | }
27 |
28 |
29 | @end
30 |
--------------------------------------------------------------------------------
/WKWebView/WKWebView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // WKWebView
4 | //
5 | // Created by zzg on 2018/12/21.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // edit-uitableview
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // edit-uitableview
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 |
11 | @interface AppDelegate ()
12 |
13 | @end
14 |
15 | @implementation AppDelegate
16 |
17 |
18 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19 | // Override point for customization after application launch.
20 | return YES;
21 | }
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 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/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 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // edit-uitableview
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/edit-uitableview/edit-uitableview/edit-uitableview/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // edit-uitableview
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/push/bash_profile_self/alias.sh:
--------------------------------------------------------------------------------
1 | alias mo='./test.sh' # mobro-echo 1:
2 |
--------------------------------------------------------------------------------
/push/bash_profile_self/gpush:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
3 | if [ "${branch_name}" = "" ]; then
4 | echo "Not In Git Repo."
5 | exit 1
6 | elif [ "${branch_name}" = "HEAD" ]; then
7 | echo "Detached HEAD."
8 | exit 1
9 | fi
10 | echo "branch: ${branch_name}"
11 |
12 | remote_name=$(git config "branch.${branch_name}.remote")
13 | if [ "${remote_name}" == "" ]; then
14 | echo "Remote Not Set"
15 | exit 1
16 | fi
17 | echo "remote: ${remote_name}"
18 |
19 | merge_name=$(git config branch.${branch_name}.merge)
20 | merge_branch=${merge_name##refs/heads/}
21 |
22 | echo "git push ${remote_name} ${branch_name}:refs/for/${merge_branch}"
23 | git push ${remote_name} ${branch_name}:refs/for/${merge_branch}%r=zhuxiaofei2@guazi.com,r=liuyuxi@guazi.com
24 |
--------------------------------------------------------------------------------
/push/bash_profile_self/test.sh:
--------------------------------------------------------------------------------
1 |
2 |
3 | #!/bin/bash
4 | branch_name=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
5 | if [ "${branch_name}" = "" ]; then
6 | echo "Not In Git Repo."
7 | exit 1
8 | elif [ "${branch_name}" = "HEAD" ]; then
9 | echo "Detached HEAD."
10 | exit 1
11 | fi
12 | echo "branch: ${branch_name}"
13 |
14 |
15 |
16 | remote_name=$(git config "branch.${branch_name}.remote")
17 | if [ "${remote_name}" == "" ]; then
18 | echo "Remote Not Set"
19 | exit 1
20 | fi
21 | echo "remote: ${remote_name}"
22 |
23 | merge_name=$(git config branch.${branch_name}.merge)
24 | merge_branch=${merge_name##refs/heads/}
25 |
26 | echo "git push ${remote_name} ${branch_name}:refs/for/${merge_branch}"
27 | git push ${remote_name} ${branch_name}:refs/for/${merge_branch}%r=zhuxiaofei2@guazi.com,r=liuyuxi@guazi.com
28 |
29 |
30 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/123.mp4:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/rate-screen-旋转/rate-screen/rate-screen/123.mp4
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/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 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | $(DEVELOPMENT_LANGUAGE)
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | APPL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 | LSRequiresIPhoneOS
22 |
23 | UILaunchStoryboardName
24 | LaunchScreen
25 | UIMainStoryboardFile
26 | Main
27 | UIRequiredDeviceCapabilities
28 |
29 | armv7
30 |
31 | UISupportedInterfaceOrientations
32 |
33 | UIInterfaceOrientationPortrait
34 | UIInterfaceOrientationLandscapeLeft
35 | UIInterfaceOrientationLandscapeRight
36 |
37 | UISupportedInterfaceOrientations~ipad
38 |
39 | UIInterfaceOrientationPortrait
40 | UIInterfaceOrientationPortraitUpsideDown
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/MainViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.h
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface MainViewController : UIViewController
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/MainViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // MainViewController.m
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "MainViewController.h"
10 | #import "VideoView.h"
11 |
12 |
13 | @interface MainViewController ()
14 |
15 |
16 | @end
17 |
18 | @implementation MainViewController
19 |
20 | - (void)viewDidLoad {
21 | [super viewDidLoad];
22 | self.view.backgroundColor = [UIColor grayColor];
23 | VideoView * vv = [[VideoView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, 200)];
24 | [self.view addSubview:vv];
25 | }
26 |
27 |
28 | @end
29 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/VideoView.h:
--------------------------------------------------------------------------------
1 | //
2 | // VideoView.h
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | NS_ASSUME_NONNULL_BEGIN
12 |
13 | @interface VideoView : UIView
14 |
15 | @end
16 |
17 | NS_ASSUME_NONNULL_END
18 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/VideoView.m:
--------------------------------------------------------------------------------
1 | //
2 | // VideoView.m
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "VideoView.h"
10 | #import
11 |
12 |
13 | @interface VideoView()
14 |
15 | @property (nonatomic, strong) AVPlayer *player;
16 | @property (nonatomic, strong) AVPlayerItem *playerItem;
17 | @property (nonatomic, strong) AVPlayerLayer *playerLayer;
18 |
19 | @end
20 |
21 | @implementation VideoView
22 |
23 | - (instancetype)initWithFrame:(CGRect)frame
24 | {
25 | self = [super initWithFrame:frame];
26 | if (self) {
27 | [self initPlayer];
28 | }
29 | return self;
30 | }
31 |
32 | - (void)initPlayer {
33 | self.player = [[AVPlayer alloc] init];
34 |
35 |
36 | self.playerLayer = [AVPlayerLayer playerLayerWithPlayer:self.player];
37 | self.playerLayer.frame = CGRectMake(0, 0, self.frame.size.width, self.frame.size.height);
38 | self.playerLayer.videoGravity = AVLayerVideoGravityResizeAspect; // 适配视频尺寸
39 | self.playerLayer.backgroundColor = (__bridge CGColorRef _Nullable)([UIColor blackColor]);
40 | [self.layer addSublayer:self.playerLayer];
41 |
42 |
43 | NSString *path = [[NSBundle mainBundle] pathForResource:@"123" ofType:@"mp4"];
44 |
45 | NSURL *sourceMovieUrl = [NSURL fileURLWithPath:path];
46 | AVAsset *movieAsset = [AVURLAsset URLAssetWithURL:sourceMovieUrl options:nil];
47 | self.playerItem = [AVPlayerItem playerItemWithAsset:movieAsset];
48 |
49 |
50 | [self.player replaceCurrentItemWithPlayerItem:self.playerItem];
51 |
52 | [self.player play];
53 | }
54 |
55 | -(void)layoutSubviews {
56 |
57 | CGFloat width = self.frame.size.width;
58 | CGFloat height = self.frame.size.height;
59 | UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
60 | if (UIInterfaceOrientationPortrait == orientation) {
61 | self.playerLayer.frame = CGRectMake(0, 0, width, height);
62 | }
63 | else {
64 | self.playerLayer.frame = CGRectMake(0, 0, [UIScreen mainScreen].bounds.size.width, [UIScreen mainScreen].bounds.size.height);
65 | }
66 |
67 |
68 | NSLog(@"-------");
69 | }
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 |
11 | @interface ViewController ()
12 |
13 | @end
14 |
15 | @implementation ViewController
16 |
17 | - (void)viewDidLoad {
18 | [super viewDidLoad];
19 | // Do any additional setup after loading the view, typically from a nib.
20 | }
21 |
22 |
23 | @end
24 |
--------------------------------------------------------------------------------
/rate-screen-旋转/rate-screen/rate-screen/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // rate-screen
4 | //
5 | // Created by zzg on 2019/3/24.
6 | // Copyright © 2019 zzg. 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 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Podfile:
--------------------------------------------------------------------------------
1 |
2 | platform :ios, '8.0'
3 |
4 | target 'wechatShare' do
5 | pod 'WechatOpenSDK'
6 | pod 'TencentOpenAPI'
7 | end
8 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Podfile.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - TencentOpenAPI (1.0.0)
3 | - WechatOpenSDK (1.8.3)
4 |
5 | DEPENDENCIES:
6 | - TencentOpenAPI
7 | - WechatOpenSDK
8 |
9 | SPEC REPOS:
10 | https://github.com/cocoapods/specs.git:
11 | - TencentOpenAPI
12 | - WechatOpenSDK
13 |
14 | SPEC CHECKSUMS:
15 | TencentOpenAPI: ddc6fb0134b25c9078ccd27fd2259ed0cc30a49a
16 | WechatOpenSDK: 3117412f8aafde4758cac1e8d20b93c67cafcfef
17 |
18 | PODFILE CHECKSUM: 2f6e0acd16dabb5e7aecb237e82d7796bce765a8
19 |
20 | COCOAPODS: 1.5.3
21 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Private/WechatOpenSDK/WXApi.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WXApi.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Private/WechatOpenSDK/WXApiObject.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WXApiObject.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Private/WechatOpenSDK/WechatAuthSDK.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WechatAuthSDK.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/QQApiInterface.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/QQApiInterface.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/QQApiInterfaceObject.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/QQApiInterfaceObject.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/TencentApiInterface.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/TencentApiInterface.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/TencentMessageObject.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/TencentMessageObject.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/TencentOAuth.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/TencentOAuth.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/TencentOAuthObject.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/TencentOAuthObject.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/TencentOpenAPI/TencentOpenAPI/sdkdef.h:
--------------------------------------------------------------------------------
1 | ../../../../TencentOpenAPI/TencentOpenAPI.framework/Headers/sdkdef.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/WechatOpenSDK/WXApi.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WXApi.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/WechatOpenSDK/WXApiObject.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WXApiObject.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Headers/Public/WechatOpenSDK/WechatAuthSDK.h:
--------------------------------------------------------------------------------
1 | ../../../WechatOpenSDK/WeChatSDK1.8.3/WechatAuthSDK.h
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Manifest.lock:
--------------------------------------------------------------------------------
1 | PODS:
2 | - TencentOpenAPI (1.0.0)
3 | - WechatOpenSDK (1.8.3)
4 |
5 | DEPENDENCIES:
6 | - TencentOpenAPI
7 | - WechatOpenSDK
8 |
9 | SPEC REPOS:
10 | https://github.com/cocoapods/specs.git:
11 | - TencentOpenAPI
12 | - WechatOpenSDK
13 |
14 | SPEC CHECKSUMS:
15 | TencentOpenAPI: ddc6fb0134b25c9078ccd27fd2259ed0cc30a49a
16 | WechatOpenSDK: 3117412f8aafde4758cac1e8d20b93c67cafcfef
17 |
18 | PODFILE CHECKSUM: 2f6e0acd16dabb5e7aecb237e82d7796bce765a8
19 |
20 | COCOAPODS: 1.5.3
21 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Target Support Files/Pods-wechatShare/Pods-wechatShare-acknowledgements.markdown:
--------------------------------------------------------------------------------
1 | # Acknowledgements
2 | This application makes use of the following third party libraries:
3 |
4 | ## TencentOpenAPI
5 |
6 | MIT License
7 |
8 | Copyright (c) 2018 itollei
9 |
10 | Permission is hereby granted, free of charge, to any person obtaining a copy
11 | of this software and associated documentation files (the "Software"), to deal
12 | in the Software without restriction, including without limitation the rights
13 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 | copies of the Software, and to permit persons to whom the Software is
15 | furnished to do so, subject to the following conditions:
16 |
17 | The above copyright notice and this permission notice shall be included in all
18 | copies or substantial portions of the Software.
19 |
20 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
23 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
25 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 | SOFTWARE.
27 |
28 |
29 | ## WechatOpenSDK
30 |
31 | Copyright 2018 tencent.com. All rights reserved.
32 |
33 | Generated by CocoaPods - https://cocoapods.org
34 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Target Support Files/Pods-wechatShare/Pods-wechatShare-dummy.m:
--------------------------------------------------------------------------------
1 | #import
2 | @interface PodsDummy_Pods_wechatShare : NSObject
3 | @end
4 | @implementation PodsDummy_Pods_wechatShare
5 | @end
6 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Target Support Files/Pods-wechatShare/Pods-wechatShare.debug.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/TencentOpenAPI"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TencentOpenAPI" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TencentOpenAPI" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"WeChatSDK" -l"c++" -l"iconv" -l"sqlite3" -l"sqlite3.0" -l"stdc++" -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Security" -framework "SystemConfiguration" -framework "TencentOpenAPI" -framework "UIKit"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
10 | PODS_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/Target Support Files/Pods-wechatShare/Pods-wechatShare.release.xcconfig:
--------------------------------------------------------------------------------
1 | FRAMEWORK_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/TencentOpenAPI"
2 | GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1
3 | HEADER_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/Headers/Public" "${PODS_ROOT}/Headers/Public/TencentOpenAPI" "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
4 | LIBRARY_SEARCH_PATHS = $(inherited) "${PODS_ROOT}/WechatOpenSDK/WeChatSDK1.8.3"
5 | OTHER_CFLAGS = $(inherited) -isystem "${PODS_ROOT}/Headers/Public" -isystem "${PODS_ROOT}/Headers/Public/TencentOpenAPI" -isystem "${PODS_ROOT}/Headers/Public/WechatOpenSDK"
6 | OTHER_LDFLAGS = $(inherited) -ObjC -l"WeChatSDK" -l"c++" -l"iconv" -l"sqlite3" -l"sqlite3.0" -l"stdc++" -l"z" -framework "CFNetwork" -framework "CoreGraphics" -framework "CoreTelephony" -framework "Security" -framework "SystemConfiguration" -framework "TencentOpenAPI" -framework "UIKit"
7 | PODS_BUILD_DIR = ${BUILD_DIR}
8 | PODS_CONFIGURATION_BUILD_DIR = ${PODS_BUILD_DIR}/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)
9 | PODS_PODFILE_DIR_PATH = ${SRCROOT}/.
10 | PODS_ROOT = ${SRCROOT}/Pods
11 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2018 itollei
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 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/README.md:
--------------------------------------------------------------------------------
1 | # TencentOpenAPI
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenAPI.framework/Headers/TencentApiInterface.h:
--------------------------------------------------------------------------------
1 | //
2 | // TencentMessage.h
3 | // TencentOpenApi_IOS
4 | //
5 | // Created by qqconnect on 13-5-29.
6 | // Copyright (c) 2013年 Tencent. All rights reserved.
7 | //
8 |
9 | #ifndef QQ_OPEN_SDK_LITE
10 |
11 | #import
12 | #import "TencentMessageObject.h"
13 |
14 | typedef enum
15 | {
16 | kIphoneQQ,
17 | kIphoneQZONE,
18 | kIphoneTIM,
19 | kThirdApp,
20 | }
21 | TecnentPlatformType;
22 |
23 | typedef enum
24 | {
25 | kTencentApiSuccess,
26 | kTencentApiPlatformUninstall,
27 | kTencentApiPlatformNotSupport,
28 | kTencentApiParamsError,
29 | kTencentApiFail,
30 | }
31 | TencentApiRetCode;
32 |
33 | @class TencentApiReq;
34 | @class TencentApiResp;
35 |
36 | /**
37 | * \brief TencentApiInterface的回调
38 | *
39 | * TencentApiInterface的回调接口
40 | * \note v1.0版本只支持腾讯业务拉起第三方请求内容
41 | */
42 | @protocol TencentApiInterfaceDelegate
43 |
44 | @optional
45 | /**
46 | * 请求获得内容 当前版本只支持第三方相应腾讯业务请求
47 | */
48 | - (BOOL)onTencentReq:(TencentApiReq *)req;
49 |
50 | /**
51 | * 响应请求答复 当前版本只支持腾讯业务相应第三方的请求答复
52 | */
53 | - (BOOL)onTencentResp:(TencentApiResp *)resp;
54 |
55 | @end
56 |
57 | /**
58 | * \brief TencentApiInterface的回调
59 | *
60 | * TencentApiInterface的调用接口
61 | * \note v1.0版本只支持第三方答复内容
62 | */
63 | @interface TencentApiInterface : NSObject
64 |
65 | /**
66 | * 发送答复返回腾讯业务
67 | * \param resp 答复内容
68 | * \return 返回码
69 | */
70 | + (TencentApiRetCode)sendRespMessageToTencentApp:(TencentApiResp *)resp;
71 |
72 | /**
73 | * 是否可以处理拉起协议
74 | * \param url
75 | * \param delegate 指定的回调
76 | * \return 是否是腾讯API认识的消息类型
77 | */
78 | + (BOOL)canOpenURL:(NSURL *)url delegate:(id)delegate;
79 |
80 | /**
81 | * 处理应用拉起协议
82 | * \param url
83 | * \param delegate 指定的回调
84 | * \return 是否是腾讯API认识的消息类型
85 | */
86 | + (BOOL)handleOpenURL:(NSURL *)url delegate:(id)delegate;
87 |
88 | /**
89 | * 用户设备是否安装腾讯APP
90 | * \param platform 指定的腾讯业务
91 | * \return YES:安装 NO:未安装
92 | */
93 | + (BOOL)isTencentAppInstall:(TecnentPlatformType)platform;
94 |
95 | /**
96 | * 用户设备是否支持调用SDK
97 | * \param platform 指定的腾讯业务
98 | * \return YES:支持 NO:不支持
99 | */
100 | + (BOOL)isTencentAppSupportTencentApi:(TecnentPlatformType)platform;
101 |
102 | @end
103 |
104 | #endif
105 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenAPI.framework/Resources/ios_open_sdk_3.2.2.500_iphone_release:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenAPI.framework/Resources/ios_open_sdk_3.2.2.500_iphone_release
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenAPI.framework/TencentOpenAPI:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenAPI.framework/TencentOpenAPI
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/Info.plist:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/Info.plist
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/error.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/error.png
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/qqicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/qqicon.png
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/success.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/TencentOpenAPI/TencentOpenApi_IOS_Bundle.bundle/success.png
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/WechatOpenSDK/WeChatSDK1.8.3/WechatAuthSDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // WechatAuthSDK.h
3 | // WechatAuthSDK
4 | //
5 | // Created by 李凯 on 13-11-29.
6 | // Copyright (c) 2013年 Tencent. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | enum AuthErrCode {
13 | WechatAuth_Err_Ok = 0, //Auth成功
14 | WechatAuth_Err_NormalErr = -1, //普通错误
15 | WechatAuth_Err_NetworkErr = -2, //网络错误
16 | WechatAuth_Err_GetQrcodeFailed = -3, //获取二维码失败
17 | WechatAuth_Err_Cancel = -4, //用户取消授权
18 | WechatAuth_Err_Timeout = -5, //超时
19 | };
20 |
21 | @protocol WechatAuthAPIDelegate
22 | @optional
23 |
24 | - (void)onAuthGotQrcode:(UIImage *)image; //得到二维码
25 | - (void)onQrcodeScanned; //二维码被扫描
26 | - (void)onAuthFinish:(int)errCode AuthCode:(NSString *)authCode; //成功登录
27 |
28 | @end
29 |
30 | @interface WechatAuthSDK : NSObject{
31 | NSString *_sdkVersion;
32 | __weak id _delegate;
33 | }
34 |
35 | @property(nonatomic, weak) id delegate;
36 | @property(nonatomic, readonly) NSString *sdkVersion; //authSDK版本号
37 |
38 | /*! @brief 发送登录请求,等待WechatAuthAPIDelegate回调
39 | *
40 | * @param appId 微信开发者ID
41 | * @param nonceStr 一个随机的尽量不重复的字符串,用来使得每次的signature不同
42 | * @param timeStamp 时间戳
43 | * @param scope 应用授权作用域,拥有多个作用域用逗号(,)分隔
44 | * @param signature 签名
45 | * @param schemeData 会在扫码后拼在scheme后
46 | * @return 成功返回YES,失败返回NO
47 | 注:该实现只保证同时只有一个Auth在运行,Auth未完成或未Stop再次调用Auth接口时会返回NO。
48 | */
49 |
50 | - (BOOL)Auth:(NSString *)appId
51 | nonceStr:(NSString *)nonceStr
52 | timeStamp:(NSString*)timeStamp
53 | scope:(NSString *)scope
54 | signature:(NSString *)signature
55 | schemeData:(NSString *)schemeData;
56 |
57 |
58 | /*! @brief 暂停登录请求
59 | *
60 | * @return 成功返回YES,失败返回NO。
61 | */
62 | - (BOOL)StopAuth;
63 |
64 | @end
65 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/Pods/WechatOpenSDK/WeChatSDK1.8.3/libWeChatSDK.a:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/Pods/WechatOpenSDK/WeChatSDK1.8.3/libWeChatSDK.a
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
9 |
10 |
11 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/123.imageset/123@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/wechatShare/Assets.xcassets/123.imageset/123@2x.png
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/123.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "scale" : "1x"
6 | },
7 | {
8 | "idiom" : "universal",
9 | "filename" : "123@2x.png",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "20x20",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "20x20",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "29x29",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "29x29",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "40x40",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "40x40",
31 | "scale" : "3x"
32 | },
33 | {
34 | "idiom" : "iphone",
35 | "size" : "60x60",
36 | "scale" : "2x"
37 | },
38 | {
39 | "idiom" : "iphone",
40 | "size" : "60x60",
41 | "scale" : "3x"
42 | },
43 | {
44 | "idiom" : "ipad",
45 | "size" : "20x20",
46 | "scale" : "1x"
47 | },
48 | {
49 | "idiom" : "ipad",
50 | "size" : "20x20",
51 | "scale" : "2x"
52 | },
53 | {
54 | "idiom" : "ipad",
55 | "size" : "29x29",
56 | "scale" : "1x"
57 | },
58 | {
59 | "idiom" : "ipad",
60 | "size" : "29x29",
61 | "scale" : "2x"
62 | },
63 | {
64 | "idiom" : "ipad",
65 | "size" : "40x40",
66 | "scale" : "1x"
67 | },
68 | {
69 | "idiom" : "ipad",
70 | "size" : "40x40",
71 | "scale" : "2x"
72 | },
73 | {
74 | "idiom" : "ipad",
75 | "size" : "76x76",
76 | "scale" : "1x"
77 | },
78 | {
79 | "idiom" : "ipad",
80 | "size" : "76x76",
81 | "scale" : "2x"
82 | },
83 | {
84 | "idiom" : "ipad",
85 | "size" : "83.5x83.5",
86 | "scale" : "2x"
87 | },
88 | {
89 | "idiom" : "ios-marketing",
90 | "size" : "1024x1024",
91 | "scale" : "1x"
92 | }
93 | ],
94 | "info" : {
95 | "version" : 1,
96 | "author" : "xcode"
97 | }
98 | }
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "info" : {
3 | "version" : 1,
4 | "author" : "xcode"
5 | }
6 | }
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/world.imageset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "universal",
5 | "filename" : "world.jpg",
6 | "scale" : "1x"
7 | },
8 | {
9 | "idiom" : "universal",
10 | "scale" : "2x"
11 | },
12 | {
13 | "idiom" : "universal",
14 | "scale" : "3x"
15 | }
16 | ],
17 | "info" : {
18 | "version" : 1,
19 | "author" : "xcode"
20 | }
21 | }
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Assets.xcassets/world.imageset/world.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/7General/iOS-openICloud/6693dde81ae425c736a40d9806348bbf9a4545bd/wechatShare/wechatShare/wechatShare/Assets.xcassets/world.imageset/world.jpg
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/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 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/ViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.h
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import "ViewController.h"
10 | #import "OSShareHelper.h"
11 |
12 | @interface ViewController ()
13 |
14 | @end
15 |
16 | @implementation ViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view, typically from a nib.
21 | }
22 |
23 | -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
24 | NSLog(@"-=---");
25 | /* 微信 */
26 | // [[OSShareHelper shareInstance] shareTextMessage:@"爱我中华" shareType:(OSShareTypeWXFriend) shareResult:^(BOOL result) {
27 | // NSLog(@"resoult");
28 | // }];
29 |
30 | /* QQ */
31 |
32 | [[OSShareHelper shareInstance] shareMediaMessageWithTitle:@"QQ分享" description:@"中国虎东北浪中国虎东北浪中国虎东北浪中国虎东北浪中国虎东北浪中国虎东北浪123" thumbImage:[UIImage imageNamed:@"123"] shareURL:@"http://www.osjoin.com/ios/70.html" shareType:OSShareTypeWXFriend shareResult:^(BOOL result) {
33 | NSLog(@"resoult,www.osjoin.com");
34 | }];
35 | }
36 |
37 |
38 | - (void)didReceiveMemoryWarning {
39 | [super didReceiveMemoryWarning];
40 | // Dispose of any resources that can be recreated.
41 | }
42 |
43 |
44 | @end
45 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/info/OSQQShareSDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // 微信朋友圈 OSQQShareSDK.h
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 | typedef enum : NSUInteger {
13 | OSQQShareQType, //微信聊天界面
14 | OSQQShareQZoneType //微信朋友圈
15 | } OSQQShareType;
16 |
17 |
18 |
19 | @interface OSQQShareSDK : NSObject
20 |
21 |
22 | - (id)initWithShareID:(NSString *)shareID;
23 |
24 | - (BOOL)isQQOpenURL:(NSURL *)url;
25 |
26 | - (BOOL)handleOpenUrl:(NSURL*)url;
27 |
28 | + (BOOL)canSupportShare;
29 |
30 | - (void)shareTextMessage:(NSString *)textMessage
31 | shareType:(OSQQShareType)shareType
32 | shareResult:(void(^)(BOOL result))shareResult;
33 |
34 | - (void)shareMediaMessageWithTitle:(NSString *)title
35 | description:(NSString *)description
36 | thumbImage:(UIImage *)thumbImage
37 | shareURL:(NSString *)shareURL
38 | shareType:(OSQQShareType)shareType
39 | shareResult:(void(^)(BOOL result))shareResult;
40 |
41 |
42 | @end
43 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/info/OSShareHelper.h:
--------------------------------------------------------------------------------
1 | //
2 | // OSShareHelper.h
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 |
13 | typedef enum : NSUInteger {
14 | OSShareTypeWXFriend,
15 | OSShareTypeWXTimeline,
16 | OSShareTypeWXFavorite,
17 | OSShareTypeWBShare, //微博分享
18 | OSShareTypeQQShare, //QQ分享
19 | OSShareTypeQQZoneShare //QQ空间分享
20 |
21 | } OSShareType;
22 |
23 |
24 | @interface OSShareHelper : NSObject
25 |
26 | + (instancetype)shareInstance;
27 |
28 | - (void)setShareSDKKeysWithQQID:(NSString *)qqID wechatID:(NSString *)wechatID weiBoID:(NSString *)weiBoID;
29 |
30 | + (BOOL)isShareOpenURL:(NSURL *)url;
31 |
32 | - (BOOL)handleOpenUrl:(NSURL *)url;
33 |
34 | + (BOOL)canSupportShare:(OSShareType)shareType;
35 |
36 | - (void)shareTextMessage:(NSString *)textMessage shareType:(OSShareType)shareType shareResult:(void(^)(BOOL result))shareResult;
37 |
38 | - (void)shareMediaMessageWithTitle:(NSString *)title
39 | description:(NSString *)description
40 | thumbImage:(UIImage *)thumbImage
41 | shareURL:(NSString *)shareURL
42 | shareType:(OSShareType)shareType
43 | shareResult:(void(^)(BOOL result))shareResult;
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/info/OSWeChatShareSDK.h:
--------------------------------------------------------------------------------
1 | //
2 | // wts.h
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. All rights reserved.
7 | //
8 |
9 | #import
10 | #import
11 |
12 |
13 | typedef enum : NSUInteger {
14 | GZWeChatShareTypeFriend, //微信聊天界面
15 | GZWeChatShareTypeTimeline, //微信朋友圈
16 | GZWeChatShareTypeFavorite //微信收藏
17 | } GZWeChatShareType;
18 |
19 | @interface OSWeChatShareSDK : NSObject
20 |
21 |
22 | - (id)initWithShareID:(NSString *)shareID;
23 |
24 |
25 | - (BOOL)isWechatOpenURL:(NSURL *)url;
26 |
27 |
28 | - (BOOL)handleOpenUrl:(NSURL*)url;
29 |
30 |
31 | + (BOOL)canSupportShare;
32 |
33 |
34 | - (void)shareTextMessage:(NSString *)textMessage
35 | shareType:(GZWeChatShareType)shareType
36 | shareResult:(void(^)(BOOL result))shareResult;
37 |
38 |
39 | - (void)shareMediaMessageWithTitle:(NSString *)title
40 | description:(NSString *)description
41 | thumbImage:(UIImage *)thumbImage
42 | shareURL:(NSString *)shareURL
43 | shareType:(GZWeChatShareType)shareType
44 | shareResult:(void(^)(BOOL result))shareResult;
45 |
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/wechatShare/wechatShare/wechatShare/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // wechatShare
4 | //
5 | // Created by zzg on 2018/12/10.
6 | // Copyright © 2018年 zzg. 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 |
--------------------------------------------------------------------------------