Skip to content

Commit 1d612de

Browse files
committed
first commit
1 parent 834c560 commit 1d612de

30 files changed

+1523
-0
lines changed

.DS_Store

6 KB
Binary file not shown.

README.md

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# UIAlertController+CNBlocks
2+
3+
Convenience methods for UIAlertController. It can add custom style (defalut and destructive) and actions sort by index of NSArray which contain items of custom style's actions.
4+
5+
### Requirements
6+
Greater iOS 8.0.
7+
8+
9+
### Usage
10+
Add UIAlertController+CNBlocks.h/m into your project.
11+
12+
**Alert**
13+
14+
Showing Alert Viiew in current toppest ViewController. Items contain title、message、cancel action、confirm action.
15+
```objc
16+
[UIAlertController cn_showAlertViewWithTitle:_title message:_message cancelTitle:_cancelTitle confirmTitle:_confirmTitle confirm:^{
17+
NSLog(@"I'm a adult!");
18+
}];
19+
```
20+
21+
22+
**ActionSheet**
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,356 @@
1+
// !$*UTF8*$!
2+
{
3+
archiveVersion = 1;
4+
classes = {
5+
};
6+
objectVersion = 50;
7+
objects = {
8+
9+
/* Begin PBXBuildFile section */
10+
6319A8AB21EC2D6300D63E19 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 6319A8AA21EC2D6300D63E19 /* AppDelegate.m */; };
11+
6319A8AE21EC2D6300D63E19 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6319A8AD21EC2D6300D63E19 /* ViewController.m */; };
12+
6319A8B121EC2D6300D63E19 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6319A8AF21EC2D6300D63E19 /* Main.storyboard */; };
13+
6319A8B321EC2D6400D63E19 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 6319A8B221EC2D6400D63E19 /* Assets.xcassets */; };
14+
6319A8B621EC2D6400D63E19 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6319A8B421EC2D6400D63E19 /* LaunchScreen.storyboard */; };
15+
6319A8B921EC2D6400D63E19 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 6319A8B821EC2D6400D63E19 /* main.m */; };
16+
6319A8C221EC2D8200D63E19 /* UIAlertController+CNBlocks.m in Sources */ = {isa = PBXBuildFile; fileRef = 6319A8C121EC2D8200D63E19 /* UIAlertController+CNBlocks.m */; };
17+
/* End PBXBuildFile section */
18+
19+
/* Begin PBXFileReference section */
20+
6319A8A621EC2D6300D63E19 /* UIAlertControllerDemo.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = UIAlertControllerDemo.app; sourceTree = BUILT_PRODUCTS_DIR; };
21+
6319A8A921EC2D6300D63E19 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; };
22+
6319A8AA21EC2D6300D63E19 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = "<group>"; };
23+
6319A8AC21EC2D6300D63E19 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; };
24+
6319A8AD21EC2D6300D63E19 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = "<group>"; };
25+
6319A8B021EC2D6300D63E19 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
26+
6319A8B221EC2D6400D63E19 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
27+
6319A8B521EC2D6400D63E19 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; };
28+
6319A8B721EC2D6400D63E19 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
29+
6319A8B821EC2D6400D63E19 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
30+
6319A8C021EC2D8200D63E19 /* UIAlertController+CNBlocks.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "UIAlertController+CNBlocks.h"; sourceTree = "<group>"; };
31+
6319A8C121EC2D8200D63E19 /* UIAlertController+CNBlocks.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = "UIAlertController+CNBlocks.m"; sourceTree = "<group>"; };
32+
/* End PBXFileReference section */
33+
34+
/* Begin PBXFrameworksBuildPhase section */
35+
6319A8A321EC2D6300D63E19 /* Frameworks */ = {
36+
isa = PBXFrameworksBuildPhase;
37+
buildActionMask = 2147483647;
38+
files = (
39+
);
40+
runOnlyForDeploymentPostprocessing = 0;
41+
};
42+
/* End PBXFrameworksBuildPhase section */
43+
44+
/* Begin PBXGroup section */
45+
6319A89D21EC2D6300D63E19 = {
46+
isa = PBXGroup;
47+
children = (
48+
6319A8A821EC2D6300D63E19 /* UIAlertControllerDemo */,
49+
6319A8A721EC2D6300D63E19 /* Products */,
50+
);
51+
sourceTree = "<group>";
52+
};
53+
6319A8A721EC2D6300D63E19 /* Products */ = {
54+
isa = PBXGroup;
55+
children = (
56+
6319A8A621EC2D6300D63E19 /* UIAlertControllerDemo.app */,
57+
);
58+
name = Products;
59+
sourceTree = "<group>";
60+
};
61+
6319A8A821EC2D6300D63E19 /* UIAlertControllerDemo */ = {
62+
isa = PBXGroup;
63+
children = (
64+
6319A8BF21EC2D6F00D63E19 /* UIAlertControllerCategory */,
65+
6319A8A921EC2D6300D63E19 /* AppDelegate.h */,
66+
6319A8AA21EC2D6300D63E19 /* AppDelegate.m */,
67+
6319A8AC21EC2D6300D63E19 /* ViewController.h */,
68+
6319A8AD21EC2D6300D63E19 /* ViewController.m */,
69+
6319A8AF21EC2D6300D63E19 /* Main.storyboard */,
70+
6319A8B221EC2D6400D63E19 /* Assets.xcassets */,
71+
6319A8B421EC2D6400D63E19 /* LaunchScreen.storyboard */,
72+
6319A8B721EC2D6400D63E19 /* Info.plist */,
73+
6319A8B821EC2D6400D63E19 /* main.m */,
74+
);
75+
path = UIAlertControllerDemo;
76+
sourceTree = "<group>";
77+
};
78+
6319A8BF21EC2D6F00D63E19 /* UIAlertControllerCategory */ = {
79+
isa = PBXGroup;
80+
children = (
81+
6319A8C021EC2D8200D63E19 /* UIAlertController+CNBlocks.h */,
82+
6319A8C121EC2D8200D63E19 /* UIAlertController+CNBlocks.m */,
83+
);
84+
path = UIAlertControllerCategory;
85+
sourceTree = "<group>";
86+
};
87+
/* End PBXGroup section */
88+
89+
/* Begin PBXNativeTarget section */
90+
6319A8A521EC2D6300D63E19 /* UIAlertControllerDemo */ = {
91+
isa = PBXNativeTarget;
92+
buildConfigurationList = 6319A8BC21EC2D6400D63E19 /* Build configuration list for PBXNativeTarget "UIAlertControllerDemo" */;
93+
buildPhases = (
94+
6319A8A221EC2D6300D63E19 /* Sources */,
95+
6319A8A321EC2D6300D63E19 /* Frameworks */,
96+
6319A8A421EC2D6300D63E19 /* Resources */,
97+
);
98+
buildRules = (
99+
);
100+
dependencies = (
101+
);
102+
name = UIAlertControllerDemo;
103+
productName = UIAlertControllerDemo;
104+
productReference = 6319A8A621EC2D6300D63E19 /* UIAlertControllerDemo.app */;
105+
productType = "com.apple.product-type.application";
106+
};
107+
/* End PBXNativeTarget section */
108+
109+
/* Begin PBXProject section */
110+
6319A89E21EC2D6300D63E19 /* Project object */ = {
111+
isa = PBXProject;
112+
attributes = {
113+
LastUpgradeCheck = 1010;
114+
ORGANIZATIONNAME = cievon;
115+
TargetAttributes = {
116+
6319A8A521EC2D6300D63E19 = {
117+
CreatedOnToolsVersion = 10.1;
118+
};
119+
};
120+
};
121+
buildConfigurationList = 6319A8A121EC2D6300D63E19 /* Build configuration list for PBXProject "UIAlertControllerDemo" */;
122+
compatibilityVersion = "Xcode 9.3";
123+
developmentRegion = en;
124+
hasScannedForEncodings = 0;
125+
knownRegions = (
126+
en,
127+
Base,
128+
);
129+
mainGroup = 6319A89D21EC2D6300D63E19;
130+
productRefGroup = 6319A8A721EC2D6300D63E19 /* Products */;
131+
projectDirPath = "";
132+
projectRoot = "";
133+
targets = (
134+
6319A8A521EC2D6300D63E19 /* UIAlertControllerDemo */,
135+
);
136+
};
137+
/* End PBXProject section */
138+
139+
/* Begin PBXResourcesBuildPhase section */
140+
6319A8A421EC2D6300D63E19 /* Resources */ = {
141+
isa = PBXResourcesBuildPhase;
142+
buildActionMask = 2147483647;
143+
files = (
144+
6319A8B621EC2D6400D63E19 /* LaunchScreen.storyboard in Resources */,
145+
6319A8B321EC2D6400D63E19 /* Assets.xcassets in Resources */,
146+
6319A8B121EC2D6300D63E19 /* Main.storyboard in Resources */,
147+
);
148+
runOnlyForDeploymentPostprocessing = 0;
149+
};
150+
/* End PBXResourcesBuildPhase section */
151+
152+
/* Begin PBXSourcesBuildPhase section */
153+
6319A8A221EC2D6300D63E19 /* Sources */ = {
154+
isa = PBXSourcesBuildPhase;
155+
buildActionMask = 2147483647;
156+
files = (
157+
6319A8AE21EC2D6300D63E19 /* ViewController.m in Sources */,
158+
6319A8B921EC2D6400D63E19 /* main.m in Sources */,
159+
6319A8AB21EC2D6300D63E19 /* AppDelegate.m in Sources */,
160+
6319A8C221EC2D8200D63E19 /* UIAlertController+CNBlocks.m in Sources */,
161+
);
162+
runOnlyForDeploymentPostprocessing = 0;
163+
};
164+
/* End PBXSourcesBuildPhase section */
165+
166+
/* Begin PBXVariantGroup section */
167+
6319A8AF21EC2D6300D63E19 /* Main.storyboard */ = {
168+
isa = PBXVariantGroup;
169+
children = (
170+
6319A8B021EC2D6300D63E19 /* Base */,
171+
);
172+
name = Main.storyboard;
173+
sourceTree = "<group>";
174+
};
175+
6319A8B421EC2D6400D63E19 /* LaunchScreen.storyboard */ = {
176+
isa = PBXVariantGroup;
177+
children = (
178+
6319A8B521EC2D6400D63E19 /* Base */,
179+
);
180+
name = LaunchScreen.storyboard;
181+
sourceTree = "<group>";
182+
};
183+
/* End PBXVariantGroup section */
184+
185+
/* Begin XCBuildConfiguration section */
186+
6319A8BA21EC2D6400D63E19 /* Debug */ = {
187+
isa = XCBuildConfiguration;
188+
buildSettings = {
189+
ALWAYS_SEARCH_USER_PATHS = NO;
190+
CLANG_ANALYZER_NONNULL = YES;
191+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
192+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
193+
CLANG_CXX_LIBRARY = "libc++";
194+
CLANG_ENABLE_MODULES = YES;
195+
CLANG_ENABLE_OBJC_ARC = YES;
196+
CLANG_ENABLE_OBJC_WEAK = YES;
197+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
198+
CLANG_WARN_BOOL_CONVERSION = YES;
199+
CLANG_WARN_COMMA = YES;
200+
CLANG_WARN_CONSTANT_CONVERSION = YES;
201+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
202+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
203+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
204+
CLANG_WARN_EMPTY_BODY = YES;
205+
CLANG_WARN_ENUM_CONVERSION = YES;
206+
CLANG_WARN_INFINITE_RECURSION = YES;
207+
CLANG_WARN_INT_CONVERSION = YES;
208+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
209+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
210+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
211+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
212+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
213+
CLANG_WARN_STRICT_PROTOTYPES = YES;
214+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
215+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
216+
CLANG_WARN_UNREACHABLE_CODE = YES;
217+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
218+
CODE_SIGN_IDENTITY = "iPhone Developer";
219+
COPY_PHASE_STRIP = NO;
220+
DEBUG_INFORMATION_FORMAT = dwarf;
221+
ENABLE_STRICT_OBJC_MSGSEND = YES;
222+
ENABLE_TESTABILITY = YES;
223+
GCC_C_LANGUAGE_STANDARD = gnu11;
224+
GCC_DYNAMIC_NO_PIC = NO;
225+
GCC_NO_COMMON_BLOCKS = YES;
226+
GCC_OPTIMIZATION_LEVEL = 0;
227+
GCC_PREPROCESSOR_DEFINITIONS = (
228+
"DEBUG=1",
229+
"$(inherited)",
230+
);
231+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
232+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
233+
GCC_WARN_UNDECLARED_SELECTOR = YES;
234+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
235+
GCC_WARN_UNUSED_FUNCTION = YES;
236+
GCC_WARN_UNUSED_VARIABLE = YES;
237+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
238+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
239+
MTL_FAST_MATH = YES;
240+
ONLY_ACTIVE_ARCH = YES;
241+
SDKROOT = iphoneos;
242+
};
243+
name = Debug;
244+
};
245+
6319A8BB21EC2D6400D63E19 /* Release */ = {
246+
isa = XCBuildConfiguration;
247+
buildSettings = {
248+
ALWAYS_SEARCH_USER_PATHS = NO;
249+
CLANG_ANALYZER_NONNULL = YES;
250+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
251+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
252+
CLANG_CXX_LIBRARY = "libc++";
253+
CLANG_ENABLE_MODULES = YES;
254+
CLANG_ENABLE_OBJC_ARC = YES;
255+
CLANG_ENABLE_OBJC_WEAK = YES;
256+
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
257+
CLANG_WARN_BOOL_CONVERSION = YES;
258+
CLANG_WARN_COMMA = YES;
259+
CLANG_WARN_CONSTANT_CONVERSION = YES;
260+
CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
261+
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
262+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
263+
CLANG_WARN_EMPTY_BODY = YES;
264+
CLANG_WARN_ENUM_CONVERSION = YES;
265+
CLANG_WARN_INFINITE_RECURSION = YES;
266+
CLANG_WARN_INT_CONVERSION = YES;
267+
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
268+
CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
269+
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
270+
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
271+
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
272+
CLANG_WARN_STRICT_PROTOTYPES = YES;
273+
CLANG_WARN_SUSPICIOUS_MOVE = YES;
274+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
275+
CLANG_WARN_UNREACHABLE_CODE = YES;
276+
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
277+
CODE_SIGN_IDENTITY = "iPhone Developer";
278+
COPY_PHASE_STRIP = NO;
279+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
280+
ENABLE_NS_ASSERTIONS = NO;
281+
ENABLE_STRICT_OBJC_MSGSEND = YES;
282+
GCC_C_LANGUAGE_STANDARD = gnu11;
283+
GCC_NO_COMMON_BLOCKS = YES;
284+
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
285+
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
286+
GCC_WARN_UNDECLARED_SELECTOR = YES;
287+
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
288+
GCC_WARN_UNUSED_FUNCTION = YES;
289+
GCC_WARN_UNUSED_VARIABLE = YES;
290+
IPHONEOS_DEPLOYMENT_TARGET = 12.1;
291+
MTL_ENABLE_DEBUG_INFO = NO;
292+
MTL_FAST_MATH = YES;
293+
SDKROOT = iphoneos;
294+
VALIDATE_PRODUCT = YES;
295+
};
296+
name = Release;
297+
};
298+
6319A8BD21EC2D6400D63E19 /* Debug */ = {
299+
isa = XCBuildConfiguration;
300+
buildSettings = {
301+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
302+
CODE_SIGN_STYLE = Automatic;
303+
INFOPLIST_FILE = UIAlertControllerDemo/Info.plist;
304+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
305+
LD_RUNPATH_SEARCH_PATHS = (
306+
"$(inherited)",
307+
"@executable_path/Frameworks",
308+
);
309+
PRODUCT_BUNDLE_IDENTIFIER = leo.UIAlertControllerDemo;
310+
PRODUCT_NAME = "$(TARGET_NAME)";
311+
TARGETED_DEVICE_FAMILY = "1,2";
312+
};
313+
name = Debug;
314+
};
315+
6319A8BE21EC2D6400D63E19 /* Release */ = {
316+
isa = XCBuildConfiguration;
317+
buildSettings = {
318+
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
319+
CODE_SIGN_STYLE = Automatic;
320+
INFOPLIST_FILE = UIAlertControllerDemo/Info.plist;
321+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
322+
LD_RUNPATH_SEARCH_PATHS = (
323+
"$(inherited)",
324+
"@executable_path/Frameworks",
325+
);
326+
PRODUCT_BUNDLE_IDENTIFIER = leo.UIAlertControllerDemo;
327+
PRODUCT_NAME = "$(TARGET_NAME)";
328+
TARGETED_DEVICE_FAMILY = "1,2";
329+
};
330+
name = Release;
331+
};
332+
/* End XCBuildConfiguration section */
333+
334+
/* Begin XCConfigurationList section */
335+
6319A8A121EC2D6300D63E19 /* Build configuration list for PBXProject "UIAlertControllerDemo" */ = {
336+
isa = XCConfigurationList;
337+
buildConfigurations = (
338+
6319A8BA21EC2D6400D63E19 /* Debug */,
339+
6319A8BB21EC2D6400D63E19 /* Release */,
340+
);
341+
defaultConfigurationIsVisible = 0;
342+
defaultConfigurationName = Release;
343+
};
344+
6319A8BC21EC2D6400D63E19 /* Build configuration list for PBXNativeTarget "UIAlertControllerDemo" */ = {
345+
isa = XCConfigurationList;
346+
buildConfigurations = (
347+
6319A8BD21EC2D6400D63E19 /* Debug */,
348+
6319A8BE21EC2D6400D63E19 /* Release */,
349+
);
350+
defaultConfigurationIsVisible = 0;
351+
defaultConfigurationName = Release;
352+
};
353+
/* End XCConfigurationList section */
354+
};
355+
rootObject = 6319A89E21EC2D6300D63E19 /* Project object */;
356+
}

UIAlertControllerDemo.xcodeproj/project.xcworkspace/contents.xcworkspacedata

+7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>IDEDidComputeMac32BitWarning</key>
6+
<true/>
7+
</dict>
8+
</plist>

0 commit comments

Comments
 (0)