Git Product home page Git Product logo

jkcategories's Issues

JKCategories 影响到导航栏相关设置

UINavigationController (JKNavigationItemBackBtnTile)
这个分类的代码,影响到我修改导航栏BackBarButtonItem,目前我只能先注释掉如下代码

- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPushItem:(UINavigationItem *)item {
    
    UIViewController * viewController = self.viewControllers.count > 1 ? \
                    [self.viewControllers objectAtIndex:self.viewControllers.count - 2] : nil;
    
    if (!viewController) {
        return YES;
    }
    
    NSString *backButtonTitle = nil;
    if ([viewController respondsToSelector:@selector(jk_navigationItemBackBarButtonTitle)]) {
        backButtonTitle = [viewController jk_navigationItemBackBarButtonTitle];
    }
    
    if (!backButtonTitle) {
        backButtonTitle = viewController.title;
    }
    
    UIBarButtonItem *backButtonItem = [[UIBarButtonItem alloc] initWithTitle:backButtonTitle
                                                                       style:UIBarButtonItemStylePlain
                                                                      target:nil action:nil];
    viewController.navigationItem.backBarButtonItem = backButtonItem;
    
    return YES;
}

下面是我的代码:

- (void)customePushNavigationItem:(UINavigationItem *)item animated:(BOOL)animated {
    NSLog(@"UINavigationBar ====== item: %@, topItem: %@, backItem: %@", item, self.topItem, self.backItem);
    if (self.topItem) {
        UIBarButtonItem *item = self.ty_globalBackBarButtonItem;
        [self.topItem setBackBarButtonItem:item];  //我在这里对BackBarButtonItem做了替换
    }
    [self customePushNavigationItem:item animated:animated];
}

由于该库的代码导致我替换了BackBarButtonItem后,又被该库的代码替换成了带Title的BackBarButtonItem,我认为这块代码不应该出现在这个库里面,直接重写了系统的方法,在用户无察觉的情况下做这件事情似乎不是很好吧!

UIWebView能否移除

webview已经被deprecated并被要求强制移除,之后的版本能否移除相关分类

直接下载的项目和pod最新的不一致

下载最新的1.8.1版本和pod不一致,比如UIDevice+Hardware这个分类中的+ (NSString *)jk_platformString 方法,下载的有iPhone 11、iPhone 11 Pro和iPhone 11 Pro Max,而pod却没有还停留iPhone XR,希望跟新一下。

下载之后直接报错

Use of '@import' when modules are disabled
这个错误我上网上查了一下,说是把enabled modules改成YES就行了,但是我本身就是YES。
然后stackoverflow说是因为我用了ObjectiveC++,所以modules被禁用了,

CommonCrypto 是不是有冲突啊

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.0.sdk/usr/include/CommonCrypto/module.modulemap:1:8: Redefinition of module 'CommonCrypto'

NSDictionary+JKSafeAccess have a bug

NSDictionary+JKSafeAccess have a bug

- (NSDate *)jk_dateForKey:(id)key dateFormat:(NSString *)dateFormat{
    NSDateFormatter *formater = [[NSDateFormatter alloc]init];
    formater.dateFormat = dateFormat;
    id value = [self objectForKey:key];
    
    if (value == nil || value == [NSNull null])
    {
        return nil;
    }
    
    if ([value isKindOfClass:[NSString class]] && ![value isEqualToString:@""] && !dateFormat) {
        return [formater dateFromString:value];
    }
    return nil; 
}

!dateFormat

UIAlertView

UIAlertView遭弃用,看着⚠️心烦,求更新

UINavigationBar致命问题

@shaojiankui 使用pod安装后,不添加任何一行分类代码,对UINavigationController的UINavigationBar有�致命的UI影响。测试环境:xcode 7.3.1 iOS9.3。

"NSDate+JKExtension 类中 - (NSString *)jk_formatYMD; 返回值有误

原代码:

  • (NSUInteger)jk_weekOfYear:(NSDate *)date {
    NSUInteger i;
    NSUInteger year = [date jk_year];

    NSDate *lastdate = [date jk_lastdayOfMonth];

    for (i = 1;[[lastdate jk_dateAfterDay:-7 * i] jk_year] == year; i++) {

    }

    return i;
    }

应把 [lastdate jk_dateAfterDay:-7 * i] 改成 [date jk_dateAfterDay:-7 * i]

