Linux/Ubuntu: How do I import Swift module - swift

I want to import Swift collections. I'm using Ubuntu 20.04; is it possible to do it?

Related

What's the role of the show keyword in import statement? [duplicate]

This question already has answers here:
What is the difference between "show" and "as" in an import statement?
(4 answers)
Closed 4 months ago.
How the show keyword makes difference in theese two imports? The second one is that the IDE suggests to use but sometimes the first one is what in real code.
import 'package:flutter/foundation.dart' show kDebugMode;
vs
import 'package:flutter/foundation.dart';
The show keyword allows you to pick the class you want to use from the library, so basically that means you will only be able to use the KDebugMode class from the foundation library, while if you didn't write it you will be able to use all the classes in the foundation library

Expose Swift Package as part of Another Swift Package

I have a set of Swift Packages that I'm writing (ex: CUIExpandableButton), that I'd like to roll up into another Swift Package called CrystalUI. The overall goal is to write a set of packages that get bundled into a single package. However, I want to make it so people can just have one import
import CrystalUI
instead of a series of import statements
import CrystalUI
import CUIExpandableButton
import PreviewKit
...
Is it possible to re-expose an existing library as part of the parent library?
Looks like #_exported Is what I was looking for. Found this article that explains it. It's an unsupported method but it's also used in Alamofire so I think it's safe.

QML File Dialog multiple presentations

When using FileDialog from my app, I get this:
I initially thought it was the QML way of doing things but it turns out that I have played with example photosurface (provided with QtCreator) and the same FileDialog outputs:
I do not understand where the difference between the two calls come from, i.e. how can I decide to call the 1st version or the 2nd one (I guess the 1st one is best for mobile and the last one better for desktop).
I have played with the import versions:
import QtQuick 2.7
import QtQuick.Layouts 1.3
import QtQuick.Window 2.2
import QtQuick.Controls 2.0
import QtQuick.Controls.Material 2.0
import QtQuick.Controls.Styles 1.2
import QtQuick.Dialogs 1.2
in my case, versus:
import QtQuick 2.6
import QtQuick.Dialogs 1.0
import QtQuick.Window 2.1
import Qt.labs.folderlistmodel 1.0
in the case of photosurface. I have tried photosurface's parameters and obviously they does not solve my riddle.
I have also tried removing my qtquickcontrols2.conf (just in case) but that was not it either...
Any idea where the option is to choose between the 1st and the 2nd version of FileDialog?
Thanks,
Antoine.

IronPython: Cannot import 'Rect'-struct from System.Windows

When I try to import the 'Rect'-struct from System.Windows, IronPython-Interpreter claims that it cannot import.
Since I am using the IronPython Tools for Visual Studio, i can also see that the IntelliSense-DropDown does not show this struct.
Is there a need for a special statement for importing this struct?
Thanks!
You probably need to do:
import clr
clr.AddReference('WindowsBase')
to load the assembly Rect is declared in before importing it.

Why "import javax.jdo.* "caused error?

I have a class uses the following lines, it works fine in a Google App Engine project:
import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;
But when I included this class in another project, it cause error :
package javax.jdo.annotations does not exist
What should I do to find javax.jdo.* ?
Add the JDO jar file to the class path.
The star notation for imports isn't working the way you think it does.
It's not recursive - it only applies the child classes in javax.jdo, not the child packages.
If you want all the classes in javax.jdo.annotations, you'll need to import javax.jdo.annotations.*, too.
I'd recommend not using the star notation. Better to type out the imports for every class individually. Use an IDE to help you. It's clearer for you and other programmers who come after you where those classes came from.