Objective C项目的命名有多长
admin
2023-07-31 01:48:32
0

LongestCocoa

Objective-C程序员一定非常喜欢它详细的描述性命名风格。

SoWhatIsTheLongestMethodOrConstantNamesInCocoaFramework? (那么,Cocoa框架中最长的方法名或常量名是什么?)答案是:

  • outputImageProviderFromBufferWithPixelFormat:pixelsWide:pixelsHigh:baseAddress:bytesPerRow:releaseCallback:releaseContext:colorSpace:shouldColorMatch:
  • kCMSampleBufferConduitNotificationParameter_UpcomingOutputPTSRangeMayOverlapQueuedOutputPTSRange

longest.py可以帮你找出Objective-C项目中每种标识符中最长的10个。使用很简单:

git clone https://github.com/Quotation/LongestCocoa
cd LongestCocoa
python longest.py <到Objective-C项目目录的路径>

以下是iPhoneOS的结果:

iPhoneOS armv7

最长的Objective-C接口名

  • [55] AVAssetResourceLoadingContentInformationRequestInternal
  • [49] AVMutableVideoCompositionLayerInstructionInternal
  • [47] AVAssetResourceLoadingContentInformationRequest
  • [45] UICollectionViewFlowLayoutInvalidationContext
  • [45] AVAsynchronousVideoCompositionRequestInternal
  • [44] AVAssetWriterInputPixelBufferAdaptorInternal
  • [44] AVMutableVideoCompositionInstructionInternal
  • [43] AVVideoCompositionCoreAnimationToolInternal
  • [43] AVAssetReaderVideoCompositionOutputInternal
  • [43] AVMetadataMachineReadableCodeObjectInternal

最长的Objective-C协议名

  • [44] UIViewControllerTransitionCoordinatorContext
  • [44] GKFriendRequestComposeViewControllerDelegate
  • [44] AVCaptureAudioDataOutputSampleBufferDelegate
  • [44] AVCaptureVideoDataOutputSampleBufferDelegate
  • [43] GKTurnBasedMatchmakerViewControllerDelegate
  • [42] ABPeoplePickerNavigationControllerDelegate
  • [40] UIViewControllerInteractiveTransitioning
  • [39] UIDocumentInteractionControllerDelegate
  • [38] AVCaptureMetadataOutputObjectsDelegate
  • [38] MFMessageComposeViewControllerDelegate

最长的Objective-C属性名

  • [56] automaticallyEnablesStillImageStabilizationWhenAvailable
  • [54] availableMediaCharacteristicsWithMediaSelectionOptions
  • [49] outputObscuredDueToInsufficientExternalProtection
  • [47] usesExternalPlaybackWhileExternalScreenIsActive
  • [46] automaticallyEnablesLowLightBoostWhenAvailable
  • [46] automaticallyConfiguresApplicationAudioSession
  • [45] requiredPixelBufferAttributesForRenderContext
  • [44] modalPresentationCapturesStatusBarAppearance
  • [42] usesAirPlayVideoWhileAirPlayScreenIsActive
  • [42] providesPresentationContextTransitionStyle

最长的Objective-C方法名

  • [128] initRecurrenceWithFrequency:interval:daysOfTheWeek:daysOfTheMonth:monthsOfTheYear:weeksOfTheYear:daysOfTheYear:setPositions:end:
  • [120] drawStrikethroughForGlyphRange:strikethroughType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:
  • [115] layoutManager:boundingBoxForControlGlyphAtIndex:forTextContainer:proposedLineFragment:glyphPosition:characterIndex:
  • [113] decimalNumberHandlerWithRoundingMode:scale:raiseOnExactness:raiseOnOverflow:raiseOnUnderflow:raiseOnDivideByZero:
  • [112] drawUnderlineForGlyphRange:underlineType:baselineOffset:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:
  • [111] getLineFragmentInsertionPointsForCharacterAtIndex:alternatePositions:inDisplayOrder:positions:characterIndexes:
  • [108] migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error:
  • [104] videoComposition:shouldContinueValidatingAfterFindingInvalidTrackIDInInstruction:layerInstruction:asset:
  • [101] animateWithDuration:delay:usingSpringWithDamping:initialSpringVelocity:options:animations:completion:
  • [98] strikethroughGlyphRange:strikethroughType:lineFragmentRect:lineFragmentGlyphRange:containerOrigin:

最长的Objective-C方法名(0/1 参数)

  • [70] automaticallyForwardAppearanceAndRotationMethodsToChildViewControllers
  • [65] navigationControllerPreferredInterfaceOrientationForPresentation:
  • [64] splitViewControllerPreferredInterfaceOrientationForPresentation:
  • [63] pageViewControllerPreferredInterfaceOrientationForPresentation:
  • [61] tabBarControllerPreferredInterfaceOrientationForPresentation:
  • [60] backButtonBackgroundVerticalPositionAdjustmentForBarMetrics:
  • [60] setAutomaticallyEnablesStillImageStabilizationWhenAvailable:
  • [59] generateIdentityVerificationSignatureWithCompletionHandler:
  • [57] recommendedVideoSettingsForAssetWriterWithOutputFileType:
  • [57] recommendedAudioSettingsForAssetWriterWithOutputFileType:

