Issues making a wrapper Swift Package for Tidy-HTML5 - ios

So I'm trying to include Tidy-HTML5 into an app I'm making. I've run into some issue lately that I don't really know how to solve.
I created this wrapper package, since Tidy-HTML5 is a pure C library and does not support Swift Package Manager.
When I add this package as a dependency in my main project it works fine. That is I need to do the following:
import SwiftTidyHTML
import tidy
But this only works if I build for macOS, if I build for iOS I get an error that tidy cannot be found.
Any help would be really appreciated.
Thanks in advance.

Related

Adding support for SwiftPM to Swift Library

Last one hour or so I have been looking at how to add SwiftPM support to the open-source library.
I started mimicking Alamofire's Package.swift file.
// swift-tools-version:5.1
import PackageDescription
let package = Package(name: "MASegmentedControl",
platforms: [.iOS(.v10)],
products: [.library(name: "MASegmentedControl",
targets: ["MASegmentedControl"])],
targets: [.target(name: "MASegmentedControl",
path: "MASegmentedControl")],
swiftLanguageVersions: [.v4, .v4_2, .v5])
But when I am trying to add that to a test project as swift package I am getting error as shown below.
When I run swift package tools-version I get the output as 3.1.0. I am running Xcode 11.2.1.
I also tried looking at how to update swift package tool. I couldn't find anything on it.
I am wondering if anyone of you added SwiftPM support to your libraries, can please help me out. I am missing something but I can't put my finger on it.
Any help or pointers would be greatly appreciated.
Thanks a lot for reading my post.
I think that can be appeared due to one of the following:
1- Regarding the documentation, May you need to remove the "swiftLanguageVersions" key.
https://swift.org/blog/swift-package-manager-manifest-api-redesign/
The tools version also determines the default Swift language version
used to compile the package’s sources. Existing Swift 3 packages will
compile in Swift 3 compatibility mode. You can optionally use the
swiftLanguageVersions property in both Swift 3 and Swift 4 manifests
to set the language version used to compile that package, if you don’t
want the default version. This means it is possible to upgrade a
package to use the newer manifest format without upgrading its sources
to Swift 4.
2- Ensure the following format for the commented line, as follows:
// swift-tools-version:5.1
import PackageDescription
// swift-tools-version:. Packages that omit this special
comment will default to tools version 3.1.0.

Why Flutter copies the src of standard libraries to sky_engine?

Since dart:ffi is available from Dart 2.2.0-dev.2.0, I've been trying to use that library. The sample app works fine for me and I also tried to use it for my Flutter app but I couldn't call it with import "dart:ffi", although Flutter on my machine was HEAD of master that used Dart 2.3.0-dev.0.0.
I checked what happened, then I found that sky_engine didn't contain ffi.dart while it contained other libraries (e.g. "dart:core"). Also I noticed that the source files of those libraries were copied from $FLUTTER_ROOT/bin/cache/dart-sdk/lib to $FLUTTER_ROOT/bin/cache/pkg/sky_engine using BUILD.gn or _embedder.yaml and that seemed to be why I couldn't use the dart:ffi in my Flutter app.
However, in the first place, why does Flutter need sky_engine, which is "the interface between Dart and the Flutter Engine"? Why not calling them directly without this glue code?
Flutter has a good documentation for FFI to be able to call native C APIs. Adding import 'dart:ffi' as ffi; on the Flutter app works without issues as of my testing with Flutter 2.5. If you're able to provide a minimal repro of your issue, this will help folks to understand the question better.
As for the question on why sky_engine is used by Flutter, that's just simply because it's the "flutter_engine" - similar to what has been already mentioned in the comments.

need help regarding Markerless example using opencv for unity

I am working on project which is based on markerless technology so for this right now I am using opencv for unity and well known unity asset "Markerless example using opencv for unity" so after importing both packages it's showing one error of coremodule. I tried as much as i can but now I need help so i can proceed further to achieve my target.
here I am attaching the error that i am getting!!
enter image description here
This is because the plugin not successfully installed or imported or you're using outdated. Because new update of opencv for unity is just awesome. Do import it again or else you need to manually import classes by going to core module.

Would it be troublesome to bring Swift files into a OC project?

I've already had a Objective-C version big project. Now I want to develop the future features in Swift. I know it's easy to use Swift in Objective-C.
But what makes me worried is whether it would make any trouble like some build errors.
Especially, I'am using CocoaPods to import a doze of Objective-C version frameworks.
Would it make errors by adding use_frameworks!?
I've already gotten a problem that I should change <> to "" to import frameworks installed by CocoaPods.
I'm not sure whether it would cause any other problems or not. That's why I'm asking this question.
So, I will be really appreciate if someone could tell me is it safe or not to use Swift in Objective-C project.

JNWSpringAnimation Framework for iOS (Compile Errors)

I followed the instructions that came with the framework at the github repository. But I got an error when I tried to compile all stemming from the NSValue+JNWAdditions files. The example project that comes with the code is meant to run in Mac OS X and not iOS. What am I missing here when trying to use this framework for an iOS app? For giggles I removed the aforementioned files and was able to compile but got a runtime error, I guess not surprising. I'm fairly new to this stuff and just want to play with animation and springs :(
GitHub repository:
https://github.com/jwilling/JNWSpringAnimation
Help!
Ah. Got it. For any fellow newbs out there: I had to import UIKit into the header file of NSValue+JNWAdditions.h. This got rid of all the "Expected a type" errors! Makes sense to me now and I have no idea why this took me so long to figure out.
Womp womp

Resources