garethpaul/iHeartRating is an Apple platform application or Swift sample. Simple Ratings View for iOS enabling you to use any image as a rating e.g. hearts, stars, pigeons etc.
This README is based on the checked-in source, manifests, scripts, and repository metadata on the master branch. The project language mix found during review was: Swift (6), C/C++ headers (1), shell (1).
CHANGES.md- concise history of maintenance changesMakefile- local verification entry pointREADME.md- project overview and local usage notesbuild.shexample- source or example codeiHeartRating- source or example codeiHeartRating.xcodeproj- Xcode project fileiHeartRating.podspec- CocoaPods package metadataiHeartRatingTests- source or example codeSECURITY.md- security reporting and disclosure guidancescripts/check-baseline.py- static rating-view and package verifierVISION.md- project direction and maintenance guardrails
Additional scan context:
- Source directories: example, iHeartRating, iHeartRatingTests
- Dependency and build manifests: iHeartRating.podspec
- Entry points or build surfaces:
make check, build.sh, iHeartRating.xcodeproj - Test-looking files: example/SampleApp/SampleAppTests/Info.plist, example/SampleApp/SampleAppTests/SampleAppTests.swift, example/SampleApp/SampleAppUITests/Info.plist, example/SampleApp/SampleAppUITests/SampleAppUITests.swift, iHeartRatingTests/Info.plist, iHeartRatingTests/iHeartRatingTests.swift
- Git
- macOS with a current Xcode release for building Apple platform projects
- iOS 12 or newer for consumers
- Python 3 for local static verification on non-macOS hosts
git clone https://github.com/garethpaul/iHeartRating.git
cd iHeartRating
make lint
make test
make build
make check
make xcode-testThe first four commands validate the location-independent static baseline.
make xcode-test selects an available iPhone simulator, runs the library XCTest
suite, checks the generated Objective-C compatibility header, and builds the
sample application.
- Open
iHeartRating.xcodeprojin Xcode, choose the app or sample scheme, and run it on the matching simulator/device. - Run
./build.shwhen Xcode and the required simulator runtime are installed. - Use
example/SampleAppfor storyboard/sample-app behavior andiHeartRating.podspecfor CocoaPods metadata review.
- CocoaPods and direct Xcode project integration are the currently declared and verified distribution surfaces.
- Swift Package Manager is not currently supported: this repository has no
Package.swift, resource declaration, or hosted SwiftPM build. - Adding SwiftPM support requires a focused change that defines the package products/targets, handles image resources, and adds executable hosted tests.
Run the local static baseline:
make lint
make test
make build
make checkThe lint, test, and build targets intentionally alias the static baseline.
Use make xcode-test for executable Swift, UIKit, Objective-C interoperability,
and sample-project evidence.
The baseline parses plist/storyboard/SVG files, validates both podspecs, checks build.sh shell syntax, verifies rating-view guards for empty, single-item, zero-size, negative minImageSize, invalid maxRating, rating bounds, non-editable touch endings, empty touch endings, empty began/moved touch events, out-of-range bounce configurations, and delegate-independent bounce behavior, and reports when Xcode is unavailable.
It also keeps non-editable began/moved touch events from sending live-update
delegate callbacks.
It also keeps image layout invalidation in the rating image setters so runtime
image changes recalculate frames before masks refresh.
Rating image geometry is calculated from the view's local bounds so transforms
do not inflate or misalign child images.
When a control is narrower than its intrinsic minimum, each image is capped to
its rating slot so interactive frames remain ordered and non-overlapping.
An incomplete image pair renders no full overlays: clearing either image hides
filled ratings and removes stale masks until both images are configured again.
NaN programmatic ratings fall back to minRating before mask rendering or
bounce animation indexing.
NaN minImageSize dimensions normalize independently to zero while valid
companion dimensions are preserved.
Infinite minImageSize dimensions normalize independently to zero while valid
companion dimensions are preserved.
imageContentMode changes propagate to every existing image view so already
created empty and full image pairs stay synchronized with the configured mode.
External consumers can configure the public imageContentMode property while its existing observer keeps every rating image synchronized.
Complete image pairs provide an intrinsic content size derived from the larger
configured image, minImageSize, and maxRating; incomplete pairs have zero
intrinsic size and clear stale filled-image masks.
Hostile NaN, infinite, negative, zero, and extreme finite geometry is normalized
or bounded before frames and masks reach Core Animation.
maxRating is capped at 100 before child image views are allocated, preventing
unbounded memory growth from malformed configuration.
The control is one adjustable accessibility element with a default Rating
label, a synchronized <value> of <max> value, and bounded increment/decrement
actions. Consumers may replace the accessibility label for localization.
As with UIKit generally, create and mutate HeartRatingView on the main thread.
The pinned, credential-free GitHub Actions check runs both make check and
make xcode-test on macos-15. The projects pin Swift 5 and iOS 12, the hosted
gate executes XCTest on a simulator, inspects the generated Swift-to-Objective-C
header, and compiles the SampleApp without signing.
When the required SDK or runtime is unavailable, use static checks and source review first, then verify on a machine that has the matching platform toolchain.
- No required secret or credential file was identified in the repository scan. If you add integrations later, keep secrets out of git.
- Review changes touching network requests, sockets, or service endpoints; examples from the scan include example/SampleApp/SampleApp/Info.plist, example/SampleApp/SampleAppTests/Info.plist, example/SampleApp/SampleAppUITests/Info.plist, iHeartRating/Info.plist, and 1 more.
- Review changes touching mobile permissions or privacy-sensitive device data; examples from the scan include iHeartRating/iHeartRatingView.swift.
- Review changes touching file, media, JSON, XML, CSV, OCR, or data parsing; examples from the scan include example/SampleApp/SampleApp/Info.plist, example/SampleApp/SampleAppTests/Info.plist, example/SampleApp/SampleAppUITests/Info.plist, iHeartRating/Info.plist, and 2 more.
- UI configuration changes should not crash on empty image arrays, single-rating views, zero-sized images, negative
minImageSize, invalidmaxRating, inconsistent rating bounds, or out-of-range ratings. - Runtime image changes should preserve image layout invalidation before mask refresh work runs.
- Rating image layout should use local bounds rather than transformed frame dimensions.
- Compressed layouts should cap images to their rating slots instead of allowing oversized minimum widths to create overlapping frames.
- An incomplete image pair should hide full overlays and clear stale masks until both rating images are configured.
- Every Make verification target derives the checkout root from the loaded Makefile, so an absolute Makefile path works from any working directory, including checkout paths containing spaces.
- This looks like an Apple platform project or sample. Xcode, Swift, CocoaPods, and deployment target versions may need to match the original project era.
- See
SECURITY.mdfor vulnerability reporting and safe research guidance. - See
VISION.mdfor project direction and contribution guardrails. - See
docs/plans/2026-06-08-bounce-without-delegate.mdfor the bounce-without-delegate guardrail. - See
docs/plans/2026-06-09-noneditable-touch-end.mdfor the non-editable touch-ending guardrail. - See
docs/plans/2026-06-09-empty-touch-end.mdfor the empty touch-ending guardrail. - See
docs/plans/2026-06-09-empty-touch-phase-guard.mdfor the empty began/moved touch guardrail. - See
docs/plans/2026-06-09-noneditable-touch-phase-guard.mdfor the non-editable began/moved touch guardrail. - See
docs/plans/2026-06-09-min-image-size-guard.mdfor theminImageSizelower-bound guardrail. - See
docs/plans/2026-06-09-rating-image-layout-invalidation.mdfor the image layout invalidation guardrail. - See
docs/plans/2026-06-10-nan-rating-boundary.mdfor non-finite rating normalization. - See
docs/plans/2026-06-12-bounds-based-image-layout.mdfor transformed-view layout correctness. - See
docs/plans/2026-06-13-incomplete-image-pair.mdfor fail-closed image-pair rendering. - See
docs/plans/2026-06-26-swift-package-support.mdfor the current CocoaPods/Xcode-only package boundary. - See
docs/plans/2026-06-09-make-gate-aliases.mdfor the local gate alias guardrail. - Run
make lint,make test,make build, andmake checkbefore pushing changes to Swift sources, podspecs, plist/storyboard files, or build scripts.
Keep changes small and tied to the project that is already present in this repository. For code changes, document the toolchain used, avoid committing generated dependency directories or local configuration, and update this README when setup or verification steps change.