最长的Objective-C函数名

  • [63] CTFontCollectionCreateMatchingFontDescriptorsSortedWithCallback
  • [62] CVPixelFormatDescriptionRegisterDescriptionWithPixelFormatType
  • [62] CMVideoFormatDescriptionGetExtensionKeysCommonWithImageBuffers
  • [62] MACaptionAppearanceCopyPreferredCaptioningMediaCharacteristics
  • [61] CFLocaleCreateCanonicalLocaleIdentifierFromScriptManagerCodes
  • [58] CVPixelFormatDescriptionArrayCreateWithAllPixelFormatTypes
  • [58] CMBufferQueueGetCallbacksForSampleBuffersSortedByOutputPTS
  • [57] ABAddressBookCopyArrayOfAllPeopleInSourceWithSortOrdering
  • [57] vImageMultiDimensionalInterpolatedLookupTable_Planar16Q12
  • [57] vImageAlphaBlend_NonpremultipliedToPremultiplied_ARGB8888

最长的Enum名

  • [41] NSPersistentStoreUbiquitousTransitionType
  • [41] UIPageViewControllerNavigationOrientation
  • [40] UIImagePickerControllerCameraCaptureMode
  • [39] UIPageViewControllerNavigationDirection
  • [38] UIImagePickerControllerCameraFlashMode
  • [38] CBPeripheralManagerAuthorizationStatus
  • [36] NSAttributedStringEnumerationOptions
  • [36] NSURLSessionAuthChallengeDisposition
  • [36] CBPeripheralManagerConnectionLatency
  • [35] UIImagePickerControllerCameraDevice

最长的Enum常量名

  • [64] kCFStreamErrorHTTPSProxyFailureUnexpectedResponseToCONNECTMethod
  • [63] NSPersistentStoreUbiquitousTransitionTypeInitialImportCompleted
  • [63] NSDataWritingFileProtectionCompleteUntilFirstUserAuthentication
  • [61] kCMBufferQueueTrigger_WhenDurationBecomesGreaterThanOrEqualTo
  • [61] NSAttributedStringEnumerationLongestEffectiveRangeNotRequired
  • [58] kCMBufferQueueTrigger_WhenDurationBecomesLessThanOrEqualTo
  • [58] kAudioSessionProperty_OverrideCategoryEnableBluetoothInput
  • [57] kCMBufferQueueTrigger_WhenMaxPresentationTimeStampChanges
  • [57] kAudioFileGlobalInfo_AvailableStreamDescriptionsForFormat
  • [57] AVAudioSessionRouteChangeReasonNoSuitableRouteForCategory

最长的变量常量名

  • [96] kCMSampleBufferConduitNotificationParameter_UpcomingOutputPTSRangeMayOverlapQueuedOutputPTSRange
  • [81] kCMTextMarkupAttribute_OrthogonalLinePositionPercentageRelativeToWritingDirection
  • [74] MFMessageComposeViewControllerTextMessageAvailabilityDidChangeNotification
  • [71] kCMTextMarkupAttribute_TextPositionPercentageRelativeToWritingDirection
  • [66] kCMTextMarkupAttribute_BaseFontSizePercentageRelativeToVideoHeight
  • [64] kCMSampleBufferConduitNotificationParameter_MinUpcomingOutputPTS
  • [64] kCMSampleBufferConduitNotification_UpcomingOutputPTSRangeChanged
  • [64] AVPlayerItemLegibleOutputTextStylingResolutionSourceAndRulesOnly
  • [64] kCMSampleBufferConduitNotificationParameter_MaxUpcomingOutputPTS
  • [62] NSPersistentStoreDidImportUbiquitousContentChangesNotification

你的Objective-C项目中最长的标识符名称是什么呢?


编撰 SegmentFault

相关内容

热门资讯

500 行 Python 代码... 语法分析器描述了一个句子的语法结构,用来帮助其他的应用进行推理。自然语言引入了很多意外的歧义,以我们...
定时清理删除C:\Progra... C:\Program Files (x86)下面很多scoped_dir开头的文件夹 写个批处理 定...
65536是2的几次方 计算2... 65536是2的16次方:65536=2⁶ 65536是256的2次方:65536=256 6553...
Mobi、epub格式电子书如... 在wps里全局设置里有一个文件关联,打开,勾选电子书文件选项就可以了。
scoped_dir32_70... 一台虚拟机C盘总是莫名奇妙的空间用完,导致很多软件没法再运行。经过仔细检查发现是C:\Program...
小程序支付时提示:appid和... [Q]小程序支付时提示:appid和mch_id不匹配 [A]小程序和微信支付没有进行关联,访问“小...
pycparser 是一个用... `pycparser` 是一个用 Python 编写的 C 语言解析器。它可以用来解析 C 代码并构...
微信小程序使用slider实现... 众所周知哈,微信小程序里面的音频播放是没有进度条的,但最近有个项目呢,客户要求音频要有进度条控制,所...
python查找阿姆斯特朗数 题目解释 如果一个n位正整数等于其各位数字的n次方之和,则称该数为阿姆斯特朗数。 例如1^3 + 5...
Apache Doris 2.... 亲爱的社区小伙伴们,我们很高兴地向大家宣布,Apache Doris 2.0.0 版本已于...