Browse Source

修改了demo里的文件命名为ZZTestViewController
UIViewController添加了zz_viewDidDisappearBlock扩展

zzb 3 years ago
parent
commit
3459aa2479

+ 2 - 2
Example/Podfile.lock

@@ -73,8 +73,8 @@ SPEC CHECKSUMS:
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   Yoga: cff67a400f6b74dc38eb0bad4f156673d9aa980c
   ZZFoundation: 91e9ee45372135b8fc4d10a7dd76cc6c164d4d51
-  ZZUIKit: 64a1e4572645e6f9dc00504b123ab74a52f350bd
+  ZZUIKit: 364ee3381072cba4ae267a26734ff51851f28c61
 
-PODFILE CHECKSUM: b910f79bcb127de3200b23f171ceda48e9d8c8e8
+PODFILE CHECKSUM: 1b609e1fcc63b784675098040f92ea06856c80ae
 
 COCOAPODS: 1.10.1

+ 2 - 1
Example/Pods/Local Podspecs/ZZUIKit.podspec.json

@@ -40,7 +40,8 @@
     "ZZUIKit/Classes/ZZCheckBox/*",
     "ZZUIKit/Classes/ZZRaido/*",
     "ZZUIKit/Classes/ZZSelect/*",
-    "ZZUIKit/Classes/ZZOption/*"
+    "ZZUIKit/Classes/ZZOption/*",
+    "ZZUIKit/Classes/ZZWebviewController/*"
   ],
   "resource_bundles": {
     "ZZUIKit": [

+ 2 - 2
Example/Pods/Manifest.lock

@@ -73,8 +73,8 @@ SPEC CHECKSUMS:
   Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
   Yoga: cff67a400f6b74dc38eb0bad4f156673d9aa980c
   ZZFoundation: 91e9ee45372135b8fc4d10a7dd76cc6c164d4d51
-  ZZUIKit: 64a1e4572645e6f9dc00504b123ab74a52f350bd
+  ZZUIKit: 364ee3381072cba4ae267a26734ff51851f28c61
 
-PODFILE CHECKSUM: b910f79bcb127de3200b23f171ceda48e9d8c8e8
+PODFILE CHECKSUM: 1b609e1fcc63b784675098040f92ea06856c80ae
 
 COCOAPODS: 1.10.1

File diff suppressed because it is too large
+ 1410 - 1259
Example/Pods/Pods.xcodeproj/project.pbxproj


+ 10 - 0
Example/Pods/Target Support Files/ZZUIKit/ZZUIKit-umbrella.h

@@ -10,6 +10,7 @@
 #endif
 #endif
 
+#import "ZZNavigationController.h"
 #import "ZZUIKit.h"
 #import "ZZUIKitConst.h"
 #import "UIAlertController+ZZEx.h"
@@ -29,6 +30,7 @@
 #import "UIView+ZZFrame.h"
 #import "UIView+ZZGesture.h"
 #import "UIView+ZZShot.h"
+#import "UIViewController+ZZEx.h"
 #import "ZZUIKitEx.h"
 #import "ZZColor.h"
 #import "ZZFont.h"
@@ -50,8 +52,16 @@
 #import "ZZDialog.h"
 #import "ZZDialogViewController.h"
 #import "ZZTextImgView.h"
+#import "ZZTextInputWidget.h"
 #import "ZZTextWidget.h"
 #import "ZZViewController.h"
+#import "ZZInfoWidget.h"
+#import "ZZSwitchWidget.h"
+#import "ZZCheckBox.h"
+#import "ZZRadio.h"
+#import "ZZSelect.h"
+#import "ZZOption.h"
+#import "ZZWebviewController.h"
 
 FOUNDATION_EXPORT double ZZUIKitVersionNumber;
 FOUNDATION_EXPORT const unsigned char ZZUIKitVersionString[];

+ 6 - 6
Example/ZZUIKit.xcodeproj/project.pbxproj

@@ -21,7 +21,7 @@
 		6003F598195388D20070C39A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 6003F596195388D20070C39A /* InfoPlist.strings */; };
 		6003F59A195388D20070C39A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F599195388D20070C39A /* main.m */; };
 		6003F59E195388D20070C39A /* ZZAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F59D195388D20070C39A /* ZZAppDelegate.m */; };
