Skip to content
This repository was archived by the owner on Sep 6, 2019. It is now read-only.

Commit 114f257

Browse files
committed
1. 集成了 Masonry,支持自动布局。
2. 接口可以设置字体了。 3. 其他优化。
1 parent a54c44c commit 114f257

File tree

11 files changed

+336
-148
lines changed

11 files changed

+336
-148
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,5 @@ iOSInjectionProject/
6464
RKOTextViewManager/.Archive/README.md
6565
.Archive/README.md
6666
RKOTopAlertManager/.Archive/README.md
67+
RKOTopAlertManager/RKOTopAlert/Pods
68+
*.xcworkspacedata

README.md

+8-5
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ textViewWithCode.needBorder = YES;
8282
### RKOTopAlert
8383
8484
<p align="left">
85-
<a href=""><img src="https://img.shields.io/badge/pod-v1.0.5-brightgreen.svg"></a>
85+
<a href=""><img src="https://img.shields.io/badge/pod-v1.1.0-brightgreen.svg"></a>
8686
<a href=""><img src="https://img.shields.io/badge/ObjectiveC-compatible-orange.svg"></a>
87-
<a href=""><img src="https://img.shields.io/badge/platform-iOS%207.0%2B-ff69b5152950834.svg"></a>
87+
<a href=""><img src="https://img.shields.io/badge/platform-iOS%209.0%2B-ff69b5152950834.svg"></a>
8888
<a href="https://github.com/rakuyoMo/RKOTools/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>
8989
</p>
9090
@@ -93,14 +93,17 @@ textViewWithCode.needBorder = YES;
9393
#### 集成:
9494
9595
```shell
96-
pod 'RKOTopAlert', '~> 1.0.5'
96+
pod 'RKOTopAlert', '~> 1.1.0'
9797
```
9898

9999
#### 使用:
100100

101101
```objc
102-
RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"提示文字" textColor:[UIColor whiteColor] backgroundColor:[UIColor redColor] iconImageName:nil];
103-
102+
RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"单独设置提示文字"
103+
textColor:[UIColor whiteColor]
104+
backgroundColor:[UIColor redColor]
105+
iconImageName:nil
106+
font:[UIFont systemFontOfSize:15.0f]];
104107
[topAlert alertAppearWithDuration:2.0];
105108
```
106109

RKOTopAlertManager/README.md

+20-9
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
# RKOTopAlert
22

33
<p align="center">
4-
<a href=""><img src="https://img.shields.io/badge/pod-v1.0.5-brightgreen.svg"></a>
4+
<a href=""><img src="https://img.shields.io/badge/pod-v1.1.0-brightgreen.svg"></a>
55
<a href=""><img src="https://img.shields.io/badge/ObjectiveC-compatible-orange.svg"></a>
6-
<a href=""><img src="https://img.shields.io/badge/platform-iOS%207.0%2B-ff69b5152950834.svg"></a>
6+
<a href=""><img src="https://img.shields.io/badge/platform-iOS%209.0%2B-ff69b5152950834.svg"></a>
77
<a href="https://github.com/rakuyoMo/RKOTools/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg?style=flat"></a>
88
</p>
99

1010
## 简介
1111

