Skip to content

Commit 23a3aa9

Browse files
author
chenhongwei
committed
second commit
1 parent 75496c1 commit 23a3aa9

File tree

10 files changed

+480
-6
lines changed

10 files changed

+480
-6
lines changed

HWPopTool.xcodeproj/project.pbxproj

+28
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
922B3C051C435C0D0001A162 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 922B3C031C435C0D0001A162 /* LaunchScreen.storyboard */; };
1616
922B3C101C435C0D0001A162 /* HWPopToolTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 922B3C0F1C435C0D0001A162 /* HWPopToolTests.m */; };
1717
922B3C1B1C435C0D0001A162 /* HWPopToolUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 922B3C1A1C435C0D0001A162 /* HWPopToolUITests.m */; };
18+
922B3C2C1C435CD20001A162 /* HWPopTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 922B3C2B1C435CD20001A162 /* HWPopTool.m */; };
19+
922B3C301C437DAE0001A162 /* jei.png in Resources */ = {isa = PBXBuildFile; fileRef = 922B3C2F1C437DAE0001A162 /* jei.png */; };
20+
922B3C321C437EB70001A162 /* red_packge_close.png in Resources */ = {isa = PBXBuildFile; fileRef = 922B3C311C437EB70001A162 /* red_packge_close.png */; };
21+
922B3C351C4396AE0001A162 /* SecondViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 922B3C341C4396AE0001A162 /* SecondViewController.m */; };
1822
/* End PBXBuildFile section */
1923

2024
/* Begin PBXContainerItemProxy section */
@@ -51,6 +55,12 @@
5155
922B3C161C435C0D0001A162 /* HWPopToolUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = HWPopToolUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
5256
922B3C1A1C435C0D0001A162 /* HWPopToolUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HWPopToolUITests.m; sourceTree = "<group>"; };
5357
922B3C1C1C435C0D0001A162 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
58+
922B3C2A1C435CD20001A162 /* HWPopTool.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HWPopTool.h; sourceTree = "<group>"; };
59+
922B3C2B1C435CD20001A162 /* HWPopTool.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HWPopTool.m; sourceTree = "<group>"; };
60+
922B3C2F1C437DAE0001A162 /* jei.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = jei.png; sourceTree = "<group>"; };
61+
922B3C311C437EB70001A162 /* red_packge_close.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = red_packge_close.png; sourceTree = "<group>"; };
62+
922B3C331C4396AE0001A162 /* SecondViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SecondViewController.h; sourceTree = "<group>"; };
63+
922B3C341C4396AE0001A162 /* SecondViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SecondViewController.m; sourceTree = "<group>"; };
5464
/* End PBXFileReference section */
5565

