Swift

369 readers
3 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 2 years ago
MODERATORS
51
 
 

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:

52
53
 
 

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....

54
 
 

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!

55
56
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.

57
 
 

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.

58
5
iOS Dev Weekly - Issue 616 (iosdevweekly.com)
submitted 1 year ago by balder1993 to c/swift
59
60
61
4
iOS 17: Notable UIKit Additions (www.swiftjectivec.com)
submitted 2 years ago by balder1993 to c/swift
62
63
64
3
submitted 2 years ago by balder1993 to c/swift
65
3
submitted 2 years ago* (last edited 2 years ago) by Mustafaalbazy to c/swift
 
 

I have used a few SSG framework such as Next and Hugo, and my personal blog is built by Hugo which is based on GO programming language.

IME i've noticed the majority of SSG are based on Javascript and Typescript for some reason.

Never thought of Swift as an SSG, but it sounds interesting for me to play with and built a blog or something, and maybe even migrate my current blog to a swift-based SSG if they are as good as, say, Hugo.

Do you guys have any experience with Swift-SSG?

Edit: typos

66
67
68
69
 
 

Hi all,

Lets use this post to make a list of all free online courses and books that teach Swift programming.

Please post using the following template, to make easy for us to follow.

  • Title:
  • Author:
  • Description:
  • Link: