Skip to content

Commit

Permalink
Misc cleanup and bug fixes
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
NSExceptional committed May 25, 2020
1 parent a840e90 commit 5212824
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,29 +13,10 @@
#import "FLEXAlert.h"

@interface FLEXViewControllerShortcuts ()
@property (nonatomic, readonly) UIViewController *viewController;
@property (nonatomic, readonly) BOOL viewControllerIsInUse;
@end

@implementation FLEXViewControllerShortcuts

#pragma mark - Internal

- (UIViewController *)viewController {
return self.object;
}

/// A view controller is "in use" if it's view is in a window,
/// or if it belongs to a navigation stack which is in use.
- (BOOL)viewControllerIsInUse {
if (self.viewController.view.window) {
return YES;
}

return self.viewController.navigationController != nil;
}


#pragma mark - Overrides

+ (instancetype)forObject:(UIViewController *)viewController {
Expand Down
4 changes: 2 additions & 2 deletions Classes/Utility/Categories/FLEXRuntime+UIKitHelpers.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
if (targetNotNil) {
id value = [self currentValueBeforeUnboxingWithTarget:object];
[items addObjectsFromArray:@[
@"Value Preview", [self previewWithTarget:object],
@"Value Preview", [self previewWithTarget:object] ?: @"",
@"Value Address", returnsObject ? [FLEXUtility addressOfObject:value] : @"",
]];
}
Expand Down Expand Up @@ -462,7 +462,7 @@ - (NSString *)reuseIdentifierWithTarget:(id)object { return nil; }
NSString *conformances = [conformanceNames componentsJoinedByString:@"\n"];
return @[
@"Name", self.name ?: @"",
@"Conformances", conformances,
@"Conformances", conformances ?: @"",
];
}

Expand Down
6 changes: 5 additions & 1 deletion Classes/Utility/Runtime/Objc/FLEXObjcInternal.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ extern "C" {
// originally _objc_isTaggedPointer //
//////////////////////////////////////
NS_INLINE BOOL flex_isTaggedPointer(const void *ptr) {
return ((uintptr_t)ptr & _OBJC_TAG_MASK) == _OBJC_TAG_MASK;
#if OBJC_HAVE_TAGGED_POINTERS
return ((uintptr_t)ptr & _OBJC_TAG_MASK) == _OBJC_TAG_MASK;
#else
return NO;
#endif
}

#define FLEXIsTaggedPointer(obj) flex_isTaggedPointer((__bridge void *)obj)
Expand Down

0 comments on commit 5212824

Please sign in to comment.