Skip to content

Instantly share code, notes, and snippets.

View antonmartinsson's full-sized avatar

Anton Martinsson antonmartinsson

View GitHub Profile
@antonmartinsson
antonmartinsson / xcode-mcpbridge.md
Created February 18, 2026 07:53 — forked from mackoj/xcode-mcpbridge.md
This documentation explains how to configure Apple’s official Xcode MCP with Copilot.

Edit the file ~/.copilot/mcp-config.json and add Xcode-MCP inside the mcpServers object:

"mcpServers": {
  "Xcode-MCP": {
    "type": "stdio",
    "command": "xcrun",
    "tools": [
      "*"
 ],
@antonmartinsson
antonmartinsson / LavaLamp.Swift
Last active May 4, 2024 17:33 — forked from Matt54/BlobView.Swift
A fluid-like animating SwiftUI View
import SwiftUI
struct LavaLamp: View {
@State private var mainPosition: CGPoint = .zero
@State private var positions: [CGPoint] = []
private let blurRadius = 20.0
private let alphaThreshold = 0.875
private let ballCount = 20
@antonmartinsson
antonmartinsson / EnumeratedForEach.swift
Last active August 9, 2022 08:34
EnumeratedForEach
import SwiftUI
/// An extension of ForEach that enables lookup of an array offset parameter in its ViewBuilder closure, in addition to the standard element returned.
extension ForEach where Data: RandomAccessCollection, Data.Element: Hashable, ID == Data.Element, Content: View {
init(_ values: Data?, @ViewBuilder content: @escaping (Data.Index, Data.Element) -> Content) {
self.init(values ?? ([Data.Element]() as! Data), id: \.self) { c in
content(values?.firstIndex(of:c)! ?? ([Data.Element]() as! Data).indices.first!, c)
}
}
}