Swift Package Manager vs CocoaPods
Apple'ın resmi paket yöneticisi SPM ile yıllarca endüstri standardı olan CocoaPods karşı karşıya. 2025'te bağımlılık yönetiminde hangi aracı kullanmalısınız?
Apple platformları için vazgeçilmez resmi IDE
Hafif, eklenti zengin, cross-platform editör
// Xcode - Launch Argument ile debug modu
// Scheme > Run > Arguments Passed On Launch
// -com.apple.CoreData.SQLDebug 1
// -UIPreferredContentSizeCategoryName UICTContentSizeCategoryAccessibilityXL
// Xcode özel build configuration
// xcconfig dosyası ile ortam ayrımı
// Configuration.xcconfig:
// APP_NAME = MyApp Debug
// API_BASE_URL = https://staging-api.example.com
// BUNDLE_ID = com.mycompany.myapp.debug
// Info.plist'te kullanım:
// $(API_BASE_URL) → otomatik enjekte
// Instruments kullanımı (komut satırı)
// xctrace record --template 'Time Profiler' \
// --attach <pid> --output trace.trace
// Xcode Cloud CI/CD (ci_scripts/ci_post_clone.sh)
#!/bin/bash
set -e
# SPM bağımlılıklarını önbelleğe al
echo "SPM bağımlılıkları yükleniyor..."
xcodebuild -resolvePackageDependencies \
-scheme MyApp \
-clonedSourcePackagesDirPath SourcePackages
# Ortam değişkeni enjeksiyonu
echo "MY_VAR=$CI_SECRET_VAR" >> .env.local
echo "Post-clone tamamlandı"
// Simülatörde test çalıştırma (komut satırı)
// xcodebuild test \
// -project MyApp.xcodeproj \
// -scheme MyApp \
// -destination 'platform=iOS Simulator,name=iPhone 16 Pro' \
// -resultBundlePath TestResults.xcresult// VS Code - Swift extension ile temel kullanım
// .vscode/settings.json
{
"swift.path": "/usr/bin/swift",
"swift.buildArguments": ["-c", "debug"],
"sourcekit-lsp.serverPath": "/usr/bin/sourcekit-lsp",
"editor.formatOnSave": true,
"[swift]": {
"editor.defaultFormatter": "vknabel.vscode-swift-format"
},
"swift.autoImport": true,
"editor.suggest.showWords": false
}
// .vscode/launch.json - Swift executable debug
{
"version": "0.2.0",
"configurations": [
{
"type": "swift",
"request": "launch",
"name": "Debug Swift Executable",
"program": "${workspaceFolder}/.build/debug/MyTool",
"args": ["--input", "data.json"],
"preLaunchTask": "swift: Build All"
}
]
}
// tasks.json - Build task
{
"version": "2.0.0",
"tasks": [
{
"label": "swift: Build All",
"type": "swift",
"command": "swift",
"args": ["build"],
"group": { "kind": "build", "isDefault": true }
},
{
"label": "swift: Run Tests",
"type": "swift",
"command": "swift",
"args": ["test", "--parallel"],
"group": "test"
}
]
}iOS geliştirme için Xcode zorunlu — Simulator, Instruments, SwiftUI Preview ve App Store yayınlama bunlar olmadan mümkün değil. VS Code, Swift Package geliştirme, sunucu tarafı Swift, Flutter ve web tarafında mükemmel. Birçok iOS geliştiricisi ikisini birlikte kullanıyor: Xcode iOS projesi için, VS Code diğer her şey için.
Temel düzeyde evet (SourceKit-LSP ile kod yazma), ancak build, run, debug, simulator ve App Store yayınlama için Xcode şart. VS Code iOS geliştirmede Xcode'un yerini tutamaz.