Fix iOS patterns: prefer SwiftUI, add xcodegen project setup, fix token approach - #67
Open
mattpodwysocki wants to merge 5 commits into
Open
Fix iOS patterns: prefer SwiftUI, add xcodegen project setup, fix token approach#67mattpodwysocki wants to merge 5 commits into
mattpodwysocki wants to merge 5 commits into
Conversation
…p guidance - Add xcodegen + project.yml pattern for creating runnable Xcode projects (bare SPM .target cannot launch as an iOS app) - Add Config.swift token approach for SPM projects alongside Info.plist - Make SwiftUI the primary pattern; explicitly discourage UIViewRepresentable - Add CircleAnnotationGroup, PointAnnotationGroup, onTapGesture per annotation - Add MapViewAnnotation for SwiftUI callouts - Add withViewportAnimation(.fly) for SwiftUI camera transitions - Add Puck2D(bearing: .heading) for SwiftUI user location - Add StyleColor(UIColor) gotcha — StyleColor(red:green:blue:alpha:) is optional - Fix StyleURI: rawValue: for mapbox:// URIs, url: for https:// URLs - Add Viewport.followPuck for SwiftUI camera tracking - Bump recommended minimum iOS from 12 to 16 with explanation - Update evals: fix token eval, add 4 new evals for project setup, SwiftUI annotations, camera animation, and StyleColor gotcha Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…yle-quality - ios-patterns AGENTS.md: add XcodeGen gitignore guidance (commit project.yml, gitignore .xcodeproj); fix stale .iconImage() → .image(.init(image:name:)) - search-integration: add Custom UI section surfacing session token requirement for direct API callers (billing impact) - style-patterns data-viz-base: explain why water must be gray not blue for choropleth maps (blue water competes with red/blue election data) - style-quality: expand Large Style File Size troubleshooting to spell out ordered cleanup steps (empty layers, boolean expressions) and mention reviewing percentReduction/changes in the optimization report Scores after fixes: search-integration 75%→100%, style-patterns 80%→100%, style-quality 67%→93%, ios-patterns 83%→95% Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Conflicts in ios-patterns files were between this branch's xcodegen/SwiftUI annotation patterns and PR #66's Markers API decision matrix. Resolution keeps both: xcodegen project setup, SwiftUI annotation groups + MapViewAnnotation callout patterns, AND the Markers API table + ForEvery examples from #66. evals.json now has 8 evals (added #66's Markers-API-for-GeoJSON eval as #5, shifted camera/StyleColor evals to #7/#8). Also picks up: mapbox-flutter-patterns skill, cspell additions (xcworkspace, TLHC, ARGB, etc.) from #66. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes gaps discovered while building a real demo iOS app with the Mapbox Maps SDK v11. The skill was producing incorrect patterns — particularly recommending bare SPM packages (which can't run as iOS apps) and missing most of the SwiftUI-native annotation API.
xcodegen+project.ymlpattern. A bare SPM.targetbuilds as a library — it cannot launch as an iOS app. This was the biggest practical gap.Config.swift+MapboxOptions.accessTokenapproach for SPM/xcodegen projects alongside the existing Info.plist approach (which only works in Xcode-managed projects)UIViewRepresentablewrappers;Map(viewport:)is the correct SwiftUI entry pointCircleAnnotationGroup,PointAnnotationGroup,.onTapGestureper annotation, andMapViewAnnotationfor callouts — all missing from the SwiftUI sectionwithViewportAnimation(.fly(duration:))for SwiftUI (the UIKitmapView.camera.fly(to:)was the only documented pattern)Puck2D(bearing: .heading)insideMap {}for SwiftUIStyleColorgotcha: Document thatStyleColor(red:green:blue:alpha:)returns optional — useStyleColor(UIColor(...))insteadStyleURI: ClarifyrawValue:formapbox://URIs vsurl:forhttps://URLsNavigationSplitViewrequires 16,foregroundStylerequires 15)StyleColoroptionalEval fixes (cross-skill, added in latest commit)
Ran a full eval suite across all 18 skills and fixed the worst-scoring gaps:
mapbox-style-qualitymapbox-search-integrationmapbox-style-patternsmapbox-ios-patternsChanges:
project.ymlcommitted,.xcodeprojgitignored); fix stale.iconImage()→.image(.init(image:name:))references/data-viz-base.md: explain why water must be gray not blue for choropleth maps (blue water competes with red/blue election data)percentReduction/changesin the optimization reportTest plan
npm run eval mapbox-ios-patterns— 7/7 pass (95%)npm run eval mapbox-search-integration— 3/3 pass (100%)npm run eval mapbox-style-patterns— 3/3 pass (100%)npm run eval mapbox-style-quality— 3/3 pass (93%)xcodegen generateproduces a working.xcodeprojfrom the documentedproject.yml🤖 Generated with Claude Code