1212
自定义一个顶端的`Alert`提示窗。弹出时从顶端向下移动。(**在iPhone X下可用**
1313

14-
随仓库配套了一个简单的 **演示Demo**,方便大家使用参考。
14+
集成了 `Masonry` 来做自动布局,支持横屏。
15+
16+
随仓库配套了一个简单的 **演示Demo**,方便大家使用参考,使用时请先更新 `pod`
1517

1618
可以设置**提示文字****文字颜色****背景颜色****提醒图标**
1719

@@ -27,21 +29,24 @@
2729

2830
## 已知问题
2931

30-
该控件还**未做自动布局**,故在横屏下会出现问题。
32+
3133

3234
## 集成
3335

3436
```shell
35-
pod 'RKOTopAlert', '~> 1.0.5'
37+
pod 'RKOTopAlert', '~> 1.1.0'
3638
```
3739

3840
## 使用
3941

4042
使用下面的方法创建一个`Alert`视图,对`Alert`视图调用 `alertAppearWithDuration` 并设置时候,即可弹出 `Alert`视图。
4143

4244
```objc
43-
RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"提示文字" textColor:[UIColor whiteColor] backgroundColor:[UIColor redColor] iconImageName:nil];
44-
45+
RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"单独设置提示文字"
46+
textColor:[UIColor whiteColor]
47+
backgroundColor:[UIColor redColor]
48+
iconImageName:nil
49+
font:[UIFont systemFontOfSize:15.0f]];
4550
[topAlert alertAppearWithDuration:2.0];
4651
```
4752
@@ -53,7 +58,11 @@ RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"提示文字" textColor
5358
5459
// 懒加载属性,创建对象并设置样式。
5560
- (RKOTopAlert *)topAlert {
56-
return [RKOTopAlert alertViewWithText:@"在AppDelegate中总体设置" textColor:[UIColor blackColor] backgroundColor:[UIColor orangeColor] iconImageName:nil];
61+
return [RKOTopAlert alertViewWithText:@"在AppDelegate中总体设置"
62+
textColor:[UIColor blackColor]
63+
backgroundColor:[UIColor orangeColor]
64+
iconImageName:nil
65+
font:[UIFont systemFontOfSize:15.0f]];
5766
}
5867
5968
// 在按钮方法或其它方法中,获取属性调用弹出方法。
@@ -74,12 +83,14 @@ RKOTopAlert *topAlert = [RKOTopAlert alertViewWithText:@"提示文字" textColor
7483
* @param textColor 文字颜色。
7584
* @param backgroundColor 提示窗背景颜色。
7685
* @param iconImageName 左侧提示图标的图片名。
86+
* @param font 文字字体
7787
* @return 调用对象本身
7888
*/
7989
+ (instancetype)alertViewWithText:(NSString *)text
8090
textColor:(UIColor *)textColor
8191
backgroundColor:(UIColor *)backgroundColor
82-
iconImageName:(nullable NSString *)iconImageName;
92+
iconImageName:(nullable NSString *)iconImageName
93+
font:(UIFont *)font;
8394
```
8495

8596
此外,我们分别提供了弹窗弹窗的**弹出**方法与**消失**方法,方便您动态地控制弹窗的弹出与消失:

RKOTopAlertManager/RKOTopAlert.podspec

+5-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
Pod::Spec.new do |s|
1010

1111
s.name = "RKOTopAlert"
12-
s.version = "1.0.5"
12+
s.version = "1.1.0"
1313
s.summary = "Appears at the top of the notification view"
1414
s.description = <<-DESC
1515
Appears at the top of the notification view
@@ -21,14 +21,16 @@ Pod::Spec.new do |s|
2121

2222
s.author = { "Rakuyo" => "[email protected]" }
2323

24-
s.ios.deployment_target = "7.0"
24+
s.ios.deployment_target = "9.0"
2525

26-
s.source = { :git => "https://github.com/rakuyoMo/RKOControls.git", :tag => "1.0.10" } # #{s.version}
26+
s.source = { :git => "https://github.com/rakuyoMo/RKOControls.git", :tag => "1.3.11" } # #{s.version}
2727

2828
s.requires_arc = true
2929

3030
s.source_files = "RKOTopAlertManager/RKOTopAlert/RKOTopAlert/RKOTopAlert/*.{h,m}"
3131

3232
s.resources = "RKOTopAlertManager/RKOTopAlert/RKOTopAlert/RKOTopAlert/*.{png,xib,nib,bundle}"
3333

34+
s.dependency "Masonry"
35+
3436
end
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Uncomment the next line to define a global platform for your project
2+
# platform :ios, '9.0'
3+
4+
target 'RKOTopAlert' do
5+
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
6+
# use_frameworks!
7+
8+
# Pods for RKOTopAlert
9+
10+
pod 'Masonry'
11+
12+
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PODS:
2+
- Masonry (1.1.0)
3+
4+
DEPENDENCIES:
5+
- Masonry
6+
7+
SPEC CHECKSUMS:
8+
Masonry: 678fab65091a9290e40e2832a55e7ab731aad201
9+
10+
PODFILE CHECKSUM: 2089bb5cf41476709496c493a96b09abd7f4987b
11+
12+
COCOAPODS: 1.2.1

RKOTopAlertManager/RKOTopAlert/RKOTopAlert.xcodeproj/project.pbxproj

+90-1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
objects = {
88

99
/* Begin PBXBuildFile section */
10+
0A209D08867A750CF3EEF438 /* libPods-RKOTopAlert.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 63CC9D40FCCB57CBBFFD5E74 /* libPods-RKOTopAlert.a */; };
1011
AE41FC671F6248BE00959ED0 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = AE41FC661F6248BE00959ED0 /* main.m */; };
1112
AE41FC6A1F6248BE00959ED0 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = AE41FC691F6248BE00959ED0 /* AppDelegate.m */; };
1213
AE41FC6D1F6248BE00959ED0 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = AE41FC6C1F6248BE00959ED0 /* ViewController.m */; };
@@ -18,6 +19,8 @@
1819
/* End PBXBuildFile section */
1920

2021
/* Begin PBXFileReference section */
22+
5BB6B0195FDE5C7EB23FD15C /* Pods-RKOTopAlert.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RKOTopAlert.release.xcconfig"; path = "Pods/Target Support Files/Pods-RKOTopAlert/Pods-RKOTopAlert.release.xcconfig"; sourceTree = "<group>"; };
23+
63CC9D40FCCB57CBBFFD5E74 /* libPods-RKOTopAlert.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-RKOTopAlert.a"; sourceTree = BUILT_PRODUCTS_DIR; };
2124
AE41FC621F6248BE00959ED0 /* RKOTopAlert.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = RKOTopAlert.app; sourceTree = BUILT_PRODUCTS_DIR; };
2225
AE41FC661F6248BE00959ED0 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
2326
AE41FC681F6248BE00959ED0 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
@@ -31,24 +34,37 @@
3134
AE41FC7D1F6248CF00959ED0 /* RKOTopAlert.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RKOTopAlert.h; sourceTree = "<group>"; };
3235
AE41FC7E1F6248CF00959ED0 /* RKOTopAlert.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RKOTopAlert.m; sourceTree = "<group>"; };
3336
AEE5A8821FAC3C830010688D /* icon.bundle */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.plug-in"; path = icon.bundle; sourceTree = "<group>"; };
37+
CB1D1EFFB1454CDD0D18973E /* Pods-RKOTopAlert.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-RKOTopAlert.debug.xcconfig"; path = "Pods/Target Support Files/Pods-RKOTopAlert/Pods-RKOTopAlert.debug.xcconfig"; sourceTree = "<group>"; };
3438
/* End PBXFileReference section */
3539

3640
/* Begin PBXFrameworksBuildPhase section */
3741
AE41FC5F1F6248BE00959ED0 /* Frameworks */ = {
3842
isa = PBXFrameworksBuildPhase;
3943
buildActionMask = 2147483647;
4044
files = (
45+
0A209D08867A750CF3EEF438 /* libPods-RKOTopAlert.a in Frameworks */,
4146
);
4247
runOnlyForDeploymentPostprocessing = 0;
4348
};
4449
/* End PBXFrameworksBuildPhase section */
4550

4651
/* Begin PBXGroup section */
52+
6CC861756A64273DE623A138 /* Pods */ = {
53+
isa = PBXGroup;
54+
children = (
55+
CB1D1EFFB1454CDD0D18973E /* Pods-RKOTopAlert.debug.xcconfig */,
56+
5BB6B0195FDE5C7EB23FD15C /* Pods-RKOTopAlert.release.xcconfig */,
57+
);
58+
name = Pods;
59+
sourceTree = "<group>";
60+
};
4761
AE41FC591F6248BE00959ED0 = {
4862
isa = PBXGroup;
4963
children = (
5064
AE41FC641F6248BE00959ED0 /* RKOTopAlert */,
5165
AE41FC631F6248BE00959ED0 /* Products */,
66+
6CC861756A64273DE623A138 /* Pods */,
67+
E44495F44F736290E480AC8E /* Frameworks */,
5268
);
5369
sourceTree = "<group>";
5470
};
@@ -95,16 +111,27 @@
95111
path = RKOTopAlert;
96112
sourceTree = "<group>";
97113
};
114+
E44495F44F736290E480AC8E /* Frameworks */ = {
115+
isa = PBXGroup;
116+
children = (
117+
63CC9D40FCCB57CBBFFD5E74 /* libPods-RKOTopAlert.a */,
118+
);
119+
name = Frameworks;
120+
sourceTree = "<group>";
121+
};
98122
/* End PBXGroup section */
99123

100124
/* Begin PBXNativeTarget section */
101125
AE41FC611F6248BE00959ED0 /* RKOTopAlert */ = {
102126
isa = PBXNativeTarget;
103127
buildConfigurationList = AE41FC791F6248BE00959ED0 /* Build configuration list for PBXNativeTarget "RKOTopAlert" */;
104128
buildPhases = (
129+
1B04AB495B7EB4A8F38BA389 /* [CP] Check Pods Manifest.lock */,
105130
AE41FC5E1F6248BE00959ED0 /* Sources */,
106131
AE41FC5F1F6248BE00959ED0 /* Frameworks */,
107132
AE41FC601F6248BE00959ED0 /* Resources */,
133+
005DCB23089F3DB6143D1BEE /* [CP] Embed Pods Frameworks */,
134+
295CE01B97BF8028C5E42D16 /* [CP] Copy Pods Resources */,
108135
);
109136
buildRules = (
110137
);
@@ -121,7 +148,7 @@
121148
AE41FC5A1F6248BE00959ED0 /* Project object */ = {
122149
isa = PBXProject;
123150
attributes = {
124-
LastUpgradeCheck = 0830;
151+
LastUpgradeCheck = 0920;
125152
ORGANIZATIONNAME = Rakuyo;
126153
TargetAttributes = {
127154
AE41FC611F6248BE00959ED0 = {
@@ -163,6 +190,54 @@
163190
};
164191
/* End PBXResourcesBuildPhase section */
165192

193+
/* Begin PBXShellScriptBuildPhase section */
194+
005DCB23089F3DB6143D1BEE /* [CP] Embed Pods Frameworks */ = {
195+
isa = PBXShellScriptBuildPhase;
196+
buildActionMask = 2147483647;
197+
files = (
198+
);
199+
inputPaths = (
200+
);
201+
name = "[CP] Embed Pods Frameworks";
202+
outputPaths = (
203+
);
204+
runOnlyForDeploymentPostprocessing = 0;
205+
shellPath = /bin/sh;
206+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RKOTopAlert/Pods-RKOTopAlert-frameworks.sh\"\n";
207+
showEnvVarsInLog = 0;
208+
};
209+
1B04AB495B7EB4A8F38BA389 /* [CP] Check Pods Manifest.lock */ = {
210+
isa = PBXShellScriptBuildPhase;
211+
buildActionMask = 2147483647;
212+
files = (
213+
);
214+
inputPaths = (
215+
);
216+
name = "[CP] Check Pods Manifest.lock";
217+
outputPaths = (
218+
);
219+
runOnlyForDeploymentPostprocessing = 0;
220+
shellPath = /bin/sh;
221+
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n";
222+
showEnvVarsInLog = 0;
223+
};
224+
295CE01B97BF8028C5E42D16 /* [CP] Copy Pods Resources */ = {
225+
isa = PBXShellScriptBuildPhase;
226+
buildActionMask = 2147483647;
227+
files = (
228+
);
229+
inputPaths = (
230+
);
231+
name = "[CP] Copy Pods Resources";
232+
outputPaths = (
233+
);
234+
runOnlyForDeploymentPostprocessing = 0;
235+
shellPath = /bin/sh;
236+
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-RKOTopAlert/Pods-RKOTopAlert-resources.sh\"\n";
237+
showEnvVarsInLog = 0;
238+
};
239+
/* End PBXShellScriptBuildPhase section */
240+
166241
/* Begin PBXSourcesBuildPhase section */
167242
AE41FC5E1F6248BE00959ED0 /* Sources */ = {
168243
isa = PBXSourcesBuildPhase;
@@ -207,15 +282,21 @@
207282
CLANG_CXX_LIBRARY = "libc++";
208283
CLANG_ENABLE_MODULES = YES;
209284
CLANG_ENABLE_OBJC_ARC = YES;
285+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
210286
CLANG_WARN_BOOL_CONVERSION = YES;
287+
CLANG_WARN_COMMA = YES;
211288
CLANG_WARN_CONSTANT_CONVERSION = YES;
212289
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
213290
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
214291
CLANG_WARN_EMPTY_BODY = YES;
215292
CLANG_WARN_ENUM_CONVERSION = YES;
216293
CLANG_WARN_INFINITE_RECURSION = YES;
217294
CLANG_WARN_INT_CONVERSION = YES;
295+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
296+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
218297
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
298+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
299+
CLANG_WARN_STRICT_PROTOTYPES = YES;
219300
CLANG_WARN_SUSPICIOUS_MOVE = YES;
220301
CLANG_WARN_UNREACHABLE_CODE = YES;
221302
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -255,15 +336,21 @@
255336
CLANG_CXX_LIBRARY = "libc++";
256337
CLANG_ENABLE_MODULES = YES;
257338
CLANG_ENABLE_OBJC_ARC = YES;
339+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
258340
CLANG_WARN_BOOL_CONVERSION = YES;
341+
CLANG_WARN_COMMA = YES;
259342
CLANG_WARN_CONSTANT_CONVERSION = YES;
260343
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
261344
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
262345
CLANG_WARN_EMPTY_BODY = YES;
263346
CLANG_WARN_ENUM_CONVERSION = YES;
264347
CLANG_WARN_INFINITE_RECURSION = YES;
265348
CLANG_WARN_INT_CONVERSION = YES;
349+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
350+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
266351
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
352+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
353+
CLANG_WARN_STRICT_PROTOTYPES = YES;
267354
CLANG_WARN_SUSPICIOUS_MOVE = YES;
268355
CLANG_WARN_UNREACHABLE_CODE = YES;
269356
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
@@ -289,6 +376,7 @@
289376
};
290377
AE41FC7A1F6248BE00959ED0 /* Debug */ = {
291378
isa = XCBuildConfiguration;
379+
baseConfigurationReference = CB1D1EFFB1454CDD0D18973E /* Pods-RKOTopAlert.debug.xcconfig */;
292380
buildSettings = {
293381
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
294382
DEVELOPMENT_TEAM = 5C9JW4S9DE;
@@ -301,6 +389,7 @@
301389
};
302390
AE41FC7B1F6248BE00959ED0 /* Release */ = {
303391
isa = XCBuildConfiguration;
392+
baseConfigurationReference = 5BB6B0195FDE5C7EB23FD15C /* Pods-RKOTopAlert.release.xcconfig */;
304393
buildSettings = {
305394
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
306395
DEVELOPMENT_TEAM = 5C9JW4S9DE;

RKOTopAlertManager/RKOTopAlert/RKOTopAlert/AppDelegate.m

+5-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ @implementation AppDelegate
1717

1818
#pragma mark - Top Alert
1919
- (RKOTopAlert *)topAlert {
20-
return [RKOTopAlert alertViewWithText:@"在AppDelegate中总体设置" textColor:[UIColor blackColor] backgroundColor:[UIColor orangeColor] iconImageName:nil];
20+
return [RKOTopAlert alertViewWithText:@"在AppDelegate中总体设置"
21+
textColor:[UIColor blackColor]
22+
backgroundColor:[UIColor orangeColor]
23+
iconImageName:nil
24+
font:[UIFont systemFontOfSize:15.0f]];
2125
}
2226

2327
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

0 commit comments

Comments
 (0)