-		6003F5A7195388D20070C39A /* ZZViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* ZZViewController.m */; };
+		6003F5A7195388D20070C39A /* ZZTestViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6003F5A6195388D20070C39A /* ZZTestViewController.m */; };
 		6003F5A9195388D20070C39A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6003F5A8195388D20070C39A /* Images.xcassets */; };
 		6003F5B0195388D20070C39A /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F5AF195388D20070C39A /* XCTest.framework */; };
 		6003F5B1195388D20070C39A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6003F58D195388D20070C39A /* Foundation.framework */; };
@@ -72,8 +72,8 @@
 		6003F59B195388D20070C39A /* ZZUIKit-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ZZUIKit-Prefix.pch"; sourceTree = "<group>"; };
 		6003F59C195388D20070C39A /* ZZAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZZAppDelegate.h; sourceTree = "<group>"; };
 		6003F59D195388D20070C39A /* ZZAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZZAppDelegate.m; sourceTree = "<group>"; };
-		6003F5A5195388D20070C39A /* ZZViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZZViewController.h; sourceTree = "<group>"; };
-		6003F5A6195388D20070C39A /* ZZViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZZViewController.m; sourceTree = "<group>"; };
+		6003F5A5195388D20070C39A /* ZZTestViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ZZTestViewController.h; sourceTree = "<group>"; };
+		6003F5A6195388D20070C39A /* ZZTestViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ZZTestViewController.m; sourceTree = "<group>"; };
 		6003F5A8195388D20070C39A /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = "<group>"; };
 		6003F5AE195388D20070C39A /* ZZUIKit_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ZZUIKit_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
 		6003F5AF195388D20070C39A /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; };
@@ -171,8 +171,8 @@
 				873B8AEA1B1F5CCA007FD442 /* Main.storyboard */,
 				507E589625C00EA00028E68F /* ZZExViewController.h */,
 				507E589525C00EA00028E68F /* ZZExViewController.m */,
-				6003F5A5195388D20070C39A /* ZZViewController.h */,
-				6003F5A6195388D20070C39A /* ZZViewController.m */,
+				6003F5A5195388D20070C39A /* ZZTestViewController.h */,
+				6003F5A6195388D20070C39A /* ZZTestViewController.m */,
 				50558E8C25B075CD007F26BE /* ZZDoubleVC.h */,
 				50558E8D25B075CD007F26BE /* ZZDoubleVC.m */,
 				5046870B25AFE82A00F6139F /* ZZStackViewController.h */,
@@ -443,7 +443,7 @@
 				505E622525B1840600A3BB42 /* ZZSOViewController.m in Sources */,
 				507E589725C00EA00028E68F /* ZZExViewController.m in Sources */,
 				6003F59E195388D20070C39A /* ZZAppDelegate.m in Sources */,
-				6003F5A7195388D20070C39A /* ZZViewController.m in Sources */,
+				6003F5A7195388D20070C39A /* ZZTestViewController.m in Sources */,
 				50558E8E25B075CD007F26BE /* ZZDoubleVC.m in Sources */,
 				508510F925B6A91D00E2E58C /* ZZItemInfoController.m in Sources */,
 				5097D24025B1A17100644FF5 /* ZZSOTableViewController1.m in Sources */,

+ 20 - 13
Example/ZZUIKit/Base.lproj/Main.storyboard

@@ -1,9 +1,10 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="wwB-z8-Uvx">
+<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="17701" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="wwB-z8-Uvx">
     <device id="retina4_7" orientation="portrait" appearance="light"/>
     <dependencies>
         <deployment identifier="iOS"/>
-        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
+        <plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="17703"/>
+        <capability name="System colors in document resources" minToolsVersion="11.0"/>
         <capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
     </dependencies>
     <scenes>
@@ -30,7 +31,7 @@
                     <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="plain" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="28" sectionFooterHeight="28" id="FZ7-W5-cJS">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <sections>
                             <tableViewSection headerTitle="Ex" id="iji-Sc-qgJ">
                                 <cells>
