Masthash

#Swift

Jay :verified_gay:
7 hours ago

TIL: RelativeDateTimeFormatter() exists in #swift 🤯

Ben Cohen
8 hours ago

Finally today you can learn about the #Swift OpenAPI Generator and how it can help wrangle HTTP APIs between apps and servers.

https://developer.apple.com/wwdc23/10171

Pedro Piñera
11 hours ago

For anyone running into issues deploying Vapor app using Fly from an M1 laptop. Here are some tips:

- Don't use remote builders because you'll hit memory limits. You can pass --local-only for that.
- Configure Docker to use Rosetta or deploy from a CI environment.

You can read more about it here
https://pepicrft.me/blog/2023/06/09/vapor-follow-up

#swift #vapor

Pedro Piñera
11 hours ago

We are migrating @tuist cloud to Swift using Vapor and I'm very excited about it because it means we can contribute new ideas to Swift on the server #swift

Peter Cammeraat
11 hours ago

Finally I do not have to write boring api layers anymore. Just generate them with Swift OpenAPI Generator.

https://developer.apple.com/wwdc23/10171

#WWDC #WWDC23 #OpenAPI #Swift

iOS Dev Weekly
12 hours ago

iOS Dev Weekly, Issue 613 is out. Happy Friday, everyone, and I hope you had an amazing WWDC week! 🚀
https://iosdevweekly.com/issues/613#start

#Swift #SwiftLang #iOSDev #MacDev

John Bokma
13 hours ago

Builder pattern in Rust, Sendables, and Tests aren’t enough

#rust #swift #python #book #CrimeFiction

👉 Please retweet if you ❤ Plurrrr. Thanks! 👍

https://plurrrr.com/archive/2021/10/20.html

Fabian Fett
13 hours ago

#WWDC: So cool to see my #Swift on server colleague, Si Beaumont, give an intro into the awesome Swift OpenAPI Generator:
https://developer.apple.com/wwdc23/10171

Jaanus Kase
14 hours ago

#WWDC #WWDC23 #Swift #Observed

I’m looking at all the new Observed stuff and asking myself, can I use it for communication between model objects?

Previously, if I had a class with some Published properties, I could just subscribe to those with Combine subscription, delay and debounce them, do all fancy stuff…

How would I do this in the new Observed world without Combine?

Maybe the answer is in some talk or docs, I didn’t watch everything yet.

Dan
17 hours ago

I'm writing a Mac firmware download tool via #Swift and #SwiftUI for #macOS
https://github.com/stoiandan/MacReviver

pj4533
18 hours ago

Probably showing my age, but I heard Swift Macros, and just started to twitch. I’m sure it enables a bunch of amazing new stuff, and I look forward to learning more, but the flashbacks to hidden functionality causing endless bugs is reeeeeal. #wwdc #swift

L’Alta Corte Britannica due giorni fa ha respinto l’appello di Julian Assange contro l’ordine di estradizione firmato dall’allora ministro dell’interno inglese Priti Patel.

@giornalismo

Una sentenza di tre pagine del giudice #Swift che prosegue la persecuzione contro Julian #Assange.

Da un tweet di Stella Assange apprendiamo che martedì prossimo verrà presentato un nuovo ricorso affinché il caso venga giudicato da altri due giudici.
#FreeAssange
#Dropthecharges
#Journalismisnotacrime

👉link all’articolo di Reporters without borders

👉 link al tweet di Stella Moris Assange

Mark Wyner :vm:
1 day ago

I’m currently learning Swift using @twostraws’s 100 Days of Swift. Today I wrote a while loop that coders who grew up in the 80s may appreciate. (Hint for those of you who aren’t developers: my code won’t let Sammy drive 55.)

#Swift #SwiftUI #Development #Code #100DaysOfSwift #SammyHagar #Music #Rock #IAmANerdFullStop

Screenshot of Swift code: var sammyHagarSpeed = 50; while sammyHagarSpeed != 55 { print(“I am driving \(sammyHagarSpeed)”) sammyHagarSpeed += 1 }; print(“I can’t drive 55!”)
Beno
1 day ago

Playing around with the new Observable macro in Swift. Apple seems to forget it tell you need to import the new Observables framework in pretty much all the videos about it.

#swift #swiftobservables #wwdc23 #apple #swiftdev

