Skip to content

Commit

Permalink
1.1.3
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
yulingtianxia committed Mar 29, 2018
1 parent 345d830 commit 8be6933
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion MessageThrottle.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = "MessageThrottle"
s.version = "1.1.2"
s.version = "1.1.3"
s.summary = "A lightweight Objective-C message throttle and debounce library."
s.description = <<-DESC
MessageThrottle is a lightweight, simple library for controlling frequency of forwarding Objective-C messages. You can choose to control existing methods per instance or per class. It's an implementation of function throttle/debounce developed with Objective-C runtime.
Expand Down
10 changes: 5 additions & 5 deletions MessageThrottle/MessageThrottle.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,11 @@ - (BOOL)applyRule:(MTRule *)rule
__block BOOL shouldApply = YES;
if (mt_checkRuleValid(rule)) {
[self.rules enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, MTRule * _Nonnull obj, BOOL * _Nonnull stop) {
if (sel_isEqual(rule.selector, obj.selector)) {

Class clsA = mt_classOfTarget(rule.target);
Class clsB = mt_classOfTarget(obj.target);

if (sel_isEqual(rule.selector, obj.selector)
&& mt_object_isClass(rule.target)
&& mt_object_isClass(obj.target)) {
Class clsA = rule.target;
Class clsB = obj.target;
shouldApply = !([clsA isSubclassOfClass:clsB] || [clsB isSubclassOfClass:clsA]);
*stop = shouldApply;
NSCAssert(shouldApply, @"Error: %@ already apply rule in %@. A message can only have one rule per class hierarchy.", NSStringFromSelector(obj.selector), NSStringFromClass(clsB));
Expand Down

0 comments on commit 8be6933

Please sign in to comment.