@@ -187,7 +188,7 @@
                     <view key="view" contentMode="scaleToFill" id="LUA-H7-Pma">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                     </view>
                     <navigationItem key="navigationItem" id="deE-NE-eO5"/>
                 </viewController>
@@ -206,7 +207,7 @@
                     <view key="view" contentMode="scaleToFill" id="Z7e-0T-vih">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                     </view>
                     <navigationItem key="navigationItem" id="zcl-64-3hE"/>
                 </viewController>
@@ -230,7 +231,7 @@
                                 <rect key="frame" x="163" y="540" width="51" height="31"/>
                             </switch>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         <constraints>
                             <constraint firstItem="fSp-zR-eO3" firstAttribute="top" secondItem="Mjh-De-q3d" secondAttribute="bottom" constant="496" id="c3t-8D-5ri"/>
                             <constraint firstItem="fSp-zR-eO3" firstAttribute="centerX" secondItem="JpN-f9-fue" secondAttribute="centerX" id="dVm-Cj-c0h"/>
@@ -242,10 +243,10 @@
             </objects>
             <point key="canvasLocation" x="844" y="516"/>
         </scene>
-        <!--View Controller-->
+        <!--Test View Controller-->
         <scene sceneID="iDz-Gu-bfA">
             <objects>
-                <tableViewController id="4Fz-eK-3wB" customClass="ZZViewController" sceneMemberID="viewController">
+                <tableViewController id="4Fz-eK-3wB" customClass="ZZTestViewController" sceneMemberID="viewController">
                     <tableView key="view" clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" dataMode="static" style="insetGrouped" separatorStyle="default" rowHeight="-1" estimatedRowHeight="-1" sectionHeaderHeight="18" sectionFooterHeight="18" id="6RJ-3a-b9y">
                         <rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
                         <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
@@ -294,7 +295,7 @@
                                     </subviews>
                                 </stackView>
                             </subviews>
-                            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                         </view>
                         <view key="tableFooterView" contentMode="scaleToFill" id="MGZ-Mp-zY9">
                             <rect key="frame" x="0.0" y="420" width="375" height="82"/>
@@ -302,13 +303,13 @@
                             <subviews>
                                 <textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="fVi-Fn-dip" customClass="ZZTextWidget">
                                     <rect key="frame" x="10" y="10" width="335" height="62"/>
-                                    <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
-                                    <color key="textColor" systemColor="labelColor" cocoaTouchSystemColor="darkTextColor"/>
+                                    <color key="backgroundColor" systemColor="systemBackgroundColor"/>
+                                    <color key="textColor" systemColor="labelColor"/>
                                     <fontDescription key="fontDescription" type="system" pointSize="14"/>
                                     <textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
                                 </textView>
                             </subviews>
-                            <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                            <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                             <constraints>
                                 <constraint firstItem="fVi-Fn-dip" firstAttribute="top" secondItem="MGZ-Mp-zY9" secondAttribute="topMargin" id="MR0-r7-4eu"/>
                                 <constraint firstItem="fVi-Fn-dip" firstAttribute="trailing" secondItem="MGZ-Mp-zY9" secondAttribute="trailingMargin" id="gFU-B2-EsG"/>
@@ -460,7 +461,7 @@
                                 <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
                             </switch>
                         </subviews>
-                        <color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
+                        <color key="backgroundColor" systemColor="systemBackgroundColor"/>
                     </view>
                     <navigationItem key="navigationItem" id="lxN-Zm-yNp"/>
                     <connections>
@@ -512,5 +513,11 @@
     </scenes>
     <resources>
         <image name="shareFavorites" width="25" height="25"/>
+        <systemColor name="labelColor">
+            <color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
+        <systemColor name="systemBackgroundColor">
+            <color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+        </systemColor>
     </resources>
 </document>

+ 1 - 1
Example/ZZUIKit/ZZViewController.h

@@ -8,6 +8,6 @@
 
 @import UIKit;
 
-@interface ZZViewController : UITableViewController
+@interface ZZTestViewController : UITableViewController
 
 @end

+ 3 - 3
Example/ZZUIKit/ZZViewController.m

