Goals & Deliverables: 1. Create a cocoa pod library that exposes 1 public Swift…
Private research annotation
Sign in to add a private research label or note.
- User
Goals & Deliverables:
- Create a cocoa pod library that exposes 1 public Swift function interface:
Func doubleThisArray(array: [Float]) -> [Float]
The output of this function should be doubling the element of each array and returning the new doubled array.
- The implementation of this function should NOT be done in Swift though and should be delegated to a C function in a file that you create.
The C header file should contain a function which the implementation of the swift function
doubleThisArraywould call, double the array in C and return back to Swift’sdoubleThisArray.doubleThisArrayswift function would then convert the return value of the C function back to a Swift array and return this to the caller ofdoubleThisArrayThe implementation of
doubleThisArraywill look roughly like this:codeFunc doubleThisArray(array: [Float]) -> [Float] { // TODO: Call C function and pass `array` to it to double the output // TODO: Convert the return value of the C function to a Swift array // TODO: Return the new swift array to the caller // TODO: Make sure there are no memory leaks }-
Create a unit test for this function:
-
Upload this library to Github for NimbleEdge to inspect your code.
-
Release this library in a private cocoa pod and give access to NimbleEdge team to install and test on a new iOS project.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.