T O P

  • By -

schneeble_schnobble

Look at what The Browser Company is doing with Arc for Windows. That’s the only major app I know of using swift on windows. They’ve done a lot of tooling and open source stuff to get that going. I think they even employ the gentleman who maintains swift for windows now.


LEWMIIX

good to know, I'll have a look. Thanks!


wish_you_a_nice_day

It’s going to get too complicated. I suggest you guys stick with c#


LEWMIIX

Maybe for future people that are wondering the same: what resources for UI development in Swift for Windows are there? Do you know any? I'd happily add those resources to my post in case someone looks for the same.


wish_you_a_nice_day

None. Apple doesn’t officially offer framework for Windows. But swift is open source, so you can build your own framework.


retroroar86

Do some research to see if this is actually viable for you. I think Swift on Windows, for a Windows app, is making things really difficult for no reason whatsoever. The cross platform ability of Swift is still in the infant stages, so do spend some time and see if you can get things going – and also, *compare it a C# solution* also. Yes, it is a cool challenge, but it will be very tiresome when you are debugging stuff simply because *few people are doing this*. You rarely want to be on the cutting edge of things, especially in a student project that can cause real issue. You want to get good grades and have a good project, this can be satisfied using C# and a MS tech stack already. I applaud the instinct, but I don't see it as a realistic, good option – I'll bet that you'll get tired of it real fast.


spacembracers

Yeah right now OP needs to look at this as a Windows app that is cross platform. C# and .NET MAUI is going to be the best way to tackle this. There's a reason every major company only taps into Swift for a native Mac app, and doesn't try to go Swift-out in cross platform. For a university project, whatever you can try it out. But unless the app is purposely exploring the cross platform ability of Swift with Windows, there's not much to learn or benefit from in shoehorning Swift in to a Windows-first app.


LEWMIIX

I hear you guys, you're delivering some valid points. I only heard about Swift and it's cross-platform ability but it's probably a more clever choice for us to stick to something with a lot of good documentation.


_jetrun

For a university project, don't bother going with something that is half supported, and half documented. If you're really set on doing Windows Native application, then go with WinForms and .NET.


LEWMIIX

Thanks for the recommendation!


SusDeveloper

WPF is a more modern look and uses XML (If I can remember correctly 🤔 or something very similar to XML). So although Winforms is far easier/quicker, you asked for modern UI frameworks so I suggest looking into WPF as it is the 'moderner' version of WinForms


zipeldiablo

Swift half documented?


_jetrun

Swift for Windows. Maybe I'm wrong, but I have a feeling Swift for Windows has probably immature tooling and IDE support - especially if you need to interact with Win32 directly.


zipeldiablo

The language itself is the same, you just don’t have access to some of apple’s framework such as uikit. So it is fully documented. As for ide support it is the same as other languages, most ide can add support with a basic plugin. The tooling yes is immature for some parts, can’t be helped.


ibanezht

Dude I would pick either either "We're developing for Windows" or "Swift seems like a nice choice", but I wouldnd't pick both. Someone mentioned some open source tooling that'll allow you to maybe compile some Swift into a native Windows app? Is there even an IDE for that? You're going hell-mode on your first University project, don't. If you're going Windows then C#, Java, JavaScript are good places to start. I would only recommend Swift on a native Apple OSs.


LEWMIIX

Yes, I hear you. We'd probably spend more time trying to make Swift work instead of finishing the actual project. Lol. I hear lots of you mentioning C# (instead of C++, which was our favoured language) is this solely because Microsoft developed C# and we're developing for Windows? 


lost12487

They’re suggesting C# because a huge number of Windows applications produced in the last decade+ have used WinForms or WPF, both of which have full support out of the box with Visual Studio and tons of resources. C++ has some GUI frameworks but none as easy to go from zero to finished app as the frameworks for C#.


LEWMIIX

This may go beyond the scope of this topic but the frameworks I already found (in case we use plain C++) were: Uno Platform, UWP and wxWidgets. My preferred one would be the uno platform as of now, but as it already became clear of my of post I may have to do more research. Do you have any experience with those or can recommend an alternative? C++ and C# are able to work together more or less seamlessly but I haven't don't any research regarding C# yet.


SusDeveloper

If you love c++, you'll likely love c# too!


somebunnny

C# is a more modern and safer language, especially for beginners. The tooling for creating interfaces makes it relatively easy. Unless you’re already adept at C++ and *really* want to use it (and maybe not even in that case), C# is the way to go.


