Înapoi la articole →

Cel mai recent articol

Ultima verificare

Urmăritori 0 urmăritori
Articole: 101
  1. Developers who have worked with Apple’s SwiftUI framework have likely encountered the some keyword in the context of defining custom views, where it’s typically used to enable the generic View protocol to be referenced as a type when declaring a view’s bo…

  2. New in Swift 6.4 (which at the time of writing is in beta as part of Xcode 27) is a warning which is emitted when a nested closure performs a weak capture while the parent closure implicitly captures that object as a strong reference.

  3. In Swift, the @MainActor attribute can be used to associate a given type, function, or value with the global main actor, which essentially makes any such code operate on the enclosing app’s main thread.

  4. As an app’s code base grows and evolves, it can be really tricky to maintain consistency within its UI.

  5. When declaring a Swift property, we use either the let or var keyword depending on whether we want our new property to be read-only once assigned through the enclosing type’s initializer, or whether we want to allow the property to be mutated and re-assig…

  6. Swift’s Codable API — which consists of the Encodable protocol for encoding, and Decodable for decoding — offers a powerful, built-in mechanism for converting native Swift types to and from a serialized format, such as JSON.

  7. SwiftUI’s ViewBuilder type is a key part of the library’s overall API design, in that it’s what enables multiple view expressions to be declared within a given scope (such as a body property implementation, or a closure passed to containers such as HStack…

  8. Swift’s defer keyword allows us to delay the execution of a given block of code until the current scope is exited.

  9. These days, most applications need to work with URLs in some form.

  10. Swift by Sundell is back!

    I never actually decided to stop writing Swift articles.

  11. SwiftUI views versus modifiers

    One of the most interesting aspects of SwiftUI, at least from an architectural perspective, is how it essentially treats views as data.

  12. When building various kinds of scrollable UIs, it’s very common to want to observe the current scroll position (or content offset, as UIScrollView calls it) in order to trigger layout changes, load additional data when needed, or to perform other kinds of…

  13. On this final episode of 2022, Nick Lockwood returns to the show to discuss the overall evolution of Swift and its ecosystem of tools and libraries.

  14. Ben Scheirman returns to the show to discuss how Swift’s built-in concurrency features, such as async/await and tasks, can be used in practice when building apps for Apple’s platforms.

  15. Ever since Swift was first introduced, it’s been very common to need to use type erasure when working with generic protocols — ones that either reference Self within their requirements, or make use of associated types.

  16. Adam Bell returns to the podcast to discuss different techniques and approaches for optimizing UI code, and how to utilize tools like animations in order to build iOS apps that feel fast and responsive.

  17. Donny Wals returns to the show to talk about being an iOS developer freelancer, and to discuss some of the key new APIs, Swift language features, and frameworks that were introduced at WWDC22.

  18. Gui Rambo returns to the show to talk about the role and importance of system design when building apps and open source tools, and how common app architectures and design patterns can be augmented with custom systems.

  19. Sponsored: Essential Developer

    Thanks a lot to Caio and Mike, the two developers behind Essential Developer, for sponsoring Swift by Sundell.

  20. Natalia Panferova joins John to discuss some of the key new features that are coming to SwiftUI and UIKit in iOS 16, and to talk about her experience working on SwiftUI at Apple.

  21. SwiftUI’s various stacks are some of the framework’s most fundamental layout tools, and enable us to define groups of views that are aligned either horizontally, vertically, or stacked in terms of depth.

  22. Ben Cohen, manager of the Swift team at Apple, joins John on this WWDC22 special to discuss Swift 5.7, how generics have been made more powerful and easy to use, and how the language is expected to evolve towards Swift 6.

  23. Combining Swift’s flexible generics system with protocol-oriented programming can often lead to some really powerful implementations, all while minimizing code duplication and enabling us to establish clearly defined levels of abstraction across our code…

  24. Swift 5.7 introduces a new, more concise way to unwrap optional values using if let and guard let statements.

  25. Ever since its original introduction in 2019, SwiftUI has had really strong interoperability with UIKit.

  26. Chris Eidhof returns to the podcast to talk about how SwiftUI has evolved since its initial release, to share several key learnings from using it over the past few years, and to discuss concepts like app architecture and state management.

  27. Today it’s been exactly five years since this website first launched, and what a journey it has been!

  28. Simon Støvring returns to the show to talk about how he built his new text editor Runestone, how to effectively manage an app’s settings, performance tuning, and implementing an app’s core logic as a stand-alone framework.

  29. Type placeholders in Swift

    Swift’s type inference capabilities have been a very core part of the language since the very beginning, and heavily reduces the need for us to manually specify types when declaring variables and properties that have default values.

  30. Sommer Panage returns to the show to discuss Apple’s various accessibility APIs and tools, how to incorporate accessibility support into a team’s overall development workflow, and what it was like being an engineering manager at Apple.

  31. In object-oriented programming, an abstract type provides a base implementation that other types can inherit from in order to gain access to some kind of shared, common functionality.

  32. Sponsor: Judo

    My thanks to Judo for sponsoring Swift by Sundell — both the website and the podcast — during this first quarter of the year.

  33. Basics: Equality

    Checking whether two objects or values are considered equal is definitely one of the most commonly performed operations in all of programming.

  34. On this 2022 season premiere, JP Simard returns to the show to discuss what’s next for Swift in 2022, and what kinds of improvements and new features that might be coming to the language during the year.

  35. A major part of the challenge of architecting UI-focused code bases tends to come down to deciding where to draw the line between the code that needs to interact with the platform’s various UI frameworks, versus code that’s completely within our own app’s…

  36. Combining protocols in Swift

    One of the core strengths of Swift’s protocols is that they enable us to define shared interfaces that multiple types can conform to, which in turn lets us interact with those types in a very uniform way, without necessarily knowing what underlying type t…

  37. Managing an app’s memory is something that tends to be especially tricky to do within the context of asynchronous code, as various objects and values often need to be captured and retained over time in order for our asynchronous calls to be performed and…

  38. Sometimes, we might want to automatically retry an asynchronous operation that failed, for example in order to work around temporary network problems, or to re-establish some form of connection.

  39. SwiftUI offers several different ways for us to create stacks of overlapping views that can be arranged along the Z axis, which in turn enables us to define various kinds of overlays and backgrounds for the views that we build.

  40. Basics: Loops

    Swift offers many different built-in ways to iterate over collections (such as arrays, sets, and dictionaries) — the most basic of which being for loops, which let us run a piece of code for each element that was found within a given collection.

  41. A challenge that many developers face as they maintain various code bases over time is how to neatly connect different frameworks and APIs in a way that properly adheres to the conventions of each technology involved.

  42. In Swift, there are two ways to capture self as a strong reference within an escaping closure.

  43. To wrap up the 2021 season of the show, John revisits some of the key themes and topics that were discussed both on the show itself, and within the Swift community in general, throughout the year.

  44. When building modern applications, it’s incredibly common to want to trigger some form of asynchronous action in response to a UI event.

  45. James Thomson returns to the show to discuss the various technologies that enable us to render custom UIs on Apple’s platforms.

  46. New Discover page: Concurrency

    Explore Swift’s built-in concurrency system, and how to use tools like async/await and actors to write concurrent code in robust and efficient ways. → Check it out

  47. Most often, we want our various asynchronous tasks to start as soon as possible after they’ve been created, but sometimes we might want to add a slight delay to their execution — perhaps in order to give another task time to complete first, or to add some…

  48. Very often, making code easy to unit test tends to go hand-in-hand with improving that code’s separation of concerns, its state management, and its overall architecture.

  49. Tim Condon joins John to discuss how both client and server-side Swift developers could utilize the new built-in concurrency system, as well as how distributed actors and other upcoming language features might continue to make Swift even more capable on t…

  50. When writing asynchronous code using Swift’s new built-in concurrency system, creating a Task gives us access to a new asynchronous context, in which we’re free to call async-marked APIs, and to perform work in the background.