brisk icon indicating copy to clipboard operation
brisk copied to clipboard

Make Objective-C codebase smaller

Open wokalski opened this issue 6 years ago • 0 comments

I'm starting to notice a pattern where we put more and more logic on the objective-C side because it's more convenient/necessary. I believe we should strive to put almost everything in Reason to make the codebase more robust, simple, and approachable.

One way to address it would be dynamically creating Objective-C objects that you can create OCaml methods on - in runtime. Like this:


let tableViewDelegate = ObjectiveC.makeClass();
ObjectiveC.addMethod(
  Arity_3, 
  "tableView:willDisplayCell:animated:", 
  (self, tableView, cell, animated) => {
  
})

Somewhere else:

BriskTableView.setDelegate(tableView, tableViewDelegate.init());

This is just a sketch, it needs some deeper investigation. Especially how it relates to memory management.

wokalski avatar Mar 29 '19 22:03 wokalski