Skip to content

Latest commit

 

History

History
54 lines (36 loc) · 2.51 KB

File metadata and controls

54 lines (36 loc) · 2.51 KB

iOS Wrapper

Build SealdSdkInternals.xcframework from Go

To simply build the XCFramework:

# From the root:
mkdir -p ./ios_wrapper/SealdSdk/Frameworks/ ./build/apple/ios/ ./build/apple/macos/
gomobile bind -target=ios -prefix=SealdSdkInternals -v -o=./build/apple/ios/SealdSdkInternals.xcframework ./mobile_sdk
gomobile bind -target=macos -prefix=SealdSdkInternals -v -o=./build/apple/macos/SealdSdkInternals.xcframework ./mobile_sdk
rm -rf ./ios_wrapper/SealdSdk/Frameworks/SealdSdkInternals.xcframework
xcodebuild -create-xcframework \
  -framework ./build/apple/ios/SealdSdkInternals.xcframework/ios-arm64/SealdSdkInternals.framework \
  -framework ./build/apple/ios/SealdSdkInternals.xcframework/ios-arm64_x86_64-simulator/SealdSdkInternals.framework \
  -framework ./build/apple/macos/SealdSdkInternals.xcframework/macos-arm64_x86_64/SealdSdkInternals.framework \
  -output ./ios_wrapper/SealdSdk/Frameworks/SealdSdkInternals.xcframework

Lint

Linting Objective-C code

For Objective-C code (the iOS SDK Wrapper + the ObjC example), linting uses uncrustify.

Linting rules are defined in uncrustify.cfg in the root directory. Configuration is shared.

To install uncrustify, use brew on macos (brew install uncrustify), or your package manager on linux.

To verify formatting, you can run in the ios_wrapper directory:

  • For the Seald SDK : uncrustify -c ../uncrustify.cfg --check -l OC ./SealdSdk/Classes/*.h ./SealdSdk/Classes/*.m
  • For the ObjC example: uncrustify -c ../uncrustify.cfg --check -l OC ./example_objc/SealdSDK/*.h ./example_objc/SealdSDK/*.m

To fix formatting, you can run in the ios_wrapper directory:

  • For the Seald SDK : uncrustify -c ../uncrustify.cfg --no-backup -l OC ./SealdSdk/Classes/*.h ./SealdSdk/Classes/*.m
  • For the ObjC example: uncrustify -c ../uncrustify.cfg --no-backup -l OC ./example_objc/SealdSDK/*.h ./example_objc/SealdSDK/*.m

Linting Swift code

For Swift code (the Swift example), linting uses SwiftLint.

To install, simply run brew install swiftlint.

To verify formatting, you can run swiftlint lint in the ios_wrapper/example_swift/ folder.

To fix formatting, you can run swiftlint lint --fix in the ios_wrapper/example_swift/ folder.

Using the local version in a project

You can use the local version in a project instead of one from a repo, by using the following line in its Podfile:

  pod 'SealdSdk', :path => 'LOCAL_PATH/go-seald-sdk/ios_wrapper'