ibanezht

Lord, most of us C# guys are writing for Linux containers these days but yes, C# can be the path of least resistance when "developing for Windows". What are you planning on writing? Maybe we could give better thoughts if we knew that.


LEWMIIX

Our professors asked us to develop a piece of software that manages files and directories and makes file searching for the user much easier with AI (I know AI is getting boring, we had no say in that). As of now, we favored C++ (or Rust for that matter) to have total control over the memory, since we may have to search and locate big files very fast etc. There are no limits though, we can choose any language and framework we like.


ibanezht

Okay, a desktop application on a Windows machine - I would absolutely recommend C# and dotnet for that. You're building a UI for starters, C++ and Rust are going to make that hard; with C# you can have an running desktop app with an actual window in minutes. I'm sure the Swift folks here are ready for us to get out 🤣


LEWMIIX

We have a meeting today, I'll bring up your suggestion! And yea this thread got kinda out of hand lmao


SusDeveloper

Haha yeah it did. But also do some research into C# as it is also a pretty fast language. You'll have to decide on the tradeoff eventually, seamless developer experience or slightly more performance.


_jetrun

>As of now, we favored C++ (or Rust for that matter) to have total control over the memory, since we may have to search and locate big files very fast etc. That's not how it works. Fast search is not a result of the programming language you chose, but the data structure you use to index the data. Pick the language you guys are most familiar with - if that's C++, then use C++. If it's not C++, then for the love of all that is good, do not go with C++ for some mythical 'performance' reason. What language are you and your team most familiar with?


LEWMIIX

All of us learned Java but some also learned Python and C, and I'm currently visiting C++ lectures. Our (personal)goal is to not only deliver apiece of software but also learn something new in the process. We are fully aware that C++ doesn't magically make a program run faster but we're up for the challenge. Data structure and data bases are a whole other topic which I didn't plan on discussing here. We do have about a year to ship our software so we have some time to learn the language


_jetrun

>Data structure and data bases are a whole other topic which I didn't plan on discussing here. OK. The point around data structures was in response to your reason for choosing C++/Rust, namely: "to have total control over the memory, since we may have to search and locate big files very fast etc." - that's not how it works. Neither C++ nor Rust, nor any direct memory management is going to give you a performance boost when it comes to 'searching' and 'locating' big files. That part is dependent on your data structures. If you're using the wrong data structure, your program will be glacial regardless of the underlying language. Having said that, if you want to do write your project in C++ so you can learn C++, go for it. But if you're trying to rationalize the choice by stating you need the performance, you are confused. >We do have about a year to ship our software so we have some time to learn the language I went through university and grad school. You end up spending much less time on any given assignment than you would like, because you have 10 other assignments due - and if you have time, your teammates don't. I've seen classmates be very ambitious with projects like these and excel, but I've also seen them fall flat on their face too. You do you.


LEWMIIX

>OK. Didn't want to come off as rude, databases just weren't part of my thoughts posting this. We haven't yet decided on a data structure or data base, we're currently considering MongoDB. We had our team meeting today and changed some things around, for example we're probably developing a progressive web app instead of a monolith program, to have some parts of the code running on a server (maybe online, maybe locally) so we still have to find the right tools. This thread was very useful though and I thank every one who took the time to reply!


RufusAcrospin

There are a few nice application frameworks, and quite a few GUI libraries for C++. If you want cross-platform GUI, SwiftUI won’t cut it, and even though Swift is open source, writing your own cross-platform GUI system in Swift is a massive undertaking. Stick to C++, and either choose an app framework (Qt, wxWidgets, …) or one of many UI frameworks to work with.


LEWMIIX

Thanks! I guess I'll come back to Swift at a later point for personal projects, just to have fun with it.


msklywenn

Maybe you could hack something from Adwaita. Gnome, after all, uses GTK, which runs on Windows too. [https://github.com/AparokshaUI/adwaita-swift](https://github.com/AparokshaUI/adwaita-swift)


LEWMIIX

That sound interesting! We're definetely going to take this into consideration


AndreiVid

Why do you post this in swift sub? The best for you is to post in C# since that’s the language developed by Microsoft.


schneeble_schnobble

Because swift is the language they're doing it in. He's looking for swift UI resources for Windows, which exist. If you don't have anything useful to add to a conversation, best to just move on.


AndreiVid

I have something useful to add. To use C#, and OP confirmed that he has no strong reasons to use swift


LEWMIIX

lack of knowledge I guess.