Sources
1577 sources collected
forums.swift.org
Our journey with Swift thus far - some notes and reflections# Major challenges Much of issues are centered around richer dynamic library support, API packaging and Linux platform support, something we need for packaging products properly. - Dynamic Library support on Linux with library evolution - even a limited officially supported package with clear limitations would be useful (as our customers will have a completely controlled environment, it's possible to mandate specific library versions and patch levels for OS etc). - Library support for artifact bundles (we are currently running with a custom toolchain that supports xcframeworks on Linux to work around it, but that's not long term sustainable). - Concurrency runtime analytics tools could be richer, especially for Tasks - while we have some of the tooling in Instruments, it would be fantastic to also have support for accessing similar task information (async task stack backtraces etc, for creation/running/sleeping) in LLDB (especially import on Linux that lacks Instruments...), including inspecting Task locals. - Compile and runtime availability checking support for third party APIs is not available currently. - Fundamental support for dynamic libraries overall as a first class citizen, e.g. targets can't be linked dynamically . # Minor challenges ### Concurrency and testing - The Concurrency story is a bit unfinished, e.g. non-reentrant actor support and `send` support for Actors (including in the distributed case). The good thing is that we're seeing some things like e.g. Mutex trickle in, hoping for the remaining pieces (e.g. Semaphore alternatives, in the meantime we use the Task Semaphore)to come in place too as the lack of them lead to various more-or-less ugly workarounds currently. … ### Tooling and platform support - Linux support has been lagging at times (e.g. Macro support), which has postponed adoption of newer releases for us and it hasn't always been transparent . - Build times on Linux when using the new Foundation are quite painful (we need to not only build swift-foundation, but also swift-syntax due to use of macros - it's a well-known problem of course, but just wanted to mention it as it causes long CI turnaround for us). - Build Stability and Performance - we *very* often need to nuke `.build` or SwiftPM caches or Xcodes derived data due to weird issues (like missing Packages in Xcode), e.g. things seem to rebuild more than expected (e.g. this example for Benchmark). - SwiftPMs model with products/targets is a bit problematic for larger projects; targets are exposed to downstream projects, targets can't depend products in the same package, target name conflicts (aliasing doesn't always work out there) with module names (perhaps not SwiftPM exactly). - Local development of dependencies is a bit clunky, Swift package edit only solves this partially. We end up with a sometimes convoluted and non-ideal project structure with some tools / workaround on top of it. - LLDB support has been spotty with many crashes on Linux especially (and little updates on issues reported), it is improving over time though. … ### Performance - Performance issues are sometimes a bit hard to diagnose and address (e.g. unnecessary copying, we can get tons of metadata lookups when using existensial/generics if not getting the incantations right, ARC traffic, etc) - and need workarounds that allow the compiler to specialize properly. It feels like some sort of instrument for analyzing anti-patterns in Swift could help, would be happy to discuss details. - Generics, while having improved over time, still is not without friction and it is fairly complex at times to get the desired behavior. From a performance point of view it's a bit of hit-or-miss. It's challenging to guarantee that things will get specialised, and it is easy to make a nice generic refactoring that just runs over a performance cliff that you don't expect. It would be great with improvements in this area, e.g. there have been discussions about various annotations (e.g. to guarantee specialization). - KeyPath performance is problematic - unfortunately the performance of KeyPaths has forced us to do workarounds even in fairly simple cases like sort comparators as they would take over samples completely - it'd be nice if they could be used without fear. - Deeper documentation and hints on best practices for performance when using generics and protocol oriented programming (related to the previous point). Basically a follow up to the older performance best practices, but with a bit of more focus on cross-module considerations. - Analyzing program behaviour is missing some runtime hooks to better understand runtime behaviour and perform better benchmarks. Overall, we'd welcome further investment in runtime performance, compile times and overall robustness (SwiftPM / Toolchain / Linux support on par). … > Build Stability and Performance - we *very* often need to nuke `.build` or SwiftPM caches or Xcodes derived data due to weird issues (like missing Packages in Xcode), e.g. things seem to rebuild more than expected The same is true on macOS. I love Swift but working on a large codebase can be really painful.
But over the years, that initial simplicity and focus have been buried under layers of ever-increasing complexity. It feels like the language sprinted from a practical tool for building apps to a highly academic exercise in language theory. The turning point for me began around Swift 5.5. The introduction of `async`/`await` was a welcome and long-overdue addition, simplifying asynchronous code. But it didn’t come alone. It brought with it the actor model, Structured Concurrency, and a whole new set of rules to memorize. Suddenly, simple background tasks required wrestling with a complex system. Then came the real friction: `@Sendable` and the strict data-race protections. While noble in their goal, in practice they often lead to a demoralizing battle with the compiler. You spend less time building features and more time trying to appease the type checker, deciphering alien error messages about a type not conforming to Sendable. The language that once felt like a helpful partner now felt like a pedantic adversary. ``` // What you want: func doThing() { thing() } // What Swift 6 demands: @MainActor nonisolated(unsafe) func doThing() async throws -> sending some Sendable { await withCheckedThrowingContinuation { continuation in Task { @MainActor in // 47 compiler warnings later } } } ``` This trend continued. Features like property wrappers and result builders, while powerful, added layers of “magic” that obscured what was actually happening. And the recent introduction of macros feels like the final departure from Swift’s original promise of clarity. The code on the screen is no longer the code that runs; it’s a template for generating other code, demanding a whole new level of mental gymnastics to debug and maintain. Each new feature added power, yes, but at the cost of immense cognitive overhead. The language that once empowered the solo developer now feels tailored to large, specialized teams who can afford to have experts in its arcane corners. The joy was gone, replaced by burnout. I still haven’t updated Saga, my static site generator written in Swift, to use Swift 6. I just can’t be bothered, to be honest.
contra.com
More items...In 2025, starting with Objective-C is like learning to drive in a manual car when everyone's switching to electric.
developer.apple.com
What's new in Swift - WWDC25 - Videos - Apple DeveloperPreviously, in order to build your projects, Swift PM first had to fetch the sources of swift-syntax, which is a library that powers macros. Then it would build swift-syntax, build the Stringify macro plugin, and finally build your code. While the build of swift-syntax could be cached, it still lengthened the time needed to perform a clean build. … And even when the notification is guaranteed to be posted on the main thread, you’d still get concurrency errors when accessing main actor APIs. Notification names and payloads now support concrete types. Concrete types allow the compiler to check that the object supports the notification kind you’re registering for. They also eliminate boilerplate when working with the notification payload.
One regret: I tested several reproducible SwiftUI bugs I’d encountered over the past year, and they remain in beta 1. I believe that addressing stability issues and improving performance will need to remain SwiftUI’s top priorities for some time to come. ## SwiftData SwiftData added only one feature this year—model inheritance—which isn’t widely used by most developers. Other highly requested capabilities, such as additional sync options (shared, public) and dynamic predicate adjustments, didn’t materialize in this release. That said, this update isn’t a failure. By fixing several critical bugs from previous versions and filling in some long-overdue functionality, SwiftData in Xcode 26 has become increasingly viable for real-world apps. - A bug preventing view updates when mutating data under `@ModelActor` has been resolved. - For model properties conforming to `Codable`, you can now use those properties in predicates. Remarkably, both fixes remain backward compatible to iOS 17. ... > In Xcode 26 beta 1, model inheritance and enum-typed properties still exhibit some bugs, but I expect those to be ironed out before the final release. It’s also highly likely that enums with `RawValue` will be queryable directly in predicates. Once Xcode 26 ships, I believe SwiftData can genuinely be a primary choice for persistence in most apps.
Coming from an Objective-C background, in the beginning, I felt like Swift was holding me back. Swift was not allowing me to make progress because of its strongly typed nature, which used to be infuriating at times. Unlike Objective-C, Swift enforces many requirements at the compile time. Things that are relaxed in Objective-C, such as the … In the beginning, you might want to force unwrap everything, but that will eventually lead to crashes. As you get acquainted with the language, you start to love how you hardly have runtime errors since many mistakes are caught at compile time. Most Swift programmers have significant previous experience with Objective-C, which, among other things, might lead them to write Swift code using the same practices they are familiar with in other languages. And that can cause some bad mistakes. In this article, we outline the most common mistakes that Swift developers make and ways to avoid them. … Second is forcing unwrap using the `!` operator, or using an implicitly unwrapped optional type (e.g. `String!`). If the optional is `nil`, forcing an unwrap will cause a runtime error and terminate the application. Further, attempting to access the value of an implicitly unwrapped optional will cause the same. … ## 3. Using `self` Everywhere Unlike in Objective-C, with Swift, we are not required to use `self` to access a class’ or struct’s properties inside a method. We are only required to do so in a closure because it needs to capture `self`. Using `self` where it’s not required is not exactly a mistake, it works just fine, and there will be no errors and no warnings. However, why write more code than you have to? Also, it is important to keep your code consistent. ## 4. Not Knowing the Type of Your Types Swift uses *value types* and *reference types*. Moreover, instances of a value type exhibit a slightly different behavior of instances of reference types. Not knowing what category each of your instances fit in will cause false expectations on the behavior of the code. … When you get used to Swift and go back to Objective-C, you will notice the difference. You’ll miss nice features Swift offers and will have to write tedious code in Objective-C to achieve the same effect. Other times, you’ll face runtime errors that Swift would have caught during compilation. It is a great upgrade for Apple programmers, and there’s still a lot more to come as the language matures.
Regarding API integration, ensure robust error handling is in place. Research from Rest API Services shows that applications without proper error management face a 40% higher chance of crashing. Use do-catch statements to handle exceptions cleanly, and consider implementing comprehensive logging mechanisms to track API responses and diagnose failures efficiently. ... Utilizing Instruments in Xcode is a fundamental method for pinpointing performance bottlenecks. This profiling tool allows developers to measure CPU and memory usage effectively. A study by Apple indicates that applications leveraging Instruments to optimize performance saw an improvement of up to 30% in resource usage. Memory management is critical. Swift's Automatic Reference Counting (ARC) can lead to high overhead if not managed properly. Avoid retain cycles by using weak references. Investigating the retain cycle percentage in applications showed numerous apps with a 15% increase in responsiveness after addressing this issue. … Avoid excessive looping through Collections. Instead, leverage Swift’s higher-order functions, which can parallelize operations and enhance performance. In practice, this approach can yield performance improvements of up to 25% in data processing tasks. Regularly reviewing and refactoring code is beneficial. Maintaining cleanliness and simplicity not only aids debugging but can also lead to performance improvements. ... ### Identifying Common Performance Bottlenecks Streamlining performance begins with effective profiling to pinpoint problematic areas. Utilize instruments like Instruments from Xcode to analyze CPU and memory usage, as empirical studies indicate that over 70% of performance issues arise from inefficient algorithms and excessive memory consumption. Focus on the following metrics to identify slow sections: CPU load, memory usage, and execution time. Profiling tools report that inefficient loops can slow execution by up to 90%. Optimize loops by using map, filter, or reduce functions, which often yield better performance compared to traditional for-loops. … Consider reformatting or refactoring code that yields persistent issues. Uncomplicated, readable code often allows for easier troubleshooting. Watch for repetitive patterns; complexity can hide bugs and complicate repairs. Review third-party libraries and frameworks, as incompatibilities can often lead to subtle bugs. The CocoaPods dependency manager is widely used; ensure your Podfile is updated and compatible. … ### Common Errors and Their Solutions **Force Unwrapping Optionals:** A prevalent mistake involves using the force unwrapping operator (!). This can lead to runtime crashes if the optional value is nil. Instead, utilize optional binding with `if let` or `guard let` to safely unwrap optionals. **Type Mismatch:** Type errors can occur when assigning values to variables with strict type definitions. Ensure that the variable types match the assigned value. Consider using type inference or explicitly defining types when necessary to prevent ambiguity. **Incorrectly Configured Project Settings:** Misconfiguration in build settings often leads to compilation issues. Check your target’s settings for mismatched architectures or frameworks. Regularly updating to the latest Xcode version can help avoid deprecated settings. **Memory Management Issues:** Retain cycles can arise when using closures, leading to memory leaks. Utilize capture lists (e.g., `[weak self]`) to prevent strong reference cycles, ensuring proper memory handling. **Uninitialized Variables:** Accessing uninitialized variables can cause unpredictable behavior. Always initialize your variables before use, and consider using default values or lazy properties where appropriate. **Using Deprecated API:** Leveraging outdated methods or properties can result in warnings or crashes. Regularly consult Apple’s documentation to stay current with the latest APIs. Refactor code that relies on deprecated functionality. **Performance Issues:** Looping through data inefficiently can degrade performance. In datasets exceeding tens of thousands of entries, consider algorithms like binary search or using built-in methods like `.filter()` and `.map()` that utilize optimized implementations. For additional assistance in specialized programming areas, you may want to hire matlab programmer for tailored solutions.
Some notable problems with Swift, as discussed in various WWDC sessions, include: **Performance Issues**: - Swift has a powerful optimizer, but there are limits to what optimization can achieve. The way code is written can significantly impact the optimizer's effectiveness. Regular performance monitoring and identifying hotspots are crucial for maintaining performance (Explore Swift performance). - Swift's abstractions, such as closures and generics, have non-trivial implementations that can complicate performance compared to languages like C (Explore Swift performance). **Concurrency and Data Races**: - Swift's concurrency features can lead to warnings or errors about concurrency issues, especially when adopting new features. For example, ensuring that methods and property accesses are made on the main thread can be challenging (Migrate your app to Swift 6). - Swift 6 introduces data race safety, but this requires adopting the new language mode and can involve significant changes to existing code (What’s new in Swift). **Error Handling**: - Swift's error handling model, while robust, involves type erasure which can lose concrete type information. This can be problematic in highly constrained systems without runtime allocation capabilities (What’s new in Swift). **Embedded Systems Constraints**: - Embedded Swift disallows certain features to meet the requirements of constrained environments. For example, runtime reflection is avoided due to its high code size cost (Go small with Embedded Swift). These issues highlight the complexities and trade-offs involved in using Swift, particularly in performance-critical and highly concurrent applications. Migrate your app to Swift 6
scholarship.claremont.edu
The Future of iOS Development: Evaluating the Swift Programming Languagemany advantages over Objective-C, and is easy for developers to learn and use. However there are some weak areas of Swift involving interactions with Objective-C and the strictness of the compiler that can make the language difficult to work with. Despite these difficulties Swift is overall a successful project for Apple and should attract new developers to their platform. i … to constantly unwrap everything. Additionally some of the Cocoa Touch methods require Objective-C objects such as NSObject or AnyObject which makes them harder to use. It can be difficult to work within the rules of typecasting in Swift when you need to turn a String into an AnyObject type. Strings are not objects in Swift, and therefore must be cast to NSStings … makes it difficult to use code completion in Xcode because you need to know exactly what the method name is before you call it. The second difficulty was that in order to find an element in an array that element must extend the Equatable protocol. This requires that the == method be overloaded at global scope, rather than being contained in the class. However Swift does not allow the == method to accept a protocol as a parameter, which means the Shape protocol cannot extend Equatable and therefore it is impossible to have an array of protocols in Swift. There are also a few things that should work in Swift that seem to be broken. Several methods on Strings, such as containsString or length, are
Undoubtedly, the centerpiece of Swift this year was the continued refinement of the concurrency programming experience. Although the influx of new options and keywords caused its fair share of teething troubles for developers in the short term, after months of debate and practice, the community is finally beginning to consolidate best practices for this new paradigm. I don’t expect the full establishment and widespread adoption of this paradigm to be a simple or swift process. However, in a year or two, the community’s focus will likely shift from concurrency to cross-platform development, marking a brand-new phase for the language. For SwiftUI, the focus this year was largely centered on adapting to Liquid Glass. Due to initial implementation hurdles at the system level, the visual results were somewhat underwhelming at first. However, since the release of iOS 26.2, both performance and stability have seen significant improvements. To be honest, I am actually quite pleased that SwiftUI didn’t introduce more “revolutionary” features this year. This has given both the framework team and the developers some much-needed breathing room to truly digest the existing framework. At this stage, resolving legacy issues and optimizing performance is far more meaningful than blindly piling on new features. … ... The author complains about their PM’s decision to adopt SwiftUI too casually, arguing that it is ill-suited for rewriting a seven-year-old app. ... Many developers argued that: - SwiftUI itself is already mature enough; the real issues lie in how it’s implemented - Migration should be incremental, not a big-bang rewrite - SwiftUI’s weak spots can be avoided—for example, by keeping UIKit navigation and migrating only the view layer - Multiple large-scale projects (with over 10 years of history) have already completed successful migrations
From Flutter’s highly praised “write once, run anywhere” mantra to its performance enhancements, Flutter has transformed how companies approach cross-platform development. But beneath the surface, challenges remain. Issues like large app sizes, platform-specific workarounds, and Google’s unpredictable track record raise concerns about Flutter’s long-term viability. With the recent Flutter fork into Flock, growing competition from alternatives like React Native and Kotlin Multiplatform, and questions about its scalability for enterprise applications, is Flutter still the best choice for cross-platform development? Or is its dominance starting to fade? … Then, there’s the issue of performance. Flutter offers impressive rendering capabilities, but when it comes to heavy, high-performance applications — such as those requiring advanced animations or complex real-time processing — Flutter can struggle. While Google has worked to optimize performance, it still doesn’t quite match the efficiency of truly native development, and that gap is noticeable in some applications. … ## Flutter in 2025: where are we now? ... In November 2024, Flutter was forked into a new project called Flock, created by the community to address Flutter’s perceived limitations, such as insufficient developer support and slow development. Flock aims to provide a more open-source, community-driven alternative with better cross-platform compatibility. The move was spurred by claims that Flutter’s team is understaffed and that Google has shifted focus to other priorities, particularly AI. ... ## What are the disadvantages of Flutter for cross-platform development? Now, let’s be more specific. If Flutter is supposed to be the ultimate cross-platform solution, why do some developers still hesitate to use it? While it offers many advantages, key limitations can make cross-platform development with Flutter more challenging than expected. … ### Bloated app size across all platforms One major trade-off with Flutter’s cross-platform engine is large app sizes. Because Flutter bundles its own rendering engine and framework, every app carries extra overhead. This affects all platforms — on mobile, it slows downloads and takes up more storage. On the web, it increases initial load times, impacting user experience. On desktop, it leads to bulkier applications compared to native counterparts. ### Plugin gaps & platform-specific limitations Flutter’s ecosystem has improved, but it still lags behind native development when it comes to plugins and third-party libraries. Many Flutter plugins are either incomplete or lack the same functionality as their native counterparts. For example, if your app requires advanced video editing, deep AR/VR features, or robust accessibility tools, you may find that Flutter’s plugin ecosystem isn’t quite there yet. In contrast, frameworks like React Native benefit from a larger community and more mature third-party support. ### Web & desktop support: not production-ready for all use cases Flutter is marketed as a full-fledged multi-platform solution, but its web and desktop versions still feel like a work in progress. On the web, Flutter apps can feel sluggish compared to frameworks like React, Vue, or even native web technologies. The way Flutter renders UI (using a canvas-based approach instead of the DOM) can lead to issues with SEO, accessibility, and performance. On desktop, Flutter apps don’t always feel truly “native.” While performance has improved, system integrations—like file system access, native menus, or drag-and-drop support—often require extra work. If you’re building a desktop-first application, Flutter still isn’t as mature as technologies like Electron, Tauri, or traditional native development. ### Limited adoption for enterprise & large-scale apps While Flutter is popular for startups and mobile apps, it hasn’t seen the same level of adoption in large-scale enterprise applications. Many big companies prefer React Native (because of its integration with existing web stacks) or Kotlin Multiplatform (for seamless Android-native compatibility). One reason is that Flutter introduces an entirely new language (Dart), which isn’t as widely used as JavaScript (React Native) or Kotlin (KMP). For large teams with existing native developers, shifting to Flutter can feel like an unnecessary learning curve, especially when the long-term viability of the framework is still a question mark. ### Google’s long-term commitment: a risk for cross-platform teams For a cross-platform framework to be worth investing in, it needs stability and long-term support. This is where Flutter raises concerns. As we mentioned above, Google has a history of pulling the plug on projects once they no longer serve a strategic purpose. While Flutter is still actively developed, some developers worry that Google’s focus is shifting, especially with more attention being placed on the web and desktop. If Google were to deprioritize Flutter in the future, cross-platform teams relying on it could face major migration challenges. So, before jumping in, ask yourself: Are you really saving development time with Flutter, or will platform-specific workarounds cancel out the benefits? That’s the real challenge of cross-platform development.
blog.stackademic.com
Flutter Pros and Cons Before Beginning App Development in 2024/2025## 1. Large App Sizes One major downside to Flutter is that its apps tend to be larger in size compared to natively developed apps. This is due to the additional engine that Flutter uses to render UI components. **Storage Concerns**: If you’re developing apps for markets where storage is limited (e.g., developing for older devices), the large app size could be a disadvantage. **Impact on Performance**: Larger app sizes can slow down app download times and take up more device storage, which can affect user experience. ## 2. Limited Native Features Access While Flutter provides many plugins for integrating native functionality, certain platform-specific features may require native code. This can make development a bit more complex for apps that need deep native integration. **Workarounds Required**: Developers may have to write additional platform-specific code to access certain hardware features or native APIs. **Learning Curve**: You might need knowledge of platform-specific languages like Java, Swift, or Objective-C to bridge the gap between Flutter and native platforms. ## 3. Smaller Developer Pool Despite its growing popularity, Flutter has a smaller developer community compared to more established frameworks like React Native or native development. This can make hiring experienced Flutter developers slightly more challenging. **Finding Talent**: If you’re building a team, you may need to invest in training for Flutter or deal with a limited talent pool in the market. ## 4. No 100% Native Experience While Flutter delivers close-to-native performance, it is not a native framework. If your project requires a completely native feel or uses intricate platform-specific features, you might still find that native development is more suitable. **Advanced Customization**: For some advanced use cases, native development will still be the better option to achieve maximum performance or access specialized APIs.