Swift

365 readers
2 users here now

This group focus on the content related to the development of Apple Eco-system software. So feel free to share and talk about, for example;

founded 1 year ago
MODERATORS
26
8
submitted 5 months ago by balder1993 to c/swift
 
 

“The Swift compiler is notoriously slow due to how types are inferred. Every June I hope that Apple will announce that they fixed it; sadly this is not that year.”

27
10
What's new in Swift 6.0? (www.hackingwithswift.com)
submitted 5 months ago by [email protected] to c/swift
28
6
submitted 5 months ago by [email protected] to c/swift
 
 

Hey all! I've been writing up a series on the changes coming to Swift 6 related to concurrency. Thought I'd start sharing them here too.

29
30
2
submitted 8 months ago by mac to c/swift
31
11
submitted 8 months ago by mac to c/swift
32
33
34
 
 

“Now that iOS 17 is available, let’s analyze its built-in apps to answer a few questions: How many binaries are in iOS 17? Which programming languages are used to develop these apps? How many apps are written with Swift? What is the percentage of apps using SwiftUI versus UIKit?”

35
 
 

cross-posted from: https://programming.dev/post/3558087

Type parameter packs and value parameter packs allow you to write a generic function that accepts an arbitrary number of arguments with distinct types. As a result of SE-393, SE-398, and SE-399, you can use this new feature from Swift 5.9.

36
37
4
SwiftUI Sensory Feedback (useyourloaf.com)
submitted 1 year ago by balder1993 to c/swift
 
 

In iOS 17, Apple added a range of sensory feedback view modifiers to SwiftUI removing the need to rely on UIKit.

38
 
 

#Predicate is a new Macro available since Swift 5.9 and Xcode 15, allowing you to filter or search a data collection. It can be seen as a replacement for the old-fashioned NSPredicate we’re used to from the Objective-C days.

39
3
submitted 1 year ago by balder1993 to c/swift
 
 

An overview of the different types of charts you can make with Swift Charts

40
4
submitted 1 year ago by balder1993 to c/swift
 
 

Get ready to dive deep into the inner workings of the Objective-C language and runtime! Each post delves into a specific aspect of the language and explores the details of its implementation. I hope you’ll find this valuable to demystify the language, tackle tricky bugs, and optimize your code for performance.

41
 
 

Hi,

I thought we could make a list of open source Swift projects that's open to public contribution. Which is one of the most effective ways to really learn programming.

We could follow this template to make it easy for readers:

Title in Bold

Short Description:

Link:

42
43
 
 

We’re excited to announce a new open source package called Swift HTTP Types.

Building upon insights from Swift on server, app developers, and the broader Swift community, Swift HTTP Types is designed to provide a shared set of currency types for client/server HTTP operations in Swift....

44
 
 

So I've got the following code, which seems to work, and I'm wondering if there is a better, cleaner way to approach adding/editing elements in an array.

var category: Category
var idx: Int = -1

switch mode {
case .add:
    category = Category()
case .edit(let _category):
    category = _category
    idx = categoryViewModel.categories.firstIndex(of: _category) ?? idx
}

category.name = categoryName
category.icon = "category-\(categoryIdx)"
category.color = colors[colorIdx]

switch mode {
case .add:
    categoryViewModel.categories.append(category)
case .edit:
    categoryViewModel.categories[idx] = category
}

I understand I'm not checking idx to make sure it's not -1. I'm not concerned about that part right now. It's the overall approach I'm looking for thoughts on.

Thanks!

45
46
3
WWDC 2023: What's New in Core Data (betterprogramming.pub)
submitted 1 year ago by balder1993 to c/swift
 
 

Although at WWDC 2023, Apple will mainly focus on introducing the new data framework SwiftData, Core Data, as the cornerstone of SwiftData, has also been enhanced to some extent.

47
 
 

MainActor is a new attribute introduced in Swift 5.5 as a global actor providing an executor which performs its tasks on the main thread. When building apps, it’s essential to perform UI updating tasks on the main thread, which can sometimes be challenging when using several background threads. Using the @MainActor attribute will help ensure your UI is always updated on the main thread.

48
5
iOS Dev Weekly - Issue 616 (iosdevweekly.com)
submitted 1 year ago by balder1993 to c/swift
49
50
view more: ‹ prev next ›