[HN Gopher] Develop in Swift Tutorials
___________________________________________________________________
Develop in Swift Tutorials
Author : Austin_Conlon
Score : 49 points
Date : 2024-04-04 19:21 UTC (3 hours ago)
(HTM) web link (developer.apple.com)
(TXT) w3m dump (developer.apple.com)
| yohannparis wrote:
| Thank you, I always wanted to learn to develop for apple OSes.
| This one sounds like a sure source of truth.
|
| I heard of 100 Days of Swift[1] as well. Do people have feedback
| on the matter?
|
| [1] https://www.hackingwithswift.com/100/swiftui/1
| glhaynes wrote:
| Yes, 100 Days of Swift (and, really, anything by Paul Hudson
| (@twostraws)) is really good and recommended all over the
| place.
|
| One more resource I'd add for a beginner, the book _The Swift
| Programming Language_ : https://docs.swift.org/swift-
| book/documentation/the-swift-pr...
| wahnfrieden wrote:
| I also recommend asking GPT-4-Turbo for SwiftUI guidance.
| simonbarker87 wrote:
| All of Paul Hudson's stuff is great.
| _factor wrote:
| Thank you, but no thank you. I don't need to promote a
| proprietary ecosystem charging yearly fees with my addition.
|
| PWAs or nothing.
| wiseowise wrote:
| They hated Jesus because he told them the truth.
| frizlab wrote:
| I wonder who Jesus is in this scenario.
| niek_pas wrote:
| I feel like I haven't seen PWA's in a while. Are there any you
| recommend as feeling like native apps?
| wahnfrieden wrote:
| No
| mdhb wrote:
| VSCode.dev
| _factor wrote:
| That depends. You'll start encountering dark patterns when
| the address bar and underlying Safari browser appears and
| ruins the experience.
|
| PWAs are the alternative App Store we need, not a just a
| bandaid.
| cassepipe wrote:
| Anyone developping in Swift on Linux ? How much of an uphill
| battle is it ?
| georgelyon wrote:
| I have in several capacities over the past few years.
|
| VSCode works pretty well with the sswg extension (powered by
| sourcekit-lsp). Devcontainers are particularly nice if you are
| into that sort of thing (I develop in a Linux container on a
| macOS host). I actually find it easier to experiment with new
| toolchains (for example, the nightlies) in the Linux container
| than on my host machine (which requires more manual setup).
| ngcc_hk wrote:
| Wonder which linux container - docker, Lima, vm ...
| frizlab wrote:
| I'm developing a full backend using Vapor. Fluent (Vapor's ORM)
| is a bit raw but that's being worked on, otherwise it's very
| pleasant. Vapor's community (on Discord) is great!
|
| I compile in a Docker, and deploy the resulting image (multi-
| step docker file, first step for compilation, second step copy
| the resulting binaries).
|
| Installing Swift on Linux is a one-liner now if you want to
| avoid Docker https://swift-server.github.io/swiftly/. EDIT:
| Two-liners actually: first install swiftly then install
| Swift...
| dlachausse wrote:
| It's in Fedora's repos.
|
| "sudo dnf install swiftlang" is all it takes to get started.
|
| https://developer.fedoraproject.org/tech/languages/swift/swi...
| mdhb wrote:
| Picking up Swift in 2024 seems like a bit of a sucker move if I'm
| honest.
|
| A language that only runs on a tiny fraction of hardware, has
| crappy documentation, has poor interoperability, a questionable
| developer toolchain that only runs on one platform and then to
| top it off anything you want to release with it basically has to
| go through an extortion racket where the worlds richest company
| is going to take 30% of your revenue and has the ability to shut
| you down at any point, for any reason and provides no meaningful
| recourse.
|
| Honestly it's a terrible choice.
| simonbarker87 wrote:
| Swift the language is open source and runs on pretty much
| anything.
|
| Also it's quite a nice language to work with and developing
| native iOS apps is an enjoyable hobby.
|
| I wouldn't want to tie my pay cheque to it though for sure.
| frizlab wrote:
| Swift runs on microcontrollers now; you gotta update your
| knowledge. https://www.swift.org/blog/embedded-swift-examples/
| Kon-Peki wrote:
| Basically, anything that comes from a swift.org link is
| cross-platform and will run perfectly well just about
| anywhere.
|
| If you've got something coming from developer.apple.com it
| will be specific to the Apple ecosystem. And of course this
| learning resource is Apple-specific since it is coming from
| developer.apple.com.
| gdubs wrote:
| I've built my career on Apple platforms and honestly this is
| basically what people have said about it since the beginning.
|
| I'll offer a counter and say that if you like the Apple
| ecosystem, there's never been a better time to get started.
| SwiftUI is an amazingly great way to build apps - and again,
| I've been doing this for a very long time so I'm speaking from
| experience here.
|
| For smaller developers, the revenue share can be as low as 15%.
|
| Also, for anyone weighing the decision keep in mind that while
| iOS may not represent the largest marketshare in the world,
| their users are well known to spend more money on the platform
| compared to other platforms.
| _factor wrote:
| "As low as 15%"
|
| Great! That's so much cheaper than the 0% you can get on
| other platforms.
|
| This used to be acceptable when Apple was innovating and
| providing extra value, today it doesn't fly.
| dlachausse wrote:
| What other platforms provide what Apple provides at 0%?
|
| As a hobbyist I love having international commerce largely
| papered over and abstracted away. There's no need to worry
| about exchange rates, taxes, hosting, or bandwidth. This is
| well worth the 15% to me.
| mistersquid wrote:
| > I've built my career on Apple platforms and honestly this
| is basically what people have said about it since the
| beginning.
|
| Do you have recommendations for learning Objective-C for a
| front-end web developer?
|
| I'm starting with "Objective-C Programming: The Big Nerd
| Ranch Guide" but would appreciate resources recommended by
| someone who's built a "career on Apple platforms".
|
| My apologies for so open-ended a question.
| dlachausse wrote:
| Is there a reason you want to learn Objective-C instead of
| Swift?
|
| My advice would be to swim with the current and choose
| Swift and SwiftUI unless you have a good reason not to.
|
| Some of the newer frameworks don't support Objective-C and
| I only see that trend continuing.
| ngcc_hk wrote:
| Is swiftUI is still quite a flux state? And not can be
| done by it?
| dlachausse wrote:
| I haven't had any issues with it or needed to revert to
| UiKit, but I'm still fairly new to developing for the
| Apple ecosystem, so your mileage may vary.
| gdubs wrote:
| Hmm, well - Objective-C holds a place in my heart. It's not
| for everyone, but it's really where I got my start and I
| think it's a beautiful language and had an incredibly
| unique community around it that started with all the NeXT
| folks.
|
| I'd be curious why Objective-C now? Still has its place for
| some things. It's interoperability with C++ for instance,
| especially if you're dealing with things like Metal or
| certain real time audio libraries.
|
| It's also probably a niche in terms of maintaining legacy
| stuff. Like being a Fortran developer and having your pick
| of contracts because nobody remembers it anymore and some
| crucial piece of infra relies on it.
|
| But, Big Nerd Ranch guid is how I learned! And again, by
| doing projects. Just pick something you want to build with
| it and see it through to the end. Like writing, it's best
| to plough through and just get SOMETHING that works end to
| end, knowing that it'll be your first draft and you'll get
| it better on the second Tim around.
|
| Good luck!
| hbn wrote:
| I mean, a tiny amount of overall unique hardware but the iPhone
| alone has been and continues to be the best selling computer of
| all time.
|
| And users of their hardware tend to be the most dedicated to
| the platform and willing to pay for software. And they have
| more money than the overall average "computer user".
|
| Nothing to brush off.
| abalone wrote:
| Are you suggesting iOS developers should use another language
| (Flutter? Objective-C?), or that it's a sucker move to become
| an iOS developer?
| runjake wrote:
| I think they did a pretty good job of explaining that they
| meant the latter.
| robbyiq999 wrote:
| How effective would it be to shove all of the swift/swiftui/OS-
| dev docs into vector store and RAG it with a LLM?
| bsaul wrote:
| I think swift 6 will be the version where this language finally
| exists, or will remain a niche for always, until it get replaced
| by another (hopefully open, hopefully truely cross-platform)
| tech.
|
| Apple was a great place to start the language but its now
| completely really detrimental to it, largely due to its impact on
| the ecosystem (objc compatibility, xcode, focus on iOS only,
| etc).
|
| I believe swift core team should now reorganize around a
| community of people working in various major companies, not just
| apple.
| gdubs wrote:
| I built my first iOS app in 2010. Today, it's fantastically
| easier to get started. A night and day comparison. My biggest
| piece of advice: pick something you're interested in, build it,
| see how it comes out, and then do it again. You'll learn way more
| with a project you're interested in to motivate you.
| ChrisMarshallNY wrote:
| The only issue that I've had with SwiftUI -and it's a
| showstopper- is that SwiftUI makes writing fairly basic apps
| insanely easy, but _really_ has problems, when I try to veer
| off the beaten path (which describes pretty much every single
| one of my projects).
|
| Apple has always enabled staying in their desired UI and
| workflow, but I've usually been able to find a way to coerce
| the system to do what I need.
|
| That appears to not be the case, with SwiftUI. You need to
| follow The Rules. Workarounds are crazy complex.
|
| But I _love_ working in Swift. It 's just that I ship [
| _UI|App|Watch_ ]Kit.
| gdubs wrote:
| You'll definitely have a much more pleasant time following
| conventions - which arguably provides the best user
| experience. But for those times when you just really have to
| have something non-conventional, I've found that the
| UIViewRepresentable fallback works well. Just easier in those
| circumstances to not try and mix the two approaches, but
| separate them.
|
| Example in a recent app was it was easier for me to use a
| UIScrollView for the image panning and zooming functionality
| it offers. Simple matter of wrapping that one element in the
| Representable.
|
| Generally, for me it's been a ginormous productivity booster.
| I can rip apart and re-design a SwiftUI app and it doesn't
| break. That was always a lot more of a challenge with pre-
| SwiftUI apps.
| abalone wrote:
| One of my more unpopular opinions is that Swift would've made a
| good successor to Java for server development. Syntactically I
| feel it is in that smalltalk-inspired vein and feels like a
| pretty elegant balance of simplicity and robustness (strong
| typing, concurrency friendly primitives etc etc). And the
| reference counting based memory management is really interesting
| for servers where consistent latency is desirable. I know there's
| a working group on it and a small community, but it never seemed
| to take off and get the kind of Linux optimization needed for
| high performance. Am I wrong?
| synergy20 wrote:
| I'm working on some porting-apple-code-to-Linux and it's quite a
| pain, many info is proprietary so google/chatgpt won't help you,
| neither does apple, there is no tech support, posts to its
| community forum has been zero responses for the last year.
|
| While I understand many love development with Apple, I decided
| never to touch anything to do with it. Linux, even Microsoft, are
| much easier to get things done and not locked up to a closed
| ecosystem.
| AJRF wrote:
| I will echo what others have said here - Apple have failed on the
| original goals of Swift.
|
| - It is no longer simple, Swift 4 onwards have been piling the
| complexity higher than I previously thought possible. I would
| never recommend it as a language to teach. I would have with
| Swift 3, but 4 to now - absolutely not - too complex.
|
| - It was never open, but the language features dropped on the
| community to support SwiftUI cemented the fact that outside
| contributors are not treated with any respect. Worth reading -
| this is from the guy who created the language!
| https://mjtsai.com/blog/2022/02/22/why-latter-left-the-swift...
|
| - Swift on the server is dead. Swift on other platforms has
| dreadfully poor support. It would and should be rejected for
| anything outside of iOS apps.
|
| Kotlin or Rust are much much better choices that live in the same
| space that Swift projects would be considered for.
___________________________________________________________________
(page generated 2024-04-04 23:01 UTC)