Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
mrousavy committed Feb 20, 2024
1 parent 7ee53b4 commit 5704e1f
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
8 changes: 4 additions & 4 deletions package/ios/AppleFilamentProxy.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,19 @@
//

#include "FilamentProxy.h"
#include <jsi/jsi.h>
#include <ReactCommon/CallInvoker.h>
#include <jsi/jsi.h>

namespace margelo {

class AppleFilamentProxy : public FilamentProxy {
public:
explicit AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr<react::CallInvoker> callInvoker);
~AppleFilamentProxy();

public:
int loadModel(const std::string &path) override;
int loadModel(const std::string& path) override;

private:
jsi::Runtime* _runtime;
std::shared_ptr<react::CallInvoker> _callInvoker;
Expand Down
16 changes: 8 additions & 8 deletions package/ios/AppleFilamentProxy.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
// Created by Marc Rousavy on 20.02.24.
//

#import <Foundation/Foundation.h>
#import "AppleFilamentProxy.h"
#import <Foundation/Foundation.h>

namespace margelo {
AppleFilamentProxy::AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr<react::CallInvoker> callInvoker):
_runtime(runtime), _callInvoker(callInvoker) { }

AppleFilamentProxy::AppleFilamentProxy(jsi::Runtime* runtime, std::shared_ptr<react::CallInvoker> callInvoker)
: _runtime(runtime), _callInvoker(callInvoker) {}

AppleFilamentProxy::~AppleFilamentProxy() {
// TODO(hanno): cleanup here?
}
int AppleFilamentProxy::loadModel(const std::string &path) {

int AppleFilamentProxy::loadModel(const std::string& path) {
// TODO(hanno): Implement model loading here
return 13;
}

} // namespace margelo
4 changes: 2 additions & 2 deletions package/ios/FilamentInstaller.mm
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
// Created by Marc Rousavy on 20.02.24.
//

#import <Foundation/Foundation.h>
#import "FilamentInstaller.h"
#import "AppleFilamentProxy.h"
#import <Foundation/Foundation.h>
#import <ReactCommon/CallInvoker.h>

#import <React/RCTBridge+Private.h>
Expand All @@ -22,7 +22,7 @@ @interface RCTCxxBridge (CallInvoker)

@implementation FilamentInstaller

+ (BOOL)installToBridge:(RCTBridge *)bridge {
+ (BOOL)installToBridge:(RCTBridge*)bridge {
RCTCxxBridge* cxxBridge = (RCTCxxBridge*)[RCTBridge currentBridge];
if (!cxxBridge.runtime) {
return NO;
Expand Down
2 changes: 1 addition & 1 deletion package/ios/FilamentViewManager.mm
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#import "FilamentInstaller.h"
#import "RCTBridge.h"
#import "Utils.h"
#import <React/RCTUIManager.h>
#import <React/RCTViewManager.h>
#import "FilamentInstaller.h"

@interface FilamentViewManager : RCTViewManager
@end
Expand Down
5 changes: 4 additions & 1 deletion package/src/FilamentProxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ if (global.nativeCallSyncHook == null) {
)
}

// TODO: Figure out how to call the native install method. I couldn't get codegen to properly generate that static method.
// TODO(hanno): Figure out how to call the native install method. I couldn't get codegen to properly generate that static method.
// In Bridge architecture there was a separate Module and View, but now it's all a View - how do I add static methods on that?
// Maybe we need to create a separate FilamentModule as well (in addition to the FilamentView).
// @ts-expect-error
const successful = FilamentViewNativeComponent.install()
if (!successful) {
throw new Error('Failed to initialize react-native-filament! Check the native logs (adb logcat or Xcode logs) for more information.')
Expand Down

0 comments on commit 5704e1f

Please sign in to comment.