Loading...
Loading...
Swift code style conventions for clean, readable code. Use when writing Swift code to ensure consistent formatting, naming, organization, and idiomatic patterns.
npx skill4agent add johnrogers/claude-swift-engineering swift-styleUpperCamelCaselowerCamelCase// Preferred
let maximumWidgetCount = 100
func fetchUser(byID id: String) -> Userif// Preferred
func process(value: Int?) throws -> Result {
guard let value = value else {
throw ProcessError.nilValue
}
guard value > 0 else {
throw ProcessError.invalidValue
}
return compute(value)
}class MyViewController: UIViewController {
// Core implementation
}
// MARK: - UITableViewDataSource
extension MyViewController: UITableViewDataSource { }self// Preferred
func configure() {
backgroundColor = .systemBackground
}getvar diameter: Double {
radius * 2
}var names: [String] = []// Preferred
var items: [String]
var cache: [String: Int]
var name: String?privatefileprivateinternalresource.request().onComplete { [weak self] response in
guard let self else { return }
self.updateModel(response)
}//////* */enum Math {
static let pi = 3.14159
}cfgmgrctxdescconfigurationmanagercontextdescriptionselfManagerHandlerHelperCoordinatorPaymentProcessorEventDispatcherImageCacheNavigationCoordinatorprivatepublicinternal