UPDATE: I found it: https://developer.apple.com/design/human-interface-guidelines/activity-views

——

iOS devs, please help: I want to add an action to every other app’s share menu. I see see what seems like other apps doing the same in my share menu (e.g. “Copy to Goodreader” or "Print to HP Printer”). I'd like for a user to be able to share a photo using my action. But I can't figure out what to search for in the Apple docs to get me the relevant dev documentation. #iOS #Apple #Xcode #Swift #SwiftUI

Medium article 1:
You don't have to always use [weak self].

Medium article 2:
You always have to use [weak self] otherwise kittens will die.

Apple: 😶

#swift #Xcode

George Yang
1 day ago

Watched the Write Swift macros session, it's gonna take some time and practice to be comfortable with creating macros, but also need to be careful not to overuse it. The goal is to make codebase easier to read, not cryptic. #WWDC23 #swift #iOSDev

George Yang
1 day ago

Is Swift macro template not shipped in the first Xcode 15 beta? #iOSDev #swift #WWDC23

jbz :catjam:
1 day ago

#Mojo essentially uses the #ObjectiveC approach of jamming the two languages into one. Except it doesn't repeat Objective-C's mistake of using the component language as the base (which, inexplicably, #Swift didn't just repeat, but actually doubled down on by largely deprecating objects). The reason this is a mistake is that it turns out that the connection language is actually the more general one, the component language is a specialisation of the component language⎭
https://blog.metaobject.com/2023/06/mojo-is-much-better-without-c-than.html

Ben Cohen
1 day ago

And some bonus #swift content: the “Build robust and resumable file transfers” talk includes a section on building the server side of resumable uploads using SwiftNIO, complete with sample code.

https://developer.apple.com/videos/play/wwdc2023/10006/

Otto Schmilinsky
1 day ago

Los 3 ganadores del #Swift Student Challenge de la WWDC23 - #Apple (ES)
👏🏻 👏🏻 👏🏻
https://www.apple.com/es/newsroom/2023/05/meet-3-winners-of-the-wwdc23-swift-student-challenge/

Fabian Fett
1 day ago

If you want to understand the benefits of using structured concurrency (taskGroups and async let) over unstructured concurrency (spawning new Tasks) in #Swift I highly recommend the #WWDC session: “Beyond the basics of structured concurrency”.

👩‍🍳🧄🥕🥔

https://developer.apple.com/wwdc23/10170

Important Swift server note:
AsyncHTTPClient and PostgresNIO support cancellation today.

Peter Witham
2 days ago

Did I like what Apple has for my iPhone and iPad this year? Listen to the latest Podcast episode to find out, plus so much more with ‪@leogdion#wwdc23 #swift #iPadOS17 #iphone Listen in: https://compileswift.com/podcast

Basel
2 days ago

My App Fancy - AI Art

NOW suppourt +50 languages 🔥🔥🔥

https://apps.apple.com/us/app/fancy-ai-art-generator/id1660399609

#SwiftUI #ai #art #ios #ios #Swift

Sven A. Schmidt
2 days ago

@simonbs We’ve fast tracked adding #Swift 5.9 support to @SwiftPackageIndex so people can add their macro packages and to enable the `product:macro` search filter so users can find them! 🚀

Ben Cohen
2 days ago

This morning, up your #swift concurrency game with Beyond the basics of structured concurrency

https://developer.apple.com/wwdc23/10170

Fabian Fett
2 days ago

It's so cool to see how the new #Swift Parameter Packs will allow us to get rid of our decode() overloads in PostgresNIO.

https://github.com/vapor/postgres-nio/pull/341

Roman
2 days ago

- Day 36
In #Swift some functions might expect closures (functions) as arguments. You can call a function inside the closure or, if the arguments that are passed to the closures match with arguments a certain function awaits, you can just pass it’s name and get away with it

Using following syntax: foo(bar: baz) where foo is a function that takes a closure as a bar parameter and baz is a function wie identical signature as bar
Cécile Muller
2 days ago

The new noncopyable struct introduced by #Swift 5.9 seems interesting, I added a few examples: https://gist.github.com/cecilemuller/9282da43ecfbd07ce5a90d37f5726d18

Jaanus Kase
2 days ago

#WWDC23 #CloudKit #Concurrency #Sendable #Swift #Canopy

In this year’s platform release, many CloudKit types, most importantly CKRecord, are now Sendable 🎉

Nice to see in the docs, and confirmed in an Ask Apple session.

I built Canopy with Xcode 15 and was wondering where all the actor boundary crossing warnings had gone.

I still got work to make Canopy completely warning-free, but this is great.

Jerry Gonzalez :ivory_boost:
2 days ago

#Swift Playgrounds is actually really fun! Coming from #Powershell swift is pretty easy so far.

George Yang
2 days ago

Really love the new Swift Observation, making SwiftUI state management much easier to reason with. And again, this is made possible by harnessing the magic of Swift macro. #WWDC23 #swift #iOSDev

A flow chart on determining what Swift property wrapper to use in your SwiftUI views
Majid Jabrayilov
2 days ago

Do you use actors? #swift

Joseph Duffy
2 days ago

Now that it's much easier to debug the implementation I've started to update my Renamed #swift #macro to use the types provided by SwiftSyntax when generating its output. It's a lot more clunky, but heavily reduces the reliance on strings that contains bits of Swift code and maybe it's faster?

Lots more to explore, and it's all exciting!

Here's how I did this for creating typealiases: https://github.com/JosephDuffy/Renamed/commit/51b9dc25a4b7f3b81df65aa1f5184f434c587955

Mark Gardner ‍:sdf:
2 days ago

@jamesdempsey #Swift's upcoming and experimental feature flags look pretty similar to #Perl's `feature` and `experimental` pragmas:
https://perldoc.perl.org/feature (introduced in 2007 with Perl 5.10: https://perldoc.perl.org/perl5100delta#The-feature-pragma)
https://perldoc.perl.org/experimental (released to #CPAN by @leont in 2013, added to core in 2014 with Perl 5.20: https://perldoc.perl.org/perl5200delta#New-Modules-and-Pragmata)

OK so for those of you who are like me from the past and don’t listen to conferences, tech talks ETC but are actually interested in #programming I want to show you one feature of #Swift and/or #SwiftUI which actually blew my mind because of its simplicity. Before the #iOS 17 era you would do something like
```
class User: ObservableObject {
@Published var firstName = "Nuno"
@Published var lastName = "Mao"
}
//…

struct ContentView: View {
@StateObject var user = User()
var body: some View {
Text("I am \(user.firstName) \(user.lastName)")
}
}
```
Then, in subsequent views you could pass this class around by using `@ObservedObject` property wrapper so that all views could stay in sync and point to the same data. However now they made it to work like that:
```
@Observable
class User {
var firstName = "Nuno"
var lastName = "Mao"
private var eMailAddress = "nuno69a@gmail.com"
}

struct ContentView: View {
var user = User()
var body: some View {
Text("I am \(user.firstName) \(user.lastName)")
}
}
```
This code brings some interesting implications with it, the least of it being that we no longer need to mark our properties with the `@Published` property wrapper. Basically all publicly exposed properties are marked as `@Published` automatically without our further intervention. `private` properties stay untouched, like in the example above.
The problem starts when we want to make our data actually changable like so
```
TextField("Name", text: $user.firstName)
TextField("Last name", text: $user.lastName)
```
Funnily enough, it won’t actually work because “Cannot find '$user' in scope”. Or, maybe? They made it actually very clever, to minimize overhead of code generated at compile they they once again force us to use a property wrapper. One small change and our properties can be bound to stuff
```

struct ContentView: View {
@Bindable var user = User()

```
That’s all, stufff will now work as expected.
#programming #apple #iOS #macOS #WWDC

Jobs for Developers
2 days ago
Marc
2 days ago

Perfectly in line with #WWDC, I have a four day weekend because of Corpus Christi, which means I have a lot of time to try out the new stuff. Especially lookig forwards to the new #MapKit options and the #SwiftUI observation changes 🔥
#wwdc23 #swift

iOS Dev Weekly
2 days ago
Ben Cohen
3 days ago

Today @zoecarver gets into the details of how to go between #Swift and C++ https://developer.apple.com/wwdc23/10172

Harr, harr, harr... I just discovered that I've been kinda Sherlocked by Apple. 😃

https://gist.github.com/phranck/3ba8577be40cc61dbe02970519f89083

#wwdc #wwdc23 #wwdc2023 #Swift #SwiftUI

// @swiftui @swift

Apple’s new interaction viewmodifier: .onKeyPress()
My own interaction viewmodifier: .onKeyPress()
James Brown
3 days ago

Cool, #Swift has variadic generics now. I wonder if any of that work is applicable to #Rust; I haven’t really seen any public work on Rust variadic generics for like 2 years.

https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md

Mario Guzman 🏳️‍🌈
3 days ago

It’s beta season which means Anika is here to help me write up some Feedback and Bug reports!

#WWDC #WWDC23 #AppKit #UIKit #Swift #SwiftUI

Natalia Panferova
3 days ago

Lots of new features in Swift 5.9 that comes with Xcode 15! One of them introduces the use of if/else statements as expressions, simplifying value returns and variable assignments.

I wrote a short post about it: https://nilcoalescing.com/blog/IfElseExpressionsInSwift/

#WWDC23 #Swift #iOSDev

Christian Tietze
4 days ago

Anyone else still mad at #Swift's `index(_:offsetBy:limitedBy:)` being so cumbersome to use with endIndex? 🤚

Marcin Krzyzanowski
4 days ago

SwiftData Best Practice 👇 for large projects and scalable architecture #iosdev #swift

Cihat Gündüz
4 days ago

#Xcode 15 tidbit:
Images & Colors in Asset Catalogs can now be safely referenced with auto-completion support in your #Swift code! 😍

Basically, Apple sherlocked SwiftGen and made a related update I was planning for @RemafoX_App unnecessary. 👍

#WWDC23

Natalia Panferova
4 days ago

In Xcode 15 we can access colors and images stored in asset catalog via autogenerated static properties, for example Color(.myGreen) or even Color.myGreen 🤩 No more string literals 🎉 #WWDC23

And this works for older deployment targets too, not just iOS 17!

There is more information about this new feature in my post: https://nilcoalescing.com/blog/Xcode15Assets

#SwiftUI #iOSDev #Xcode #Swift

Oh well, my other favourite #Swift says "...the haters gonna hate, hate, hate, hate, hate..." so just shake it off and press ⌘+R 🔥
Sungbin Jo
4 days ago

Wow TIL there’s a page on all updates introduced on #WWDC: https://developer.apple.com/documentation/Updates/wwdc2023

I’ve yet to see the SotU (I watched the Keynote in 4AM and collapsed), but some #Swift frameworks catch my eye:

- SwiftData for a CoreData equivalent
- Observation for a KVO equivalent
- XPC now has a native Swift quivalent
- … and AppKit for Sonoma now has Swift code inside

… seems like Swift is preparing to taking over the traditional ObjC parts in the #Apple world.

Thorsten Stark
4 days ago

Wohoo! Finally pie charts in Swift! #wwdc23 #swift #swiftui

Swift Code 

Chart {
            Plot {
                SectorMark(angle: .value("Foo", 25), angularInset: 2)
                    .foregroundStyle(.green)
                SectorMark(angle: .value("Bar", 35), innerRadius: 80, outerRadius: 140, angularInset: 2)
            }

        }
Screenshot of resulting pie chart
Sven A. Schmidt
4 days ago

@inthehands @holly You all demonstrate that a programming language is more than the technical bits and it’s a delight to observe your success.

At lot of the things you and the #Swift team do I can’t truly judge because it’s way over my head. But we can see •how• you do it and that’s exemplary.

Ben Cohen
4 days ago

Documentation for #Swift 5.9's C++ Interoperability feature is now available on swift.org

https://www.swift.org/documentation/cxx-interop/

Ben Cohen
4 days ago

Then learn all about the new #swift macros feature from @beccadax in Expand on Swift macros

https://developer.apple.com/wwdc23/10167

Ben Cohen
4 days ago

Loads of great #swift content for you this week, starting with @dgregor79 and me taking you through the latest improvements in What’s new in Swift

https://developer.apple.com/wwdc23/10164

catsynth / amanda c
4 days ago

#Swift macros! About time 😺 #WWDC

Christian Alder 🌱
4 days ago

I've been wanting to try my hand at iOS development for a while (In the hobbyist or freelancer scope, not with the intent being a full career path). Today during #WWDC23 I've decided to give it an honest try.

Not too sure what resources to use, I found 100 Days of Swift which seems good https://www.hackingwithswift.com/100/swiftui, and was thinking to pair that with whatever I can find from #Apple themselves, be it a course or documentation. 🤞📚👨🏼‍💻

#iOS #Swift #SwiftDev

Jonathan
5 days ago

Snippets Studio 2.0 is finally released for macOS just in time for #WWDC! Great timing too, since many of you may want to save some snippets of code from this fantastic event-filled week! 😁

🚀 Boosts very appreciated. If this post gets hidden by all the #wwdc23 hype I may post again later this week, as a reminder to try it out, in case it was missed.

#swiftui #swift #indiedev

Ben Cohen
5 days ago

OK trying out a real me avatar for this conference thingy. I’ll be at Apple Park today along with a bunch of other folks from the #swift team. Come say hi if you’re there.

Otávio :prami:
5 days ago

📷 👨‍💻 I’m ready from #WWDC! This photo is from 2014, the year #Apple introduced #Swift to the World! https://otavio.photos/2014/06/01/wwdc.html

Kuba Suder
5 days ago

In case this is useful to someone, I have a repo with #SwiftUI generated interfaces that I've been updating semi-regularly since #Xcode 11, so I can see the diffs between different versions (there are separate branches for macOS and watchOS): https://github.com/mackuba/swiftui-headers #Swift #iOSDev #MacDev

Gian Frangiamore
6 days ago

If anyone knows of any companies that are looking for an iOS developer please let me know!

I was recently made redundant and can start pretty much asap. I’m based in the UK but also happy to work remote.

#iOSDev #SwiftUI #Swift

Roman
6 days ago

- Day 32
Ever wanted to let a variable be read from outside but only changed inside the class in #Swift? `public private(set)` will do exactly that, making it public to read but private to write. Works with all access control keywords: public, private, internal

public private(set)
Eric Vitiello
6 days ago

I was gonna write some code on my #Swift #HPGL #GenerativeArt project, but I can’t decide which way to go with it and I lost all momentum in my brain.

Back to playing #NoMansSky

Any of you know #swift well enough to explain this playground? A former coworker sent it to me without an answer. #Xcode

Swift code showing different final results for similar code
Roman
1 week ago

- Day 31
We all know that with #Swift’s modern concurrency we can have async functions but did you know we can also have async variables? Yep, just add an ‘async’ keyword to its getter and don’t forget to call with ‘await’. The same works for throwing – just add `throws`

Using get async syntax to make a variable async
Justin Ferrell
1 week ago

It’s amazing how quickly you can get things working, even seemingly complex things that have to parse RSS and open webviews, using #Swift Playgrounds on the iPad. You could even, hypothetically, start a #lemmy client built with #SwiftUI

A photo of an iPad Air attached to a keyboard with Swift Playgrounds open. The code is showing a very basic list and toolbar but the preview shows an app browsing a Lemmy instance with sorting options.
James Vanas
1 week ago

First Look!

Pre-Alpha / Name TBC / Engine mostly written in Swift + Metal

#screenshotsaturday #Apple #MacGaming #IndieGame #Swift

Driving 2 fast and 2 furious in a car game running on a MacBook Air
Justin Ferrell
1 week ago

Sean Allen has all of his #Swift and #SwiftUI courses 30% off for #WWDC https://seanallen.teachable.com/p/home

Well, @swift and @swiftui developers: Do you know more of these fu**** cool websites? 😎

We should collect them all.

* https://fuckingswiftui.com
* https://fuckingclosuresyntax.com
* https://fuckingifcaseletsyntax.com

#Swift #SwiftUI

apmeyer
1 week ago

I've purchased a few #SwiftUI courses in recent years, without first reviewing Apple's own tutorials. They're pretty solid. No doubt the other courses warmed me up to the #Swift syntax and #Xcode. But it seems like Apple is providing some great resources for learning.

Dan Hart
1 week ago

Apple's WWDC Keynote is on Monday!

If you're in the Greater Saint Louis Area stop by LaunchCode's Mentor center for a watch event. Register now at https://www.eventbrite.com/e/wwdc-watch-event-tickets-638130323977

Boost for visibility!

#Apple #WWDC #LaunchCode #STL #stlouis #saintlouis #tech #swift

Moritz Lang
1 week ago

Can’t believe it’s been three years already since we kicked off Distributed Tracing in Swift, and today it finally reached 1.0.0 🎉

https://github.com/apple/swift-distributed-tracing/releases/tag/1.0.0

#observability #instrumentation #swift