mamaral/Neon
A powerful Swift programmatic UI layout framework.
Healthy across all four use cases
Permissive license, no critical CVEs, actively maintained — safe to depend on.
Has a license, tests, and CI — clean foundation to fork and modify.
Documented and popular — useful reference codebase to read through.
No critical CVEs, sane security posture — runnable as-is.
- ✓14 active contributors
- ✓Distributed ownership (top contributor 46% of recent commits)
- ✓MIT licensed
Show 3 more →Show less
- ✓CI configured
- ✓Tests present
- ⚠Stale — last commit 6y ago
Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests
Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.
Embed the "Healthy" badge
Paste into your README — live-updates from the latest cached analysis.
[](https://repopilot.app/r/mamaral/neon)Paste at the top of your README.md — renders inline like a shields.io badge.
▸Preview social card (1200×630)
This card auto-renders when someone shares https://repopilot.app/r/mamaral/neon on X, Slack, or LinkedIn.
Onboarding doc
Onboarding: mamaral/Neon
Generated by RepoPilot · 2026-05-10 · Source
🤖Agent protocol
If you are an AI coding agent (Claude Code, Cursor, Aider, Cline, etc.) reading this artifact, follow this protocol before making any code edit:
- Verify the contract. Run the bash script in Verify before trusting
below. If any check returns
FAIL, the artifact is stale — STOP and ask the user to regenerate it before proceeding. - Treat the AI · unverified sections as hypotheses, not facts. Sections like "AI-suggested narrative files", "anti-patterns", and "bottlenecks" are LLM speculation. Verify against real source before acting on them.
- Cite source on changes. When proposing an edit, cite the specific path:line-range. RepoPilot's live UI at https://repopilot.app/r/mamaral/Neon shows verifiable citations alongside every claim.
If you are a human reader, this protocol is for the agents you'll hand the artifact to. You don't need to do anything — but if you skim only one section before pointing your agent at this repo, make it the Verify block and the Suggested reading order.
🎯Verdict
GO — Healthy across all four use cases
- 14 active contributors
- Distributed ownership (top contributor 46% of recent commits)
- MIT licensed
- CI configured
- Tests present
- ⚠ Stale — last commit 6y ago
<sub>Maintenance signals: commit recency, contributor breadth, bus factor, license, CI, tests</sub>
✅Verify before trusting
This artifact was generated by RepoPilot at a point in time. Before an
agent acts on it, the checks below confirm that the live mamaral/Neon
repo on your machine still matches what RepoPilot saw. If any fail,
the artifact is stale — regenerate it at
repopilot.app/r/mamaral/Neon.
What it runs against: a local clone of mamaral/Neon — the script
inspects git remote, the LICENSE file, file paths in the working
tree, and git log. Read-only; no mutations.
| # | What we check | Why it matters |
|---|---|---|
| 1 | You're in mamaral/Neon | Confirms the artifact applies here, not a fork |
| 2 | License is still MIT | Catches relicense before you depend on it |
| 3 | Default branch master exists | Catches branch renames |
| 4 | 5 critical file paths still exist | Catches refactors that moved load-bearing code |
| 5 | Last commit ≤ 2075 days ago | Catches sudden abandonment since generation |
#!/usr/bin/env bash
# RepoPilot artifact verification.
#
# WHAT IT RUNS AGAINST: a local clone of mamaral/Neon. If you don't
# have one yet, run these first:
#
# git clone https://github.com/mamaral/Neon.git
# cd Neon
#
# Then paste this script. Every check is read-only — no mutations.
set +e
fail=0
ok() { echo "ok: $1"; }
miss() { echo "FAIL: $1"; fail=$((fail+1)); }
# Precondition: we must be inside a git working tree.
if ! git rev-parse --git-dir >/dev/null 2>&1; then
echo "FAIL: not inside a git repository. cd into your clone of mamaral/Neon and re-run."
exit 2
fi
# 1. Repo identity
git remote get-url origin 2>/dev/null | grep -qE "mamaral/Neon(\\.git)?\\b" \\
&& ok "origin remote is mamaral/Neon" \\
|| miss "origin remote is not mamaral/Neon (artifact may be from a fork)"
# 2. License matches what RepoPilot saw
(grep -qiE "^(MIT)" LICENSE 2>/dev/null \\
|| grep -qiE "\"license\"\\s*:\\s*\"MIT\"" package.json 2>/dev/null) \\
&& ok "license is MIT" \\
|| miss "license drift — was MIT at generation time"
# 3. Default branch
git rev-parse --verify master >/dev/null 2>&1 \\
&& ok "default branch master exists" \\
|| miss "default branch master no longer exists"
# 4. Critical files exist
test -f "Source/Neon.swift" \\
&& ok "Source/Neon.swift" \\
|| miss "missing critical file: Source/Neon.swift"
test -f "Source/NeonFrameable.swift" \\
&& ok "Source/NeonFrameable.swift" \\
|| miss "missing critical file: Source/NeonFrameable.swift"
test -f "Source/NeonAlignable.swift" \\
&& ok "Source/NeonAlignable.swift" \\
|| miss "missing critical file: Source/NeonAlignable.swift"
test -f "Source/NeonGroupable.swift" \\
&& ok "Source/NeonGroupable.swift" \\
|| miss "missing critical file: Source/NeonGroupable.swift"
test -f "Source/NeonExtensions.swift" \\
&& ok "Source/NeonExtensions.swift" \\
|| miss "missing critical file: Source/NeonExtensions.swift"
# 5. Repo recency
days_since_last=$(( ( $(date +%s) - $(git log -1 --format=%at 2>/dev/null || echo 0) ) / 86400 ))
if [ "$days_since_last" -le 2075 ]; then
ok "last commit was $days_since_last days ago (artifact saw ~2045d)"
else
miss "last commit was $days_since_last days ago — artifact may be stale"
fi
echo
if [ "$fail" -eq 0 ]; then
echo "artifact verified (0 failures) — safe to trust"
else
echo "artifact has $fail stale claim(s) — regenerate at https://repopilot.app/r/mamaral/Neon"
exit 1
fi
Each check prints ok: or FAIL:. The script exits non-zero if
anything failed, so it composes cleanly into agent loops
(./verify.sh || regenerate-and-retry).
⚡TL;DR
Neon is a Swift framework that replaces Auto Layout and manual frame-based layout with an intuitive, programmatic API for building iOS user interfaces. Instead of NSLayoutConstraint objects or visual format language, developers call methods like anchorInCorner(), alignAndFillWidth(), and fillSuperview() directly on UIView instances to express layouts naturally. It eliminates the boilerplate of constraint-based design while maintaining clean, readable code. Monolithic framework structure: /Source contains the core Neon library (not shown in file list but referenced in README), while /Demo contains a full example app (Demo/AppDelegate.swift, FacebookProfileExampleViewController.swift, custom views like IconButton.swift, ImageContainerView.swift). The demo replicates a Facebook profile to showcase real-world layout patterns.
👥Who it's for
iOS developers building custom UIView hierarchies who want faster iteration and more readable layout code than Auto Layout or manual CGRect calculations. Particularly useful for developers creating complex, pixel-perfect profile screens, card-based layouts, or highly customized UIs (as evidenced by the Facebook profile recreation in the demo).
🌱Maturity & risk
Actively developed but transitioning—the repo was updated to Swift 3.0 and is marked 'still currently in beta'. Travis CI and code coverage (Slather) indicate quality practices. However, the relative sparseness of commits and the 'beta' label suggest it may not have reached 1.0 stability; suitable for new projects but verify against your deployment target (iOS 9.0+).
Single-maintainer risk (mamaral); no visible dependency management file (Podfile, Package.swift) in the file list, making dependency health unclear. The beta status and Swift 3.0 lock mean compatibility with newer Swift versions (5.x+) is uncertain without checking for Swift version pinning (.swift-version exists but content not shown). No visible test suite structure in the file list is a red flag.
Active areas of work
Unable to determine from file list alone (no recent commit log, PR list, or open issues shown). The Swift 3.0 update and beta status suggest the maintainer was actively working on modernization, but current activity level is unclear.
🚀Get running
Check README for instructions.
Daily commands:
Open Demo/Demo.xcodeproj in Xcode and hit Run (⌘R). Or: xcodebuild -project Demo/Demo.xcodeproj -scheme Demo -configuration Debug. The demo will launch and display a Facebook-like profile screen built entirely with Neon layout calls.
🗺️Map of the codebase
Source/Neon.swift— Main entry point and core API surface that exports all layout protocols and primary positioning methodsSource/NeonFrameable.swift— Defines the Frameable protocol—fundamental abstraction for any view that can be positioned using Neon's layout systemSource/NeonAlignable.swift— Core alignment protocol enabling relative positioning of views (align, group operations)Source/NeonGroupable.swift— Grouping protocol that manages collections of views for batch layout operationsSource/NeonExtensions.swift— UIView/NSView extensions that bind all layout protocols into the framework; critical for framework integrationDemo/FacebookProfileExampleViewController.swift— Reference implementation demonstrating real-world usage patterns and layout composition
🧩Components & responsibilities
- NeonFrameable (Swift protocols, CGRect, CGSize, CGPoint) — Provides low-level frame manipulation (size, origin, edges, corners)
- Failure mode: If frame math is incorrect, views render at wrong positions or sizes
- NeonAlignable (Swift protocols, CGRect calculations, enum-based direction) — Enables relative positioning between views (align before, after, center, edges)
- Failure mode: If alignment calculation fails, views may overlap or misalign relative to targets
- NeonGroupable (Swift protocols, array iteration, collection layout) — Batch positions collections of views with uniform spacing and alignment rules
- Failure mode: If group layout fails, views may be positioned out-of-order or spaced incorrectly
- NeonExtensions (Swift extensions, UIView/NSView API surface) — Binds all protocol implementations to UIView/NSView via category extensions
- Failure mode: If extensions are not loaded, layout methods unavailable; critical integration point
🔀Data flow
Developer Code→NeonFrameable/NeonAlignable/NeonGroupable— Developer calls layout methods on view instancesNeonFrameable/NeonAlignable/NeonGroupable→NeonExtensions— Protocol methods dispatch to concrete implementations in extensionsNeonExtensions→UIView.frame property— Computed frame values assigned to view's frame, triggering layoutUIView hierarchy→Screen rendering— Layout engine renders views at calculated positions
🛠️How to make changes
Add a new layout method to a UIView
- Define the method signature in the appropriate protocol (NeonFrameable for frame-based, NeonAlignable for relative positioning, NeonGroupable for batch operations) (
Source/NeonFrameable.swift or Source/NeonAlignable.swift) - Implement the method logic in the protocol extension within NeonExtensions.swift (
Source/NeonExtensions.swift) - Add unit tests validating the new method for various view configurations (
NeonUnitTests/NeonUnitTests.swift) - Export the new method via the main Neon.swift entry point if adding a new protocol (
Source/Neon.swift)
Create a new demo screen using Neon layouts
- Create a new UIViewController subclass in the Demo folder (
Demo/NewExampleViewController.swift) - Import Neon and reference layout methods from view.frameable(), view.alignable(), and view.groupable() chains (
Demo/NewExampleViewController.swift) - Register the view controller in AppDelegate or add to the demo navigation if needed (
Demo/AppDelegate.swift)
Build a custom reusable component with Neon
- Create a UIView subclass and use Neon methods in layoutSubviews() or initialization (
Demo/IconButton.swift (example pattern)) - Use NeonGroupable to batch-position child subviews (
Demo/IconButton.swift) - Integrate into demo or main app viewControllers (
Demo/ViewController.swift)
🔧Why these technologies
- Swift Protocol Extensions — Enables non-invasive composition of layout methods onto UIView/NSView without subclassing
- Programmatic Layout (No Auto Layout) — Provides intuitive, frame-based positioning that mirrors how designers think about layout
- Chainable API — Method chaining (frameable().align().group()) improves readability and reduces boilerplate
- CocoaPods + Carthage — Dual package support maximizes adoption across iOS dependency management ecosystems
⚖️Trade-offs already made
-
Frame-based layout instead of Auto Layout
- Why: Simplifies mental model and eliminates constraint-solving complexity
- Consequence: Less flexible for dynamic device/orientation changes compared to Auto Layout; developer must handle size changes manually
-
Protocol-oriented extensions rather than view subclass hierarchy
- Why: Avoids inheritance complexity and allows composition with any view type
- Consequence: Cannot enforce layout consistency; relies on developer discipline to use API correctly
-
Eager frame calculation rather than lazy constraint evaluation
- Why: Immediate, predictable results with no solver overhead
- Consequence: Cannot respond automatically to parent size changes; developer must recalculate frames in viewDidLayoutSubviews()
🚫Non-goals (don't propose these)
- Does not provide Auto Layout constraint generation or management
- Does not handle dynamic type sizes or accessibility sizing
- Not compatible with Interface Builder or Storyboards
- Does not provide intrinsic content size calculations
- Not designed for real-time constraint solving or responsive design
- Does not include animation helpers or transition management
📊Code metrics
- Avg cyclomatic complexity: ~3.2 — Protocols are relatively simple (avg 5-8 methods each); extension implementations use straight
⚠️Anti-patterns to avoid
- Manual frame recalculation required for device rotation (Medium) —
Demo/FacebookProfileExampleViewController.swift, Demo/ViewController.swift: Developer must override viewDidLayoutSubviews() or observe size changes manually; no automatic responsive behavior - No validation of view hierarchy before layout (Medium) —
Source/NeonExtensions.swift: Methods assume views are properly initialized; passing nil or disconnected views silently fails without error - Magic number coordinates in demo code (Low) —
Demo/FacebookProfileExampleViewController.swift: Hardcoded spacing values (e.g., 10, 20) reduce maintainability; no constant definitions or spacing scale system
🔥Performance hotspots
NeonGroupable batch operations(Algorithmic) — Positioning multiple views sequentially in a loop; no parallelization. ~O(n) performance for n viewsNeonAlignable relative positioning(Caching opportunity) — Each align() call requires recalculating target view's frame relative to reference view; repeated calls recompute same values
🪤Traps & gotchas
Swift version lock: .swift-version pins to Swift 3.0; using with Xcode 11+ (Swift 5.x) may fail—check file content and Podspec for migration notes. No visible test suite: the file list contains no Test target or XCTest files, making test-driven development and regression coverage unclear—verify test coverage independently. Deployment target: README specifies iOS 9.0 as minimum; attempting to use on older projects will fail. Frame-based layout: Neon does not support Safe Area Layout Guides (introduced iOS 11); iPhone X+ notch handling may require manual adjustment. No view controller lifecycle helpers: layout must be called in viewDidLoad() or viewDidLayoutSubviews()—calling in init() will fail due to uninitialized bounds.
🏗️Architecture
💡Concepts to learn
- Frame-based Layout — Neon's entire API is built on directly manipulating CGRect frames and bounds instead of constraints; understanding x, y, width, height coordinate arithmetic is fundamental to using this library
- View Hierarchy and Coordinate Systems — Neon methods like
anchorInCorner()andalignAndFillWidth()rely on relative positioning within parent-child view hierarchies; misunderstanding coordinate space transforms and origin points causes layout bugs - Method Chaining / Fluent Interface — Neon's API is designed around fluent method chaining (e.g.,
view.anchorInCorner().fillWidth()); understanding this pattern is essential for reading and writing idiomatic Neon code - UIView Extension / Category Programming — Neon adds layout methods to UIView via Swift extensions; the entire framework is built on extending the standard iOS view class, requiring familiarity with Swift's extension model
- Padding and Inset Calculations — Neon methods accept xPad, yPad, and other inset parameters for positioning relative to edges; understanding padding algebra is critical for pixel-perfect layouts (e.g.,
anchorInCorner(.TopLeft, xPad: 10, yPad: 10)means 10pt from top-left corner, not 10pt total) - Responsive Layout (Orientation & Size Classes) — The FacebookProfileExampleViewController example checks
UIDevice.currentDevice().orientation.isLandscapeto adjust layout dynamically; Neon layouts must be recalculated on orientation changes, requiring lifecycle awareness
🔗Related repos
SnapKit/SnapKit— DSL wrapper around Auto Layout constraints in Swift; similar goal of cleaner layout syntax but uses constraints rather than frame manipulation like NeonMasonry/Masonry— Objective-C predecessor pattern that inspired constraint DSLs; demonstrates the lineage of layout abstraction before Neon's frame-based approachPinLayout/PinLayout— Another frame-based Swift layout framework offering similartop(),left(),width()chaining API; direct alternative with more recent maintenancelayoutKit/layoutKit— LinkedIn's declarative layout framework; represents a more functional approach to programmatic iOS layout in the same design-from-code ecosystem
🪄PR ideas
To work on one of these in Claude Code or Cursor, paste:
Implement the "<title>" PR idea from CLAUDE.md, working through the checklist as the task list.
Add comprehensive unit tests for Neon layout engine core functions
NeonUnitTests/NeonUnitTests.swift exists but appears minimal. The repo lacks test coverage for fundamental layout operations (alignment, positioning, sizing). Given the README emphasizes replacing Auto Layout constraints with programmatic UI, core layout functions need robust test coverage to prevent regressions and validate the framework's reliability.
- [ ] Examine existing NeonUnitTests/NeonUnitTests.swift to identify coverage gaps
- [ ] Create tests for positioning methods (e.g., anchor positioning, relative placement)
- [ ] Create tests for sizing functions (width, height, frame calculations)
- [ ] Create tests for alignment utilities mentioned in Screenshots/align.png
- [ ] Run tests with .slather.yml coverage configuration and ensure >80% coverage
- [ ] Add tests to NeonUnitTests.xcscheme if not already included
Migrate Travis CI to GitHub Actions workflow for Swift/iOS testing
.travis.yml exists but GitHub Actions is now the standard for GitHub repos and offers better integration. A modern CI workflow would provide faster feedback, better logs, and native GitHub integration. This improves contributor experience for pull request validation.
- [ ] Review .travis.yml to identify all build targets (Neon iOS, Neon OSX, Neon Demo, NeonUnitTests from .xcschemes)
- [ ] Create .github/workflows/swift-ci.yml with jobs for iOS framework, macOS framework, unit tests, and coverage reporting
- [ ] Integrate slather.yml coverage reporting with GitHub Actions
- [ ] Test workflow locally with act or by pushing to a branch
- [ ] Update README.md CI badge from Travis to GitHub Actions
- [ ] Disable or remove .travis.yml once validated
Add API documentation comments to core Neon framework source files
The repo structure shows Demo/ and NeonUnitTests/ but the actual Neon framework source files are not listed. Without visible inline documentation/comments in the main framework code, new contributors cannot easily understand the public API surface. Adding comprehensive Swift documentation comments would enable Xcode Quick Help and generate proper API documentation.
- [ ] Identify all public classes, structs, enums, and functions in the Neon framework source (likely in a Source/ or Neon/ directory not shown in the partial file list)
- [ ] Add Swift documentation comments (///) with parameter descriptions, return values, and usage examples to all public API methods
- [ ] Prioritize core layout methods referenced in the README (positioning, alignment, sizing operations)
- [ ] Verify documentation renders correctly in Xcode Quick Help by option-clicking methods
- [ ] Consider generating HTML documentation with jazzy and add it to a docs/ folder
🌿Good first issues
- Add Swift 4.0+ compatibility: audit
/Source(not in file list) for deprecated Swift 3.0 syntax and test against Xcode 9+ compiler; add a Swift 4.2 test job to.travis.yml. - Document the
anchorAndFillEdge(),alignAndFillWidth(), andfillSuperview()APIs with inline code examples in.swiftfiles or a separate USAGE.md, since the README example is truncated (buttonCocuts off mid-word). - Create XCTest unit tests for layout calculations: write tests verifying that
anchorInCorner(.BottomLeft, xPad: 15, yPad: 15, width: 100, height: 100)correctly positions a view 15pt from bottom-left with exact dimensions; test all corners and padding combinations.
⭐Top contributors
Click to expand
Top contributors
📝Recent commits
Click to expand
Recent commits
d11e633— Merge pull request #61 from Moonko/swift-4 (mamaral)9d98fac— Merge pull request #62 from icyKira/swift_4 (mamaral)502e215— Merge pull request #63 from MontakOleg/migrate-tests-swift4 (mamaral)4f7f5b7— Migrate tests to swift4 (Montak Oleg)2e59f5d— Migrating to Swift 4 (icyKira)2b1014c— Migrate project to Swift 4 (Moonko)6181a75— Update README.md (mamaral)2c63c42— Update README.md (mamaral)f088c3d— Update Neon.podspec (mamaral)8feb45f— Update .travis.yml (mamaral)
🔒Security observations
The Neon framework appears to be a legitimate UI layout library with a reasonable security posture. No critical vulnerabilities were identified from the file structure analysis. However, the actual source code could not be reviewed to identify potential Swift-specific vulnerabilities such as memory safety issues, unsafe pointer usage, or improper input validation. The primary recommendations are: (1) regularly audit dependencies for vulnerabilities, (2) perform static code analysis on Swift source files, (3) ensure sensitive credentials are properly managed in CI/CD pipelines, and (4) maintain up-to-date dependencies. The low severity issues identified are standard best practices applicable to most iOS framework projects.
- Low · Missing .travis.yml Security Configuration —
.travis.yml. The .travis.yml file is present but cannot be fully analyzed. Travis CI configurations should avoid storing sensitive credentials in version control. If this file contains any API keys, tokens, or credentials, they would be exposed. Fix: Ensure all sensitive credentials are stored as encrypted environment variables in Travis CI dashboard, not in the .travis.yml file. Use Travis CI's secure variable feature for any tokens or keys needed during build/test. - Low · No Package Dependency Manifest Provided —
Neon.podspec, Package.swift (if present). While a Neon.podspec file exists (CocoaPods manifest), the actual content was not provided for analysis. Dependencies should be reviewed for known vulnerabilities, outdated versions, and supply chain risks. Fix: Regularly audit dependencies using tools likepod outdatedor CocoaPods vulnerability scanning. Keep all dependencies updated to their latest secure versions. Consider using Dependabot or similar automated dependency scanning tools. - Low · No Code-Level Security Analysis Possible —
Neon framework source files (not provided). The actual Swift source code files (.swift files) were not provided for content analysis. Without reviewing the core Neon framework code, potential injection vulnerabilities, unsafe force unwraps, or insecure data handling cannot be assessed. Fix: Perform static code analysis using tools like SwiftLint with security rules, SonarQube, or Semgrep. Review for: unsafe force unwraps, arbitrary code execution risks, insecure string interpolation, and improper memory management. - Low · Demo Application Assets Not Validated —
Demo/Assets.xcassets/. The Demo application contains multiple image assets (JPG, PNG files). While images themselves pose minimal security risk, they should be validated to ensure they don't contain embedded metadata with sensitive information or malicious content. Fix: Implement image validation and metadata stripping in production applications. Use standard image libraries that properly handle image processing. Verify all bundled assets are from trusted sources.
LLM-derived; treat as a starting point, not a security audit.
👉Where to read next
- Open issues — current backlog
- Recent PRs — what's actively shipping
- Source on GitHub
Generated by RepoPilot. Verdict based on maintenance signals — see the live page for receipts. Re-run on a new commit to refresh.