├── .gitignore ├── .travis.yml ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── Podfile ├── Podfile.lock ├── README.md ├── ScreenShot ├── rating1.png └── rating2.png ├── StarRatingView.podspec ├── StarRatingView.xcodeproj ├── project.pbxproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcschemes │ │ └── StarRatingView.xcscheme └── xcuserdata │ └── liaojinxing.xcuserdatad │ └── xcschemes │ ├── StarRatingView.xcscheme │ └── xcschememanagement.plist ├── StarRatingView.xcworkspace └── contents.xcworkspacedata ├── StarRatingView ├── AppDelegate.h ├── AppDelegate.m ├── Images.xcassets │ ├── AppIcon.appiconset │ │ └── Contents.json │ └── LaunchImage.launchimage │ │ └── Contents.json ├── LaunchScreen.storyboard ├── Resource │ ├── ic_starred.png │ ├── ic_starredept.png │ ├── ic_starredhalf.png │ ├── ic_starwhite.png │ ├── ic_starwhiteept.png │ └── ic_starwhitehalf.png ├── Source │ ├── Controllers │ │ ├── ExampleViewController.h │ │ └── ExampleViewController.m │ └── View │ │ ├── StarRatingView.h │ │ └── StarRatingView.m ├── StarRatingView-Info.plist ├── StarRatingView-Prefix.pch ├── en.lproj │ └── InfoPlist.strings └── main.m └── StarRatingViewTests ├── ReferenceImages └── StarRatingViewSpec │ ├── fiveStars@2x.png │ ├── halfStar@2x.png │ ├── noStars@2x.png │ ├── oneStar@2x.png │ └── threePointFiveStars@2x.png ├── StarRatingViewTests-Info.plist ├── StarRatingViewTests-Prefix.pch ├── StarRatingViewTests.m └── en.lproj └── InfoPlist.strings /.gitignore: -------------------------------------------------------------------------------- 1 | # Xcode 2 | .DS_Store 3 | */build/* 4 | *.pbxuser 5 | !default.pbxuser 6 | *.mode1v3 7 | !default.mode1v3 8 | *.mode2v3 9 | !default.mode2v3 10 | *.perspectivev3 11 | !default.perspectivev3 12 | xcuserdata 13 | profile 14 | *.moved-aside 15 | DerivedData 16 | .idea/ 17 | *.hmap 18 | *.xccheckout 19 | 20 | #CocoaPods 21 | Pods 22 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: objective-c 2 | before_install: 3 | - brew update 4 | - brew uninstall xctool 5 | - brew install xctool 6 | - export LANG=en_US.UTF-8 7 | - gem i cocoapods --no-ri --no-rdoc 8 | - pod install 9 | xcode_workspace: StarRatingView.xcworkspace 10 | xcode_scheme: StarRatingView 11 | xcode_sdk: iphonesimulator 12 | 13 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'https://rubygems.org' 2 | 3 | gem 'cocoapods' 4 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | activesupport (3.2.18) 5 | i18n (~> 0.6, >= 0.6.4) 6 | multi_json (~> 1.0) 7 | claide (0.5.0) 8 | cocoapods (0.32.1) 9 | activesupport (>= 3.2.15, < 4) 10 | claide (~> 0.5.0) 11 | cocoapods-core (= 0.32.1) 12 | cocoapods-downloader (~> 0.5.0) 13 | cocoapods-try (~> 0.2.0) 14 | colored (~> 1.2) 15 | escape (~> 0.0.4) 16 | json_pure (~> 1.8) 17 | nap (~> 0.7) 18 | open4 (~> 1.3) 19 | xcodeproj (~> 0.16.1) 20 | cocoapods-core (0.32.1) 21 | activesupport (>= 3.2.15, < 4) 22 | fuzzy_match (~> 2.0.4) 23 | json_pure (~> 1.8) 24 | nap (~> 0.5) 25 | cocoapods-downloader (0.5.0) 26 | cocoapods-try (0.2.0) 27 | colored (1.2) 28 | escape (0.0.4) 29 | fuzzy_match (2.0.4) 30 | i18n (0.6.9) 31 | json_pure (1.8.1) 32 | multi_json (1.10.0) 33 | nap (0.7.0) 34 | open4 (1.3.4) 35 | xcodeproj (0.16.1) 36 | activesupport (~> 3.0) 37 | colored (~> 1.2) 38 | 39 | PLATFORMS 40 | ruby 41 | 42 | DEPENDENCIES 43 | cocoapods 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Podfile: -------------------------------------------------------------------------------- 1 | workspace 'StarRatingView' 2 | 3 | pod 'StarRatingView', :path => 'StarRatingView.podspec' 4 | 5 | xcodeproj 'StarRatingView.xcodeproj' 6 | 7 | target 'StarRatingViewTests' do 8 | pod 'Specta', '~> 0.2.1' 9 | pod 'Expecta', '~> 0.2.3' 10 | pod 'FBSnapshotTestCase', '~> 1.1' 11 | pod 'EXPMatchers+FBSnapshotTest', '~> 1.1' 12 | xcodeproj 'StarRatingView.xcodeproj' 13 | end 14 | -------------------------------------------------------------------------------- /Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - Expecta (0.2.4) 3 | - EXPMatchers+FBSnapshotTest (1.1.0): 4 | - Expecta 5 | - FBSnapshotTestCase 6 | - FBSnapshotTestCase (1.8.1) 7 | - Specta (0.2.1) 8 | - StarRatingView (1.1.0) 9 | 10 | DEPENDENCIES: 11 | - Expecta (~> 0.2.3) 12 | - EXPMatchers+FBSnapshotTest (~> 1.1) 13 | - FBSnapshotTestCase (~> 1.1) 14 | - Specta (~> 0.2.1) 15 | - StarRatingView (from `StarRatingView.podspec`) 16 | 17 | EXTERNAL SOURCES: 18 | StarRatingView: 19 | :path: StarRatingView.podspec 20 | 21 | SPEC CHECKSUMS: 22 | Expecta: cfaf1d3e2e194ca704a25e997093d30a1ce70b61 23 | EXPMatchers+FBSnapshotTest: 3c48e8a29a445476fe2d72d7da45dfdd765b5f55 24 | FBSnapshotTestCase: 3dc3899168747a0319c5278f5b3445c13a6532dd 25 | Specta: 15a276a6343867b426d5ed135d5aa4d04123a573 26 | StarRatingView: 2bd17ea3da2c6a074c1c024ea1b97b11076d8225 27 | 28 | COCOAPODS: 0.39.0 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | StarRatingView 2 | ================ 3 | 4 | Star rating view, often used in vote. Easy to use, and flexible configurations. 5 | 6 | ![StarRating1](ScreenShot/rating1.png) 7 | 8 | ![StarRating2](ScreenShot/rating2.png) 9 | 10 | Installation 11 | ------------------------- 12 | - Grab the source file into your project. 13 | - Or use cocoapods. Here is an example of your podfile: 14 | 15 | ``` 16 | pod 'StarRatingView' 17 | ``` 18 | 19 | Usage 20 | ------- 21 | ``` 22 | StarRatingView *ratingView = [[StarRatingView alloc] initWithFrame:CGRectMake(0, 100, self.view.frame.size.width, 20) configuration:configuration]; 23 | ratingView.rating = 4.0f; // rate range:[0,5] 24 | ``` 25 | 26 | Configure the view if you need it: 27 | ``` 28 | StarRatingViewConfiguration *conf = [[StarRatingViewConfiguration alloc] init]; 29 | conf.rateEnabled = YES; 30 | conf.starWidth = 40.0f; 31 | conf.fullImage = @"ic_starwhite.png"; 32 | conf.halfImage = @"ic_starwhitehalf.png"; 33 | conf.emptyImage = @"ic_starwhiteept"; 34 | ``` 35 | 36 | 37 | License 38 | ------ 39 | StarRatingView is available under the MIT license. See the LICENSE file for more info. 40 | 41 | Subscription 42 | ------- 43 | 欢迎关注[简书],关注微信公众号(iOSers),订阅高质量原创技术文章: 44 | 45 | 公众号 46 | 47 | [简书]:http://www.jianshu.com/users/25481f0294aa/latest_articles 48 | -------------------------------------------------------------------------------- /ScreenShot/rating1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/ScreenShot/rating1.png -------------------------------------------------------------------------------- /ScreenShot/rating2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/ScreenShot/rating2.png -------------------------------------------------------------------------------- /StarRatingView.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | 3 | s.name = "StarRatingView" 4 | s.version = "1.3.0" 5 | s.summary = "Star rating view, often used in vote. Easy to use, and flexible configurations" 6 | s.homepage = "https://github.com/liaojinxing/StarRatingView" 7 | s.author = { "liaojinxing" => "jinxingliao@gmail.com" } 8 | s.platform = :ios, '6.0' 9 | s.license = 'MIT' 10 | s.source = { :git => "https://github.com/liaojinxing/StarRatingView.git", :tag => "1.3.0" } 11 | s.source_files = 'StarRatingView/Source/View/**/*.{h,m}' 12 | s.requires_arc = true 13 | s.screenshots = [ "https://raw.githubusercontent.com/liaojinxing/StarRatingView/master/ScreenShot/rating1.png", 14 | "https://raw.githubusercontent.com/liaojinxing/StarRatingView/master/ScreenShot/rating2.png" ] 15 | 16 | end 17 | -------------------------------------------------------------------------------- /StarRatingView.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 05EC56951E1A4A8BAA8C3552 /* libPods-StarRatingViewTests.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 444CF95EB5A24E6787A59A0D /* libPods-StarRatingViewTests.a */; }; 11 | 5180E3625CD24F84AF4BBFC7 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 0928A47389C74410A06AA3AC /* libPods.a */; }; 12 | A8C1342C1CB527EC00419D9A /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = A8C1342B1CB527EC00419D9A /* LaunchScreen.storyboard */; }; 13 | C78228D119160F1D00ACA111 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228D019160F1D00ACA111 /* Foundation.framework */; }; 14 | C78228D319160F1D00ACA111 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228D219160F1D00ACA111 /* CoreGraphics.framework */; }; 15 | C78228D519160F1D00ACA111 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228D419160F1D00ACA111 /* UIKit.framework */; }; 16 | C78228DB19160F1D00ACA111 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C78228D919160F1D00ACA111 /* InfoPlist.strings */; }; 17 | C78228DD19160F1D00ACA111 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = C78228DC19160F1D00ACA111 /* main.m */; }; 18 | C78228E119160F1D00ACA111 /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = C78228E019160F1D00ACA111 /* AppDelegate.m */; }; 19 | C78228E319160F1D00ACA111 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = C78228E219160F1D00ACA111 /* Images.xcassets */; }; 20 | C78228EA19160F1D00ACA111 /* XCTest.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228E919160F1D00ACA111 /* XCTest.framework */; }; 21 | C78228EB19160F1D00ACA111 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228D019160F1D00ACA111 /* Foundation.framework */; }; 22 | C78228EC19160F1D00ACA111 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C78228D419160F1D00ACA111 /* UIKit.framework */; }; 23 | C78228F419160F1D00ACA111 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = C78228F219160F1D00ACA111 /* InfoPlist.strings */; }; 24 | C78228F619160F1D00ACA111 /* StarRatingViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = C78228F519160F1D00ACA111 /* StarRatingViewTests.m */; }; 25 | C782290F1916106500ACA111 /* ExampleViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C782290E1916106500ACA111 /* ExampleViewController.m */; }; 26 | C78229161916128B00ACA111 /* ic_starred.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229101916128B00ACA111 /* ic_starred.png */; }; 27 | C78229171916128B00ACA111 /* ic_starredept.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229111916128B00ACA111 /* ic_starredept.png */; }; 28 | C78229181916128B00ACA111 /* ic_starredhalf.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229121916128B00ACA111 /* ic_starredhalf.png */; }; 29 | C78229191916128B00ACA111 /* ic_starwhite.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229131916128B00ACA111 /* ic_starwhite.png */; }; 30 | C782291A1916128B00ACA111 /* ic_starwhiteept.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229141916128B00ACA111 /* ic_starwhiteept.png */; }; 31 | C782291B1916128B00ACA111 /* ic_starwhitehalf.png in Resources */ = {isa = PBXBuildFile; fileRef = C78229151916128B00ACA111 /* ic_starwhitehalf.png */; }; 32 | /* End PBXBuildFile section */ 33 | 34 | /* Begin PBXContainerItemProxy section */ 35 | C78228ED19160F1D00ACA111 /* PBXContainerItemProxy */ = { 36 | isa = PBXContainerItemProxy; 37 | containerPortal = C78228C519160F1D00ACA111 /* Project object */; 38 | proxyType = 1; 39 | remoteGlobalIDString = C78228CC19160F1D00ACA111; 40 | remoteInfo = StarRatingView; 41 | }; 42 | /* End PBXContainerItemProxy section */ 43 | 44 | /* Begin PBXFileReference section */ 45 | 0928A47389C74410A06AA3AC /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; }; 46 | 2A4E6F5A3EED2263EDD3F8EF /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = ""; }; 47 | 3C6DBF9E192AA47400197F6D /* StarRatingViewTests-Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "StarRatingViewTests-Prefix.pch"; sourceTree = ""; }; 48 | 444CF95EB5A24E6787A59A0D /* libPods-StarRatingViewTests.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-StarRatingViewTests.a"; sourceTree = BUILT_PRODUCTS_DIR; }; 49 | 64CBC30B689164B8EE4050D0 /* Pods-StarRatingViewTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StarRatingViewTests.release.xcconfig"; path = "Pods/Target Support Files/Pods-StarRatingViewTests/Pods-StarRatingViewTests.release.xcconfig"; sourceTree = ""; }; 50 | 822E2D134750FE1643867A57 /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = ""; }; 51 | A8C1342B1CB527EC00419D9A /* LaunchScreen.storyboard */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = ""; }; 52 | C78228CD19160F1D00ACA111 /* StarRatingView.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = StarRatingView.app; sourceTree = BUILT_PRODUCTS_DIR; }; 53 | C78228D019160F1D00ACA111 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; }; 54 | C78228D219160F1D00ACA111 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 55 | C78228D419160F1D00ACA111 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; }; 56 | C78228D819160F1D00ACA111 /* StarRatingView-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StarRatingView-Info.plist"; sourceTree = ""; }; 57 | C78228DA19160F1D00ACA111 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 58 | C78228DC19160F1D00ACA111 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; }; 59 | C78228DE19160F1D00ACA111 /* StarRatingView-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "StarRatingView-Prefix.pch"; sourceTree = ""; }; 60 | C78228DF19160F1D00ACA111 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; }; 61 | C78228E019160F1D00ACA111 /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; }; 62 | C78228E219160F1D00ACA111 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 63 | C78228E819160F1D00ACA111 /* StarRatingViewTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = StarRatingViewTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 64 | C78228E919160F1D00ACA111 /* XCTest.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = XCTest.framework; path = Library/Frameworks/XCTest.framework; sourceTree = DEVELOPER_DIR; }; 65 | C78228F119160F1D00ACA111 /* StarRatingViewTests-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "StarRatingViewTests-Info.plist"; sourceTree = ""; }; 66 | C78228F319160F1D00ACA111 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = ""; }; 67 | C78228F519160F1D00ACA111 /* StarRatingViewTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = StarRatingViewTests.m; sourceTree = ""; }; 68 | C782290D1916106500ACA111 /* ExampleViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = ExampleViewController.h; path = Source/Controllers/ExampleViewController.h; sourceTree = ""; }; 69 | C782290E1916106500ACA111 /* ExampleViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = ExampleViewController.m; path = Source/Controllers/ExampleViewController.m; sourceTree = ""; }; 70 | C78229101916128B00ACA111 /* ic_starred.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starred.png; path = Resource/ic_starred.png; sourceTree = ""; }; 71 | C78229111916128B00ACA111 /* ic_starredept.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starredept.png; path = Resource/ic_starredept.png; sourceTree = ""; }; 72 | C78229121916128B00ACA111 /* ic_starredhalf.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starredhalf.png; path = Resource/ic_starredhalf.png; sourceTree = ""; }; 73 | C78229131916128B00ACA111 /* ic_starwhite.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starwhite.png; path = Resource/ic_starwhite.png; sourceTree = ""; }; 74 | C78229141916128B00ACA111 /* ic_starwhiteept.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starwhiteept.png; path = Resource/ic_starwhiteept.png; sourceTree = ""; }; 75 | C78229151916128B00ACA111 /* ic_starwhitehalf.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = ic_starwhitehalf.png; path = Resource/ic_starwhitehalf.png; sourceTree = ""; }; 76 | DE54CBA58E763A7DA177F4CB /* Pods-StarRatingViewTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StarRatingViewTests.debug.xcconfig"; path = "Pods/Target Support Files/Pods-StarRatingViewTests/Pods-StarRatingViewTests.debug.xcconfig"; sourceTree = ""; }; 77 | /* End PBXFileReference section */ 78 | 79 | /* Begin PBXFrameworksBuildPhase section */ 80 | C78228CA19160F1D00ACA111 /* Frameworks */ = { 81 | isa = PBXFrameworksBuildPhase; 82 | buildActionMask = 2147483647; 83 | files = ( 84 | C78228D319160F1D00ACA111 /* CoreGraphics.framework in Frameworks */, 85 | C78228D519160F1D00ACA111 /* UIKit.framework in Frameworks */, 86 | C78228D119160F1D00ACA111 /* Foundation.framework in Frameworks */, 87 | 5180E3625CD24F84AF4BBFC7 /* libPods.a in Frameworks */, 88 | ); 89 | runOnlyForDeploymentPostprocessing = 0; 90 | }; 91 | C78228E519160F1D00ACA111 /* Frameworks */ = { 92 | isa = PBXFrameworksBuildPhase; 93 | buildActionMask = 2147483647; 94 | files = ( 95 | C78228EA19160F1D00ACA111 /* XCTest.framework in Frameworks */, 96 | C78228EC19160F1D00ACA111 /* UIKit.framework in Frameworks */, 97 | C78228EB19160F1D00ACA111 /* Foundation.framework in Frameworks */, 98 | 05EC56951E1A4A8BAA8C3552 /* libPods-StarRatingViewTests.a in Frameworks */, 99 | ); 100 | runOnlyForDeploymentPostprocessing = 0; 101 | }; 102 | /* End PBXFrameworksBuildPhase section */ 103 | 104 | /* Begin PBXGroup section */ 105 | B807EC10EF5AB728842AC130 /* Pods */ = { 106 | isa = PBXGroup; 107 | children = ( 108 | 822E2D134750FE1643867A57 /* Pods.debug.xcconfig */, 109 | 2A4E6F5A3EED2263EDD3F8EF /* Pods.release.xcconfig */, 110 | DE54CBA58E763A7DA177F4CB /* Pods-StarRatingViewTests.debug.xcconfig */, 111 | 64CBC30B689164B8EE4050D0 /* Pods-StarRatingViewTests.release.xcconfig */, 112 | ); 113 | name = Pods; 114 | sourceTree = ""; 115 | }; 116 | C78228C419160F1D00ACA111 = { 117 | isa = PBXGroup; 118 | children = ( 119 | C78228D619160F1D00ACA111 /* StarRatingView */, 120 | C78228EF19160F1D00ACA111 /* StarRatingViewTests */, 121 | C78228CF19160F1D00ACA111 /* Frameworks */, 122 | C78228CE19160F1D00ACA111 /* Products */, 123 | B807EC10EF5AB728842AC130 /* Pods */, 124 | ); 125 | sourceTree = ""; 126 | }; 127 | C78228CE19160F1D00ACA111 /* Products */ = { 128 | isa = PBXGroup; 129 | children = ( 130 | C78228CD19160F1D00ACA111 /* StarRatingView.app */, 131 | C78228E819160F1D00ACA111 /* StarRatingViewTests.xctest */, 132 | ); 133 | name = Products; 134 | sourceTree = ""; 135 | }; 136 | C78228CF19160F1D00ACA111 /* Frameworks */ = { 137 | isa = PBXGroup; 138 | children = ( 139 | C78228D019160F1D00ACA111 /* Foundation.framework */, 140 | C78228D219160F1D00ACA111 /* CoreGraphics.framework */, 141 | C78228D419160F1D00ACA111 /* UIKit.framework */, 142 | C78228E919160F1D00ACA111 /* XCTest.framework */, 143 | 0928A47389C74410A06AA3AC /* libPods.a */, 144 | 444CF95EB5A24E6787A59A0D /* libPods-StarRatingViewTests.a */, 145 | ); 146 | name = Frameworks; 147 | sourceTree = ""; 148 | }; 149 | C78228D619160F1D00ACA111 /* StarRatingView */ = { 150 | isa = PBXGroup; 151 | children = ( 152 | C782290019160F3000ACA111 /* Resource */, 153 | C78228FF19160F2600ACA111 /* Source */, 154 | C78228E219160F1D00ACA111 /* Images.xcassets */, 155 | C78228D719160F1D00ACA111 /* Supporting Files */, 156 | ); 157 | path = StarRatingView; 158 | sourceTree = ""; 159 | }; 160 | C78228D719160F1D00ACA111 /* Supporting Files */ = { 161 | isa = PBXGroup; 162 | children = ( 163 | C78228D819160F1D00ACA111 /* StarRatingView-Info.plist */, 164 | C78228D919160F1D00ACA111 /* InfoPlist.strings */, 165 | C78228DC19160F1D00ACA111 /* main.m */, 166 | C78228DE19160F1D00ACA111 /* StarRatingView-Prefix.pch */, 167 | ); 168 | name = "Supporting Files"; 169 | sourceTree = ""; 170 | }; 171 | C78228EF19160F1D00ACA111 /* StarRatingViewTests */ = { 172 | isa = PBXGroup; 173 | children = ( 174 | C78228F519160F1D00ACA111 /* StarRatingViewTests.m */, 175 | C78228F019160F1D00ACA111 /* Supporting Files */, 176 | ); 177 | path = StarRatingViewTests; 178 | sourceTree = ""; 179 | }; 180 | C78228F019160F1D00ACA111 /* Supporting Files */ = { 181 | isa = PBXGroup; 182 | children = ( 183 | C78228F119160F1D00ACA111 /* StarRatingViewTests-Info.plist */, 184 | C78228F219160F1D00ACA111 /* InfoPlist.strings */, 185 | 3C6DBF9E192AA47400197F6D /* StarRatingViewTests-Prefix.pch */, 186 | ); 187 | name = "Supporting Files"; 188 | sourceTree = ""; 189 | }; 190 | C78228FF19160F2600ACA111 /* Source */ = { 191 | isa = PBXGroup; 192 | children = ( 193 | C782290319160F4E00ACA111 /* Controllers */, 194 | C782290119160F3600ACA111 /* App */, 195 | ); 196 | name = Source; 197 | sourceTree = ""; 198 | }; 199 | C782290019160F3000ACA111 /* Resource */ = { 200 | isa = PBXGroup; 201 | children = ( 202 | C78229101916128B00ACA111 /* ic_starred.png */, 203 | C78229111916128B00ACA111 /* ic_starredept.png */, 204 | C78229121916128B00ACA111 /* ic_starredhalf.png */, 205 | C78229131916128B00ACA111 /* ic_starwhite.png */, 206 | C78229141916128B00ACA111 /* ic_starwhiteept.png */, 207 | C78229151916128B00ACA111 /* ic_starwhitehalf.png */, 208 | ); 209 | name = Resource; 210 | sourceTree = ""; 211 | }; 212 | C782290119160F3600ACA111 /* App */ = { 213 | isa = PBXGroup; 214 | children = ( 215 | C78228DF19160F1D00ACA111 /* AppDelegate.h */, 216 | C78228E019160F1D00ACA111 /* AppDelegate.m */, 217 | A8C1342B1CB527EC00419D9A /* LaunchScreen.storyboard */, 218 | ); 219 | name = App; 220 | sourceTree = ""; 221 | }; 222 | C782290319160F4E00ACA111 /* Controllers */ = { 223 | isa = PBXGroup; 224 | children = ( 225 | C782290D1916106500ACA111 /* ExampleViewController.h */, 226 | C782290E1916106500ACA111 /* ExampleViewController.m */, 227 | ); 228 | name = Controllers; 229 | sourceTree = ""; 230 | }; 231 | /* End PBXGroup section */ 232 | 233 | /* Begin PBXNativeTarget section */ 234 | C78228CC19160F1D00ACA111 /* StarRatingView */ = { 235 | isa = PBXNativeTarget; 236 | buildConfigurationList = C78228F919160F1D00ACA111 /* Build configuration list for PBXNativeTarget "StarRatingView" */; 237 | buildPhases = ( 238 | 2B2A59EBA7AC4E508AD6AD55 /* Check Pods Manifest.lock */, 239 | C78228C919160F1D00ACA111 /* Sources */, 240 | C78228CA19160F1D00ACA111 /* Frameworks */, 241 | C78228CB19160F1D00ACA111 /* Resources */, 242 | 0F20F179902A40B68F909796 /* Copy Pods Resources */, 243 | 81590B130308BABAB090A162 /* Embed Pods Frameworks */, 244 | ); 245 | buildRules = ( 246 | ); 247 | dependencies = ( 248 | ); 249 | name = StarRatingView; 250 | productName = StarRatingView; 251 | productReference = C78228CD19160F1D00ACA111 /* StarRatingView.app */; 252 | productType = "com.apple.product-type.application"; 253 | }; 254 | C78228E719160F1D00ACA111 /* StarRatingViewTests */ = { 255 | isa = PBXNativeTarget; 256 | buildConfigurationList = C78228FC19160F1D00ACA111 /* Build configuration list for PBXNativeTarget "StarRatingViewTests" */; 257 | buildPhases = ( 258 | 98F0632F1D3E4056B46BD90E /* Check Pods Manifest.lock */, 259 | C78228E419160F1D00ACA111 /* Sources */, 260 | C78228E519160F1D00ACA111 /* Frameworks */, 261 | C78228E619160F1D00ACA111 /* Resources */, 262 | 921251DC52554632B3D9F39C /* Copy Pods Resources */, 263 | 38F968AA0E9C7AA184ED8053 /* Embed Pods Frameworks */, 264 | ); 265 | buildRules = ( 266 | ); 267 | dependencies = ( 268 | C78228EE19160F1D00ACA111 /* PBXTargetDependency */, 269 | ); 270 | name = StarRatingViewTests; 271 | productName = StarRatingViewTests; 272 | productReference = C78228E819160F1D00ACA111 /* StarRatingViewTests.xctest */; 273 | productType = "com.apple.product-type.bundle.unit-test"; 274 | }; 275 | /* End PBXNativeTarget section */ 276 | 277 | /* Begin PBXProject section */ 278 | C78228C519160F1D00ACA111 /* Project object */ = { 279 | isa = PBXProject; 280 | attributes = { 281 | LastUpgradeCheck = 0510; 282 | ORGANIZATIONNAME = jinxing; 283 | TargetAttributes = { 284 | C78228E719160F1D00ACA111 = { 285 | TestTargetID = C78228CC19160F1D00ACA111; 286 | }; 287 | }; 288 | }; 289 | buildConfigurationList = C78228C819160F1D00ACA111 /* Build configuration list for PBXProject "StarRatingView" */; 290 | compatibilityVersion = "Xcode 3.2"; 291 | developmentRegion = English; 292 | hasScannedForEncodings = 0; 293 | knownRegions = ( 294 | en, 295 | ); 296 | mainGroup = C78228C419160F1D00ACA111; 297 | productRefGroup = C78228CE19160F1D00ACA111 /* Products */; 298 | projectDirPath = ""; 299 | projectRoot = ""; 300 | targets = ( 301 | C78228CC19160F1D00ACA111 /* StarRatingView */, 302 | C78228E719160F1D00ACA111 /* StarRatingViewTests */, 303 | ); 304 | }; 305 | /* End PBXProject section */ 306 | 307 | /* Begin PBXResourcesBuildPhase section */ 308 | C78228CB19160F1D00ACA111 /* Resources */ = { 309 | isa = PBXResourcesBuildPhase; 310 | buildActionMask = 2147483647; 311 | files = ( 312 | A8C1342C1CB527EC00419D9A /* LaunchScreen.storyboard in Resources */, 313 | C782291B1916128B00ACA111 /* ic_starwhitehalf.png in Resources */, 314 | C78229181916128B00ACA111 /* ic_starredhalf.png in Resources */, 315 | C782291A1916128B00ACA111 /* ic_starwhiteept.png in Resources */, 316 | C78229161916128B00ACA111 /* ic_starred.png in Resources */, 317 | C78229171916128B00ACA111 /* ic_starredept.png in Resources */, 318 | C78228DB19160F1D00ACA111 /* InfoPlist.strings in Resources */, 319 | C78228E319160F1D00ACA111 /* Images.xcassets in Resources */, 320 | C78229191916128B00ACA111 /* ic_starwhite.png in Resources */, 321 | ); 322 | runOnlyForDeploymentPostprocessing = 0; 323 | }; 324 | C78228E619160F1D00ACA111 /* Resources */ = { 325 | isa = PBXResourcesBuildPhase; 326 | buildActionMask = 2147483647; 327 | files = ( 328 | C78228F419160F1D00ACA111 /* InfoPlist.strings in Resources */, 329 | ); 330 | runOnlyForDeploymentPostprocessing = 0; 331 | }; 332 | /* End PBXResourcesBuildPhase section */ 333 | 334 | /* Begin PBXShellScriptBuildPhase section */ 335 | 0F20F179902A40B68F909796 /* Copy Pods Resources */ = { 336 | isa = PBXShellScriptBuildPhase; 337 | buildActionMask = 2147483647; 338 | files = ( 339 | ); 340 | inputPaths = ( 341 | ); 342 | name = "Copy Pods Resources"; 343 | outputPaths = ( 344 | ); 345 | runOnlyForDeploymentPostprocessing = 0; 346 | shellPath = /bin/sh; 347 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-resources.sh\"\n"; 348 | showEnvVarsInLog = 0; 349 | }; 350 | 2B2A59EBA7AC4E508AD6AD55 /* Check Pods Manifest.lock */ = { 351 | isa = PBXShellScriptBuildPhase; 352 | buildActionMask = 2147483647; 353 | files = ( 354 | ); 355 | inputPaths = ( 356 | ); 357 | name = "Check Pods Manifest.lock"; 358 | outputPaths = ( 359 | ); 360 | runOnlyForDeploymentPostprocessing = 0; 361 | shellPath = /bin/sh; 362 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 363 | showEnvVarsInLog = 0; 364 | }; 365 | 38F968AA0E9C7AA184ED8053 /* Embed Pods Frameworks */ = { 366 | isa = PBXShellScriptBuildPhase; 367 | buildActionMask = 2147483647; 368 | files = ( 369 | ); 370 | inputPaths = ( 371 | ); 372 | name = "Embed Pods Frameworks"; 373 | outputPaths = ( 374 | ); 375 | runOnlyForDeploymentPostprocessing = 0; 376 | shellPath = /bin/sh; 377 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StarRatingViewTests/Pods-StarRatingViewTests-frameworks.sh\"\n"; 378 | showEnvVarsInLog = 0; 379 | }; 380 | 81590B130308BABAB090A162 /* Embed Pods Frameworks */ = { 381 | isa = PBXShellScriptBuildPhase; 382 | buildActionMask = 2147483647; 383 | files = ( 384 | ); 385 | inputPaths = ( 386 | ); 387 | name = "Embed Pods Frameworks"; 388 | outputPaths = ( 389 | ); 390 | runOnlyForDeploymentPostprocessing = 0; 391 | shellPath = /bin/sh; 392 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods/Pods-frameworks.sh\"\n"; 393 | showEnvVarsInLog = 0; 394 | }; 395 | 921251DC52554632B3D9F39C /* Copy Pods Resources */ = { 396 | isa = PBXShellScriptBuildPhase; 397 | buildActionMask = 2147483647; 398 | files = ( 399 | ); 400 | inputPaths = ( 401 | ); 402 | name = "Copy Pods Resources"; 403 | outputPaths = ( 404 | ); 405 | runOnlyForDeploymentPostprocessing = 0; 406 | shellPath = /bin/sh; 407 | shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StarRatingViewTests/Pods-StarRatingViewTests-resources.sh\"\n"; 408 | showEnvVarsInLog = 0; 409 | }; 410 | 98F0632F1D3E4056B46BD90E /* Check Pods Manifest.lock */ = { 411 | isa = PBXShellScriptBuildPhase; 412 | buildActionMask = 2147483647; 413 | files = ( 414 | ); 415 | inputPaths = ( 416 | ); 417 | name = "Check Pods Manifest.lock"; 418 | outputPaths = ( 419 | ); 420 | runOnlyForDeploymentPostprocessing = 0; 421 | shellPath = /bin/sh; 422 | shellScript = "diff \"${PODS_ROOT}/../Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [[ $? != 0 ]] ; then\n cat << EOM\nerror: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\nEOM\n exit 1\nfi\n"; 423 | showEnvVarsInLog = 0; 424 | }; 425 | /* End PBXShellScriptBuildPhase section */ 426 | 427 | /* Begin PBXSourcesBuildPhase section */ 428 | C78228C919160F1D00ACA111 /* Sources */ = { 429 | isa = PBXSourcesBuildPhase; 430 | buildActionMask = 2147483647; 431 | files = ( 432 | C782290F1916106500ACA111 /* ExampleViewController.m in Sources */, 433 | C78228E119160F1D00ACA111 /* AppDelegate.m in Sources */, 434 | C78228DD19160F1D00ACA111 /* main.m in Sources */, 435 | ); 436 | runOnlyForDeploymentPostprocessing = 0; 437 | }; 438 | C78228E419160F1D00ACA111 /* Sources */ = { 439 | isa = PBXSourcesBuildPhase; 440 | buildActionMask = 2147483647; 441 | files = ( 442 | C78228F619160F1D00ACA111 /* StarRatingViewTests.m in Sources */, 443 | ); 444 | runOnlyForDeploymentPostprocessing = 0; 445 | }; 446 | /* End PBXSourcesBuildPhase section */ 447 | 448 | /* Begin PBXTargetDependency section */ 449 | C78228EE19160F1D00ACA111 /* PBXTargetDependency */ = { 450 | isa = PBXTargetDependency; 451 | target = C78228CC19160F1D00ACA111 /* StarRatingView */; 452 | targetProxy = C78228ED19160F1D00ACA111 /* PBXContainerItemProxy */; 453 | }; 454 | /* End PBXTargetDependency section */ 455 | 456 | /* Begin PBXVariantGroup section */ 457 | C78228D919160F1D00ACA111 /* InfoPlist.strings */ = { 458 | isa = PBXVariantGroup; 459 | children = ( 460 | C78228DA19160F1D00ACA111 /* en */, 461 | ); 462 | name = InfoPlist.strings; 463 | sourceTree = ""; 464 | }; 465 | C78228F219160F1D00ACA111 /* InfoPlist.strings */ = { 466 | isa = PBXVariantGroup; 467 | children = ( 468 | C78228F319160F1D00ACA111 /* en */, 469 | ); 470 | name = InfoPlist.strings; 471 | sourceTree = ""; 472 | }; 473 | /* End PBXVariantGroup section */ 474 | 475 | /* Begin XCBuildConfiguration section */ 476 | C78228F719160F1D00ACA111 /* Debug */ = { 477 | isa = XCBuildConfiguration; 478 | buildSettings = { 479 | ALWAYS_SEARCH_USER_PATHS = NO; 480 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 481 | CLANG_CXX_LIBRARY = "libc++"; 482 | CLANG_ENABLE_MODULES = YES; 483 | CLANG_ENABLE_OBJC_ARC = YES; 484 | CLANG_WARN_BOOL_CONVERSION = YES; 485 | CLANG_WARN_CONSTANT_CONVERSION = YES; 486 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 487 | CLANG_WARN_EMPTY_BODY = YES; 488 | CLANG_WARN_ENUM_CONVERSION = YES; 489 | CLANG_WARN_INT_CONVERSION = YES; 490 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 491 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 492 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 493 | COPY_PHASE_STRIP = NO; 494 | GCC_C_LANGUAGE_STANDARD = gnu99; 495 | GCC_DYNAMIC_NO_PIC = NO; 496 | GCC_OPTIMIZATION_LEVEL = 0; 497 | GCC_PREPROCESSOR_DEFINITIONS = ( 498 | "DEBUG=1", 499 | "$(inherited)", 500 | ); 501 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 502 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 503 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 504 | GCC_WARN_UNDECLARED_SELECTOR = YES; 505 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 506 | GCC_WARN_UNUSED_FUNCTION = YES; 507 | GCC_WARN_UNUSED_VARIABLE = YES; 508 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 509 | ONLY_ACTIVE_ARCH = YES; 510 | SDKROOT = iphoneos; 511 | TARGETED_DEVICE_FAMILY = "1,2"; 512 | }; 513 | name = Debug; 514 | }; 515 | C78228F819160F1D00ACA111 /* Release */ = { 516 | isa = XCBuildConfiguration; 517 | buildSettings = { 518 | ALWAYS_SEARCH_USER_PATHS = NO; 519 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 520 | CLANG_CXX_LIBRARY = "libc++"; 521 | CLANG_ENABLE_MODULES = YES; 522 | CLANG_ENABLE_OBJC_ARC = YES; 523 | CLANG_WARN_BOOL_CONVERSION = YES; 524 | CLANG_WARN_CONSTANT_CONVERSION = YES; 525 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 526 | CLANG_WARN_EMPTY_BODY = YES; 527 | CLANG_WARN_ENUM_CONVERSION = YES; 528 | CLANG_WARN_INT_CONVERSION = YES; 529 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 530 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 531 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 532 | COPY_PHASE_STRIP = YES; 533 | ENABLE_NS_ASSERTIONS = NO; 534 | GCC_C_LANGUAGE_STANDARD = gnu99; 535 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 536 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 537 | GCC_WARN_UNDECLARED_SELECTOR = YES; 538 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 539 | GCC_WARN_UNUSED_FUNCTION = YES; 540 | GCC_WARN_UNUSED_VARIABLE = YES; 541 | IPHONEOS_DEPLOYMENT_TARGET = 7.1; 542 | SDKROOT = iphoneos; 543 | TARGETED_DEVICE_FAMILY = "1,2"; 544 | VALIDATE_PRODUCT = YES; 545 | }; 546 | name = Release; 547 | }; 548 | C78228FA19160F1D00ACA111 /* Debug */ = { 549 | isa = XCBuildConfiguration; 550 | baseConfigurationReference = 822E2D134750FE1643867A57 /* Pods.debug.xcconfig */; 551 | buildSettings = { 552 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 553 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 554 | GCC_PREFIX_HEADER = "StarRatingView/StarRatingView-Prefix.pch"; 555 | INFOPLIST_FILE = "StarRatingView/StarRatingView-Info.plist"; 556 | ONLY_ACTIVE_ARCH = YES; 557 | PRODUCT_NAME = "$(TARGET_NAME)"; 558 | WRAPPER_EXTENSION = app; 559 | }; 560 | name = Debug; 561 | }; 562 | C78228FB19160F1D00ACA111 /* Release */ = { 563 | isa = XCBuildConfiguration; 564 | baseConfigurationReference = 2A4E6F5A3EED2263EDD3F8EF /* Pods.release.xcconfig */; 565 | buildSettings = { 566 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 567 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 568 | GCC_PREFIX_HEADER = "StarRatingView/StarRatingView-Prefix.pch"; 569 | INFOPLIST_FILE = "StarRatingView/StarRatingView-Info.plist"; 570 | ONLY_ACTIVE_ARCH = YES; 571 | PRODUCT_NAME = "$(TARGET_NAME)"; 572 | WRAPPER_EXTENSION = app; 573 | }; 574 | name = Release; 575 | }; 576 | C78228FD19160F1D00ACA111 /* Debug */ = { 577 | isa = XCBuildConfiguration; 578 | baseConfigurationReference = DE54CBA58E763A7DA177F4CB /* Pods-StarRatingViewTests.debug.xcconfig */; 579 | buildSettings = { 580 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/StarRatingView.app/StarRatingView"; 581 | FRAMEWORK_SEARCH_PATHS = ( 582 | "$(SDKROOT)/Developer/Library/Frameworks", 583 | "$(inherited)", 584 | "$(DEVELOPER_FRAMEWORKS_DIR)", 585 | ); 586 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 587 | GCC_PREFIX_HEADER = "StarRatingViewTests/StarRatingViewTests-Prefix.pch"; 588 | GCC_PREPROCESSOR_DEFINITIONS = ( 589 | "DEBUG=1", 590 | "$(inherited)", 591 | ); 592 | INFOPLIST_FILE = "StarRatingViewTests/StarRatingViewTests-Info.plist"; 593 | PRODUCT_NAME = "$(TARGET_NAME)"; 594 | TEST_HOST = "$(BUNDLE_LOADER)"; 595 | WRAPPER_EXTENSION = xctest; 596 | }; 597 | name = Debug; 598 | }; 599 | C78228FE19160F1D00ACA111 /* Release */ = { 600 | isa = XCBuildConfiguration; 601 | baseConfigurationReference = 64CBC30B689164B8EE4050D0 /* Pods-StarRatingViewTests.release.xcconfig */; 602 | buildSettings = { 603 | BUNDLE_LOADER = "$(BUILT_PRODUCTS_DIR)/StarRatingView.app/StarRatingView"; 604 | FRAMEWORK_SEARCH_PATHS = ( 605 | "$(SDKROOT)/Developer/Library/Frameworks", 606 | "$(inherited)", 607 | "$(DEVELOPER_FRAMEWORKS_DIR)", 608 | ); 609 | GCC_PRECOMPILE_PREFIX_HEADER = YES; 610 | GCC_PREFIX_HEADER = "StarRatingViewTests/StarRatingViewTests-Prefix.pch"; 611 | INFOPLIST_FILE = "StarRatingViewTests/StarRatingViewTests-Info.plist"; 612 | PRODUCT_NAME = "$(TARGET_NAME)"; 613 | TEST_HOST = "$(BUNDLE_LOADER)"; 614 | WRAPPER_EXTENSION = xctest; 615 | }; 616 | name = Release; 617 | }; 618 | /* End XCBuildConfiguration section */ 619 | 620 | /* Begin XCConfigurationList section */ 621 | C78228C819160F1D00ACA111 /* Build configuration list for PBXProject "StarRatingView" */ = { 622 | isa = XCConfigurationList; 623 | buildConfigurations = ( 624 | C78228F719160F1D00ACA111 /* Debug */, 625 | C78228F819160F1D00ACA111 /* Release */, 626 | ); 627 | defaultConfigurationIsVisible = 0; 628 | defaultConfigurationName = Release; 629 | }; 630 | C78228F919160F1D00ACA111 /* Build configuration list for PBXNativeTarget "StarRatingView" */ = { 631 | isa = XCConfigurationList; 632 | buildConfigurations = ( 633 | C78228FA19160F1D00ACA111 /* Debug */, 634 | C78228FB19160F1D00ACA111 /* Release */, 635 | ); 636 | defaultConfigurationIsVisible = 0; 637 | defaultConfigurationName = Release; 638 | }; 639 | C78228FC19160F1D00ACA111 /* Build configuration list for PBXNativeTarget "StarRatingViewTests" */ = { 640 | isa = XCConfigurationList; 641 | buildConfigurations = ( 642 | C78228FD19160F1D00ACA111 /* Debug */, 643 | C78228FE19160F1D00ACA111 /* Release */, 644 | ); 645 | defaultConfigurationIsVisible = 0; 646 | defaultConfigurationName = Release; 647 | }; 648 | /* End XCConfigurationList section */ 649 | }; 650 | rootObject = C78228C519160F1D00ACA111 /* Project object */; 651 | } 652 | -------------------------------------------------------------------------------- /StarRatingView.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /StarRatingView.xcodeproj/xcshareddata/xcschemes/StarRatingView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /StarRatingView.xcodeproj/xcuserdata/liaojinxing.xcuserdatad/xcschemes/StarRatingView.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 24 | 25 | 30 | 31 | 33 | 39 | 40 | 41 | 42 | 43 | 49 | 50 | 51 | 52 | 61 | 62 | 68 | 69 | 70 | 71 | 72 | 73 | 79 | 80 | 86 | 87 | 88 | 89 | 91 | 92 | 95 | 96 | 97 | -------------------------------------------------------------------------------- /StarRatingView.xcodeproj/xcuserdata/liaojinxing.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | StarRatingView.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | C78228CC19160F1D00ACA111 16 | 17 | primary 18 | 19 | 20 | C78228E719160F1D00ACA111 21 | 22 | primary 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /StarRatingView.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /StarRatingView/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface AppDelegate : UIResponder 12 | 13 | @property (strong, nonatomic) UIWindow *window; 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /StarRatingView/AppDelegate.m: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.m 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | #import "ExampleViewController.h" 11 | 12 | @implementation AppDelegate 13 | 14 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 15 | { 16 | self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; 17 | // Override point for customization after application launch. 18 | self.window.backgroundColor = [UIColor whiteColor]; 19 | 20 | ExampleViewController *controller = [[ExampleViewController alloc] init]; 21 | self.window.rootViewController = controller; 22 | 23 | [self.window makeKeyAndVisible]; 24 | return YES; 25 | } 26 | 27 | - (void)applicationWillResignActive:(UIApplication *)application 28 | { 29 | // 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. 30 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. 31 | } 32 | 33 | - (void)applicationDidEnterBackground:(UIApplication *)application 34 | { 35 | // 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. 36 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 37 | } 38 | 39 | - (void)applicationWillEnterForeground:(UIApplication *)application 40 | { 41 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background. 42 | } 43 | 44 | - (void)applicationDidBecomeActive:(UIApplication *)application 45 | { 46 | // 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. 47 | } 48 | 49 | - (void)applicationWillTerminate:(UIApplication *)application 50 | { 51 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 52 | } 53 | 54 | @end 55 | -------------------------------------------------------------------------------- /StarRatingView/Images.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 | "idiom" : "ipad", 35 | "size" : "29x29", 36 | "scale" : "1x" 37 | }, 38 | { 39 | "idiom" : "ipad", 40 | "size" : "29x29", 41 | "scale" : "2x" 42 | }, 43 | { 44 | "idiom" : "ipad", 45 | "size" : "40x40", 46 | "scale" : "1x" 47 | }, 48 | { 49 | "idiom" : "ipad", 50 | "size" : "40x40", 51 | "scale" : "2x" 52 | }, 53 | { 54 | "idiom" : "ipad", 55 | "size" : "76x76", 56 | "scale" : "1x" 57 | }, 58 | { 59 | "idiom" : "ipad", 60 | "size" : "76x76", 61 | "scale" : "2x" 62 | }, 63 | { 64 | "idiom" : "ipad", 65 | "size" : "83.5x83.5", 66 | "scale" : "2x" 67 | } 68 | ], 69 | "info" : { 70 | "version" : 1, 71 | "author" : "xcode" 72 | } 73 | } -------------------------------------------------------------------------------- /StarRatingView/Images.xcassets/LaunchImage.launchimage/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "orientation" : "portrait", 5 | "idiom" : "iphone", 6 | "extent" : "full-screen", 7 | "minimum-system-version" : "7.0", 8 | "scale" : "2x" 9 | }, 10 | { 11 | "orientation" : "portrait", 12 | "idiom" : "iphone", 13 | "subtype" : "retina4", 14 | "extent" : "full-screen", 15 | "minimum-system-version" : "7.0", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "orientation" : "portrait", 20 | "idiom" : "ipad", 21 | "extent" : "full-screen", 22 | "minimum-system-version" : "7.0", 23 | "scale" : "1x" 24 | }, 25 | { 26 | "orientation" : "landscape", 27 | "idiom" : "ipad", 28 | "extent" : "full-screen", 29 | "minimum-system-version" : "7.0", 30 | "scale" : "1x" 31 | }, 32 | { 33 | "orientation" : "portrait", 34 | "idiom" : "ipad", 35 | "extent" : "full-screen", 36 | "minimum-system-version" : "7.0", 37 | "scale" : "2x" 38 | }, 39 | { 40 | "orientation" : "landscape", 41 | "idiom" : "ipad", 42 | "extent" : "full-screen", 43 | "minimum-system-version" : "7.0", 44 | "scale" : "2x" 45 | } 46 | ], 47 | "info" : { 48 | "version" : 1, 49 | "author" : "xcode" 50 | } 51 | } -------------------------------------------------------------------------------- /StarRatingView/LaunchScreen.storyboard: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 27 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starred.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starred.png -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starredept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starredept.png -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starredhalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starredhalf.png -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starwhite.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starwhite.png -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starwhiteept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starwhiteept.png -------------------------------------------------------------------------------- /StarRatingView/Resource/ic_starwhitehalf.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingView/Resource/ic_starwhitehalf.png -------------------------------------------------------------------------------- /StarRatingView/Source/Controllers/ExampleViewController.h: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleViewController.h 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface ExampleViewController : UIViewController 12 | 13 | @end 14 | -------------------------------------------------------------------------------- /StarRatingView/Source/Controllers/ExampleViewController.m: -------------------------------------------------------------------------------- 1 | // 2 | // ExampleViewController.m 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import "ExampleViewController.h" 10 | #import "StarRatingView.h" 11 | 12 | @interface ExampleViewController () 13 | 14 | @end 15 | 16 | @implementation ExampleViewController 17 | 18 | - (void)viewDidLoad 19 | { 20 | [super viewDidLoad]; 21 | [self.view setBackgroundColor:[UIColor grayColor]]; 22 | 23 | StarRatingViewConfiguration *conf = [[StarRatingViewConfiguration alloc] init]; 24 | conf.rateEnabled = YES; 25 | conf.starWidth = 40.0f; 26 | conf.fullImage = @"ic_starwhite.png"; 27 | conf.halfImage = @"ic_starwhitehalf.png"; 28 | conf.emptyImage = @"ic_starwhiteept"; 29 | StarRatingView *ratingView = [[StarRatingView alloc] initWithFrame:CGRectMake(50, 100, self.view.frame.size.width - 50, 50) configuration:conf]; 30 | 31 | [ratingView setRating:4.25 completion:^{ 32 | NSLog(@"rate done"); 33 | }]; 34 | [self.view addSubview:ratingView]; 35 | } 36 | 37 | @end 38 | -------------------------------------------------------------------------------- /StarRatingView/Source/View/StarRatingView.h: -------------------------------------------------------------------------------- 1 | // 2 | // RatingView.h 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | @interface StarRatingViewConfiguration : NSObject 12 | 13 | // star configuration 14 | @property (nonatomic, assign) CGFloat starWidth; 15 | @property (nonatomic, assign) BOOL rateEnabled; // default is YES 16 | 17 | // star image, these should not be nil 18 | @property (nonatomic, strong, nonnull) NSString *fullImage; 19 | @property (nonatomic, strong, nonnull) NSString *halfImage; 20 | @property (nonatomic, strong, nonnull) NSString *emptyImage; 21 | 22 | @end 23 | 24 | typedef void (^StarRatingViewAction)(); 25 | 26 | @interface StarRatingView : UIView 27 | 28 | - (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nonnull StarRatingViewConfiguration *)configuration; 29 | 30 | // rating 31 | @property (nonatomic, assign) CGFloat rating; 32 | - (void)setRating:(CGFloat)rating completion:(nullable StarRatingViewAction)completion; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /StarRatingView/Source/View/StarRatingView.m: -------------------------------------------------------------------------------- 1 | // 2 | // RatingView.m 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import "StarRatingView.h" 10 | 11 | @interface StarRatingView () 12 | 13 | @property (nonatomic, strong) NSMutableArray *starButtons; 14 | @property (nonatomic, copy) StarRatingViewAction ratingAction; 15 | @property (nonatomic, strong) StarRatingViewConfiguration *configuration; 16 | 17 | @end 18 | 19 | @implementation StarRatingViewConfiguration 20 | 21 | @end 22 | 23 | 24 | @implementation StarRatingView 25 | 26 | - (nullable instancetype)initWithFrame:(CGRect)frame configuration:(nonnull StarRatingViewConfiguration *)configuration { 27 | if (!configuration.fullImage || !configuration.emptyImage || !configuration.halfImage) { 28 | return nil; 29 | } 30 | 31 | self = [super initWithFrame:frame]; 32 | if (self) { 33 | _starButtons = [[NSMutableArray alloc] initWithCapacity:5]; 34 | for (int i = 0; i < 5; i++) { 35 | UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; 36 | CGFloat starWidth = configuration.starWidth? configuration.starWidth: 16; 37 | [button setFrame:CGRectMake(starWidth * i, 0, starWidth, starWidth)]; 38 | [button setTitleColor:[UIColor redColor] forState:UIControlStateNormal]; 39 | button.tag = i; 40 | [button setUserInteractionEnabled:configuration.rateEnabled]; 41 | if (configuration.rateEnabled) { 42 | [button addTarget:self action:@selector(rate:) forControlEvents:UIControlEventTouchUpInside]; 43 | } 44 | [self addSubview:button]; 45 | [_starButtons addObject:button]; 46 | } 47 | 48 | self.configuration = configuration; 49 | } 50 | return self; 51 | } 52 | 53 | - (void)rate:(id)sender { 54 | UIButton *button = (UIButton *)sender; 55 | [self setRating:button.tag + 1]; 56 | } 57 | 58 | - (void)setRating:(CGFloat)rating completion:(nullable StarRatingViewAction)completion { 59 | [self setRating:rating]; 60 | if (completion) { 61 | completion(); 62 | } 63 | } 64 | 65 | - (void)setRating:(CGFloat)rating { 66 | _rating = rating; 67 | UIImage *starFull = [UIImage imageNamed:self.configuration.fullImage]; 68 | UIImage *starHalf = [UIImage imageNamed:self.configuration.halfImage]; 69 | UIImage *starEmpty = [UIImage imageNamed:self.configuration.emptyImage]; 70 | 71 | rating = round(rating * 2) / 2; 72 | int fullStars = floor(rating); 73 | int i; 74 | for (i = 0; i < fullStars; i++) { 75 | UIButton *button = [_starButtons objectAtIndex:i]; 76 | [button setImage:starFull forState:UIControlStateNormal]; 77 | } 78 | 79 | if (rating - fullStars >= 0.5) { 80 | UIButton *button = [_starButtons objectAtIndex:fullStars]; 81 | [button setImage:starHalf forState:UIControlStateNormal]; 82 | i++; 83 | } 84 | 85 | for (; i < 5; i++) { 86 | UIButton *button = [_starButtons objectAtIndex:i]; 87 | [button setImage:starEmpty forState:UIControlStateNormal]; 88 | } 89 | } 90 | 91 | @end 92 | -------------------------------------------------------------------------------- /StarRatingView/StarRatingView-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleDisplayName 8 | ${PRODUCT_NAME} 9 | CFBundleExecutable 10 | ${EXECUTABLE_NAME} 11 | CFBundleIdentifier 12 | cn.jinxing.${PRODUCT_NAME:rfc1034identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1.0 25 | LSRequiresIPhoneOS 26 | 27 | UILaunchStoryboardName 28 | LaunchScreen 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | UIInterfaceOrientationLandscapeRight 38 | 39 | UISupportedInterfaceOrientations~ipad 40 | 41 | UIInterfaceOrientationPortrait 42 | UIInterfaceOrientationPortraitUpsideDown 43 | UIInterfaceOrientationLandscapeLeft 44 | UIInterfaceOrientationLandscapeRight 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /StarRatingView/StarRatingView-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header 3 | // 4 | // The contents of this file are implicitly included at the beginning of every source file. 5 | // 6 | 7 | #import 8 | 9 | #ifndef __IPHONE_3_0 10 | #warning "This project uses features only available in iOS SDK 3.0 and later." 11 | #endif 12 | 13 | #ifdef __OBJC__ 14 | #import 15 | #import 16 | #endif 17 | -------------------------------------------------------------------------------- /StarRatingView/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /StarRatingView/main.m: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // StarRatingView 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #import "AppDelegate.h" 12 | 13 | int main(int argc, char * argv[]) 14 | { 15 | @autoreleasepool { 16 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /StarRatingViewTests/ReferenceImages/StarRatingViewSpec/fiveStars@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingViewTests/ReferenceImages/StarRatingViewSpec/fiveStars@2x.png -------------------------------------------------------------------------------- /StarRatingViewTests/ReferenceImages/StarRatingViewSpec/halfStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingViewTests/ReferenceImages/StarRatingViewSpec/halfStar@2x.png -------------------------------------------------------------------------------- /StarRatingViewTests/ReferenceImages/StarRatingViewSpec/noStars@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingViewTests/ReferenceImages/StarRatingViewSpec/noStars@2x.png -------------------------------------------------------------------------------- /StarRatingViewTests/ReferenceImages/StarRatingViewSpec/oneStar@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingViewTests/ReferenceImages/StarRatingViewSpec/oneStar@2x.png -------------------------------------------------------------------------------- /StarRatingViewTests/ReferenceImages/StarRatingViewSpec/threePointFiveStars@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/liaojinxing/StarRatingView/05e911e5f62bd5bd54fa0291355ad854f274999b/StarRatingViewTests/ReferenceImages/StarRatingViewSpec/threePointFiveStars@2x.png -------------------------------------------------------------------------------- /StarRatingViewTests/StarRatingViewTests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | cn.jinxing.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /StarRatingViewTests/StarRatingViewTests-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // StarRatingViewTests-Prefix.pch 3 | // StarRatingView 4 | // 5 | // Created by Daniel Doubrovkine on 5/19/14. 6 | // Copyright (c) 2014 jinxing. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | #ifndef __IPHONE_4_0 12 | #warning "This project uses features only available in iOS SDK 4.0 and later." 13 | #endif 14 | 15 | #ifdef __OBJC__ 16 | 17 | #import 18 | #import 19 | 20 | #define EXP_SHORTHAND 21 | #import 22 | #import 23 | #import 24 | 25 | #import 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /StarRatingViewTests/StarRatingViewTests.m: -------------------------------------------------------------------------------- 1 | // 2 | // StarRatingViewTests.m 3 | // StarRatingViewTests 4 | // 5 | // Created by liaojinxing on 14-5-4. 6 | // Copyright (c) 2014年 jinxing. All rights reserved. 7 | // 8 | 9 | SpecBegin(StarRatingView) 10 | 11 | __block StarRatingView* view; 12 | 13 | beforeEach(^{ 14 | view = [[StarRatingView alloc] initWithFrame:CGRectMake(0, 0, 200, 100)]; 15 | }); 16 | 17 | describe(@"rating", ^{ 18 | it(@"defaults to zero", ^{ 19 | expect(view.rating).to.equal(0); 20 | }); 21 | 22 | it(@"can be set", ^{ 23 | view.rating = 3.5f; 24 | expect(view.rating).to.equal(3.5f); 25 | }); 26 | 27 | it(@"displays no stars", ^{ 28 | expect(view).to.haveValidSnapshotNamed(@"noStars"); 29 | }); 30 | 31 | it(@"displays half a star", ^{ 32 | view.rating = 0.5f; 33 | expect(view).to.haveValidSnapshotNamed(@"halfStar"); 34 | }); 35 | 36 | it(@"displays one star", ^{ 37 | view.rating = 1.0f; 38 | expect(view).to.haveValidSnapshotNamed(@"oneStar"); 39 | }); 40 | 41 | it(@"displays five stars", ^{ 42 | view.rating = 5.0f; 43 | expect(view).to.haveValidSnapshotNamed(@"fiveStars"); 44 | }); 45 | 46 | it(@"displays half stars", ^{ 47 | view.rating = 3.5f; 48 | expect(view).to.haveValidSnapshotNamed(@"threePointFiveStars"); 49 | }); 50 | }); 51 | 52 | SpecEnd 53 | 54 | -------------------------------------------------------------------------------- /StarRatingViewTests/en.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | --------------------------------------------------------------------------------