FLEXRuntime+UIKitHelpers.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645
  1. //
  2. // FLEXRuntime+UIKitHelpers.m
  3. // FLEX
  4. //
  5. // Created by Tanner Bennett on 12/16/19.
  6. // Copyright © 2020 FLEX Team. All rights reserved.
  7. //
  8. #import "FLEXRuntime+UIKitHelpers.h"
  9. #import "FLEXRuntimeUtility.h"
  10. #import "FLEXPropertyAttributes.h"
  11. #import "FLEXArgumentInputViewFactory.h"
  12. #import "FLEXObjectExplorerFactory.h"
  13. #import "FLEXFieldEditorViewController.h"
  14. #import "FLEXMethodCallingViewController.h"
  15. #import "FLEXTableView.h"
  16. #import "FLEXUtility.h"
  17. #import "NSArray+FLEX.h"
  18. #import "NSString+FLEX.h"
  19. #define FLEXObjectExplorerDefaultsImpl \
  20. - (FLEXObjectExplorerDefaults *)defaults { \
  21. return self.tag; \
  22. } \
  23. \
  24. - (void)setDefaults:(FLEXObjectExplorerDefaults *)defaults { \
  25. self.tag = defaults; \
  26. }
  27. #pragma mark FLEXProperty
  28. @implementation FLEXProperty (UIKitHelpers)
  29. FLEXObjectExplorerDefaultsImpl
  30. /// Decide whether to use potentialTarget or [potentialTarget class] to get or set property
  31. - (id)appropriateTargetForPropertyType:(id)potentialTarget {
  32. if (!object_isClass(potentialTarget)) {
  33. if (self.isClassProperty) {
  34. return [potentialTarget class];
  35. } else {
  36. return potentialTarget;
  37. }
  38. } else {
  39. if (self.isClassProperty) {
  40. return potentialTarget;
  41. } else {
  42. // Instance property with a class object
  43. return nil;
  44. }
  45. }
  46. }
  47. - (BOOL)isEditable {
  48. if (self.attributes.isReadOnly) {
  49. return self.likelySetterExists;
  50. }
  51. const FLEXTypeEncoding *typeEncoding = self.attributes.typeEncoding.UTF8String;
  52. return [FLEXArgumentInputViewFactory canEditFieldWithTypeEncoding:typeEncoding currentValue:nil];
  53. }
  54. - (BOOL)isCallable {
  55. return YES;
  56. }
  57. - (id)currentValueWithTarget:(id)object {
  58. return [self getPotentiallyUnboxedValue:
  59. [self appropriateTargetForPropertyType:object]
  60. ];
  61. }
  62. - (id)currentValueBeforeUnboxingWithTarget:(id)object {
  63. return [self getValue:
  64. [self appropriateTargetForPropertyType:object]
  65. ];
  66. }
  67. - (NSString *)previewWithTarget:(id)object {
  68. if (object_isClass(object) && !self.isClassProperty) {
  69. return self.attributes.fullDeclaration;
  70. } else if (self.defaults.wantsDynamicPreviews) {
  71. return [FLEXRuntimeUtility
  72. summaryForObject:[self currentValueWithTarget:object]
  73. ];
  74. }
  75. return nil;
  76. }
  77. - (UIViewController *)viewerWithTarget:(id)object {
  78. id value = [self currentValueWithTarget:object];
  79. return [FLEXObjectExplorerFactory explorerViewControllerForObject:value];
  80. }
  81. - (UIViewController *)editorWithTarget:(id)object section:(FLEXTableViewSection *)section {
  82. id target = [self appropriateTargetForPropertyType:object];
  83. return [FLEXFieldEditorViewController target:target property:self commitHandler:^{
  84. [section reloadData:YES];
  85. }];
  86. }
  87. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  88. id targetForValueCheck = [self appropriateTargetForPropertyType:object];
  89. if (!targetForValueCheck) {
  90. // Instance property with a class object
  91. return UITableViewCellAccessoryNone;
  92. }
  93. // We use .tag to store the cached value of .isEditable that is
  94. // initialized by FLEXObjectExplorer in -reloadMetada
  95. if ([self getPotentiallyUnboxedValue:targetForValueCheck]) {
  96. if (self.defaults.isEditable) {
  97. // Editable non-nil value, both
  98. #if !TARGET_OS_TV
  99. return UITableViewCellAccessoryDetailDisclosureButton;
  100. #else
  101. return UITableViewCellAccessoryDisclosureIndicator; //FIXME: not a proper fix
  102. #endif
  103. } else {
  104. // Uneditable non-nil value, chevron only
  105. return UITableViewCellAccessoryDisclosureIndicator;
  106. }
  107. } else {
  108. if (self.defaults.isEditable) {
  109. // Editable nil value, just (i)
  110. #if !TARGET_OS_TV
  111. return UITableViewCellAccessoryDetailButton;
  112. #else
  113. return UITableViewCellAccessoryDisclosureIndicator; //FIXME: not a proper fix
  114. #endif
  115. } else {
  116. // Non-editable nil value, neither
  117. return UITableViewCellAccessoryNone;
  118. }
  119. }
  120. }
  121. - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
  122. #if FLEX_AT_LEAST_IOS13_SDK
  123. - (NSArray<UIAction *> *)additionalActionsWithTarget:(id)object sender:(UIViewController *)sender __IOS_AVAILABLE(13.0) {
  124. Class propertyClass = self.attributes.typeEncoding.flex_typeClass;
  125. // "Explore PropertyClass" for properties with a concrete class name
  126. if (propertyClass) {
  127. NSString *title = [NSString stringWithFormat:@"Explore %@", NSStringFromClass(propertyClass)];
  128. return @[[UIAction actionWithTitle:title image:nil identifier:nil handler:^(UIAction *action) {
  129. UIViewController *explorer = [FLEXObjectExplorerFactory explorerViewControllerForObject:propertyClass];
  130. [sender.navigationController pushViewController:explorer animated:YES];
  131. }]];
  132. }
  133. return nil;
  134. }
  135. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  136. BOOL returnsObject = self.attributes.typeEncoding.flex_typeIsObjectOrClass;
  137. BOOL targetNotNil = [self appropriateTargetForPropertyType:object] != nil;
  138. NSMutableArray *items = [NSMutableArray arrayWithArray:@[
  139. @"Name", self.name ?: @"",
  140. @"Type", self.attributes.typeEncoding ?: @"",
  141. @"Declaration", self.fullDescription ?: @"",
  142. ]];
  143. if (targetNotNil) {
  144. id value = [self currentValueBeforeUnboxingWithTarget:object];
  145. [items addObjectsFromArray:@[
  146. @"Value Preview", [self previewWithTarget:object] ?: @"",
  147. @"Value Address", returnsObject ? [FLEXUtility addressOfObject:value] : @"",
  148. ]];
  149. }
  150. [items addObjectsFromArray:@[
  151. @"Getter", NSStringFromSelector(self.likelyGetter) ?: @"",
  152. @"Setter", self.likelySetterExists ? NSStringFromSelector(self.likelySetter) : @"",
  153. @"Image Name", self.imageName ?: @"",
  154. @"Attributes", self.attributes.string ?: @"",
  155. @"objc_property", [FLEXUtility pointerToString:self.objc_property],
  156. @"objc_property_attribute_t", [FLEXUtility pointerToString:self.attributes.list],
  157. ]];
  158. return items;
  159. }
  160. - (NSString *)contextualSubtitleWithTarget:(id)object {
  161. id target = [self appropriateTargetForPropertyType:object];
  162. if (target && self.attributes.typeEncoding.flex_typeIsObjectOrClass) {
  163. return [FLEXUtility addressOfObject:[self currentValueBeforeUnboxingWithTarget:target]];
  164. }
  165. return nil;
  166. }
  167. #endif
  168. @end
  169. #pragma mark FLEXIvar
  170. @implementation FLEXIvar (UIKitHelpers)
  171. FLEXObjectExplorerDefaultsImpl
  172. - (BOOL)isEditable {
  173. const FLEXTypeEncoding *typeEncoding = self.typeEncoding.UTF8String;
  174. return [FLEXArgumentInputViewFactory canEditFieldWithTypeEncoding:typeEncoding currentValue:nil];
  175. }
  176. - (BOOL)isCallable {
  177. return NO;
  178. }
  179. - (id)currentValueWithTarget:(id)object {
  180. if (!object_isClass(object)) {
  181. return [self getPotentiallyUnboxedValue:object];
  182. }
  183. return nil;
  184. }
  185. - (NSString *)previewWithTarget:(id)object {
  186. if (object_isClass(object)) {
  187. return self.details;
  188. } else if (self.defaults.wantsDynamicPreviews) {
  189. return [FLEXRuntimeUtility
  190. summaryForObject:[self currentValueWithTarget:object]
  191. ];
  192. }
  193. return nil;
  194. }
  195. - (UIViewController *)viewerWithTarget:(id)object {
  196. NSAssert(!object_isClass(object), @"Unreachable state: viewing ivar on class object");
  197. id value = [self currentValueWithTarget:object];
  198. return [FLEXObjectExplorerFactory explorerViewControllerForObject:value];
  199. }
  200. - (UIViewController *)editorWithTarget:(id)object section:(FLEXTableViewSection *)section {
  201. NSAssert(!object_isClass(object), @"Unreachable state: editing ivar on class object");
  202. return [FLEXFieldEditorViewController target:object ivar:self commitHandler:^{
  203. [section reloadData:YES];
  204. }];
  205. }
  206. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  207. if (object_isClass(object)) {
  208. return UITableViewCellAccessoryNone;
  209. }
  210. // Could use .isEditable here, but we use .tag for speed since it is cached
  211. if ([self getPotentiallyUnboxedValue:object]) {
  212. if (self.defaults.isEditable) {
  213. // Editable non-nil value, both
  214. #if !TARGET_OS_TV
  215. return UITableViewCellAccessoryDetailDisclosureButton;
  216. #else
  217. return UITableViewCellAccessoryDisclosureIndicator; //FIXME: not a proper fix
  218. #endif
  219. } else {
  220. // Uneditable non-nil value, chevron only
  221. return UITableViewCellAccessoryDisclosureIndicator;
  222. }
  223. } else {
  224. if (self.defaults.isEditable) {
  225. // Editable nil value, just (i)
  226. #if !TARGET_OS_TV
  227. return UITableViewCellAccessoryDetailButton;
  228. #else
  229. return UITableViewCellAccessoryDisclosureIndicator; //FIXME: not a proper fix
  230. #endif
  231. } else {
  232. // Non-editable nil value, neither
  233. return UITableViewCellAccessoryNone;
  234. }
  235. }
  236. }
  237. - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
  238. #if FLEX_AT_LEAST_IOS13_SDK
  239. - (NSArray<UIAction *> *)additionalActionsWithTarget:(id)object sender:(UIViewController *)sender __IOS_AVAILABLE(13.0) {
  240. Class ivarClass = self.typeEncoding.flex_typeClass;
  241. // "Explore PropertyClass" for properties with a concrete class name
  242. if (ivarClass) {
  243. NSString *title = [NSString stringWithFormat:@"Explore %@", NSStringFromClass(ivarClass)];
  244. return @[[UIAction actionWithTitle:title image:nil identifier:nil handler:^(UIAction *action) {
  245. UIViewController *explorer = [FLEXObjectExplorerFactory explorerViewControllerForObject:ivarClass];
  246. [sender.navigationController pushViewController:explorer animated:YES];
  247. }]];
  248. }
  249. return nil;
  250. }
  251. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  252. BOOL isInstance = !object_isClass(object);
  253. BOOL returnsObject = self.typeEncoding.flex_typeIsObjectOrClass;
  254. id value = isInstance ? [self getValue:object] : nil;
  255. NSMutableArray *items = [NSMutableArray arrayWithArray:@[
  256. @"Name", self.name ?: @"",
  257. @"Type", self.typeEncoding ?: @"",
  258. @"Declaration", self.description ?: @"",
  259. ]];
  260. if (isInstance) {
  261. [items addObjectsFromArray:@[
  262. @"Value Preview", isInstance ? [self previewWithTarget:object] : @"",
  263. @"Value Address", returnsObject ? [FLEXUtility addressOfObject:value] : @"",
  264. ]];
  265. }
  266. [items addObjectsFromArray:@[
  267. @"Size", @(self.size).stringValue,
  268. @"Offset", @(self.offset).stringValue,
  269. @"objc_ivar", [FLEXUtility pointerToString:self.objc_ivar],
  270. ]];
  271. return items;
  272. }
  273. - (NSString *)contextualSubtitleWithTarget:(id)object {
  274. if (!object_isClass(object) && self.typeEncoding.flex_typeIsObjectOrClass) {
  275. return [FLEXUtility addressOfObject:[self getValue:object]];
  276. }
  277. return nil;
  278. }
  279. #endif
  280. @end
  281. #pragma mark FLEXMethod
  282. @implementation FLEXMethodBase (UIKitHelpers)
  283. FLEXObjectExplorerDefaultsImpl
  284. - (BOOL)isEditable {
  285. return NO;
  286. }
  287. - (BOOL)isCallable {
  288. return NO;
  289. }
  290. - (id)currentValueWithTarget:(id)object {
  291. // Methods can't be "edited" and have no "value"
  292. return nil;
  293. }
  294. - (NSString *)previewWithTarget:(id)object {
  295. return [self.selectorString stringByAppendingFormat:@" — %@", self.typeEncoding];
  296. }
  297. - (UIViewController *)viewerWithTarget:(id)object {
  298. // We disallow calling of FLEXMethodBase methods
  299. @throw NSInternalInconsistencyException;
  300. return nil;
  301. }
  302. - (UIViewController *)editorWithTarget:(id)object section:(FLEXTableViewSection *)section {
  303. // Methods cannot be edited
  304. @throw NSInternalInconsistencyException;
  305. return nil;
  306. }
  307. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  308. // We shouldn't be using any FLEXMethodBase objects for this
  309. @throw NSInternalInconsistencyException;
  310. return UITableViewCellAccessoryNone;
  311. }
  312. - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
  313. #if FLEX_AT_LEAST_IOS13_SDK
  314. - (NSArray<UIAction *> *)additionalActionsWithTarget:(id)object sender:(UIViewController *)sender __IOS_AVAILABLE(13.0) {
  315. return nil;
  316. }
  317. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  318. return @[
  319. @"Selector", self.name ?: @"",
  320. @"Type Encoding", self.typeEncoding ?: @"",
  321. @"Declaration", self.description ?: @"",
  322. ];
  323. }
  324. - (NSString *)contextualSubtitleWithTarget:(id)object {
  325. return nil;
  326. }
  327. #endif
  328. @end
  329. @implementation FLEXMethod (UIKitHelpers)
  330. - (BOOL)isCallable {
  331. return self.signature != nil;
  332. }
  333. - (UIViewController *)viewerWithTarget:(id)object {
  334. object = self.isInstanceMethod ? object : (object_isClass(object) ? object : [object class]);
  335. return [FLEXMethodCallingViewController target:object method:self];
  336. }
  337. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  338. if (self.isInstanceMethod) {
  339. if (object_isClass(object)) {
  340. // Instance method from class, can't call
  341. return UITableViewCellAccessoryNone;
  342. } else {
  343. // Instance method from instance, can call
  344. return UITableViewCellAccessoryDisclosureIndicator;
  345. }
  346. } else {
  347. return UITableViewCellAccessoryDisclosureIndicator;
  348. }
  349. }
  350. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  351. return [[super copiableMetadataWithTarget:object] arrayByAddingObjectsFromArray:@[
  352. @"NSMethodSignature *", [FLEXUtility addressOfObject:self.signature],
  353. @"Signature String", self.signatureString ?: @"",
  354. @"Number of Arguments", @(self.numberOfArguments).stringValue,
  355. @"Return Type", @(self.returnType ?: ""),
  356. @"Return Size", @(self.returnSize).stringValue,
  357. @"objc_method", [FLEXUtility pointerToString:self.objc_method],
  358. ]];
  359. }
  360. @end
  361. #pragma mark FLEXProtocol
  362. @implementation FLEXProtocol (UIKitHelpers)
  363. FLEXObjectExplorerDefaultsImpl
  364. - (BOOL)isEditable {
  365. return NO;
  366. }
  367. - (BOOL)isCallable {
  368. return NO;
  369. }
  370. - (id)currentValueWithTarget:(id)object {
  371. return nil;
  372. }
  373. - (NSString *)previewWithTarget:(id)object {
  374. return nil;
  375. }
  376. - (UIViewController *)viewerWithTarget:(id)object {
  377. return [FLEXObjectExplorerFactory explorerViewControllerForObject:self];
  378. }
  379. - (UIViewController *)editorWithTarget:(id)object section:(FLEXTableViewSection *)section {
  380. // Protocols cannot be edited
  381. @throw NSInternalInconsistencyException;
  382. return nil;
  383. }
  384. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  385. return UITableViewCellAccessoryDisclosureIndicator;
  386. }
  387. - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
  388. #if FLEX_AT_LEAST_IOS13_SDK
  389. - (NSArray<UIAction *> *)additionalActionsWithTarget:(id)object sender:(UIViewController *)sender __IOS_AVAILABLE(13.0) {
  390. return nil;
  391. }
  392. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  393. NSArray<NSString *> *conformanceNames = [self.protocols valueForKeyPath:@"name"];
  394. NSString *conformances = [conformanceNames componentsJoinedByString:@"\n"];
  395. return @[
  396. @"Name", self.name ?: @"",
  397. @"Conformances", conformances ?: @"",
  398. ];
  399. }
  400. - (NSString *)contextualSubtitleWithTarget:(id)object {
  401. return nil;
  402. }
  403. #endif
  404. @end
  405. #pragma mark FLEXStaticMetadata
  406. @interface FLEXStaticMetadata () {
  407. @protected
  408. NSString *_name;
  409. }
  410. @property (nonatomic) FLEXTableViewCellReuseIdentifier reuse;
  411. @property (nonatomic) NSString *subtitle;
  412. @property (nonatomic) id metadata;
  413. @end
  414. @interface FLEXStaticMetadata_Class : FLEXStaticMetadata
  415. + (instancetype)withClass:(Class)cls;
  416. @end
  417. @implementation FLEXStaticMetadata
  418. @synthesize name = _name;
  419. @synthesize tag = _tag;
  420. FLEXObjectExplorerDefaultsImpl
  421. + (NSArray<FLEXStaticMetadata *> *)classHierarchy:(NSArray<Class> *)classes {
  422. return [classes flex_mapped:^id(Class cls, NSUInteger idx) {
  423. return [FLEXStaticMetadata_Class withClass:cls];
  424. }];
  425. }
  426. + (instancetype)style:(FLEXStaticMetadataRowStyle)style title:(NSString *)title string:(NSString *)string {
  427. return [[self alloc] initWithStyle:style title:title subtitle:string];
  428. }
  429. + (instancetype)style:(FLEXStaticMetadataRowStyle)style title:(NSString *)title number:(NSNumber *)number {
  430. return [[self alloc] initWithStyle:style title:title subtitle:number.stringValue];
  431. }
  432. - (id)initWithStyle:(FLEXStaticMetadataRowStyle)style title:(NSString *)title subtitle:(NSString *)subtitle {
  433. self = [super init];
  434. if (self) {
  435. if (style == FLEXStaticMetadataRowStyleKeyValue) {
  436. _reuse = kFLEXKeyValueCell;
  437. } else {
  438. _reuse = kFLEXMultilineDetailCell;
  439. }
  440. _name = title;
  441. _subtitle = subtitle;
  442. }
  443. return self;
  444. }
  445. - (NSString *)description {
  446. return self.name;
  447. }
  448. - (NSString *)reuseIdentifierWithTarget:(id)object {
  449. return self.reuse;
  450. }
  451. - (BOOL)isEditable {
  452. return NO;
  453. }
  454. - (BOOL)isCallable {
  455. return NO;
  456. }
  457. - (id)currentValueWithTarget:(id)object {
  458. return nil;
  459. }
  460. - (NSString *)previewWithTarget:(id)object {
  461. return self.subtitle;
  462. }
  463. - (UIViewController *)viewerWithTarget:(id)object {
  464. return nil;
  465. }
  466. - (UIViewController *)editorWithTarget:(id)object section:(FLEXTableViewSection *)section {
  467. // Static metadata cannot be edited
  468. @throw NSInternalInconsistencyException;
  469. return nil;
  470. }
  471. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  472. return UITableViewCellAccessoryNone;
  473. }
  474. #if FLEX_AT_LEAST_IOS13_SDK
  475. - (NSArray<UIAction *> *)additionalActionsWithTarget:(id)object sender:(UIViewController *)sender __IOS_AVAILABLE(13.0) {
  476. return nil;
  477. }
  478. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  479. return @[self.name, self.subtitle];
  480. }
  481. - (NSString *)contextualSubtitleWithTarget:(id)object {
  482. return nil;
  483. }
  484. #endif
  485. @end
  486. #pragma mark FLEXStaticMetadata_Class
  487. @implementation FLEXStaticMetadata_Class
  488. + (instancetype)withClass:(Class)cls {
  489. NSParameterAssert(cls);
  490. FLEXStaticMetadata_Class *metadata = [self new];
  491. metadata.metadata = cls;
  492. metadata->_name = NSStringFromClass(cls);
  493. metadata.reuse = kFLEXDefaultCell;
  494. return metadata;
  495. }
  496. - (id)initWithStyle:(FLEXStaticMetadataRowStyle)style title:(NSString *)title subtitle:(NSString *)subtitle {
  497. @throw NSInternalInconsistencyException;
  498. return nil;
  499. }
  500. - (UIViewController *)viewerWithTarget:(id)object {
  501. return [FLEXObjectExplorerFactory explorerViewControllerForObject:self.metadata];
  502. }
  503. - (UITableViewCellAccessoryType)suggestedAccessoryTypeWithTarget:(id)object {
  504. return UITableViewCellAccessoryDisclosureIndicator;
  505. }
  506. - (NSArray<NSString *> *)copiableMetadataWithTarget:(id)object {
  507. return @[
  508. @"Class Name", self.name,
  509. @"Class", [FLEXUtility addressOfObject:self.metadata]
  510. ];
  511. }
  512. - (NSString *)contextualSubtitleWithTarget:(id)object {
  513. return [FLEXUtility addressOfObject:self.metadata];
  514. }
  515. @end