36
loading...
This website collects cookies to deliver better user experience
name
, which gets displayed in their user interface.name
carries the implication that its value will be unique within some namespace.Notification.name
UIFont.fontName
NSManagedObjectModel.entitiesByName
name
property, you will typically also see a way to look up values of that type via its name.[type]Named:
rather than [type]WithName:
.)name
have unique values is what makes them unsuitable for storing user-facing text.title
and identifier
respectively.UIMenuItem.title
UIViewController.title
NSUserActivity.title
title
you often also see a property called localizedDescription
next to it.identifier
.CNContact.identifier
EKEvent.eventIdentifier
URLSessionConfiguration.identifier
name
are typically human readable (if only for development and debugging purposes),identifier
are typically opaque and generated randomly.Identifiable
protocol to the standard library.var id: ID
property is statically associated with the Identifiable
protocol, which provides additional semantic context.NSManagedObject.objectID
CKRecord.recordID
. Notice that the types of these properties are not NSString
but the more semantic NSManagedObjectID
and CKRecordID
classes respectively.Playlist
type has a property called name
, but it seems like it should have been called title
. But please don't let a few inconsistences discourage you from designing your own APIs rigorously.