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
- (void)nsf_properlyAnimateCell:(__kindof UITableViewCell<NSFTableViewCellExpandable> *)cell | |
atIndexPath:(NSIndexPath *)indexPath | |
expand:(BOOL)expand | |
{ | |
CGFloat beforeRowHeight = [self.tableView.delegate tableView:self.tableView heightForRowAtIndexPath:indexPath]; | |
self.states[indexPath] = @(expand); | |
if (self.useAutoLayout) | |
{ | |
[cell configWithExpandState:expand]; |
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
let url = URL(string: "https://my.domain.com/k0kSc8hHzAM?t=1461")! | |
UIApplication.shared.open(url, options: [.universalLinksOnly: true]) { (success) in | |
if !success { | |
// not a universal link or app not installed | |
let vc = SFSafariViewController(url: url) | |
self.present(vc, animated: true) | |
} | |
} |
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
#define LOCK(lock) dispatch_semaphore_wait(lock, DISPATCH_TIME_FOREVER); | |
#define UNLOCK(lock) dispatch_semaphore_signal(lock); |
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 <Foundation/Foundation.h> | |
NS_ASSUME_NONNULL_BEGIN | |
@interface NSFPrioritizedDelegate : NSObject | |
@property (readonly) id<NSObject> content; | |
/// 是否需要在 container 中弱引用 delegate | |
@property (readonly) BOOL weakRef; |
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
- (void)someMethod | |
{ | |
// will return a NSPlaceholderNumber instance. | |
NSNumber *a = [NSNumber alloc]; | |
// will simplely just return nil according to https://github.com/NSFish/PrivateFrameworkPseudos/blob/master/Foundation/NSPlaceholderNumber.mm#L1-L5 | |
a = [a init]; | |
// so... nil. | |
NSNumber *a = [NSNumber new]; | |
} |
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
// Come from https://blog.csdn.net/wangyanchang21/article/details/80570863 | |
@interface SomeClass : NSObject | |
@property (nonatomic, strong) NSString *string; | |
@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
@interface ViewController () | |
@property (nonatomic, strong) UIScrollView *scrollView; | |
@end |