Skip to content

Instantly share code, notes, and snippets.

@pcantrell

pcantrell/case patterns

Last active Jun 17, 2017
Embed
What would you like to do?
project_cache/Chatto/Chatto/Source/ChatController/BaseChatViewController+Changes.swift: case .preservePosition(rectForReferenceIndexPathBeforeUpdate: let oldRect, referenceIndexPathAfterUpdate: let indexPath):
project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .template(isIncoming: isIncoming, showsTail: showsTail):
project_cache/Chatto/ChattoAdditions/Source/Chat Items/TextMessages/Views/TextMessageCollectionViewCellDefaultStyle.swift: case let .normal(isIncoming: isIncoming, status: status, showsTail: showsTail, isSelected: isSelected):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .transaction(action: let action):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .savepoint(name: let name, action: let action):
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .insert(tableName: let tableName): return tableName
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .delete(tableName: let tableName): return tableName
project_cache/GRDB.swift/GRDB/Core/Database.swift: case .update(tableName: let tableName, columnNames: _): return tableName
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .insertion(item: let item, indexPath: _):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .deletion(item: let item, indexPath: _):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .move(item: let item, indexPath: _, newIndexPath: _, changes: _):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .update(item: let item, indexPath: _, changes: _):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .insertion(item: _, indexPath: let indexPath):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .deletion(item: _, indexPath: let indexPath):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .move(item: _, indexPath: let indexPath, newIndexPath: let newIndexPath, changes: let changes):
project_cache/GRDB.swift/GRDB/Record/FetchedRecordsController.swift: case .update(item: _, indexPath: let indexPath, changes: let changes):
project_cache/IBAnimatable/IBAnimatable/PresentationAnimationType.swift: case .cover(from: .bottom): return .coverVertical
project_cache/JSQDataSourcesKit/Example/Sources/ComposedSupplementaryViewFactory.swift: case .supplementaryView(kind: UICollectionElementKindSectionHeader):
project_cache/JSQDataSourcesKit/Example/Sources/ComposedSupplementaryViewFactory.swift: case .supplementaryView(kind: UICollectionElementKindSectionFooter):
project_cache/Lark/Sources/CodeGenerator/Generator.swift: case let .list(itemType: itemType): hierarchy.insertEdge((.type(type.name!), .type(itemType)))
project_cache/Lark/Sources/CodeGenerator/WebServiceDescription+verify.swift: case let .list(itemType: itemType): return [Edge(from: from, to: .type(itemType))]
project_cache/Plank/Sources/Core/ObjCADTRenderer.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjCADTRenderer.swift: case .array(itemType: _): return "Array"
project_cache/Plank/Sources/Core/ObjCADTRenderer.swift: case .map(valueType: _): return "Dictionary"
project_cache/Plank/Sources/Core/ObjCADTRenderer.swift: case .oneOf(types:_):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .map(valueType: .some(let valueType)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .array(itemType: .some(let itemType)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .oneOf(types: let itemTypes):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .array(itemType: .none):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .array(itemType: .some(let itemType)) where itemType.isObjCPrimitiveType:
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .array(itemType: .some(let itemType)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .map(valueType: .none):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .map(valueType: .some(let valueType)) where valueType.isObjCPrimitiveType:
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .map(valueType: .some(let valueType)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .string(format: .none),
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .string(format: .some(.dateTime)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .string(format: .some(.uri)):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjCFileRenderer.swift: case .oneOf(types:_):
project_cache/Plank/Sources/Core/ObjCModelRenderer.swift: case .oneOf(types: let possibleTypes):
project_cache/Plank/Sources/Core/ObjCModelRenderer.swift: case .array(itemType: .some(let itemType)):
project_cache/Plank/Sources/Core/ObjCModelRenderer.swift: case .oneOf(types: let possibleTypes):
project_cache/Plank/Sources/Core/ObjCModelRenderer.swift: case .map(valueType: .some(let additionalProperties)):
project_cache/Plank/Sources/Core/ObjCModelRenderer.swift: case .oneOf(types: let possibleTypes):
project_cache/Plank/Sources/Core/ObjectiveCBuilderExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCDebugExtension.swift: case .string(format: _):
project_cache/Plank/Sources/Core/ObjectiveCDebugExtension.swift: case .array(itemType: _):
project_cache/Plank/Sources/Core/ObjectiveCDebugExtension.swift: case .map(valueType: _):
project_cache/Plank/Sources/Core/ObjectiveCDebugExtension.swift: case .oneOf(types: _):
project_cache/Plank/Sources/Core/ObjectiveCDebugExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCEqualityExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCEqualityExtension.swift: case .string(format: .some(.dateTime)):
project_cache/Plank/Sources/Core/ObjectiveCEqualityExtension.swift: case .string(format: .none),
project_cache/Plank/Sources/Core/ObjectiveCEqualityExtension.swift: case .oneOf(types:_), .object(_), .array(_), .string(format: .some(.uri)):
project_cache/Plank/Sources/Core/ObjectiveCEqualityExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .array(itemType: .some(let itemType)):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .map(valueType: .some(let valueType)) where valueType.isObjCPrimitiveType == false:
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .string(format: .some(.uri)):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .string(format: .some(.dateTime)):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .oneOf(types: let schemas):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .array(itemType: _):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .map(valueType: _):
project_cache/Plank/Sources/Core/ObjectiveCInitExtension.swift: case .oneOf(types:_):
project_cache/Plank/Sources/Core/ObjectiveCIR.swift: case .string(format: .none):
project_cache/Plank/Sources/Core/ObjectiveCIR.swift: case .category(className: _, categoryName: _, methods: _, properties: _):
project_cache/Plank/Sources/Core/ObjectiveCIR.swift: case .structDecl(name: let name, fields: let fields):
project_cache/Plank/Sources/Core/ObjectiveCIR.swift: case .classDecl(name: let className, extends: _, methods: let methods, properties: _, protocols: let protocols):
project_cache/Plank/Sources/Core/ObjectiveCIR.swift: case .category(className: let className, categoryName: let categoryName, methods: let methods, properties: let properties):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .array(itemType: .none):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .array(itemType: .some(let itemType)):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .map(valueType: .none):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .map(valueType: .some(let valueType)):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .string(format: .none),
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .string(format: .some(.dateTime)):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .string(format: .some(.uri)):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/ObjectiveCNSCodingExtension.swift: case .oneOf(types: let schemaTypes):
project_cache/Plank/Sources/Core/Schema.swift: case .array(itemType: let itemType):
project_cache/Plank/Sources/Core/Schema.swift: case .map(valueType: let valueType):
project_cache/Plank/Sources/Core/Schema.swift: case .oneOf(types: let types):
project_cache/Plank/Sources/Core/Schema.swift: case .reference(with: let ref):
project_cache/Plank/Sources/Core/Schema.swift: case .array(itemType: let itemType):
project_cache/Plank/Sources/Core/Schema.swift: case .map(valueType: let valueType):
project_cache/Plank/Sources/Core/Schema.swift: case .oneOf(types: let types):
project_cache/Plank/Sources/Core/Schema.swift: case .reference(with: let ref):
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .random(minimum: min, maximum: max):
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .incrementing(initial: initial, increment: increment):
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .fibonacci(period: period, maximum: max):
project_cache/ProcedureKit/Sources/ProcedureKit/Repeat.swift: case let .exponential(power: power, period: period, maximum: max):
project_cache/ProcedureKit/Sources/ProcedureKitNetwork/NetworkSupport.swift: guard case .timedOut(with: _) = procedureKitError.context else { return false }
project_cache/R.swift/Sources/RswiftCore/SwiftTypes/CodeGenerators/TypePrinter.swift: if case let .custom(name: moduleName) = type.module {
project_cache/R.swift/Sources/RswiftCore/SwiftTypes/Module.swift: case let .custom(name: name): return name.hashValue
project_cache/R.swift/Sources/RswiftCore/SwiftTypes/Module.swift: case let .custom(name: name): return name
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .ImageProvidableSection(title: _, items: let items):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .StepperableSection(title: _, items: let items):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .ToggleableSection(title: _, items: let items):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case let .ImageProvidableSection(title: title, items: _):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .ImageProvidableSection(title: let title, items: _):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .StepperableSection(title: let title, items: _):
project_cache/RxDataSources/Example/Example4_DifferentSectionAndItemTypes.swift: case .ToggleableSection(title: let title, items: _):
project_cache/SwiftLint/Source/SwiftLintFramework/Rules/SwitchCaseOnNewlineRule.swift: "case let .myCase(code: lhsErrorCode, description: _)\n where lhsErrorCode > 10:\n return false",
project_cache/vapor/Sources/Settings/Config.swift: case let .memory(name: name, config: config):
project_cache/vapor/Sources/Settings/Config.swift: case let .directory(root: root):
project_cache/vapor/Sources/Vapor/Error/Abort.swift: case .custom(status: _, message: let message):
project_cache/vapor/Sources/Vapor/Error/Abort.swift: case .custom(status: let status, message: _):
project_cache/vapor/Sources/Vapor/Error/Abort.swift: case .custom(status: let status, message: _):
project_cache/vapor/Sources/Vapor/Validation/Convenience/Compare.swift: case .containedIn(low: let l, high: let h) where l <= value && value <= h:
project_cache/vapor/Sources/Vapor/Validation/Convenience/Count.swift: case .containedIn(low: let l, high: let h) where l <= count && count <= h:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.