├── .gitignore ├── .travis.yml ├── Example ├── JXReviewController.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── IDEWorkspaceChecks.plist │ └── xcshareddata │ │ └── xcschemes │ │ └── JXReviewController-Example.xcscheme ├── JXReviewController.xcworkspace │ ├── contents.xcworkspacedata │ └── xcshareddata │ │ └── IDEWorkspaceChecks.plist ├── JXReviewController │ ├── AppDelegate.swift │ ├── Base.lproj │ │ ├── LaunchScreen.xib │ │ └── Main.storyboard │ ├── Images.xcassets │ │ └── AppIcon.appiconset │ │ │ └── Contents.json │ ├── Info.plist │ └── ViewController.swift ├── Podfile ├── Podfile.lock └── Tests │ ├── Info.plist │ └── Tests.swift ├── JXReviewController.podspec ├── JXReviewController ├── Assets │ └── .gitkeep ├── Classes │ ├── .gitkeep │ ├── JXReviewController.swift │ ├── JXReviewControllerButton.swift │ ├── JXReviewControllerDelegate.swift │ └── JXReviewControllerStarCell.swift ├── en.lproj │ └── Localizable.strings ├── ja-JP.lproj │ └── Localizable.strings ├── zh-HK.lproj │ └── Localizable.strings ├── zh-Hans.lproj │ └── Localizable.strings └── zh-Hant.lproj │ └── Localizable.strings ├── LICENSE ├── README.md └── _Pods.xcodeproj /.gitignore: -------------------------------------------------------------------------------- 1 | # OS X 2 | .DS_Store 3 | 4 | # Xcode 5 | build/ 6 | *.pbxuser 7 | !default.pbxuser 8 | *.mode1v3 9 | !default.mode1v3 10 | *.mode2v3 11 | !default.mode2v3 12 | *.perspectivev3 13 | !default.perspectivev3 14 | xcuserdata/ 15 | *.xccheckout 16 | profile 17 | *.moved-aside 18 | DerivedData 19 | *.hmap 20 | *.ipa 21 | 22 | # Bundler 23 | .bundle 24 | 25 | # Add this line if you want to avoid checking in source code from Carthage dependencies. 26 | # Carthage/Checkouts 27 | 28 | Carthage/Build 29 | 30 | # We recommend against adding the Pods directory to your .gitignore. However 31 | # you should judge for yourself, the pros and cons are mentioned at: 32 | # https://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control 33 | # 34 | # Note: if you ignore the Pods directory, make sure to uncomment 35 | # `pod install` in .travis.yml 36 | # 37 | Pods/ 38 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # references: 2 | # * https://www.objc.io/issues/6-build-tools/travis-ci/ 3 | # * https://github.com/supermarin/xcpretty#usage 4 | 5 | osx_image: xcode7.3 6 | language: objective-c 7 | # cache: cocoapods 8 | # podfile: Example/Podfile 9 | # before_install: 10 | # - gem install cocoapods # Since Travis is not always on latest version 11 | # - pod install --project-directory=Example 12 | script: 13 | - set -o pipefail && xcodebuild test -enableCodeCoverage YES -workspace Example/JXReviewController.xcworkspace -scheme JXReviewController-Example -sdk iphonesimulator9.3 ONLY_ACTIVE_ARCH=NO | xcpretty 14 | - pod lib lint 15 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 15D13211FED25F5AF78450C6 /* Pods_JXReviewController_Example.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4E8475DA6DA5BD38D045A267 /* Pods_JXReviewController_Example.framework */; }; 11 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD51AFB9204008FA782 /* AppDelegate.swift */; }; 12 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACD71AFB9204008FA782 /* ViewController.swift */; }; 13 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 607FACD91AFB9204008FA782 /* Main.storyboard */; }; 14 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDC1AFB9204008FA782 /* Images.xcassets */; }; 15 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */; }; 16 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 607FACEB1AFB9204008FA782 /* Tests.swift */; }; 17 | 6254876A36384257D9112A88 /* Pods_JXReviewController_Tests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 2392EFD140A2A58E883B78CE /* Pods_JXReviewController_Tests.framework */; }; 18 | /* End PBXBuildFile section */ 19 | 20 | /* Begin PBXContainerItemProxy section */ 21 | 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */ = { 22 | isa = PBXContainerItemProxy; 23 | containerPortal = 607FACC81AFB9204008FA782 /* Project object */; 24 | proxyType = 1; 25 | remoteGlobalIDString = 607FACCF1AFB9204008FA782; 26 | remoteInfo = JXReviewController; 27 | }; 28 | /* End PBXContainerItemProxy section */ 29 | 30 | /* Begin PBXFileReference section */ 31 | 0E343DBC3E9D836BF56CE3AF /* Pods-JXReviewController_Tests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JXReviewController_Tests.release.xcconfig"; path = "Target Support Files/Pods-JXReviewController_Tests/Pods-JXReviewController_Tests.release.xcconfig"; sourceTree = ""; }; 32 | 2392EFD140A2A58E883B78CE /* Pods_JXReviewController_Tests.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JXReviewController_Tests.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 33 | 23FDBE67C811EF994FD6CB32 /* README.md */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = net.daringfireball.markdown; name = README.md; path = ../README.md; sourceTree = ""; }; 34 | 474DE879396136DCC6B71707 /* Pods-JXReviewController_Example.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JXReviewController_Example.debug.xcconfig"; path = "Target Support Files/Pods-JXReviewController_Example/Pods-JXReviewController_Example.debug.xcconfig"; sourceTree = ""; }; 35 | 4E8475DA6DA5BD38D045A267 /* Pods_JXReviewController_Example.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_JXReviewController_Example.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 36 | 607FACD01AFB9204008FA782 /* JXReviewController_Example.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = JXReviewController_Example.app; sourceTree = BUILT_PRODUCTS_DIR; }; 37 | 607FACD41AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 38 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; 39 | 607FACD71AFB9204008FA782 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = ""; }; 40 | 607FACDA1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; }; 41 | 607FACDC1AFB9204008FA782 /* Images.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Images.xcassets; sourceTree = ""; }; 42 | 607FACDF1AFB9204008FA782 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/LaunchScreen.xib; sourceTree = ""; }; 43 | 607FACE51AFB9204008FA782 /* JXReviewController_Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = JXReviewController_Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 44 | 607FACEA1AFB9204008FA782 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 45 | 607FACEB1AFB9204008FA782 /* Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Tests.swift; sourceTree = ""; }; 46 | 9622870C5714D61FB8EF0A66 /* Pods-JXReviewController_Example.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JXReviewController_Example.release.xcconfig"; path = "Target Support Files/Pods-JXReviewController_Example/Pods-JXReviewController_Example.release.xcconfig"; sourceTree = ""; }; 47 | A359990C9C26ADE69BB31A56 /* Pods-JXReviewController_Tests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-JXReviewController_Tests.debug.xcconfig"; path = "Target Support Files/Pods-JXReviewController_Tests/Pods-JXReviewController_Tests.debug.xcconfig"; sourceTree = ""; }; 48 | C13979975B60BD06A1A61F01 /* LICENSE */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = LICENSE; path = ../LICENSE; sourceTree = ""; }; 49 | E214D8F9DD1376FEB46B457D /* JXReviewController.podspec */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text; name = JXReviewController.podspec; path = ../JXReviewController.podspec; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.ruby; }; 50 | /* End PBXFileReference section */ 51 | 52 | /* Begin PBXFrameworksBuildPhase section */ 53 | 607FACCD1AFB9204008FA782 /* Frameworks */ = { 54 | isa = PBXFrameworksBuildPhase; 55 | buildActionMask = 2147483647; 56 | files = ( 57 | 15D13211FED25F5AF78450C6 /* Pods_JXReviewController_Example.framework in Frameworks */, 58 | ); 59 | runOnlyForDeploymentPostprocessing = 0; 60 | }; 61 | 607FACE21AFB9204008FA782 /* Frameworks */ = { 62 | isa = PBXFrameworksBuildPhase; 63 | buildActionMask = 2147483647; 64 | files = ( 65 | 6254876A36384257D9112A88 /* Pods_JXReviewController_Tests.framework in Frameworks */, 66 | ); 67 | runOnlyForDeploymentPostprocessing = 0; 68 | }; 69 | /* End PBXFrameworksBuildPhase section */ 70 | 71 | /* Begin PBXGroup section */ 72 | 607FACC71AFB9204008FA782 = { 73 | isa = PBXGroup; 74 | children = ( 75 | 607FACF51AFB993E008FA782 /* Podspec Metadata */, 76 | 607FACD21AFB9204008FA782 /* Example for JXReviewController */, 77 | 607FACE81AFB9204008FA782 /* Tests */, 78 | 607FACD11AFB9204008FA782 /* Products */, 79 | F237D9F0391FA5D00CB1142B /* Pods */, 80 | 684544247479A32DC21E09AF /* Frameworks */, 81 | ); 82 | sourceTree = ""; 83 | }; 84 | 607FACD11AFB9204008FA782 /* Products */ = { 85 | isa = PBXGroup; 86 | children = ( 87 | 607FACD01AFB9204008FA782 /* JXReviewController_Example.app */, 88 | 607FACE51AFB9204008FA782 /* JXReviewController_Tests.xctest */, 89 | ); 90 | name = Products; 91 | sourceTree = ""; 92 | }; 93 | 607FACD21AFB9204008FA782 /* Example for JXReviewController */ = { 94 | isa = PBXGroup; 95 | children = ( 96 | 607FACD51AFB9204008FA782 /* AppDelegate.swift */, 97 | 607FACD71AFB9204008FA782 /* ViewController.swift */, 98 | 607FACD91AFB9204008FA782 /* Main.storyboard */, 99 | 607FACDC1AFB9204008FA782 /* Images.xcassets */, 100 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */, 101 | 607FACD31AFB9204008FA782 /* Supporting Files */, 102 | ); 103 | name = "Example for JXReviewController"; 104 | path = JXReviewController; 105 | sourceTree = ""; 106 | }; 107 | 607FACD31AFB9204008FA782 /* Supporting Files */ = { 108 | isa = PBXGroup; 109 | children = ( 110 | 607FACD41AFB9204008FA782 /* Info.plist */, 111 | ); 112 | name = "Supporting Files"; 113 | sourceTree = ""; 114 | }; 115 | 607FACE81AFB9204008FA782 /* Tests */ = { 116 | isa = PBXGroup; 117 | children = ( 118 | 607FACEB1AFB9204008FA782 /* Tests.swift */, 119 | 607FACE91AFB9204008FA782 /* Supporting Files */, 120 | ); 121 | path = Tests; 122 | sourceTree = ""; 123 | }; 124 | 607FACE91AFB9204008FA782 /* Supporting Files */ = { 125 | isa = PBXGroup; 126 | children = ( 127 | 607FACEA1AFB9204008FA782 /* Info.plist */, 128 | ); 129 | name = "Supporting Files"; 130 | sourceTree = ""; 131 | }; 132 | 607FACF51AFB993E008FA782 /* Podspec Metadata */ = { 133 | isa = PBXGroup; 134 | children = ( 135 | E214D8F9DD1376FEB46B457D /* JXReviewController.podspec */, 136 | 23FDBE67C811EF994FD6CB32 /* README.md */, 137 | C13979975B60BD06A1A61F01 /* LICENSE */, 138 | ); 139 | name = "Podspec Metadata"; 140 | sourceTree = ""; 141 | }; 142 | 684544247479A32DC21E09AF /* Frameworks */ = { 143 | isa = PBXGroup; 144 | children = ( 145 | 4E8475DA6DA5BD38D045A267 /* Pods_JXReviewController_Example.framework */, 146 | 2392EFD140A2A58E883B78CE /* Pods_JXReviewController_Tests.framework */, 147 | ); 148 | name = Frameworks; 149 | sourceTree = ""; 150 | }; 151 | F237D9F0391FA5D00CB1142B /* Pods */ = { 152 | isa = PBXGroup; 153 | children = ( 154 | 474DE879396136DCC6B71707 /* Pods-JXReviewController_Example.debug.xcconfig */, 155 | 9622870C5714D61FB8EF0A66 /* Pods-JXReviewController_Example.release.xcconfig */, 156 | A359990C9C26ADE69BB31A56 /* Pods-JXReviewController_Tests.debug.xcconfig */, 157 | 0E343DBC3E9D836BF56CE3AF /* Pods-JXReviewController_Tests.release.xcconfig */, 158 | ); 159 | path = Pods; 160 | sourceTree = ""; 161 | }; 162 | /* End PBXGroup section */ 163 | 164 | /* Begin PBXNativeTarget section */ 165 | 607FACCF1AFB9204008FA782 /* JXReviewController_Example */ = { 166 | isa = PBXNativeTarget; 167 | buildConfigurationList = 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JXReviewController_Example" */; 168 | buildPhases = ( 169 | 9B3B7616BF263111A2535CB6 /* [CP] Check Pods Manifest.lock */, 170 | 607FACCC1AFB9204008FA782 /* Sources */, 171 | 607FACCD1AFB9204008FA782 /* Frameworks */, 172 | 607FACCE1AFB9204008FA782 /* Resources */, 173 | 72579353C5CA1D2CCDD5D421 /* [CP] Embed Pods Frameworks */, 174 | ); 175 | buildRules = ( 176 | ); 177 | dependencies = ( 178 | ); 179 | name = JXReviewController_Example; 180 | productName = JXReviewController; 181 | productReference = 607FACD01AFB9204008FA782 /* JXReviewController_Example.app */; 182 | productType = "com.apple.product-type.application"; 183 | }; 184 | 607FACE41AFB9204008FA782 /* JXReviewController_Tests */ = { 185 | isa = PBXNativeTarget; 186 | buildConfigurationList = 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JXReviewController_Tests" */; 187 | buildPhases = ( 188 | 38E8A5A0FB3938A10FF4B056 /* [CP] Check Pods Manifest.lock */, 189 | 607FACE11AFB9204008FA782 /* Sources */, 190 | 607FACE21AFB9204008FA782 /* Frameworks */, 191 | 607FACE31AFB9204008FA782 /* Resources */, 192 | ); 193 | buildRules = ( 194 | ); 195 | dependencies = ( 196 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */, 197 | ); 198 | name = JXReviewController_Tests; 199 | productName = Tests; 200 | productReference = 607FACE51AFB9204008FA782 /* JXReviewController_Tests.xctest */; 201 | productType = "com.apple.product-type.bundle.unit-test"; 202 | }; 203 | /* End PBXNativeTarget section */ 204 | 205 | /* Begin PBXProject section */ 206 | 607FACC81AFB9204008FA782 /* Project object */ = { 207 | isa = PBXProject; 208 | attributes = { 209 | LastSwiftUpdateCheck = 0830; 210 | LastUpgradeCheck = 0830; 211 | ORGANIZATIONNAME = CocoaPods; 212 | TargetAttributes = { 213 | 607FACCF1AFB9204008FA782 = { 214 | CreatedOnToolsVersion = 6.3.1; 215 | LastSwiftMigration = 0900; 216 | }; 217 | 607FACE41AFB9204008FA782 = { 218 | CreatedOnToolsVersion = 6.3.1; 219 | LastSwiftMigration = 0900; 220 | TestTargetID = 607FACCF1AFB9204008FA782; 221 | }; 222 | }; 223 | }; 224 | buildConfigurationList = 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "JXReviewController" */; 225 | compatibilityVersion = "Xcode 3.2"; 226 | developmentRegion = English; 227 | hasScannedForEncodings = 0; 228 | knownRegions = ( 229 | English, 230 | en, 231 | Base, 232 | ); 233 | mainGroup = 607FACC71AFB9204008FA782; 234 | productRefGroup = 607FACD11AFB9204008FA782 /* Products */; 235 | projectDirPath = ""; 236 | projectRoot = ""; 237 | targets = ( 238 | 607FACCF1AFB9204008FA782 /* JXReviewController_Example */, 239 | 607FACE41AFB9204008FA782 /* JXReviewController_Tests */, 240 | ); 241 | }; 242 | /* End PBXProject section */ 243 | 244 | /* Begin PBXResourcesBuildPhase section */ 245 | 607FACCE1AFB9204008FA782 /* Resources */ = { 246 | isa = PBXResourcesBuildPhase; 247 | buildActionMask = 2147483647; 248 | files = ( 249 | 607FACDB1AFB9204008FA782 /* Main.storyboard in Resources */, 250 | 607FACE01AFB9204008FA782 /* LaunchScreen.xib in Resources */, 251 | 607FACDD1AFB9204008FA782 /* Images.xcassets in Resources */, 252 | ); 253 | runOnlyForDeploymentPostprocessing = 0; 254 | }; 255 | 607FACE31AFB9204008FA782 /* Resources */ = { 256 | isa = PBXResourcesBuildPhase; 257 | buildActionMask = 2147483647; 258 | files = ( 259 | ); 260 | runOnlyForDeploymentPostprocessing = 0; 261 | }; 262 | /* End PBXResourcesBuildPhase section */ 263 | 264 | /* Begin PBXShellScriptBuildPhase section */ 265 | 38E8A5A0FB3938A10FF4B056 /* [CP] Check Pods Manifest.lock */ = { 266 | isa = PBXShellScriptBuildPhase; 267 | buildActionMask = 2147483647; 268 | files = ( 269 | ); 270 | inputFileListPaths = ( 271 | ); 272 | inputPaths = ( 273 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 274 | "${PODS_ROOT}/Manifest.lock", 275 | ); 276 | name = "[CP] Check Pods Manifest.lock"; 277 | outputFileListPaths = ( 278 | ); 279 | outputPaths = ( 280 | "$(DERIVED_FILE_DIR)/Pods-JXReviewController_Tests-checkManifestLockResult.txt", 281 | ); 282 | runOnlyForDeploymentPostprocessing = 0; 283 | shellPath = /bin/sh; 284 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 285 | showEnvVarsInLog = 0; 286 | }; 287 | 72579353C5CA1D2CCDD5D421 /* [CP] Embed Pods Frameworks */ = { 288 | isa = PBXShellScriptBuildPhase; 289 | buildActionMask = 2147483647; 290 | files = ( 291 | ); 292 | inputPaths = ( 293 | "${PODS_ROOT}/Target Support Files/Pods-JXReviewController_Example/Pods-JXReviewController_Example-frameworks.sh", 294 | "${BUILT_PRODUCTS_DIR}/JXReviewController/JXReviewController.framework", 295 | "${BUILT_PRODUCTS_DIR}/SnapKit/SnapKit.framework", 296 | "${BUILT_PRODUCTS_DIR}/UIButtonSetBackgroundColorForState/UIButtonSetBackgroundColorForState.framework", 297 | ); 298 | name = "[CP] Embed Pods Frameworks"; 299 | outputPaths = ( 300 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/JXReviewController.framework", 301 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SnapKit.framework", 302 | "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/UIButtonSetBackgroundColorForState.framework", 303 | ); 304 | runOnlyForDeploymentPostprocessing = 0; 305 | shellPath = /bin/sh; 306 | shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-JXReviewController_Example/Pods-JXReviewController_Example-frameworks.sh\"\n"; 307 | showEnvVarsInLog = 0; 308 | }; 309 | 9B3B7616BF263111A2535CB6 /* [CP] Check Pods Manifest.lock */ = { 310 | isa = PBXShellScriptBuildPhase; 311 | buildActionMask = 2147483647; 312 | files = ( 313 | ); 314 | inputFileListPaths = ( 315 | ); 316 | inputPaths = ( 317 | "${PODS_PODFILE_DIR_PATH}/Podfile.lock", 318 | "${PODS_ROOT}/Manifest.lock", 319 | ); 320 | name = "[CP] Check Pods Manifest.lock"; 321 | outputFileListPaths = ( 322 | ); 323 | outputPaths = ( 324 | "$(DERIVED_FILE_DIR)/Pods-JXReviewController_Example-checkManifestLockResult.txt", 325 | ); 326 | runOnlyForDeploymentPostprocessing = 0; 327 | shellPath = /bin/sh; 328 | shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; 329 | showEnvVarsInLog = 0; 330 | }; 331 | /* End PBXShellScriptBuildPhase section */ 332 | 333 | /* Begin PBXSourcesBuildPhase section */ 334 | 607FACCC1AFB9204008FA782 /* Sources */ = { 335 | isa = PBXSourcesBuildPhase; 336 | buildActionMask = 2147483647; 337 | files = ( 338 | 607FACD81AFB9204008FA782 /* ViewController.swift in Sources */, 339 | 607FACD61AFB9204008FA782 /* AppDelegate.swift in Sources */, 340 | ); 341 | runOnlyForDeploymentPostprocessing = 0; 342 | }; 343 | 607FACE11AFB9204008FA782 /* Sources */ = { 344 | isa = PBXSourcesBuildPhase; 345 | buildActionMask = 2147483647; 346 | files = ( 347 | 607FACEC1AFB9204008FA782 /* Tests.swift in Sources */, 348 | ); 349 | runOnlyForDeploymentPostprocessing = 0; 350 | }; 351 | /* End PBXSourcesBuildPhase section */ 352 | 353 | /* Begin PBXTargetDependency section */ 354 | 607FACE71AFB9204008FA782 /* PBXTargetDependency */ = { 355 | isa = PBXTargetDependency; 356 | target = 607FACCF1AFB9204008FA782 /* JXReviewController_Example */; 357 | targetProxy = 607FACE61AFB9204008FA782 /* PBXContainerItemProxy */; 358 | }; 359 | /* End PBXTargetDependency section */ 360 | 361 | /* Begin PBXVariantGroup section */ 362 | 607FACD91AFB9204008FA782 /* Main.storyboard */ = { 363 | isa = PBXVariantGroup; 364 | children = ( 365 | 607FACDA1AFB9204008FA782 /* Base */, 366 | ); 367 | name = Main.storyboard; 368 | sourceTree = ""; 369 | }; 370 | 607FACDE1AFB9204008FA782 /* LaunchScreen.xib */ = { 371 | isa = PBXVariantGroup; 372 | children = ( 373 | 607FACDF1AFB9204008FA782 /* Base */, 374 | ); 375 | name = LaunchScreen.xib; 376 | sourceTree = ""; 377 | }; 378 | /* End PBXVariantGroup section */ 379 | 380 | /* Begin XCBuildConfiguration section */ 381 | 607FACED1AFB9204008FA782 /* Debug */ = { 382 | isa = XCBuildConfiguration; 383 | buildSettings = { 384 | ALWAYS_SEARCH_USER_PATHS = NO; 385 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 386 | CLANG_CXX_LIBRARY = "libc++"; 387 | CLANG_ENABLE_MODULES = YES; 388 | CLANG_ENABLE_OBJC_ARC = YES; 389 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 390 | CLANG_WARN_BOOL_CONVERSION = YES; 391 | CLANG_WARN_COMMA = YES; 392 | CLANG_WARN_CONSTANT_CONVERSION = YES; 393 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 394 | CLANG_WARN_EMPTY_BODY = YES; 395 | CLANG_WARN_ENUM_CONVERSION = YES; 396 | CLANG_WARN_INFINITE_RECURSION = YES; 397 | CLANG_WARN_INT_CONVERSION = YES; 398 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 399 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 400 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 401 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 402 | CLANG_WARN_STRICT_PROTOTYPES = YES; 403 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 404 | CLANG_WARN_UNREACHABLE_CODE = YES; 405 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 406 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 407 | COPY_PHASE_STRIP = NO; 408 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 409 | ENABLE_STRICT_OBJC_MSGSEND = YES; 410 | ENABLE_TESTABILITY = YES; 411 | GCC_C_LANGUAGE_STANDARD = gnu99; 412 | GCC_DYNAMIC_NO_PIC = NO; 413 | GCC_NO_COMMON_BLOCKS = YES; 414 | GCC_OPTIMIZATION_LEVEL = 0; 415 | GCC_PREPROCESSOR_DEFINITIONS = ( 416 | "DEBUG=1", 417 | "$(inherited)", 418 | ); 419 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 420 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 421 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 422 | GCC_WARN_UNDECLARED_SELECTOR = YES; 423 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 424 | GCC_WARN_UNUSED_FUNCTION = YES; 425 | GCC_WARN_UNUSED_VARIABLE = YES; 426 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 427 | MTL_ENABLE_DEBUG_INFO = YES; 428 | ONLY_ACTIVE_ARCH = YES; 429 | SDKROOT = iphoneos; 430 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 431 | }; 432 | name = Debug; 433 | }; 434 | 607FACEE1AFB9204008FA782 /* Release */ = { 435 | isa = XCBuildConfiguration; 436 | buildSettings = { 437 | ALWAYS_SEARCH_USER_PATHS = NO; 438 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 439 | CLANG_CXX_LIBRARY = "libc++"; 440 | CLANG_ENABLE_MODULES = YES; 441 | CLANG_ENABLE_OBJC_ARC = YES; 442 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; 443 | CLANG_WARN_BOOL_CONVERSION = YES; 444 | CLANG_WARN_COMMA = YES; 445 | CLANG_WARN_CONSTANT_CONVERSION = YES; 446 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 447 | CLANG_WARN_EMPTY_BODY = YES; 448 | CLANG_WARN_ENUM_CONVERSION = YES; 449 | CLANG_WARN_INFINITE_RECURSION = YES; 450 | CLANG_WARN_INT_CONVERSION = YES; 451 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; 452 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; 453 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 454 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; 455 | CLANG_WARN_STRICT_PROTOTYPES = YES; 456 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 457 | CLANG_WARN_UNREACHABLE_CODE = YES; 458 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 459 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 460 | COPY_PHASE_STRIP = NO; 461 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 462 | ENABLE_NS_ASSERTIONS = NO; 463 | ENABLE_STRICT_OBJC_MSGSEND = YES; 464 | GCC_C_LANGUAGE_STANDARD = gnu99; 465 | GCC_NO_COMMON_BLOCKS = YES; 466 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 467 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 468 | GCC_WARN_UNDECLARED_SELECTOR = YES; 469 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 470 | GCC_WARN_UNUSED_FUNCTION = YES; 471 | GCC_WARN_UNUSED_VARIABLE = YES; 472 | IPHONEOS_DEPLOYMENT_TARGET = 13.0; 473 | MTL_ENABLE_DEBUG_INFO = NO; 474 | SDKROOT = iphoneos; 475 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 476 | VALIDATE_PRODUCT = YES; 477 | }; 478 | name = Release; 479 | }; 480 | 607FACF01AFB9204008FA782 /* Debug */ = { 481 | isa = XCBuildConfiguration; 482 | baseConfigurationReference = 474DE879396136DCC6B71707 /* Pods-JXReviewController_Example.debug.xcconfig */; 483 | buildSettings = { 484 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 485 | INFOPLIST_FILE = JXReviewController/Info.plist; 486 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 487 | MODULE_NAME = ExampleApp; 488 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 489 | PRODUCT_NAME = "$(TARGET_NAME)"; 490 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 491 | SWIFT_VERSION = 4.0; 492 | }; 493 | name = Debug; 494 | }; 495 | 607FACF11AFB9204008FA782 /* Release */ = { 496 | isa = XCBuildConfiguration; 497 | baseConfigurationReference = 9622870C5714D61FB8EF0A66 /* Pods-JXReviewController_Example.release.xcconfig */; 498 | buildSettings = { 499 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; 500 | INFOPLIST_FILE = JXReviewController/Info.plist; 501 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; 502 | MODULE_NAME = ExampleApp; 503 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.demo.$(PRODUCT_NAME:rfc1034identifier)"; 504 | PRODUCT_NAME = "$(TARGET_NAME)"; 505 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 506 | SWIFT_VERSION = 4.0; 507 | }; 508 | name = Release; 509 | }; 510 | 607FACF31AFB9204008FA782 /* Debug */ = { 511 | isa = XCBuildConfiguration; 512 | baseConfigurationReference = A359990C9C26ADE69BB31A56 /* Pods-JXReviewController_Tests.debug.xcconfig */; 513 | buildSettings = { 514 | FRAMEWORK_SEARCH_PATHS = ( 515 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 516 | "$(inherited)", 517 | ); 518 | GCC_PREPROCESSOR_DEFINITIONS = ( 519 | "DEBUG=1", 520 | "$(inherited)", 521 | ); 522 | INFOPLIST_FILE = Tests/Info.plist; 523 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 524 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 525 | PRODUCT_NAME = "$(TARGET_NAME)"; 526 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 527 | SWIFT_VERSION = 4.0; 528 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JXReviewController_Example.app/JXReviewController_Example"; 529 | }; 530 | name = Debug; 531 | }; 532 | 607FACF41AFB9204008FA782 /* Release */ = { 533 | isa = XCBuildConfiguration; 534 | baseConfigurationReference = 0E343DBC3E9D836BF56CE3AF /* Pods-JXReviewController_Tests.release.xcconfig */; 535 | buildSettings = { 536 | FRAMEWORK_SEARCH_PATHS = ( 537 | "$(PLATFORM_DIR)/Developer/Library/Frameworks", 538 | "$(inherited)", 539 | ); 540 | INFOPLIST_FILE = Tests/Info.plist; 541 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 542 | PRODUCT_BUNDLE_IDENTIFIER = "org.cocoapods.$(PRODUCT_NAME:rfc1034identifier)"; 543 | PRODUCT_NAME = "$(TARGET_NAME)"; 544 | SWIFT_SWIFT3_OBJC_INFERENCE = Default; 545 | SWIFT_VERSION = 4.0; 546 | TEST_HOST = "$(BUILT_PRODUCTS_DIR)/JXReviewController_Example.app/JXReviewController_Example"; 547 | }; 548 | name = Release; 549 | }; 550 | /* End XCBuildConfiguration section */ 551 | 552 | /* Begin XCConfigurationList section */ 553 | 607FACCB1AFB9204008FA782 /* Build configuration list for PBXProject "JXReviewController" */ = { 554 | isa = XCConfigurationList; 555 | buildConfigurations = ( 556 | 607FACED1AFB9204008FA782 /* Debug */, 557 | 607FACEE1AFB9204008FA782 /* Release */, 558 | ); 559 | defaultConfigurationIsVisible = 0; 560 | defaultConfigurationName = Release; 561 | }; 562 | 607FACEF1AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JXReviewController_Example" */ = { 563 | isa = XCConfigurationList; 564 | buildConfigurations = ( 565 | 607FACF01AFB9204008FA782 /* Debug */, 566 | 607FACF11AFB9204008FA782 /* Release */, 567 | ); 568 | defaultConfigurationIsVisible = 0; 569 | defaultConfigurationName = Release; 570 | }; 571 | 607FACF21AFB9204008FA782 /* Build configuration list for PBXNativeTarget "JXReviewController_Tests" */ = { 572 | isa = XCConfigurationList; 573 | buildConfigurations = ( 574 | 607FACF31AFB9204008FA782 /* Debug */, 575 | 607FACF41AFB9204008FA782 /* Release */, 576 | ); 577 | defaultConfigurationIsVisible = 0; 578 | defaultConfigurationName = Release; 579 | }; 580 | /* End XCConfigurationList section */ 581 | }; 582 | rootObject = 607FACC81AFB9204008FA782 /* Project object */; 583 | } 584 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcodeproj/xcshareddata/xcschemes/JXReviewController-Example.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 15 | 21 | 22 | 23 | 29 | 35 | 36 | 37 | 38 | 39 | 45 | 46 | 48 | 54 | 55 | 56 | 57 | 58 | 64 | 65 | 66 | 67 | 68 | 69 | 80 | 82 | 88 | 89 | 90 | 91 | 92 | 93 | 99 | 101 | 107 | 108 | 109 | 110 | 112 | 113 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /Example/JXReviewController.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEDidComputeMac32BitWarning 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /Example/JXReviewController/AppDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 07/02/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | import UIKit 10 | 11 | @UIApplicationMain 12 | class AppDelegate: UIResponder, UIApplicationDelegate { 13 | 14 | var window: UIWindow? 15 | 16 | 17 | func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { 18 | // Override point for customization after application launch. 19 | return true 20 | } 21 | 22 | func applicationWillResignActive(_ application: UIApplication) { 23 | // 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. 24 | // 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. 25 | } 26 | 27 | func applicationDidEnterBackground(_ application: UIApplication) { 28 | // 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. 29 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. 30 | } 31 | 32 | func applicationWillEnterForeground(_ application: UIApplication) { 33 | // 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. 34 | } 35 | 36 | func applicationDidBecomeActive(_ application: UIApplication) { 37 | // 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. 38 | } 39 | 40 | func applicationWillTerminate(_ application: UIApplication) { 41 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. 42 | } 43 | 44 | 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Example/JXReviewController/Base.lproj/LaunchScreen.xib: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 25 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /Example/JXReviewController/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 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /Example/JXReviewController/Images.xcassets/AppIcon.appiconset/Contents.json: -------------------------------------------------------------------------------- 1 | { 2 | "images" : [ 3 | { 4 | "idiom" : "iphone", 5 | "size" : "20x20", 6 | "scale" : "2x" 7 | }, 8 | { 9 | "idiom" : "iphone", 10 | "size" : "20x20", 11 | "scale" : "3x" 12 | }, 13 | { 14 | "idiom" : "iphone", 15 | "size" : "29x29", 16 | "scale" : "2x" 17 | }, 18 | { 19 | "idiom" : "iphone", 20 | "size" : "29x29", 21 | "scale" : "3x" 22 | }, 23 | { 24 | "idiom" : "iphone", 25 | "size" : "40x40", 26 | "scale" : "2x" 27 | }, 28 | { 29 | "idiom" : "iphone", 30 | "size" : "40x40", 31 | "scale" : "3x" 32 | }, 33 | { 34 | "idiom" : "iphone", 35 | "size" : "60x60", 36 | "scale" : "2x" 37 | }, 38 | { 39 | "idiom" : "iphone", 40 | "size" : "60x60", 41 | "scale" : "3x" 42 | }, 43 | { 44 | "idiom" : "ios-marketing", 45 | "size" : "1024x1024", 46 | "scale" : "1x" 47 | } 48 | ], 49 | "info" : { 50 | "version" : 1, 51 | "author" : "xcode" 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /Example/JXReviewController/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | LSRequiresIPhoneOS 24 | 25 | UILaunchStoryboardName 26 | LaunchScreen 27 | UIMainStoryboardFile 28 | Main 29 | UIRequiredDeviceCapabilities 30 | 31 | armv7 32 | 33 | UISupportedInterfaceOrientations 34 | 35 | UIInterfaceOrientationPortrait 36 | UIInterfaceOrientationLandscapeLeft 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /Example/JXReviewController/ViewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // ViewController.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 07/02/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | import JXReviewController 10 | import UIKit 11 | 12 | class ViewController: UIViewController { 13 | 14 | override func viewDidAppear(_ animated: Bool) { 15 | super.viewDidAppear(animated) 16 | 17 | requestReview() 18 | } 19 | 20 | private func requestReview() { 21 | let reviewController = JXReviewController() 22 | reviewController.image = UIImage(systemName: "app.fill") 23 | reviewController.title = "Enjoy it?" 24 | reviewController.message = "Tap a star to rate it." 25 | reviewController.delegate = self 26 | present(reviewController, animated: true) 27 | } 28 | } 29 | 30 | extension ViewController: JXReviewControllerDelegate { 31 | 32 | func reviewController(_ reviewController: JXReviewController, didSelectWith point: Int) { 33 | print("Did select with \(point) point(s).") 34 | } 35 | 36 | func reviewController(_ reviewController: JXReviewController, didCancelWith point: Int) { 37 | print("Did cancel with \(point) point(s).") 38 | } 39 | 40 | func reviewController(_ reviewController: JXReviewController, didSubmitWith point: Int) { 41 | print("Did submit with \(point) point(s).") 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Example/Podfile: -------------------------------------------------------------------------------- 1 | use_frameworks! 2 | 3 | target 'JXReviewController_Example' do 4 | pod 'JXReviewController', :path => '../' 5 | 6 | target 'JXReviewController_Tests' do 7 | inherit! :search_paths 8 | 9 | 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /Example/Podfile.lock: -------------------------------------------------------------------------------- 1 | PODS: 2 | - JXReviewController (0.1.4): 3 | - SnapKit 4 | - UIButtonSetBackgroundColorForState 5 | - SnapKit (5.6.0) 6 | - UIButtonSetBackgroundColorForState (0.1.1) 7 | 8 | DEPENDENCIES: 9 | - JXReviewController (from `../`) 10 | 11 | SPEC REPOS: 12 | trunk: 13 | - SnapKit 14 | - UIButtonSetBackgroundColorForState 15 | 16 | EXTERNAL SOURCES: 17 | JXReviewController: 18 | :path: "../" 19 | 20 | SPEC CHECKSUMS: 21 | JXReviewController: d3ced9c5c9d4c8c3ac7694dc944967f3fa33f7de 22 | SnapKit: e01d52ebb8ddbc333eefe2132acf85c8227d9c25 23 | UIButtonSetBackgroundColorForState: 53e57d766d62f19e564b62bf31b64236902f852c 24 | 25 | PODFILE CHECKSUM: e9399a835be392a8b1ab6825d36c4b3418353a0c 26 | 27 | COCOAPODS: 1.11.3 28 | -------------------------------------------------------------------------------- /Example/Tests/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 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /Example/Tests/Tests.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | import JXReviewController 3 | 4 | class Tests: XCTestCase { 5 | 6 | override func setUp() { 7 | super.setUp() 8 | // Put setup code here. This method is called before the invocation of each test method in the class. 9 | } 10 | 11 | override func tearDown() { 12 | // Put teardown code here. This method is called after the invocation of each test method in the class. 13 | super.tearDown() 14 | } 15 | 16 | func testExample() { 17 | // This is an example of a functional test case. 18 | XCTAssert(true, "Pass") 19 | } 20 | 21 | func testPerformanceExample() { 22 | // This is an example of a performance test case. 23 | self.measure() { 24 | // Put the code you want to measure the time of here. 25 | } 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /JXReviewController.podspec: -------------------------------------------------------------------------------- 1 | # 2 | # Be sure to run `pod lib lint JXReviewController.podspec' to ensure this is a 3 | # valid spec before submitting. 4 | # 5 | # Any lines starting with a # are optional, but their use is encouraged 6 | # To learn more about a Podspec see https://guides.cocoapods.org/syntax/podspec.html 7 | # 8 | 9 | Pod::Spec.new do |s| 10 | s.name = 'JXReviewController' 11 | s.version = '0.1.4' 12 | s.summary = 'Request rating by 1-5 stars.' 13 | 14 | # This description is used to generate tags and improve search results. 15 | # * Think: What does it do? Why did you write it? What is the focus? 16 | # * Try to keep it short, snappy and to the point. 17 | # * Write the description between the DESC delimiters below. 18 | # * Finally, don't worry about the indent, CocoaPods strips it! 19 | 20 | s.description = <<-DESC 21 | Request rating by 1-5 stars. iOS 13+ is required. 22 | DESC 23 | 24 | s.homepage = 'https://bailushuyuan.org' 25 | # s.screenshots = 'www.example.com/screenshots_1', 'www.example.com/screenshots_2' 26 | s.license = { :type => 'MIT', :file => 'LICENSE' } 27 | s.author = { 'Jianqiu Xiao' => 'swordray@gmail.com' } 28 | s.source = { :git => 'https://github.com/swordray/JXReviewController.git', :tag => s.version.to_s } 29 | # s.social_media_url = 'https://twitter.com/' 30 | 31 | s.ios.deployment_target = '10.0' 32 | 33 | s.source_files = 'JXReviewController/Classes/**/*' 34 | 35 | s.resource_bundles = { 36 | 'JXReviewController' => ['JXReviewController/*.lproj/*.strings'] 37 | } 38 | 39 | # s.public_header_files = 'Pod/Classes/**/*.h' 40 | # s.frameworks = 'UIKit', 'MapKit' 41 | s.dependency 'SnapKit' 42 | s.dependency 'UIButtonSetBackgroundColorForState' 43 | 44 | s.swift_versions = '5.2' 45 | end 46 | -------------------------------------------------------------------------------- /JXReviewController/Assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swordray/JXReviewController/8b44ee9e05aa545c054f1dffa50c98bd2919c6d0/JXReviewController/Assets/.gitkeep -------------------------------------------------------------------------------- /JXReviewController/Classes/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/swordray/JXReviewController/8b44ee9e05aa545c054f1dffa50c98bd2919c6d0/JXReviewController/Classes/.gitkeep -------------------------------------------------------------------------------- /JXReviewController/Classes/JXReviewController.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JXReviewController.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 07/02/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | import SnapKit 10 | import UIKit 11 | 12 | @available(iOS 13, *) 13 | public class JXReviewController: UIViewController { 14 | 15 | private var cancelButton: UIButton! 16 | public weak var delegate: JXReviewControllerDelegate? 17 | public var image: UIImage? 18 | public var message: String? 19 | private var point = 0 20 | private var submitButton: UIButton! 21 | 22 | override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: Bundle?) { 23 | super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil) 24 | 25 | modalPresentationStyle = .custom 26 | modalTransitionStyle = .crossDissolve 27 | } 28 | 29 | @available(*, unavailable) 30 | required public init?(coder: NSCoder) { 31 | fatalError("init(coder:) has not been implemented") 32 | } 33 | 34 | override public func loadView() { 35 | super.loadView() 36 | 37 | view.backgroundColor = UIColor { UIColor.black.withAlphaComponent($0.userInterfaceStyle == .dark ? 0.6 : 0.4) } 38 | 39 | let contentView = UIVisualEffectView() 40 | contentView.clipsToBounds = true 41 | contentView.effect = UIBlurEffect(style: .systemMaterial) 42 | contentView.layer.cornerRadius = 16 43 | view.addSubview(contentView) 44 | contentView.snp.makeConstraints { 45 | $0.centerX.equalToSuperview() 46 | $0.centerY.equalToSuperview().offset(-10) 47 | $0.width.equalTo(270) 48 | } 49 | 50 | let stackView = UIStackView() 51 | stackView.axis = .vertical 52 | contentView.contentView.addSubview(stackView) 53 | stackView.snp.makeConstraints { $0.edges.equalToSuperview() } 54 | 55 | let headerView = UIStackView() 56 | headerView.alignment = .center 57 | headerView.axis = .vertical 58 | headerView.directionalLayoutMargins = NSDirectionalEdgeInsets(top: 20, leading: 20, bottom: 20, trailing: 20) 59 | headerView.isLayoutMarginsRelativeArrangement = true 60 | headerView.snp.makeConstraints { $0.height.greaterThanOrEqualTo(170) } 61 | stackView.addArrangedSubview(headerView) 62 | 63 | let imageView = UIImageView() 64 | imageView.clipsToBounds = true 65 | imageView.image = image 66 | imageView.layer.cornerRadius = 60 * 0.223_7 67 | imageView.snp.makeConstraints { $0.size.equalTo(60) } 68 | headerView.addArrangedSubview(imageView) 69 | headerView.setCustomSpacing(15, after: imageView) 70 | 71 | let titleLabel = UILabel() 72 | titleLabel.font = .preferredFont(forTextStyle: .headline) 73 | titleLabel.numberOfLines = 0 74 | titleLabel.text = title 75 | titleLabel.textAlignment = .center 76 | headerView.addArrangedSubview(titleLabel) 77 | headerView.setCustomSpacing(2, after: titleLabel) 78 | 79 | let messageLabel = UILabel() 80 | messageLabel.font = .preferredFont(forTextStyle: .subheadline) 81 | messageLabel.numberOfLines = 0 82 | messageLabel.text = message 83 | messageLabel.textAlignment = .center 84 | headerView.addArrangedSubview(messageLabel) 85 | 86 | headerView.addArrangedSubview(UIView()) 87 | 88 | let headerSeparator = UIView() 89 | headerSeparator.backgroundColor = .separator 90 | headerSeparator.snp.makeConstraints { $0.height.equalTo(1 / traitCollection.displayScale) } 91 | stackView.addArrangedSubview(headerSeparator) 92 | 93 | let flowLayout = UICollectionViewFlowLayout() 94 | flowLayout.itemSize = CGSize(width: 40, height: 44) 95 | flowLayout.minimumInteritemSpacing = 0 96 | flowLayout.minimumLineSpacing = 0 97 | flowLayout.scrollDirection = .horizontal 98 | flowLayout.sectionInset.left = 35 99 | 100 | let collectionView = UICollectionView(frame: .zero, collectionViewLayout: flowLayout) 101 | collectionView.backgroundColor = .clear 102 | collectionView.dataSource = self 103 | collectionView.delegate = self 104 | collectionView.register(JXReviewControllerStarCell.self, forCellWithReuseIdentifier: JXReviewControllerStarCell.description()) 105 | collectionView.snp.makeConstraints { $0.height.equalTo(44) } 106 | stackView.addArrangedSubview(collectionView) 107 | 108 | let collectionSeparator = UIView() 109 | collectionSeparator.backgroundColor = .separator 110 | collectionSeparator.snp.makeConstraints { $0.height.equalTo(1 / traitCollection.displayScale) } 111 | stackView.addArrangedSubview(collectionSeparator) 112 | 113 | let actionsView = UIStackView() 114 | actionsView.distribution = .fillEqually 115 | actionsView.snp.makeConstraints { $0.height.equalTo(44) } 116 | stackView.addArrangedSubview(actionsView) 117 | 118 | cancelButton = JXReviewControllerButton() 119 | cancelButton.addTarget(self, action: #selector(cancel), for: .touchUpInside) 120 | cancelButton.setTitle(l("Not Now"), for: .normal) 121 | cancelButton.titleLabel?.font = .systemFont(ofSize: 17) 122 | actionsView.addArrangedSubview(cancelButton) 123 | 124 | submitButton = JXReviewControllerButton() 125 | submitButton.addTarget(self, action: #selector(submit), for: .touchUpInside) 126 | submitButton.isHidden = true 127 | submitButton.setTitle(l("Submit"), for: .normal) 128 | submitButton.titleLabel?.font = .systemFont(ofSize: 17, weight: .semibold) 129 | actionsView.addArrangedSubview(submitButton) 130 | 131 | let submitSeparator = UIView() 132 | submitSeparator.backgroundColor = .separator 133 | submitButton.addSubview(submitSeparator) 134 | submitSeparator.snp.makeConstraints { 135 | $0.leading.top.bottom.equalToSuperview() 136 | $0.width.equalTo(1 / traitCollection.displayScale) 137 | } 138 | } 139 | 140 | @objc 141 | private func cancel() { 142 | dismiss(animated: true) { 143 | self.delegate?.reviewController(self, didCancelWith: self.point) 144 | } 145 | } 146 | 147 | @objc 148 | private func submit() { 149 | dismiss(animated: true) { 150 | self.delegate?.reviewController(self, didSubmitWith: self.point) 151 | } 152 | } 153 | 154 | private func l(_ key: String) -> String { 155 | let bundle = Bundle(path: Bundle(for: JXReviewController.self).path(forResource: "JXReviewController", ofType: "bundle") ?? "") ?? .main 156 | return NSLocalizedString(key, bundle: bundle, comment: "") 157 | } 158 | } 159 | 160 | @available(iOS 13, *) 161 | extension JXReviewController: UICollectionViewDataSource { 162 | 163 | public func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int { 164 | 5 165 | } 166 | 167 | public func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell { 168 | let cell = collectionView.dequeueReusableCell(withReuseIdentifier: JXReviewControllerStarCell.description(), for: indexPath) as? JXReviewControllerStarCell ?? .init() 169 | cell.isFilled = indexPath.item < point 170 | return cell 171 | } 172 | } 173 | 174 | @available(iOS 13, *) 175 | extension JXReviewController: UICollectionViewDelegate { 176 | 177 | public func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) { 178 | point = indexPath.item + 1 179 | collectionView.reloadData() 180 | cancelButton.setTitle(l("Cancel"), for: .normal) 181 | submitButton.isHidden = false 182 | delegate?.reviewController(self, didSelectWith: point) 183 | } 184 | } 185 | -------------------------------------------------------------------------------- /JXReviewController/Classes/JXReviewControllerButton.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JXReviewControllerButton.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 5/7/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | import UIButtonSetBackgroundColorForState 10 | import UIKit 11 | 12 | @available(iOS 13.0, *) 13 | class JXReviewControllerButton: UIButton { 14 | 15 | override init(frame: CGRect) { 16 | super.init(frame: frame) 17 | 18 | setBackgroundColor(.systemFill, for: .highlighted) 19 | 20 | setTitleColor(tintColor, for: .normal) 21 | } 22 | 23 | @available(*, unavailable) 24 | required init?(coder: NSCoder) { 25 | fatalError("init(coder:) has not been implemented") 26 | } 27 | 28 | override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) { 29 | super.traitCollectionDidChange(previousTraitCollection) 30 | 31 | if traitCollection.hasDifferentColorAppearance(comparedTo: previousTraitCollection) { 32 | setBackgroundColor(.systemFill, for: .highlighted) 33 | } 34 | } 35 | 36 | override func tintColorDidChange() { 37 | super.tintColorDidChange() 38 | 39 | setTitleColor(tintColor, for: .normal) 40 | } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /JXReviewController/Classes/JXReviewControllerDelegate.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JXReviewControllerDelegate.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 07/02/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | @available(iOS 13, *) 10 | public protocol JXReviewControllerDelegate: AnyObject { 11 | 12 | func reviewController(_ reviewController: JXReviewController, didSelectWith point: Int) 13 | 14 | func reviewController(_ reviewController: JXReviewController, didCancelWith point: Int) 15 | 16 | func reviewController(_ reviewController: JXReviewController, didSubmitWith point: Int) 17 | } 18 | 19 | @available(iOS 13, *) 20 | public extension JXReviewControllerDelegate { 21 | 22 | func reviewController(_ reviewController: JXReviewController, didSelectWith point: Int) {} 23 | 24 | func reviewController(_ reviewController: JXReviewController, didCancelWith point: Int) {} 25 | 26 | func reviewController(_ reviewController: JXReviewController, didSubmitWith point: Int) {} 27 | } 28 | -------------------------------------------------------------------------------- /JXReviewController/Classes/JXReviewControllerStarCell.swift: -------------------------------------------------------------------------------- 1 | // 2 | // JXReviewControllerStarCell.swift 3 | // JXReviewController 4 | // 5 | // Created by Jianqiu Xiao on 07/02/2020. 6 | // Copyright (c) 2020 Jianqiu Xiao. All rights reserved. 7 | // 8 | 9 | import SnapKit 10 | import UIKit 11 | 12 | @available(iOS 13, *) 13 | internal class JXReviewControllerStarCell: UICollectionViewCell { 14 | 15 | private var imageView: UIImageView! 16 | public var isFilled = false { didSet { didSetFilled() } } 17 | 18 | override init(frame: CGRect) { 19 | super.init(frame: frame) 20 | 21 | imageView = UIImageView() 22 | contentView.addSubview(imageView) 23 | imageView.snp.makeConstraints { $0.center.equalToSuperview() } 24 | } 25 | 26 | @available(*, unavailable) 27 | required init?(coder: NSCoder) { 28 | fatalError("init(coder:) has not been implemented") 29 | } 30 | 31 | private func didSetFilled() { 32 | imageView.image = UIImage(systemName: isFilled ? "star.fill" : "star") 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /JXReviewController/en.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Cancel" = "Cancel"; 2 | "Submit" = "Submit"; 3 | "Not Now" = "Not Now"; 4 | -------------------------------------------------------------------------------- /JXReviewController/ja-JP.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Cancel" = "キャンセル"; 2 | "Submit" = "送信"; 3 | "Not Now" = "今はしない"; 4 | -------------------------------------------------------------------------------- /JXReviewController/zh-HK.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Cancel" = "取消"; 2 | "Submit" = "送出"; 3 | "Not Now" = "稍後再說"; 4 | -------------------------------------------------------------------------------- /JXReviewController/zh-Hans.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Cancel" = "取消"; 2 | "Submit" = "提交"; 3 | "Not Now" = "以后"; 4 | -------------------------------------------------------------------------------- /JXReviewController/zh-Hant.lproj/Localizable.strings: -------------------------------------------------------------------------------- 1 | "Cancel" = "取消"; 2 | "Submit" = "送出"; 3 | "Not Now" = "稍後決定"; 4 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 Jianqiu Xiao 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. 20 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JXReviewController 2 | 3 | Request rating by 1-5 stars. 4 | 5 | [![CI Status](https://img.shields.io/travis/swordray/JXReviewController.svg?style=flat)](https://travis-ci.org/swordray/JXReviewController) 6 | [![Version](https://img.shields.io/cocoapods/v/JXReviewController.svg?style=flat)](https://cocoapods.org/pods/JXReviewController) 7 | [![License](https://img.shields.io/cocoapods/l/JXReviewController.svg?style=flat)](https://cocoapods.org/pods/JXReviewController) 8 | [![Platform](https://img.shields.io/cocoapods/p/JXReviewController.svg?style=flat)](https://cocoapods.org/pods/JXReviewController) 9 | 10 | ## Requirements 11 | 12 | * iOS 13+ 13 | 14 | ## Installation 15 | 16 | JXReviewController is available through [CocoaPods](https://cocoapods.org). To install it, simply add the following line to your Podfile: 17 | 18 | ```ruby 19 | pod 'JXReviewController' 20 | ``` 21 | 22 | ## Usage 23 | 24 | * Present a `JXReviewController` instance from your view controller. 25 | 26 | ```swift 27 | import JXReviewController 28 | 29 | class ViewController: UIViewController { 30 | 31 | func requestReview() { 32 | let reviewController = JXReviewController() 33 | reviewController.image = UIImage(systemName: "app.fill") 34 | reviewController.title = "Enjoy it?" 35 | reviewController.message = "Tap a star to rate it." 36 | reviewController.delegate = self 37 | present(reviewController, animated: true) 38 | } 39 | } 40 | ``` 41 | 42 | * Receive feedbacks by implimenting `JXReviewControllerDelegate`. 43 | 44 | ```swift 45 | extension ViewController: JXReviewControllerDelegate { 46 | 47 | func reviewController(_ reviewController: JXReviewController, didSelectWith point: Int) { 48 | print("Did select with \(point) point(s).") 49 | } 50 | 51 | func reviewController(_ reviewController: JXReviewController, didCancelWith point: Int) { 52 | print("Did cancel with \(point) point(s).") 53 | } 54 | 55 | func reviewController(_ reviewController: JXReviewController, didSubmitWith point: Int) { 56 | print("Did submit with \(point) point(s).") 57 | } 58 | } 59 | ``` 60 | 61 | ## Author 62 | 63 | Jianqiu Xiao, swordray@gmail.com 64 | 65 | ## Sponsors 66 | 67 | * [BaiLu ShuYuan](https://bailushuyuan.org) 68 | 69 | ## License 70 | 71 | JXReviewController is available under the MIT license. See the LICENSE file for more info. 72 | -------------------------------------------------------------------------------- /_Pods.xcodeproj: -------------------------------------------------------------------------------- 1 | Example/Pods/Pods.xcodeproj --------------------------------------------------------------------------------