@momo-kits/native-kits 0.160.1-scrolltotop.25-debug → 0.160.1-scrolltotop.26-debug

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -40,7 +40,7 @@ kotlin {
40
40
  }
41
41
 
42
42
  cocoapods {
43
- version = "0.160.1-scrolltotop.25-debug"
43
+ version = "0.160.1-scrolltotop.26-debug"
44
44
  summary = "IOS Shared module"
45
45
  homepage = "https://momo.vn"
46
46
  ios.deploymentTarget = "15.0"
@@ -1,6 +1,6 @@
1
1
  Pod::Spec.new do |spec|
2
2
  spec.name = 'compose'
3
- spec.version = '0.160.1-scrolltotop.23'
3
+ spec.version = '0.159.1-beta.12'
4
4
  spec.homepage = 'https://momo.vn'
5
5
  spec.source = { :http=> ''}
6
6
  spec.authors = ''
package/gradle.properties CHANGED
@@ -18,7 +18,7 @@ kotlin.apple.xcodeCompatibility.nowarn=true
18
18
  name="ComposeKits"
19
19
  group=vn.momo.kits
20
20
  artifact.id=kits
21
- version=0.160.1-scrolltotop.25
21
+ version=0.160.1-scrolltotop.26
22
22
 
23
23
  repo=GitLab
24
24
  url=https://gitlab.mservice.com.vn/api/v4/projects/5400/packages/maven
@@ -3,26 +3,13 @@
3
3
  #import <objc/runtime.h>
4
4
  #import "StatusBarTap.h"
5
5
 
6
- @implementation MoMoStatusBarTap
7
- + (NSNotificationName)notificationName { return @"statusBarSelected"; }
8
- + (void)install { /* installed automatically via +load below */ }
9
- @end
10
-
11
- // MARK: - Swizzle on UIStatusBarManager
12
- // Runs once at framework-load time. Uses the canonical add-or-exchange
13
- // idiom so we never accidentally swizzle an inherited (superclass) IMP.
14
-
15
- @interface UIStatusBarManager (MoMoStatusBarTap)
16
- @end
17
-
18
- @implementation UIStatusBarManager (MoMoStatusBarTap)
19
-
20
- + (void)load {
6
+ // Performs the actual swizzle once per process. Safe to call multiple times.
7
+ static void mm_installStatusBarTapSwizzleOnce(void) {
21
8
  static dispatch_once_t onceToken;
22
9
  dispatch_once(&onceToken, ^{
23
- Class cls = [self class];
10
+ Class cls = [UIStatusBarManager class];
24
11
  SEL originalSelector = NSSelectorFromString(@"handleTapAction:");
25
- SEL swizzledSelector = @selector(mm_handleTapAction:);
12
+ SEL swizzledSelector = NSSelectorFromString(@"mm_handleTapAction:");
26
13
 
27
14
  Method originalMethod = class_getInstanceMethod(cls, originalSelector);
28
15
  Method swizzledMethod = class_getInstanceMethod(cls, swizzledSelector);
@@ -55,10 +42,31 @@
55
42
  });
56
43
  }
57
44
 
45
+ @implementation MoMoStatusBarTap
46
+ + (NSNotificationName)notificationName { return @"statusBarSelected"; }
47
+ + (void)install { mm_installStatusBarTapSwizzleOnce(); }
48
+ @end
49
+
50
+ // MARK: - Swizzle target on UIStatusBarManager
51
+ // `mm_handleTapAction:` is the replacement IMP. After the add/exchange,
52
+ // this selector points at the original UIKit IMP — calling it inside
53
+ // the body invokes UIKit's real handler so UIScrollView.scrollsToTop
54
+ // and any other side effects continue to work.
55
+
56
+ @interface UIStatusBarManager (MoMoStatusBarTap)
57
+ @end
58
+
59
+ @implementation UIStatusBarManager (MoMoStatusBarTap)
60
+
61
+ // Auto-install at framework load. Commented out so the swizzle stays
62
+ // opt-in via `[MoMoStatusBarTap install]`. Uncomment to revert to
63
+ // auto-installation before main().
64
+ //
65
+ // + (void)load {
66
+ // mm_installStatusBarTapSwizzleOnce();
67
+ // }
68
+
58
69
  - (void)mm_handleTapAction:(id)action {
59
- // After the swap, this selector points at the original UIKit IMP —
60
- // call it first so UIScrollView.scrollsToTop and other UIKit side
61
- // effects fire normally, then notify our observers.
62
70
  [self mm_handleTapAction:action];
63
71
  [[NSNotificationCenter defaultCenter] postNotificationName:MoMoStatusBarTap.notificationName
64
72
  object:nil];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momo-kits/native-kits",
3
- "version": "0.160.1-scrolltotop.25-debug",
3
+ "version": "0.160.1-scrolltotop.26-debug",
4
4
  "private": false,
5
5
  "dependencies": {},
6
6
  "devDependencies": {},