9.3.5系统上调用 textView.jk_maxLength 方法会发生崩溃问题

iOS 9.3.5系统真机 iPad mini中,运行程序,调用JKCategories分类文件UITextView+JKInputLimit.h中的jk_maxLength属性(此属性用于限制 UITextView 输入的文本字符串长度)会直接崩溃,崩溃信息如下

Signal 11 was raised. SIGSEGV (_mh_execute_header + 1193343)

在其他系统环境中调用此属性用于限制用户输入的文本字符串长度则无此异常,期待你的解决!!!

UIViewController+DDPopUpViewController.m ARC下编译错误

感谢作者,categories很全面,节省了很多精力.
小问题,就不pull了.
+(vo�id)load
原:
Method original = class_getInstanceMethod([UIViewController class], @selector(dealloc));
修改为
Method original = class_getInstanceMethod([UIViewController class], NSSelectorFromString(@"dealloc"));

关于使用<Masonry>添加约束时,使用扩展绘制圆角的问题

我的项目使用了进行布局,添加完约束,在调用 [UIView jk_setRoundedCorners:radius] 方法为视图添加圆角的时,无法正常添加,建议将该扩展下的方法实现改为:

[self layoutIfNeeded];//增加这一行代码,其他维持不变

CGRect rect = self.bounds;

// Create the path
UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:rect
                                               byRoundingCorners:corners
                                                     cornerRadii:CGSizeMake(radius, radius)];

// Create the shape layer and set its path
CAShapeLayer *maskLayer = [CAShapeLayer layer];
maskLayer.frame = rect;
maskLayer.path = maskPath.CGPath;

// Set the newly created shape layer as the mask for the view's layer
self.layer.mask = maskLayer;

其他类似的地方都应该添加这个代码

使用CocoaPods导入报错

Podfile:
platform :ios, '7.0'
target 'BKCustom' do
pod 'JKCategories'
end
error:
[!] Unable to find a specification for JKCategories
导入别的第三方框架不会报这个错!

0分钟前

文件 NSDate+JKExtension 对应 433 行,如果当时间小于1分钟时(比如retTime为0.5),使用该方法会表示为 0分钟前 ,建议对改行代码进行修正。修正前

    retTime = retTime <= 0.0 ? 1.0 : retTime;
    return [NSString stringWithFormat:@"%.0f分钟前", retTime];

修正后

    return retTime < 1.0 ? @"刚刚" : [NSString stringWithFormat:@"%.0f分钟前", retTime];

NSObject+JKKVOBlocks

jk_observeValueForKeyPath 这个方法会被系统调用么?
不会。。会因为没有handled KVO 的 message 而 crash。

某些方法定义为内联函数比 Category 更合适

感谢作者的分享这么丰富的 Category ,666

比如 NSObject+JKGCD.m 类中的 GCD 相关函数
正常使用是

[someObject jk_performAsynchronous{
    ...
}];

感觉不太合适,下面这样定义为内联函数会不会更好些 ?

NS_INLINE void ExecuteAsyncInGlobalQueue(void (^block)()){
    dispatch_async(getGlobalQueue(), block);
};

Demo或者注释

非常感谢有这么多的分类可以使用.希望能补上Demo和注释.有很多没有注释,有的是英文的,有的是中文.

辛苦了,但有点不知所措

感谢作者,but,分类太强大,太庞大了,不知道如何去使用,仅仅只看一个方法名并不知道有什么用,有有些注释,但仅仅看一点注释也不太明白,这该如何解决呢

UIButton+JKCountDown

// int minutes = timeout / 60;
int seconds = timeOut % 60;
NSString *strTime = [NSString stringWithFormat:@"%.2d", seconds];
dispatch_async(dispatch_get_main_queue(), ^{
//设置界面的按钮显示 根据自己需求设置
NSLog(@"____%@",strTime);
[self setTitle:[NSString stringWithFormat:@"%@%@",strTime,waitTittle] forState:UIControlStateNormal];
self.userInteractionEnabled = NO;
});
timeOut--;

起始时间为60的时候,按钮因为%60为0而显示不了“60”的状态
(还有命名为“tittle”的问题)

热更新

您的源码中存在热更新代码 dlopen(), dlsym() ,建议修复一下

NSData+Encrypt.h

I use this category to encrypt my nsdata and set the IV param to nil,why the result is nil.If i have post the wrong param?Hope your response,thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.