Replace verbose Auto Layout constraints with readable function calls like fillSuperview() or anchorInCorner() in an iOS app.
Arrange a row of buttons with equal spacing using a single groupAndFill() call.
Build adaptive layouts that automatically resize for different iPhone and iPad screen sizes and orientations.
Recreate complex screens like a Facebook profile layout in about ten lines of readable Swift code.
Add Neon via CocoaPods or drop source files into the project, targets iOS 9.0 and above.
Neon is a Swift library for positioning UI elements in iOS apps without using Auto Layout constraints. In iOS development, placing views on screen typically involves either Auto Layout (which uses a constraint-based system that many developers find verbose and difficult to read) or the older springs-and-struts approach. Neon offers a third option: a set of plain-English functions that describe where a view should sit relative to its parent or sibling views. Instead of writing constraints, you call functions directly on a view. For example, fillSuperview() makes a view expand to fill its container. anchorInCorner(.BottomLeft...) places a view in the bottom-left corner with specified padding and size. align(.ToTheRightCentered, relativeTo: anotherView...) positions a view to the right of another view, vertically centered next to it. Groups of views can be arranged in horizontal or vertical rows with equal spacing using a single groupAndFill() call. The README demonstrates the approach by replicating the profile screen of the Facebook iOS app. The layout for the major visible components, including a banner image, avatar photo, name label, camera button, and four action buttons arranged in a row, is written in about ten lines of code. The result adapts to different device sizes and screen rotations without any extra work. Layouts built with Neon are dynamic: they recalculate positions based on the current screen size, so the same code works on an iPhone SE and an iPad in landscape mode. The README includes screenshots showing both portrait and landscape results from the Facebook demo. The library is installed via CocoaPods (a popular iOS dependency manager) or by dropping the source files directly into a project. It targets iOS 9.0 and above. The README notes that Swift 3.0 support was added but was still in beta at the time of writing.
← mamaral on gitmyhub — every repo by this author, as a profile.
Verify against the repo before relying on details.