├── README.md
├── SDPriceStarSelectView.xcodeproj
├── project.pbxproj
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ ├── apple.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
│ │ └── slowdony.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── xcuserdata
│ ├── apple.xcuserdatad
│ └── xcschemes
│ │ ├── SDPriceStarSelectView.xcscheme
│ │ └── xcschememanagement.plist
│ └── slowdony.xcuserdatad
│ ├── xcdebugger
│ └── Breakpoints_v2.xcbkptlist
│ └── xcschemes
│ ├── SDPriceStarSelectView.xcscheme
│ └── xcschememanagement.plist
├── SDPriceStarSelectView
├── AppDelegate.h
├── AppDelegate.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
├── Info.plist
├── SDPriceStarView.h
├── SDPriceStarView.m
├── ViewController.h
├── ViewController.m
├── main.m
└── sdpricestarview.gif
├── SDPriceStarSelectViewTests
├── Info.plist
└── SDPriceStarSelectViewTests.m
└── SDPriceStarSelectViewUITests
├── Info.plist
└── SDPriceStarSelectViewUITests.m
/README.md:
--------------------------------------------------------------------------------
1 | # SDPriceStarSelectView
2 |
3 |
4 |
5 |
6 | 项目预览:
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 | 支持价格单选,星级多选功能
16 |
17 |
18 |
19 | 我的邮箱:devslowdony@gmail.com
20 |
21 | 我的微博:[slowdony](https://weibo.com/u/2428779285)
22 |
23 | 如果有好的建议或者意见 ,欢迎指出 , 您的支持是对我最大的鼓励,谢谢. 求STAR ..😆
24 |
25 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 180EAD2D1E3597E20057C246 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD2C1E3597E20057C246 /* main.m */; };
11 | 180EAD301E3597E20057C246 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD2F1E3597E20057C246 /* AppDelegate.m */; };
12 | 180EAD331E3597E20057C246 /* ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD321E3597E20057C246 /* ViewController.m */; };
13 | 180EAD361E3597E20057C246 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180EAD341E3597E20057C246 /* Main.storyboard */; };
14 | 180EAD381E3597E20057C246 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 180EAD371E3597E20057C246 /* Assets.xcassets */; };
15 | 180EAD3B1E3597E20057C246 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 180EAD391E3597E20057C246 /* LaunchScreen.storyboard */; };
16 | 180EAD461E3597E30057C246 /* SDPriceStarSelectViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD451E3597E30057C246 /* SDPriceStarSelectViewTests.m */; };
17 | 180EAD511E3597E30057C246 /* SDPriceStarSelectViewUITests.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD501E3597E30057C246 /* SDPriceStarSelectViewUITests.m */; };
18 | 180EAD601E35986C0057C246 /* SDPriceStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 180EAD5F1E35986C0057C246 /* SDPriceStarView.m */; };
19 | EF63BFEC1F24F1A0009F5EA9 /* sdpricestarview.gif in Resources */ = {isa = PBXBuildFile; fileRef = EF63BFEB1F24F1A0009F5EA9 /* sdpricestarview.gif */; };
20 | /* End PBXBuildFile section */
21 |
22 | /* Begin PBXContainerItemProxy section */
23 | 180EAD421E3597E30057C246 /* PBXContainerItemProxy */ = {
24 | isa = PBXContainerItemProxy;
25 | containerPortal = 180EAD201E3597E20057C246 /* Project object */;
26 | proxyType = 1;
27 | remoteGlobalIDString = 180EAD271E3597E20057C246;
28 | remoteInfo = SDPriceStarSelectView;
29 | };
30 | 180EAD4D1E3597E30057C246 /* PBXContainerItemProxy */ = {
31 | isa = PBXContainerItemProxy;
32 | containerPortal = 180EAD201E3597E20057C246 /* Project object */;
33 | proxyType = 1;
34 | remoteGlobalIDString = 180EAD271E3597E20057C246;
35 | remoteInfo = SDPriceStarSelectView;
36 | };
37 | /* End PBXContainerItemProxy section */
38 |
39 | /* Begin PBXFileReference section */
40 | 180EAD281E3597E20057C246 /* SDPriceStarSelectView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SDPriceStarSelectView.app; sourceTree = BUILT_PRODUCTS_DIR; };
41 | 180EAD2C1E3597E20057C246 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
42 | 180EAD2E1E3597E20057C246 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
43 | 180EAD2F1E3597E20057C246 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
44 | 180EAD311E3597E20057C246 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = ""; };
45 | 180EAD321E3597E20057C246 /* ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ViewController.m; sourceTree = ""; };
46 | 180EAD351E3597E20057C246 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
47 | 180EAD371E3597E20057C246 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
48 | 180EAD3A1E3597E20057C246 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
49 | 180EAD3C1E3597E20057C246 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
50 | 180EAD411E3597E30057C246 /* SDPriceStarSelectViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDPriceStarSelectViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
51 | 180EAD451E3597E30057C246 /* SDPriceStarSelectViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDPriceStarSelectViewTests.m; sourceTree = ""; };
52 | 180EAD471E3597E30057C246 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
53 | 180EAD4C1E3597E30057C246 /* SDPriceStarSelectViewUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SDPriceStarSelectViewUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
54 | 180EAD501E3597E30057C246 /* SDPriceStarSelectViewUITests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SDPriceStarSelectViewUITests.m; sourceTree = ""; };
55 | 180EAD521E3597E30057C246 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
56 | 180EAD5E1E35986C0057C246 /* SDPriceStarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDPriceStarView.h; sourceTree = ""; };
57 | 180EAD5F1E35986C0057C246 /* SDPriceStarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SDPriceStarView.m; sourceTree = ""; };
58 | EF63BFEB1F24F1A0009F5EA9 /* sdpricestarview.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = sdpricestarview.gif; sourceTree = ""; };
59 | /* End PBXFileReference section */
60 |
61 | /* Begin PBXFrameworksBuildPhase section */
62 | 180EAD251E3597E20057C246 /* Frameworks */ = {
63 | isa = PBXFrameworksBuildPhase;
64 | buildActionMask = 2147483647;
65 | files = (
66 | );
67 | runOnlyForDeploymentPostprocessing = 0;
68 | };
69 | 180EAD3E1E3597E30057C246 /* Frameworks */ = {
70 | isa = PBXFrameworksBuildPhase;
71 | buildActionMask = 2147483647;
72 | files = (
73 | );
74 | runOnlyForDeploymentPostprocessing = 0;
75 | };
76 | 180EAD491E3597E30057C246 /* Frameworks */ = {
77 | isa = PBXFrameworksBuildPhase;
78 | buildActionMask = 2147483647;
79 | files = (
80 | );
81 | runOnlyForDeploymentPostprocessing = 0;
82 | };
83 | /* End PBXFrameworksBuildPhase section */
84 |
85 | /* Begin PBXGroup section */
86 | 180EAD1F1E3597E20057C246 = {
87 | isa = PBXGroup;
88 | children = (
89 | 180EAD2A1E3597E20057C246 /* SDPriceStarSelectView */,
90 | 180EAD441E3597E30057C246 /* SDPriceStarSelectViewTests */,
91 | 180EAD4F1E3597E30057C246 /* SDPriceStarSelectViewUITests */,
92 | 180EAD291E3597E20057C246 /* Products */,
93 | );
94 | sourceTree = "";
95 | };
96 | 180EAD291E3597E20057C246 /* Products */ = {
97 | isa = PBXGroup;
98 | children = (
99 | 180EAD281E3597E20057C246 /* SDPriceStarSelectView.app */,
100 | 180EAD411E3597E30057C246 /* SDPriceStarSelectViewTests.xctest */,
101 | 180EAD4C1E3597E30057C246 /* SDPriceStarSelectViewUITests.xctest */,
102 | );
103 | name = Products;
104 | sourceTree = "";
105 | };
106 | 180EAD2A1E3597E20057C246 /* SDPriceStarSelectView */ = {
107 | isa = PBXGroup;
108 | children = (
109 | 180EAD2E1E3597E20057C246 /* AppDelegate.h */,
110 | 180EAD2F1E3597E20057C246 /* AppDelegate.m */,
111 | 180EAD311E3597E20057C246 /* ViewController.h */,
112 | 180EAD321E3597E20057C246 /* ViewController.m */,
113 | 180EAD5E1E35986C0057C246 /* SDPriceStarView.h */,
114 | 180EAD5F1E35986C0057C246 /* SDPriceStarView.m */,
115 | 180EAD341E3597E20057C246 /* Main.storyboard */,
116 | 180EAD371E3597E20057C246 /* Assets.xcassets */,
117 | 180EAD391E3597E20057C246 /* LaunchScreen.storyboard */,
118 | 180EAD3C1E3597E20057C246 /* Info.plist */,
119 | 180EAD2B1E3597E20057C246 /* Supporting Files */,
120 | );
121 | path = SDPriceStarSelectView;
122 | sourceTree = "";
123 | };
124 | 180EAD2B1E3597E20057C246 /* Supporting Files */ = {
125 | isa = PBXGroup;
126 | children = (
127 | EF63BFEB1F24F1A0009F5EA9 /* sdpricestarview.gif */,
128 | 180EAD2C1E3597E20057C246 /* main.m */,
129 | );
130 | name = "Supporting Files";
131 | sourceTree = "";
132 | };
133 | 180EAD441E3597E30057C246 /* SDPriceStarSelectViewTests */ = {
134 | isa = PBXGroup;
135 | children = (
136 | 180EAD451E3597E30057C246 /* SDPriceStarSelectViewTests.m */,
137 | 180EAD471E3597E30057C246 /* Info.plist */,
138 | );
139 | path = SDPriceStarSelectViewTests;
140 | sourceTree = "";
141 | };
142 | 180EAD4F1E3597E30057C246 /* SDPriceStarSelectViewUITests */ = {
143 | isa = PBXGroup;
144 | children = (
145 | 180EAD501E3597E30057C246 /* SDPriceStarSelectViewUITests.m */,
146 | 180EAD521E3597E30057C246 /* Info.plist */,
147 | );
148 | path = SDPriceStarSelectViewUITests;
149 | sourceTree = "";
150 | };
151 | /* End PBXGroup section */
152 |
153 | /* Begin PBXNativeTarget section */
154 | 180EAD271E3597E20057C246 /* SDPriceStarSelectView */ = {
155 | isa = PBXNativeTarget;
156 | buildConfigurationList = 180EAD551E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectView" */;
157 | buildPhases = (
158 | 180EAD241E3597E20057C246 /* Sources */,
159 | 180EAD251E3597E20057C246 /* Frameworks */,
160 | 180EAD261E3597E20057C246 /* Resources */,
161 | );
162 | buildRules = (
163 | );
164 | dependencies = (
165 | );
166 | name = SDPriceStarSelectView;
167 | productName = SDPriceStarSelectView;
168 | productReference = 180EAD281E3597E20057C246 /* SDPriceStarSelectView.app */;
169 | productType = "com.apple.product-type.application";
170 | };
171 | 180EAD401E3597E30057C246 /* SDPriceStarSelectViewTests */ = {
172 | isa = PBXNativeTarget;
173 | buildConfigurationList = 180EAD581E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectViewTests" */;
174 | buildPhases = (
175 | 180EAD3D1E3597E30057C246 /* Sources */,
176 | 180EAD3E1E3597E30057C246 /* Frameworks */,
177 | 180EAD3F1E3597E30057C246 /* Resources */,
178 | );
179 | buildRules = (
180 | );
181 | dependencies = (
182 | 180EAD431E3597E30057C246 /* PBXTargetDependency */,
183 | );
184 | name = SDPriceStarSelectViewTests;
185 | productName = SDPriceStarSelectViewTests;
186 | productReference = 180EAD411E3597E30057C246 /* SDPriceStarSelectViewTests.xctest */;
187 | productType = "com.apple.product-type.bundle.unit-test";
188 | };
189 | 180EAD4B1E3597E30057C246 /* SDPriceStarSelectViewUITests */ = {
190 | isa = PBXNativeTarget;
191 | buildConfigurationList = 180EAD5B1E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectViewUITests" */;
192 | buildPhases = (
193 | 180EAD481E3597E30057C246 /* Sources */,
194 | 180EAD491E3597E30057C246 /* Frameworks */,
195 | 180EAD4A1E3597E30057C246 /* Resources */,
196 | );
197 | buildRules = (
198 | );
199 | dependencies = (
200 | 180EAD4E1E3597E30057C246 /* PBXTargetDependency */,
201 | );
202 | name = SDPriceStarSelectViewUITests;
203 | productName = SDPriceStarSelectViewUITests;
204 | productReference = 180EAD4C1E3597E30057C246 /* SDPriceStarSelectViewUITests.xctest */;
205 | productType = "com.apple.product-type.bundle.ui-testing";
206 | };
207 | /* End PBXNativeTarget section */
208 |
209 | /* Begin PBXProject section */
210 | 180EAD201E3597E20057C246 /* Project object */ = {
211 | isa = PBXProject;
212 | attributes = {
213 | LastUpgradeCheck = 0820;
214 | ORGANIZATIONNAME = slowdony;
215 | TargetAttributes = {
216 | 180EAD271E3597E20057C246 = {
217 | CreatedOnToolsVersion = 8.2.1;
218 | ProvisioningStyle = Automatic;
219 | };
220 | 180EAD401E3597E30057C246 = {
221 | CreatedOnToolsVersion = 8.2.1;
222 | ProvisioningStyle = Automatic;
223 | TestTargetID = 180EAD271E3597E20057C246;
224 | };
225 | 180EAD4B1E3597E30057C246 = {
226 | CreatedOnToolsVersion = 8.2.1;
227 | ProvisioningStyle = Automatic;
228 | TestTargetID = 180EAD271E3597E20057C246;
229 | };
230 | };
231 | };
232 | buildConfigurationList = 180EAD231E3597E20057C246 /* Build configuration list for PBXProject "SDPriceStarSelectView" */;
233 | compatibilityVersion = "Xcode 3.2";
234 | developmentRegion = English;
235 | hasScannedForEncodings = 0;
236 | knownRegions = (
237 | en,
238 | Base,
239 | );
240 | mainGroup = 180EAD1F1E3597E20057C246;
241 | productRefGroup = 180EAD291E3597E20057C246 /* Products */;
242 | projectDirPath = "";
243 | projectRoot = "";
244 | targets = (
245 | 180EAD271E3597E20057C246 /* SDPriceStarSelectView */,
246 | 180EAD401E3597E30057C246 /* SDPriceStarSelectViewTests */,
247 | 180EAD4B1E3597E30057C246 /* SDPriceStarSelectViewUITests */,
248 | );
249 | };
250 | /* End PBXProject section */
251 |
252 | /* Begin PBXResourcesBuildPhase section */
253 | 180EAD261E3597E20057C246 /* Resources */ = {
254 | isa = PBXResourcesBuildPhase;
255 | buildActionMask = 2147483647;
256 | files = (
257 | 180EAD3B1E3597E20057C246 /* LaunchScreen.storyboard in Resources */,
258 | 180EAD381E3597E20057C246 /* Assets.xcassets in Resources */,
259 | EF63BFEC1F24F1A0009F5EA9 /* sdpricestarview.gif in Resources */,
260 | 180EAD361E3597E20057C246 /* Main.storyboard in Resources */,
261 | );
262 | runOnlyForDeploymentPostprocessing = 0;
263 | };
264 | 180EAD3F1E3597E30057C246 /* Resources */ = {
265 | isa = PBXResourcesBuildPhase;
266 | buildActionMask = 2147483647;
267 | files = (
268 | );
269 | runOnlyForDeploymentPostprocessing = 0;
270 | };
271 | 180EAD4A1E3597E30057C246 /* Resources */ = {
272 | isa = PBXResourcesBuildPhase;
273 | buildActionMask = 2147483647;
274 | files = (
275 | );
276 | runOnlyForDeploymentPostprocessing = 0;
277 | };
278 | /* End PBXResourcesBuildPhase section */
279 |
280 | /* Begin PBXSourcesBuildPhase section */
281 | 180EAD241E3597E20057C246 /* Sources */ = {
282 | isa = PBXSourcesBuildPhase;
283 | buildActionMask = 2147483647;
284 | files = (
285 | 180EAD331E3597E20057C246 /* ViewController.m in Sources */,
286 | 180EAD301E3597E20057C246 /* AppDelegate.m in Sources */,
287 | 180EAD2D1E3597E20057C246 /* main.m in Sources */,
288 | 180EAD601E35986C0057C246 /* SDPriceStarView.m in Sources */,
289 | );
290 | runOnlyForDeploymentPostprocessing = 0;
291 | };
292 | 180EAD3D1E3597E30057C246 /* Sources */ = {
293 | isa = PBXSourcesBuildPhase;
294 | buildActionMask = 2147483647;
295 | files = (
296 | 180EAD461E3597E30057C246 /* SDPriceStarSelectViewTests.m in Sources */,
297 | );
298 | runOnlyForDeploymentPostprocessing = 0;
299 | };
300 | 180EAD481E3597E30057C246 /* Sources */ = {
301 | isa = PBXSourcesBuildPhase;
302 | buildActionMask = 2147483647;
303 | files = (
304 | 180EAD511E3597E30057C246 /* SDPriceStarSelectViewUITests.m in Sources */,
305 | );
306 | runOnlyForDeploymentPostprocessing = 0;
307 | };
308 | /* End PBXSourcesBuildPhase section */
309 |
310 | /* Begin PBXTargetDependency section */
311 | 180EAD431E3597E30057C246 /* PBXTargetDependency */ = {
312 | isa = PBXTargetDependency;
313 | target = 180EAD271E3597E20057C246 /* SDPriceStarSelectView */;
314 | targetProxy = 180EAD421E3597E30057C246 /* PBXContainerItemProxy */;
315 | };
316 | 180EAD4E1E3597E30057C246 /* PBXTargetDependency */ = {
317 | isa = PBXTargetDependency;
318 | target = 180EAD271E3597E20057C246 /* SDPriceStarSelectView */;
319 | targetProxy = 180EAD4D1E3597E30057C246 /* PBXContainerItemProxy */;
320 | };
321 | /* End PBXTargetDependency section */
322 |
323 | /* Begin PBXVariantGroup section */
324 | 180EAD341E3597E20057C246 /* Main.storyboard */ = {
325 | isa = PBXVariantGroup;
326 | children = (
327 | 180EAD351E3597E20057C246 /* Base */,
328 | );
329 | name = Main.storyboard;
330 | sourceTree = "";
331 | };
332 | 180EAD391E3597E20057C246 /* LaunchScreen.storyboard */ = {
333 | isa = PBXVariantGroup;
334 | children = (
335 | 180EAD3A1E3597E20057C246 /* Base */,
336 | );
337 | name = LaunchScreen.storyboard;
338 | sourceTree = "";
339 | };
340 | /* End PBXVariantGroup section */
341 |
342 | /* Begin XCBuildConfiguration section */
343 | 180EAD531E3597E30057C246 /* Debug */ = {
344 | isa = XCBuildConfiguration;
345 | buildSettings = {
346 | ALWAYS_SEARCH_USER_PATHS = NO;
347 | CLANG_ANALYZER_NONNULL = YES;
348 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
349 | CLANG_CXX_LIBRARY = "libc++";
350 | CLANG_ENABLE_MODULES = YES;
351 | CLANG_ENABLE_OBJC_ARC = YES;
352 | CLANG_WARN_BOOL_CONVERSION = YES;
353 | CLANG_WARN_CONSTANT_CONVERSION = YES;
354 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
355 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
356 | CLANG_WARN_EMPTY_BODY = YES;
357 | CLANG_WARN_ENUM_CONVERSION = YES;
358 | CLANG_WARN_INFINITE_RECURSION = YES;
359 | CLANG_WARN_INT_CONVERSION = YES;
360 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
361 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
362 | CLANG_WARN_UNREACHABLE_CODE = YES;
363 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
364 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
365 | COPY_PHASE_STRIP = NO;
366 | DEBUG_INFORMATION_FORMAT = dwarf;
367 | ENABLE_STRICT_OBJC_MSGSEND = YES;
368 | ENABLE_TESTABILITY = YES;
369 | GCC_C_LANGUAGE_STANDARD = gnu99;
370 | GCC_DYNAMIC_NO_PIC = NO;
371 | GCC_NO_COMMON_BLOCKS = YES;
372 | GCC_OPTIMIZATION_LEVEL = 0;
373 | GCC_PREPROCESSOR_DEFINITIONS = (
374 | "DEBUG=1",
375 | "$(inherited)",
376 | );
377 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
378 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
379 | GCC_WARN_UNDECLARED_SELECTOR = YES;
380 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
381 | GCC_WARN_UNUSED_FUNCTION = YES;
382 | GCC_WARN_UNUSED_VARIABLE = YES;
383 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
384 | MTL_ENABLE_DEBUG_INFO = YES;
385 | ONLY_ACTIVE_ARCH = YES;
386 | SDKROOT = iphoneos;
387 | };
388 | name = Debug;
389 | };
390 | 180EAD541E3597E30057C246 /* Release */ = {
391 | isa = XCBuildConfiguration;
392 | buildSettings = {
393 | ALWAYS_SEARCH_USER_PATHS = NO;
394 | CLANG_ANALYZER_NONNULL = YES;
395 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
396 | CLANG_CXX_LIBRARY = "libc++";
397 | CLANG_ENABLE_MODULES = YES;
398 | CLANG_ENABLE_OBJC_ARC = YES;
399 | CLANG_WARN_BOOL_CONVERSION = YES;
400 | CLANG_WARN_CONSTANT_CONVERSION = YES;
401 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
402 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
403 | CLANG_WARN_EMPTY_BODY = YES;
404 | CLANG_WARN_ENUM_CONVERSION = YES;
405 | CLANG_WARN_INFINITE_RECURSION = YES;
406 | CLANG_WARN_INT_CONVERSION = YES;
407 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
408 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
409 | CLANG_WARN_UNREACHABLE_CODE = YES;
410 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
411 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
412 | COPY_PHASE_STRIP = NO;
413 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
414 | ENABLE_NS_ASSERTIONS = NO;
415 | ENABLE_STRICT_OBJC_MSGSEND = YES;
416 | GCC_C_LANGUAGE_STANDARD = gnu99;
417 | GCC_NO_COMMON_BLOCKS = YES;
418 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
419 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
420 | GCC_WARN_UNDECLARED_SELECTOR = YES;
421 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
422 | GCC_WARN_UNUSED_FUNCTION = YES;
423 | GCC_WARN_UNUSED_VARIABLE = YES;
424 | IPHONEOS_DEPLOYMENT_TARGET = 10.2;
425 | MTL_ENABLE_DEBUG_INFO = NO;
426 | SDKROOT = iphoneos;
427 | VALIDATE_PRODUCT = YES;
428 | };
429 | name = Release;
430 | };
431 | 180EAD561E3597E30057C246 /* Debug */ = {
432 | isa = XCBuildConfiguration;
433 | buildSettings = {
434 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
435 | INFOPLIST_FILE = SDPriceStarSelectView/Info.plist;
436 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
437 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectView;
438 | PRODUCT_NAME = "$(TARGET_NAME)";
439 | };
440 | name = Debug;
441 | };
442 | 180EAD571E3597E30057C246 /* Release */ = {
443 | isa = XCBuildConfiguration;
444 | buildSettings = {
445 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
446 | INFOPLIST_FILE = SDPriceStarSelectView/Info.plist;
447 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
448 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectView;
449 | PRODUCT_NAME = "$(TARGET_NAME)";
450 | };
451 | name = Release;
452 | };
453 | 180EAD591E3597E30057C246 /* Debug */ = {
454 | isa = XCBuildConfiguration;
455 | buildSettings = {
456 | BUNDLE_LOADER = "$(TEST_HOST)";
457 | INFOPLIST_FILE = SDPriceStarSelectViewTests/Info.plist;
458 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
459 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectViewTests;
460 | PRODUCT_NAME = "$(TARGET_NAME)";
461 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDPriceStarSelectView.app/SDPriceStarSelectView";
462 | };
463 | name = Debug;
464 | };
465 | 180EAD5A1E3597E30057C246 /* Release */ = {
466 | isa = XCBuildConfiguration;
467 | buildSettings = {
468 | BUNDLE_LOADER = "$(TEST_HOST)";
469 | INFOPLIST_FILE = SDPriceStarSelectViewTests/Info.plist;
470 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
471 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectViewTests;
472 | PRODUCT_NAME = "$(TARGET_NAME)";
473 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/SDPriceStarSelectView.app/SDPriceStarSelectView";
474 | };
475 | name = Release;
476 | };
477 | 180EAD5C1E3597E30057C246 /* Debug */ = {
478 | isa = XCBuildConfiguration;
479 | buildSettings = {
480 | INFOPLIST_FILE = SDPriceStarSelectViewUITests/Info.plist;
481 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
482 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectViewUITests;
483 | PRODUCT_NAME = "$(TARGET_NAME)";
484 | TEST_TARGET_NAME = SDPriceStarSelectView;
485 | };
486 | name = Debug;
487 | };
488 | 180EAD5D1E3597E30057C246 /* Release */ = {
489 | isa = XCBuildConfiguration;
490 | buildSettings = {
491 | INFOPLIST_FILE = SDPriceStarSelectViewUITests/Info.plist;
492 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
493 | PRODUCT_BUNDLE_IDENTIFIER = SD.SDPriceStarSelectViewUITests;
494 | PRODUCT_NAME = "$(TARGET_NAME)";
495 | TEST_TARGET_NAME = SDPriceStarSelectView;
496 | };
497 | name = Release;
498 | };
499 | /* End XCBuildConfiguration section */
500 |
501 | /* Begin XCConfigurationList section */
502 | 180EAD231E3597E20057C246 /* Build configuration list for PBXProject "SDPriceStarSelectView" */ = {
503 | isa = XCConfigurationList;
504 | buildConfigurations = (
505 | 180EAD531E3597E30057C246 /* Debug */,
506 | 180EAD541E3597E30057C246 /* Release */,
507 | );
508 | defaultConfigurationIsVisible = 0;
509 | defaultConfigurationName = Release;
510 | };
511 | 180EAD551E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectView" */ = {
512 | isa = XCConfigurationList;
513 | buildConfigurations = (
514 | 180EAD561E3597E30057C246 /* Debug */,
515 | 180EAD571E3597E30057C246 /* Release */,
516 | );
517 | defaultConfigurationIsVisible = 0;
518 | defaultConfigurationName = Release;
519 | };
520 | 180EAD581E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectViewTests" */ = {
521 | isa = XCConfigurationList;
522 | buildConfigurations = (
523 | 180EAD591E3597E30057C246 /* Debug */,
524 | 180EAD5A1E3597E30057C246 /* Release */,
525 | );
526 | defaultConfigurationIsVisible = 0;
527 | defaultConfigurationName = Release;
528 | };
529 | 180EAD5B1E3597E30057C246 /* Build configuration list for PBXNativeTarget "SDPriceStarSelectViewUITests" */ = {
530 | isa = XCConfigurationList;
531 | buildConfigurations = (
532 | 180EAD5C1E3597E30057C246 /* Debug */,
533 | 180EAD5D1E3597E30057C246 /* Release */,
534 | );
535 | defaultConfigurationIsVisible = 0;
536 | defaultConfigurationName = Release;
537 | };
538 | /* End XCConfigurationList section */
539 | };
540 | rootObject = 180EAD201E3597E20057C246 /* Project object */;
541 | }
542 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlowDony/SDPriceStarSelectView/8fbe9a9f31690dd0f17a242abb8cbe4f10df110b/SDPriceStarSelectView.xcodeproj/project.xcworkspace/xcuserdata/apple.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/project.xcworkspace/xcuserdata/slowdony.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlowDony/SDPriceStarSelectView/8fbe9a9f31690dd0f17a242abb8cbe4f10df110b/SDPriceStarSelectView.xcodeproj/project.xcworkspace/xcuserdata/slowdony.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/SDPriceStarSelectView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/xcuserdata/apple.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SDPriceStarSelectView.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 180EAD271E3597E20057C246
16 |
17 | primary
18 |
19 |
20 | 180EAD401E3597E30057C246
21 |
22 | primary
23 |
24 |
25 | 180EAD4B1E3597E30057C246
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/xcuserdata/slowdony.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/xcuserdata/slowdony.xcuserdatad/xcschemes/SDPriceStarSelectView.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
33 |
39 |
40 |
41 |
43 |
49 |
50 |
51 |
52 |
53 |
59 |
60 |
61 |
62 |
63 |
64 |
74 |
76 |
82 |
83 |
84 |
85 |
86 |
87 |
93 |
95 |
101 |
102 |
103 |
104 |
106 |
107 |
110 |
111 |
112 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView.xcodeproj/xcuserdata/slowdony.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | SDPriceStarSelectView.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 180EAD271E3597E20057C246
16 |
17 | primary
18 |
19 |
20 | 180EAD401E3597E30057C246
21 |
22 | primary
23 |
24 |
25 | 180EAD4B1E3597E30057C246
26 |
27 | primary
28 |
29 |
30 |
31 |
32 |
33 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. 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 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. 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 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/SDPriceStarSelectView/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 |
27 |
28 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/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 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
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 |
38 |
39 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/SDPriceStarView.h:
--------------------------------------------------------------------------------
1 | //
2 | // SDPriceStarView.h
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SDPriceStarView : UIView
12 |
13 | +(instancetype)sdPriceStarView;
14 |
15 | @property (nonatomic,copy) void (^sdPriceBlock)(NSString *priceID);
16 |
17 | @property (nonatomic,copy) void (^sdStarBlock)(NSString *starID);
18 |
19 | @property (nonatomic,copy) void (^sdSureBlock)();
20 |
21 |
22 | /**
23 | 星级arr
24 | */
25 | @property (nonatomic,strong) NSMutableArray *starArr;
26 |
27 |
28 | /**
29 | 价格arr
30 | */
31 | @property (nonatomic,strong) NSMutableArray *priceArr;
32 | @end
33 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/SDPriceStarView.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDPriceStarView.m
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. All rights reserved.
7 | //
8 | /*
9 | github: https://github.com/SlowDony/SDPriceStarSelectView
10 | 如果有好的建议或者意见 ,欢迎指出.
11 | 我的邮箱:devslowdony@gmail.com
12 | 您的支持是对我最大的鼓励,谢谢. 求STAR ..😆
13 | */
14 |
15 |
16 |
17 | #import "SDPriceStarView.h"
18 |
19 |
20 |
21 | #define mDeviceWidth [UIScreen mainScreen].bounds.size.width
22 | #define mDeviceHeight [UIScreen mainScreen].bounds.size.height
23 |
24 |
25 | #define mRGB(r,g,b,a) [UIColor colorWithRed:(r)/255.0f green:(g)/255.0f blue:(b)/255.0f alpha:a]
26 | #define mHexRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]
27 | #define mHexRGBAlpha(rgbValue,a) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:(a)]
28 |
29 | #define fontHightRedColor mHexRGB(0xeb3027) //字体深红色
30 | #define fontHightColor mHexRGB(0x585858) //字体深色
31 | #define fontNomalColor mHexRGB(0x999999) //字体浅色
32 |
33 |
34 |
35 | #define bjviewheight 290
36 |
37 |
38 | @interface SDPriceStarView ()
39 |
40 |
41 |
42 |
43 | /**
44 | 星级选择数组
45 | */
46 | @property (nonatomic,strong)NSMutableArray *starSelectArr;
47 | /**
48 | 星级选择
49 | */
50 | @property (nonatomic,strong)NSString *starSelectStr;
51 |
52 | /**
53 | 星级view
54 | */
55 | @property (nonatomic,strong)UIView *starView;
56 |
57 | /**
58 | 价格view
59 | */
60 | @property (nonatomic,strong)UIView *priceView;
61 |
62 | /**
63 | 背景
64 | */
65 | @property (nonatomic,strong)UIView *bjView ;
66 |
67 | /**
68 | 确定按钮
69 | */
70 | @property (nonatomic,strong)UIButton *sureBtn;
71 |
72 | /**
73 | 取消按钮
74 | */
75 | @property (nonatomic,strong)UIButton *cancelBtn;
76 |
77 |
78 |
79 |
80 | @end
81 |
82 |
83 | @implementation SDPriceStarView
84 |
85 | /*
86 | // Only override drawRect: if you perform custom drawing.
87 | // An empty implementation adversely affects performance during animation.
88 | - (void)drawRect:(CGRect)rect {
89 | // Drawing code
90 | }
91 | */
92 | -(NSMutableArray *)starArr{
93 | if (!_starArr) {
94 |
95 | NSArray* arr = @[@{@"title":@"不限",@"value":@""},
96 | @{@"title":@"二星/经济",@"value":@"1"},
97 | @{@"title":@"三星/舒适",@"value":@"2"},
98 | @{@"title":@"四星/高档",@"value":@"3"},
99 | @{@"title":@"五星/豪华",@"value":@"4"},
100 | ];
101 | _starArr =[[NSMutableArray alloc]initWithArray:arr];
102 | }
103 | return _starArr;
104 | }
105 |
106 | -(NSMutableArray *)priceArr{
107 | if (!_priceArr)
108 | {
109 | NSArray * arr = @[@{@"title":@"不限",@"value":@"0"},
110 | @{@"title":@"¥150以内",@"value":@"1"},
111 | @{@"title":@"¥150-300",@"value":@"2"},
112 | @{@"title":@"¥301-450",@"value":@"3"},
113 | @{@"title":@"¥451-600",@"value":@"4"},
114 | @{@"title":@"¥601-1000",@"value":@"5"},
115 | @{@"title":@"¥1000以上",@"value":@"6"},
116 | ];
117 |
118 | _priceArr =[[NSMutableArray alloc]initWithArray:arr];
119 | }
120 | return _priceArr;
121 | }
122 |
123 |
124 | //-(void)setStarArr:(NSMutableArray *)starArr{
125 | // _starArr =starArr;
126 |
127 |
128 | //}
129 |
130 | //-(void)setPriceArr:(NSMutableArray *)priceArr{
131 | // _priceArr =priceArr;
132 |
133 | //}
134 |
135 | +(instancetype)sdPriceStarView
136 | {
137 | SDPriceStarView *starView =[[SDPriceStarView alloc]init];
138 | [starView setUI];
139 | return starView;
140 | }
141 | - (instancetype)init
142 | {
143 | self = [super init];
144 | if (self) {
145 |
146 | }
147 | return self;
148 | }
149 |
150 | /**
151 | 初始化
152 | */
153 | -(void)setUI{
154 |
155 |
156 | self.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.5];
157 |
158 | self.frame =CGRectMake(0, 0, mDeviceWidth, mDeviceHeight);
159 | [self addSubview:self.bjView];
160 |
161 | [UIView animateWithDuration:0.25 animations:^{
162 | self.bjView.frame=CGRectMake(0, mDeviceHeight -bjviewheight,mDeviceWidth, bjviewheight);
163 | }];
164 | //点击手势
165 | UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(removeView)];
166 | tap.delegate = self;
167 | [self addGestureRecognizer:tap];
168 |
169 | }
170 |
171 |
172 |
173 |
174 | #pragma mark - 选择价格(单选)
175 | -(void)setupPriceBtnWithPriceArr:(NSMutableArray *)priceArr {
176 |
177 | //
178 | int totalloc =4;
179 | CGFloat btnVW = (mDeviceWidth-10*5)/4; //宽
180 | CGFloat btnVH = 30; //高
181 | CGFloat margin =10; //间距
182 | int count =(int)priceArr.count;
183 | for (int i=0;i
10 |
11 | @interface ViewController : UIViewController
12 |
13 |
14 | @end
15 |
16 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/ViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // ViewController.m
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. All rights reserved.
7 | //
8 |
9 | /*
10 | github: https://github.com/SlowDony/SDPriceStarSelectView
11 | 如果有好的建议或者意见 ,欢迎指出.
12 | 我的邮箱:devslowdony@gmail.com
13 | 您的支持是对我最大的鼓励,谢谢. 求STAR ..😆
14 | */
15 |
16 | #import "ViewController.h"
17 |
18 | #import "SDPriceStarView.h"
19 | #define mDeviceWidth [UIScreen mainScreen].bounds.size.width
20 | #define mDeviceHeight [UIScreen mainScreen].bounds.size.height
21 | @interface ViewController ()
22 |
23 | @end
24 |
25 | @implementation ViewController
26 |
27 | - (void)viewDidLoad {
28 | [super viewDidLoad];
29 | [self setUI];
30 | // Do any additional setup after loading the view, typically from a nib.
31 | }
32 | - (void)didReceiveMemoryWarning {
33 | [super didReceiveMemoryWarning];
34 | // Dispose of any resources that can be recreated.
35 | }
36 |
37 | -(void)setUI{
38 |
39 | //
40 | UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
41 | btn.frame = CGRectMake(100, 100, 200, 50);
42 | [btn setTitle:@"星级价格选择" forState:UIControlStateNormal];
43 | [btn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
44 |
45 | btn.backgroundColor =[UIColor redColor];
46 | [btn addTarget:self action:@selector(btnClick:) forControlEvents:UIControlEventTouchUpInside];
47 | [self.view addSubview: btn];
48 |
49 |
50 |
51 |
52 |
53 | }
54 | -(void)btnClick:(UIButton *)sender{
55 | // __weak __typeof__(self) weakSelf = self;
56 | SDPriceStarView *priceStarView =[SDPriceStarView sdPriceStarView];
57 |
58 | priceStarView.sdPriceBlock=^(NSString *priceID){
59 |
60 | NSLog(@"价格ID:%@",priceID);
61 |
62 | };
63 |
64 | priceStarView.sdStarBlock=^(NSString *starID){
65 |
66 | NSLog(@"星级ID:%@",starID);
67 |
68 | };
69 |
70 | priceStarView.sdSureBlock=^(){
71 | //刷新数据
72 | // [weakSelf Refreshing];
73 | };
74 |
75 | [self.view addSubview:priceStarView];
76 |
77 | }
78 | @end
79 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // SDPriceStarSelectView
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. 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 |
--------------------------------------------------------------------------------
/SDPriceStarSelectView/sdpricestarview.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/SlowDony/SDPriceStarSelectView/8fbe9a9f31690dd0f17a242abb8cbe4f10df110b/SDPriceStarSelectView/sdpricestarview.gif
--------------------------------------------------------------------------------
/SDPriceStarSelectViewTests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SDPriceStarSelectViewTests/SDPriceStarSelectViewTests.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDPriceStarSelectViewTests.m
3 | // SDPriceStarSelectViewTests
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SDPriceStarSelectViewTests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation SDPriceStarSelectViewTests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 | // Put setup code here. This method is called before the invocation of each test method in the class.
20 | }
21 |
22 | - (void)tearDown {
23 | // Put teardown code here. This method is called after the invocation of each test method in the class.
24 | [super tearDown];
25 | }
26 |
27 | - (void)testExample {
28 | // This is an example of a functional test case.
29 | // Use XCTAssert and related functions to verify your tests produce the correct results.
30 | }
31 |
32 | - (void)testPerformanceExample {
33 | // This is an example of a performance test case.
34 | [self measureBlock:^{
35 | // Put the code you want to measure the time of here.
36 | }];
37 | }
38 |
39 | @end
40 |
--------------------------------------------------------------------------------
/SDPriceStarSelectViewUITests/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | $(PRODUCT_BUNDLE_IDENTIFIER)
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | BNDL
17 | CFBundleShortVersionString
18 | 1.0
19 | CFBundleVersion
20 | 1
21 |
22 |
23 |
--------------------------------------------------------------------------------
/SDPriceStarSelectViewUITests/SDPriceStarSelectViewUITests.m:
--------------------------------------------------------------------------------
1 | //
2 | // SDPriceStarSelectViewUITests.m
3 | // SDPriceStarSelectViewUITests
4 | //
5 | // Created by apple on 2017/1/23.
6 | // Copyright © 2017年 slowdony. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface SDPriceStarSelectViewUITests : XCTestCase
12 |
13 | @end
14 |
15 | @implementation SDPriceStarSelectViewUITests
16 |
17 | - (void)setUp {
18 | [super setUp];
19 |
20 | // Put setup code here. This method is called before the invocation of each test method in the class.
21 |
22 | // In UI tests it is usually best to stop immediately when a failure occurs.
23 | self.continueAfterFailure = NO;
24 | // UI tests must launch the application that they test. Doing this in setup will make sure it happens for each test method.
25 | [[[XCUIApplication alloc] init] launch];
26 |
27 | // In UI tests it’s important to set the initial state - such as interface orientation - required for your tests before they run. The setUp method is a good place to do this.
28 | }
29 |
30 | - (void)tearDown {
31 | // Put teardown code here. This method is called after the invocation of each test method in the class.
32 | [super tearDown];
33 | }
34 |
35 | - (void)testExample {
36 | // Use recording to get started writing UI tests.
37 | // Use XCTAssert and related functions to verify your tests produce the correct results.
38 | }
39 |
40 | @end
41 |
--------------------------------------------------------------------------------