@@ -6,20 +6,20 @@
 //  Copyright (c) 2021 bymiracles@163.com. All rights reserved.
 //
 
-#import "ZZViewController.h"
+#import "ZZTestViewController.h"
 #import <ZZUIKit/ZZUIKitEx.h>
 #import <ZZUIKit/ZZDialog.h>
 #import <ZZUIKit/ZZDialogViewController.h>
 #import <ZZUIKit/ZZTextWidget.h>
 CGFloat const handleBarH = 200;
-@interface ZZViewController ()<ZZDialogDelegate,ZZDialogHandleDelegate>
+@interface ZZTestViewController ()<ZZDialogDelegate,ZZDialogHandleDelegate>
 @property(nonatomic,strong) ZZDialog *dialog;
 @property(nonatomic,strong) ZZDialogViewController *dialogVC;
 @property (strong, nonatomic) IBOutlet ZZTextWidget *textWidget;
 @property(nonatomic,strong) NSArray *titles;
 @end
 
-@implementation ZZViewController
+@implementation ZZTestViewController
 
 - (void)viewDidLoad
 {

+ 1 - 0
ZZUIKit/Classes/Ex/ViewController/UIViewController+ZZEx.h

@@ -15,6 +15,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property(nonatomic,copy) void(^zz_viewDidLoadBlock)(__kindof UIViewController *vc);
 @property(nonatomic,copy) void(^zz_viewWillAppearBlock)(__kindof UIViewController *vc);
 @property(nonatomic,copy) void(^zz_viewDidAppearBlock)(__kindof UIViewController *vc);
+@property(nonatomic,copy) void(^zz_viewDidDisappearBlock)(__kindof UIViewController *vc);
 @property(nonatomic,copy) void(^zz_viewWillLayoutSubviewsBlock)(__kindof UIViewController *vc);
 @property(nonatomic,copy) void(^zz_viewDidLayoutSubviewsBlock)(__kindof UIViewController *vc);
 

+ 18 - 0
ZZUIKit/Classes/Ex/ViewController/UIViewController+ZZEx.m

@@ -15,6 +15,7 @@
     ZZ_best_Swizzle(self, @selector(viewDidLoad), @selector(zz_viewDidLoad));
     ZZ_best_Swizzle(self, @selector(viewWillAppear:), @selector(zz_viewWillAppear));
     ZZ_best_Swizzle(self, @selector(viewDidAppear:), @selector(zz_viewDidAppear));
+    ZZ_best_Swizzle(self, @selector(viewDidDisappear:), @selector(zz_viewDidDisappear));
     ZZ_best_Swizzle(self, @selector(viewWillLayoutSubviews), @selector(zz_viewWillLayoutSubviews));
     ZZ_best_Swizzle(self, @selector(viewDidLayoutSubviews), @selector(zz_viewDidLayoutSubviews));
 }
@@ -70,6 +71,23 @@
     }
 }
 
+#pragma mark -- viewDidAppearBlock
+-(void)setZz_viewDidDisappearBlock:(void (^)(__kindof UIViewController * _Nonnull))zz_viewDidDisappearBlock{
+    objc_setAssociatedObject(self, @selector(zz_viewDidDisappearBlock), zz_viewDidDisappearBlock, OBJC_ASSOCIATION_COPY);
+}
+
+-(void (^)(__kindof UIViewController * _Nonnull))zz_viewDidDisappearBlock{
+    return objc_getAssociatedObject(self, @selector(zz_viewDidDisappearBlock));
+}
+
+-(void)zz_viewDidDisappear{
+    [self zz_viewDidDisappear];
+    if (self.zz_viewDidDisappearBlock) {
+        @weakify(self);
+        self.zz_viewDidDisappearBlock(weak_self);
+    }
+}
+
 #pragma mark -- zz_viewWillLayoutSubviewsBlock
 -(void)setZz_viewWillLayoutSubviewsBlock:(void (^)(__kindof UIViewController * _Nonnull))zz_viewWillLayoutSubviewsBlock{
     objc_setAssociatedObject(self, @selector(zz_viewWillLayoutSubviews), zz_viewWillLayoutSubviewsBlock, OBJC_ASSOCIATION_COPY);