* fix(ios): pin scrollview to closest top sibling when no header * chore: update example * docs: update README * fix: fix TrueSheet style to fix android scrollable * refactor: rename fitScrollView to scrollable * refactor(android): cleanup code, update example
46 lines
1.1 KiB
Objective-C
46 lines
1.1 KiB
Objective-C
//
|
|
// Created by Jovanni Lo (@lodev09)
|
|
// Copyright (c) 2024-present. All rights reserved.
|
|
//
|
|
// This source code is licensed under the MIT license found in the
|
|
// LICENSE file in the root directory of this source tree.
|
|
//
|
|
|
|
#ifdef RCT_NEW_ARCH_ENABLED
|
|
|
|
#import <React/RCTSurfaceTouchHandler.h>
|
|
#import <React/RCTViewComponentView.h>
|
|
#import <UIKit/UIKit.h>
|
|
#import <react/renderer/core/LayoutMetrics.h>
|
|
|
|
@class TrueSheetViewController;
|
|
@class RCTScrollViewComponentView;
|
|
|
|
NS_ASSUME_NONNULL_BEGIN
|
|
|
|
@protocol TrueSheetContentViewDelegate <NSObject>
|
|
|
|
- (void)contentViewDidChangeSize:(CGSize)newSize;
|
|
- (void)contentViewDidChangeChildren;
|
|
|
|
@end
|
|
|
|
@interface TrueSheetContentView : RCTViewComponentView
|
|
|
|
@property (nonatomic, weak, nullable) id<TrueSheetContentViewDelegate> delegate;
|
|
|
|
- (RCTScrollViewComponentView *_Nullable)findScrollView:(UIView *_Nullable *_Nullable)outTopSibling;
|
|
|
|
/**
|
|
* Setup ScrollView pinning
|
|
* @param pinned Whether to pin the scroll view
|
|
* @param headerView Optional header view to pin below (can be nil)
|
|
*/
|
|
- (void)setupScrollViewPinning:(BOOL)pinned withHeaderView:(nullable UIView *)headerView;
|
|
|
|
@end
|
|
|
|
NS_ASSUME_NONNULL_END
|
|
|
|
#endif
|