5666
/* Begin PBXFrameworksBuildPhase section */
@@ -101,10 +111,13 @@
101111
922B3BF41C435C0D0001A162 /* HWPopTool */ = {
102112
isa = PBXGroup;
103113
children = (
114+
922B3C281C435C9E0001A162 /* HWPoTools */,
104115
922B3BF81C435C0D0001A162 /* AppDelegate.h */,
105116
922B3BF91C435C0D0001A162 /* AppDelegate.m */,
106117
922B3BFB1C435C0D0001A162 /* ViewController.h */,
107118
922B3BFC1C435C0D0001A162 /* ViewController.m */,
119+
922B3C331C4396AE0001A162 /* SecondViewController.h */,
120+
922B3C341C4396AE0001A162 /* SecondViewController.m */,
108121
922B3BFE1C435C0D0001A162 /* Main.storyboard */,
109122
922B3C011C435C0D0001A162 /* Assets.xcassets */,
110123
922B3C031C435C0D0001A162 /* LaunchScreen.storyboard */,
@@ -117,6 +130,8 @@
117130
922B3BF51C435C0D0001A162 /* Supporting Files */ = {
118131
isa = PBXGroup;
119132
children = (
133+
922B3C311C437EB70001A162 /* red_packge_close.png */,
134+
922B3C2F1C437DAE0001A162 /* jei.png */,
120135
922B3BF61C435C0D0001A162 /* main.m */,
121136
);
122137
name = "Supporting Files";
@@ -140,6 +155,15 @@
140155
path = HWPopToolUITests;
141156
sourceTree = "<group>";
142157
};
158+
922B3C281C435C9E0001A162 /* HWPoTools */ = {
159+
isa = PBXGroup;
160+
children = (
161+
922B3C2A1C435CD20001A162 /* HWPopTool.h */,
162+
922B3C2B1C435CD20001A162 /* HWPopTool.m */,
163+
);
164+
path = HWPoTools;
165+
sourceTree = "<group>";
166+
};
143167
/* End PBXGroup section */
144168

145169
/* Begin PBXNativeTarget section */
@@ -243,7 +267,9 @@
243267
isa = PBXResourcesBuildPhase;
244268
buildActionMask = 2147483647;
245269
files = (
270+
922B3C301C437DAE0001A162 /* jei.png in Resources */,
246271
922B3C051C435C0D0001A162 /* LaunchScreen.storyboard in Resources */,
272+
922B3C321C437EB70001A162 /* red_packge_close.png in Resources */,
247273
922B3C021C435C0D0001A162 /* Assets.xcassets in Resources */,
248274
922B3C001C435C0D0001A162 /* Main.storyboard in Resources */,
249275
);
@@ -270,8 +296,10 @@
270296
isa = PBXSourcesBuildPhase;
271297
buildActionMask = 2147483647;
272298
files = (
299+
922B3C351C4396AE0001A162 /* SecondViewController.m in Sources */,
273300
922B3BFD1C435C0D0001A162 /* ViewController.m in Sources */,
274301
922B3BFA1C435C0D0001A162 /* AppDelegate.m in Sources */,
302+
922B3C2C1C435CD20001A162 /* HWPopTool.m in Sources */,
275303
922B3BF71C435C0D0001A162 /* main.m in Sources */,
276304
);
277305
runOnlyForDeploymentPostprocessing = 0;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Bucket
3+
type = "1"
4+
version = "2.0">
5+
</Bucket>

HWPopTool/AppDelegate.m

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "AppDelegate.h"
10+
#import "ViewController.h"
1011

1112
@interface AppDelegate ()
1213

@@ -16,7 +17,14 @@ @implementation AppDelegate
1617

1718

1819
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
19-
// Override point for customization after application launch.
20+
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
21+
self.window.backgroundColor = [UIColor whiteColor];
22+
23+
ViewController *vc = [[ViewController alloc]init];
24+
UINavigationController *nav = [[UINavigationController alloc]initWithRootViewController:vc];
25+
self.window.rootViewController = nav;
26+
[self.window makeKeyAndVisible];
27+
2028
return YES;
2129
}
2230

HWPopTool/Base.lproj/Main.storyboard

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="9531" systemVersion="15C50" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9529"/>
56
</dependencies>
67
<scenes>
78
<!--View Controller-->
89
<scene sceneID="tne-QT-ifu">
910
<objects>
10-
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController">
11+
<viewController id="BYZ-38-t0r" customClass="ViewController" sceneMemberID="viewController">
1112
<layoutGuides>
1213
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
1314
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
@@ -20,6 +21,7 @@
2021
</viewController>
2122
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
2223
</objects>
24+
<point key="canvasLocation" x="577" y="422"/>
2325
</scene>
2426
</scenes>
2527
</document>

HWPopTool/HWPoTools/HWPopTool.h

+59
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,66 @@
77
//
88

99
#import <Foundation/Foundation.h>
10+
#import <UIKit/UIKit.h>
11+
/**
12+
* 关闭按钮的位置
13+
*/
14+
typedef NS_ENUM(NSInteger, ButtonPositionType) {
15+
/**
16+
* 无
17+
*/
18+
ButtonPositionTypeNone = 0,
19+
/**
20+
* 左上角
21+
*/
22+
ButtonPositionTypeLeft = 1 << 0,
23+
/**
24+
* 右上角
25+
*/
26+
ButtonPositionTypeRight = 2 << 0
27+
};
28+
/**
29+
* 蒙板的背景色
30+
*/
31+
typedef NS_ENUM(NSInteger, ShadeBackgroundType) {
32+
/**
33+
* 渐变色
34+
*/
35+
ShadeBackgroundTypeGradient = 0,
36+
/**
37+
* 固定色
38+
*/
39+
ShadeBackgroundTypeSolid = 1 << 0
40+
};
41+
42+
typedef void(^completeBlock)(void);
1043

1144
@interface HWPopTool : NSObject
1245

46+
@property (strong, nonatomic) UIColor *popBackgroudColor;//弹出视图的背景色
47+
@property (assign, nonatomic) BOOL tapOutsideToDismiss;//点击蒙板是否弹出视图消失
48+
@property (assign, nonatomic) ButtonPositionType closeButtonType;//关闭按钮的类型
49+
@property (assign, nonatomic) ShadeBackgroundType shadeBackgroundType;//蒙板的背景色
50+
51+
/**
52+
* 创建一个实例
53+
*
54+
* @return CHWPopTool
55+
*/
56+
+ (HWPopTool *)sharedInstance;
57+
/**
58+
* 弹出要展示的View
59+
*
60+
* @param presentView show View
61+
* @param animated 是否动画
62+
*/
63+
- (void)showWithPresentView:(UIView *)presentView animated:(BOOL)animated;
64+
/**
65+
* 关闭弹出视图
66+
*
67+
* @param complete complete block
68+
*/
69+
- (void)closeWithBlcok:(void(^)())complete;
70+
1371
@end
72+

0 commit comments

Comments
 (0)