This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <AVFoundation/AVFoundation.h> | |
@interface MLWAsyncAVPlayer : AVPlayer | |
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <JRSwizzle/JRSwizzle.h> | |
@implementation AVPlayerItem (MLWPerformance) | |
+ (void)load { | |
[AVPlayerItem jr_swizzleMethod:NSSelectorFromString(@"_attachToFigPlayer") withMethod:@selector(mlw_attachToFigPlayer) error:nil]; | |
} | |
- (void)mlw_attachToFigPlayer { | |
static dispatch_queue_t queue = nil; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static NSTimeInterval const kMinInactiveTime = 0.2; | |
// | |
@interface WhenNoScrollingExecutor : NSObject | |
@property (assign, nonatomic) BOOL runLoopModeWasUITrackingAgain; | |
- (void)executeBlock:(void (^)())block; | |
- (void)executeBlock:(void (^)())block completion:(void (^_Nullable)())completion; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface LabelMaskedView : UIView | |
@property (strong, nonatomic) UIView *maskView; | |
@property (assign, nonatomic) CGSize cachedIntrisincContentSize; | |
@end | |
@implementation LabelMaskedView | |
- (instancetype)initWitLabel:(UIView *)maskView { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
๐ถ Main thread was blocked for 0.17 sec | |
๐ถ Main thread is still blocked for 0.27 sec | |
๐ถ Main thread is still blocked for 0.37 sec | |
๐ถ Main thread is still blocked for 0.48 sec | |
๐ถ Main thread is still blocked for 0.60 sec | |
๐ถ Main thread is still blocked for 0.71 sec | |
๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ๐ถ Collected 39 reports for 0.8 sec: | |
100.000% _start (in libdyld.dylib) | |
| 100.000% __mh_execute_header (in xctest) | |
| | 100.000% __XCTestMain (in XCTest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[ | |
@[ | |
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero], | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight], | |
], | |
@[ | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView], | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)], | |
], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@[ | |
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero], | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight], | |
].active = YES; | |
@[ | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView], | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)], | |
].active = YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[statusBarBackground.edgesAnchor.withoutBottomAnchor constraintsEqualToConstant:UIEdgeInsetsZero].active = YES; | |
[statusBarBackground.heightAnchor constraintEqualToConstant:kStatusBarBackgroundHeight]; | |
[commentLabel.centerYAnchor constraintEqualToAnchor:commentLabel.superView].active = YES; | |
[commentLabel.leadingAnchor.withTrailingAnchor constraintsLessThanOrEqualToConstant:UIEdgeInsetsMake(0, kCommentLeading, 0, kCommentTrailing)].active = YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add `defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interface AutolayoutTableView : UITableView | |
@end | |
@implementation AutolayoutTableView | |
- (void)layoutSubviews { | |
[super layoutSubviews]; | |
// Dynamic sizing for the header view |