Need advice about which tool to choose?Ask the StackShare community!
SwiftUI vs UIkIt: What are the differences?
# Introduction
This comparison will highlight key differences between SwiftUI and UIKit.
1. **Declarative vs. Imperative Approach**: SwiftUI uses a declarative approach where you describe the desired result, and the framework handles the implementation details automatically. In contrast, UIKit follows an imperative approach where you have to explicitly define every step in the interface creation process.
2. **Cross-Platform Compatibility**: SwiftUI offers better support for cross-platform development by allowing you to write code that can run on iOS, macOS, watchOS, and tvOS. On the other hand, UIKit is primarily focused on iOS development, making it less suitable for cross-platform projects.
3. **Live Preview**: SwiftUI offers a live preview feature that allows you to see changes in the interface in real-time as you edit the code. This makes the development process more efficient and interactive compared to UIKit, where you have to compile and run the app to view the changes.
4. **Data Flow and State Management**: SwiftUI simplifies data flow and state management with features like @State, @Binding, and ObservableObject. These tools streamline the process of handling data changes and updates within the app, which can be more complex in UIKit with manual state management.
5. **UI Component Hierarchy**: SwiftUI introduces a new way of constructing user interfaces with a hierarchy of views using modifiers like VStack, HStack, and ZStack. This approach simplifies the layout and organization of UI components compared to UIKit's reliance on constraints and frames for layout.
6. **Backwards Compatibility**: While SwiftUI is the future of Apple's UI development, UIKit remains essential for maintaining compatibility with older iOS versions and integrating with existing codebases. This duality can lead to challenges in choosing the right framework for new projects or transitioning existing ones.
In Summary, SwiftUI and UIKit differ in their approach to UI development, cross-platform compatibility, live preview capabilities, data flow management, UI component hierarchy, and backwards compatibility.
I'm building, from scratch, a webapp. It's going to be a dashboard to check on our apps in New Relic and update the Apdex from the webapp. I have just chosen Next.js as our framework because we use React already, and after going through the tutorial, I just loved the latest changes they have implemented.
But we have to decide on a CSS framework for the UI. I'm partial to Bulma because I love that it's all about CSS (and you can use SCSS from the start), that it's rather lightweight and that it doesn't come with JavaScript clutter. One of the things I hate about Bootstrap is that you depend on jQuery to use the JavaScript part. My boss loves UIkIt, but when I've used it in the past, I didn't like it.
What do you think we should use? Maybe you have another suggestion?
I have used bulma in several projects. We could not customize with the websites very well. Also when we need "quick solutions" Bulma is not suitable (I mean basic animations, to-top buttons, transparent navbar solutions etc. For these solutions, you need extra js codes).
Everybody knows about Bootstrap (heavy but popular).
Now we start a new project with UI kit, I like it. Pros: It is fast and lightweight and imho it has very good UI. Cons: Small community. Documentation.
Check this link for kick-off. https://github.com/zzseba78/Kick-Off
Maybe it is helpful.
Been checking out Bulma, myself, and really dig it. I like that it's a great base level jumping off point. You can get a layout going with it, pretty quickly, and then customize as you want. It definitely sounds like it's the one you're leaning towards but a big factor would be who will be using it most? Your boss, yourself, others? Whichever you like best, you'll prob be most productive with but if in the end your boss says it has to be UIkit, then best to be open-minded and give it another shot. Sometimes you may not jive with new tools in your stack, at first, but then they can become tools you learn to love. Best to you in your decision! Take care & keep safe.
I've moved away from the concept of UI kits. Not that many support CSS grid. A lot of the icons are easier to use in SVG. I've had success in the concept of design framework and design tokens. I build my brand identity in Figma, and extract in Diez. Then Diez integrates into React and SASS. Much easier because design is decoupled from software in a central authority, and software updates automatically from design changes.
Honestly - pick whatever you are the most comfortable with. You can achieve almost the same effects with different tools, so why not use something I like using?
I used UIKit and Bootstrap many times. I love Bootstrap for fast, easy layouts to web apps. Clean code, easiest and fastest way to write layouts for front end if you learned something before about Bootstrap. Now in React I use React-Boostrap too. About UIKit I can say its nice idea. It's easier than Bootstrap. This is good option for trainee developer to learn how u should create layout of your website, but for me UIKit have not enough functions. If you need to create something complicated, u have an error in your mind. You must create amazing code combinations for UIKit where in Bootstrap in the same ideas you have easy solutions.
Actually it really depends on your needs, there are 3 types of UI frameworks you can use:
-
A complete set of UI components like: https://react-bulma.dev/en/getting-started.
Pros:
Having a lot of pre-built UI components saves a lot of time
Cons:
need to learn the react framework and the bulma styles, and it's harder to customize to your needs
-
A pure css framework, like Bulma, where you write all the components yourself.
Pros:
A lot of flexibility to build the components you need
Cons:
You are bound to Bulma classes and markup.
Takes more time since you need to build the components
A utility class framework like: https://tailwindcss.com/.
Pros:
Most flexible, mix and match classes as you like and build your own markup
Very easy to customize to your needs
Cons:
Might take time to get used to and takes more time since you need to build the components
If you choose options one, then it's just a matter of deciding what style you like (material,ant, bulma) and go with the library that implements it If you go with pure css and build your own components, I can't recommend tailwind enough, I've been finding myself building entire pages without writing a single line of css.
And if later on, the designer wants to make a change to some color, or size, I just need to change one value in the config file, and the entire app is updated.
We are re-modifying the existing portal to the new one. Looking out for a CSS framework where over-rides are possible, the performance of page loading, extendable, etc Please suggest between tailwind, UIkit and bootstrap frameworks explaining in detail on different factors. I request your help on the same.
Hey Sai, My thoughts on UIkit - It's beautiful, fast, and it has good animation too. Why would I choose it ? Nothing other than giving the internet a new look .
My thoughts on Bootstrap - it's beautiful, if used well. It's very fast and has clean class naming convention unlike Uikit. Why I would choose it ? It's been tested and trusted, I can find a whole lot of resources and a community around it. Also with the type of project you working on I bet Bootstrap would do the job .
Now, considering Tailwind, it's seen as a classic, simple-to-set-up tool with clean utilities. I wouldn't think of tailwind the way I would to Bootstrap or UIkit. What do I mean ? Tailwind is more like a tool set to create your own design flow. Tailwind allows you to build unique design elements, offering you a level of customization that may be unmatched by the other frameworks.
My final thoughts.
If you have the time , setup and use tailwind it will give you a great chance when it comes to customization and performance.
I'm a big proponent of Tailwind and I personally use it whenever I get the chance, mostly because it's not really a UI-kit, but it sounds like in this case a UI-kit like Bootstrap with pre-defined components is more what you are looking for. Bootstrap is (relatively) extendable and overridable and makes it really simple to make a decent looking UI using a handful of pre-defined classes, whereas with Tailwind you configure the classes and create your own components. My main reason for replacing Bootstrap in my workflow is that it feels like the component creation has become so abstracted from the developer that any meaningful customization becomes a chore, resulting in many websites having the generic "Bootstrap-look". Nonetheless, it is effective for creating a pleasant and responsive UI. Though, I don't have any experience with UIkit.
Pros of SwiftUI
- XCode Canvas feature2
- Live previews2
- Smaller Scalable views2
Pros of UIkIt
- Complete GUI39
- Easy modify29
- Practical27
- Easy to learn24
- Functional24
- Intuitive22
- Free21
- Simple16
- Lightweight15
- Easy to use15
- Modular5
- Because I can create amazing things with little effort5
- Modern look5
- Responsiveness4
- Small but Active Community3
- Convenient JS Components2
- Based on Flexbox2
- No requires jquery2
- Responsive grid2