We've discussed four possibile conventions for the case of initialisms. This document examines the tradeoffs.
If the initialism starts a non-type name, downcase it; otherwise, upcase it.
| import SwiftUI | |
| @main | |
| struct KeyCommandsTestApp: App { | |
| @State var counter: Counter = .init() | |
| var body: some Scene { | |
| WindowGroup { |
| // MARK: Types: | |
| protocol EnumType { | |
| } | |
| protocol MyProtocol { | |
| associatedtype SomeType: EnumType |
| enum MyEnum { | |
| case IntCase(value: Int) | |
| case StringCase(value: String) | |
| case IntStringCase(intValue: Int, stringValue: String) | |
| } | |
| extension MyEnum: RawRepresentable { | |
| init?(rawValue: Any) { |
| // | |
| // NSObject+RFExtensions.h | |
| // | |
| // Created by brandon on 10/5/12. | |
| // Modified by Marco Masser on 2012-10-11 | |
| // Copyright (c) 2012 redf.net. All rights reserved. | |
| // | |
| #import <Foundation/Foundation.h> |