|
Pulcinella posted:https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes
|
# ? Oct 28, 2021 02:34 |
|
|
# ? May 16, 2024 12:26 |
|
Pulcinella posted:Yeah Interface Builder works great if you are just using it to grey box the UI layout (I actually really, really like Interface Builder, merge conflicts aside, and it feels very fast to layout complicated hierarchies to me). IBInspectable and IBdesignable never really worked very well, in my experience, and we generally avoid them. IBDesignable is amazing feels like magic…when it works. The problem is IBdesignable views can potentially take a lot of code work to setup properly, work that is usually specific to functioning in IB and isn’t actually needed for the app to work properly. Also sometimes you do everything perfect and they still break anyway. yep that's about my conclusion as well. Interface Builder is great when there's only one person making changes at a time, but is unworkable beyond that so every large team wants to get rid of them except for fringe features. in my experience IBInspectable was fine, but IBDesignable definitely was not the last time I tried, even with a small project. SwiftUI previews are somehow even worse than I remember with IBDesignable I have to wonder what it's like at Apple, given they're building these tools and are also the largest iOS developer in the world. they must not use them internally for their major apps? Pulcinella posted:https://developer.apple.com/documentation/xcode-release-notes/xcode-13_2-release-notes I'm really excited for this, I hope they do more backwards compatibility in the future. (I realize this is Swift and not a framework feature but still). probably a long shot, but it gets old waiting 2-3 years to use the latest and greatest
|
# ? Oct 28, 2021 16:38 |
|
Does anyone else follow point-free? I've been enjoying their videos and the helpers/tools they develop seem very useful and cool. They're all open source on GitHub. They have probably the best explanatory video and coding presentation style I've seen. They explain issues, the naive solutions (that I find on other sites lol) and their shortcomings. Then they come up with magic to solve them. Their latest is part of an ongoing series on SwiftUI navigation: https://www.pointfree.co/episodes/ep166-swiftui-navigation-links-part-2#t1623 point-free posted:So, this is all looking really promising. We have an incredible amount of power in deep linking and testing in our application. When we first started discussing navigation links earlier in this episode we mentioned that they are the most prototypical form of navigation, but also at the same time the most “complicated.” The catch is a pricy subscription required to watch more than one video: $18 per month. My account has a referral code that gives us both a free month. I could post it in coupons or something? Not sure if referrals also get codes. I was also curious if anyone had opinions on/heard of their Composable Architecture? https://github.com/pointfreeco/swift-composable-architecture https://forums.swift.org/c/related-projects/swift-composable-architecture/
|
# ? Nov 5, 2021 22:49 |
|
commie kong posted:I was also curious if anyone had opinions on/heard of their Composable Architecture?
|
# ? Nov 8, 2021 05:13 |
|
I remember they had a seemingly nice way to handle "dependency injection" that was appealing, but I haven't actually used it. Came across it in the Xcodes.app source.
|
# ? Nov 8, 2021 14:56 |
|
I was looking for a solutions to asynchronous image loading in table views for an interview take home where you can’t use frameworks and came across an apple solution to it. https://developer.apple.com/documentation/uikit/views_and_controls/table_views/asynchronously_loading_images_into_table_and_collection_views I’m entirely confused by the table view code. When did that shift come about? I feel like I need to go back and learn some things. Also good lord is there a lot of stuff you don’t really think about when you’re in an already built app with an established code base and use frameworks. Do y’all keep like an architecture skeleton repo around to help with setting up new apps? I don’t really make apps from scratch often.
|
# ? Nov 8, 2021 16:11 |
|
Looks like diffable data source showed up in 13 and cell content configuration in 14
|
# ? Nov 8, 2021 16:26 |
|
Yep it's pretty recent, possibly only a month old if you maintain "current iOS version minus two" compatibility.KidDynamite posted:Do y’all keep like an architecture skeleton repo around to help with setting up new apps? I don’t really make apps from scratch often. I intentionally don't so that I'm more likely to run into new things. I might decide that I dislike the new things and pull in old stuff, but I'd rather it be a conscious choice than the default.
|
# ? Nov 8, 2021 16:36 |
KidDynamite posted:I was looking for a solutions to asynchronous image loading in table views for an interview take home where you can’t use frameworks and came across an apple solution to it. https://developer.apple.com/documentation/uikit/views_and_controls/table_views/asynchronously_loading_images_into_table_and_collection_views A friend of mine is trying to Learn To Code from absolute scratch, using the iPad-centric Swift Playgrounds stuff. He thinks he's going to be able to write iOS apps. I don't have the slightest clue how to tell him as gently and patiently as possible that between "hello world" in Swift and "writing an iOS app" is about ten years of breakneck dedication and painful trial and error. *I* have no idea how one would start a Swift app from scratch without a framework or a tutorial or a demo app to modify. It's not just taking a basic script and adding bits and bobs to it, it's controllers and delegates and wrestling with Xcode and a mountain of weird poo poo that doesn't even sound like English. (Never mind Obj-C.) I've been coding basically my whole adult life and I can barely get my head around it.
|
|
# ? Nov 8, 2021 17:54 |
|
That's been my experience as well. I'm not "a developer" but I've done hobbyist grade programming for 25 years and it's been a big struggle figuring out xcode and swift. A couple weeks ago I got this itch for an app that I figured was small enough in scope that I could pull it off and getting anywhere has been agony. All documentation assumes you're already familiar with every component of ios development so there's a huge chicken/egg problem. Tutorials or code samples are problematic too because they're always 3+ years old and refuse to compile because of regularly shifting requirements in xcode so there's a big rabbit hole of googling the error and getting sucked into documentation that loops back to my first complaint.
|
# ? Nov 8, 2021 18:04 |
And/or it'll be a youtube video by a 12-year-old kid who just says like "See all you do is you lay out your view classes and assign delegates and link them together like this, and drag a button onto the storyboard and click here and now there's a function linked to it, then click here and here and here and then your app is done, it's so easy" and I'm like how did I get this old
|
|
# ? Nov 8, 2021 19:11 |
|
xzzy posted:Tutorials or code samples are problematic too because they're always 3+ years old and refuse to compile because of regularly shifting requirements in xcode so there's a big rabbit hole of googling the error and getting sucked into documentation that loops back to my first complaint. WWDC videos too, for the same reasons. (I mention it just to make sure you you check them out too. And there are some intro/summary sessions on various topics each year so it's not just a firehose of new stuff.) But yeah it's a slog. Better if you have someone or somewhere to ask for help. This thread is always open, no question too small!
|
# ? Nov 8, 2021 19:27 |
|
Something I didn't realize about WWDC videos is often the first session on a topic contains an introduction and definitions. So if you want to learn about eg. Core Data, you don't want the latest videos. You want the first one from 2016 or whatever because it explains wtf Core Data actually is and the main concepts. The latest videos assume you know everything up to that point which is basically the problem you're describing. Also I completely agree the Apple docs are mostly dog poo poo, I find them useful mainly if I've used the thing before as a refresher. Apple sample projects are a good place to find actual examples.
|
# ? Nov 9, 2021 00:40 |
|
take boat posted:ha, this was with autolayout? was layout slow at runtime with all that? Surprisingly, no. It ran quite nicely. It was just evil to work with. I'm assuming that however the editor worked, the actual compiled result worked differently.
|
# ? Nov 12, 2021 04:02 |
|
It seems that the Swift compiler does not give up after a large number of errors. Unsurprisingly Xcode does not like trying to display 4k errors in one file.
|
# ? Nov 23, 2021 19:41 |
|
only 5 warnings though!
|
# ? Nov 23, 2021 19:59 |
|
too many errors in one file (make fewer)
|
# ? Nov 23, 2021 20:52 |
(I know, I'm just trying to annoy you)
|
|
# ? Nov 24, 2021 05:13 |
|
Data Graham posted:A friend of mine is trying to Learn To Code from absolute scratch, using the iPad-centric Swift Playgrounds stuff. He thinks he's going to be able to write iOS apps. I don't have the slightest clue how to tell him as gently and patiently as possible that between "hello world" in Swift and "writing an iOS app" is about ten years of breakneck dedication and painful trial and error. *I* have no idea how one would start a Swift app from scratch without a framework or a tutorial or a demo app to modify. It's not just taking a basic script and adding bits and bobs to it, it's controllers and delegates and wrestling with Xcode and a mountain of weird poo poo that doesn't even sound like English. (Never mind Obj-C.) I've been coding basically my whole adult life and I can barely get my head around it. Ehh that’s literally what I did. Worked full time as a teacher then at night learned Swift through the iPad Swift Playgrounds app. Then followed Apples “learn iOS programming” tutorial (basically one of the last things to be updated on their documentation archive website before they put up a message saying they weren’t maintaining that anymore. I agree that Apple’s documentation is bad. E.g. They have all these in depth documentation guides for things like Collection View layouts that were never even updated for Swift). Total time from knowing nothing to having an app on the store was probably 2 years, and that was only because I could do it in my feee time. Of course, it helped that I was incredibly motivated to GTFO of teaching. I do agree it helps to have existing code to use as an external brain so you don’t always have to remember the many, many bits of trivia and gotchas. (E.g. self sizing cells, dynamic type, location/notification permissions, how to set scroll view constraints so autolayout doesn’t complain at you or have everything collapse to zero, etc.) Also agree that the non-code (and even non-interface builder) parts of XCode can be very unfriendly. Provisioning profiles, certs and signing, build phases, capabilities, adding external frameworks/libraries, etc. edit: Oh also app extensions. I don’t think I’ve ever been able to get one to attach to the Xcode debugger, even in the simulator. Pulcinella fucked around with this message at 19:42 on Nov 24, 2021 |
# ? Nov 24, 2021 19:39 |
|
Pulcinella posted:Oh also app extensions. I don’t think I’ve ever been able to get one to attach to the Xcode debugger, even in the simulator. Probably already tried this, but changing the extension's scheme to "wait for the executable to be launched", mashing Run in Xcode, then doing whatever on the device or in simulator to launch the extension works best for me. Definitely finicky though.
|
# ? Nov 24, 2021 20:37 |
|
I'm trying to make an unsafeMutablePointer with a context, and I'm getting the error "No exact matches in call to initializer". Not sure what is going on here. I’m doing this in part to draw individual pixels onto a CGContext. code:
|
# ? Dec 11, 2021 16:22 |
|
Good Sphere posted:I'm trying to make an unsafeMutablePointer with a context, and I'm getting the error "No exact matches in call to initializer". Not sure what is going on here. I’m doing this in part to draw individual pixels onto a CGContext. I think you want something like data.assumingMemoryBound(to: UInt8.self)?
|
# ? Dec 11, 2021 19:10 |
|
pokeyman posted:I think you want something like data.assumingMemoryBound(to: UInt8.self)? Thanks, that looks more like it. I used CUnsignedChar for the type of memory. pixels = data.assumingMemoryBound(to: CUnsignedChar.self) Now my problem is that I can not get my cgContext data, because it is always nil, even though I am drawing to it with the built in functions of drawing lines, circles or rectangles. code:
|
# ? Dec 12, 2021 23:48 |
|
Good Sphere posted:Thanks, that looks more like it. I used CUnsignedChar for the type of memory. Where are you getting the context from? I'm at the edge of what I remember, but I think if you create a bitmap context (with or without a buffer passed in) you should end up with a buffer after creating the context. If iOS is passing you the context, I don't know that you can assume anything.
|
# ? Dec 13, 2021 07:20 |
|
pokeyman posted:Where are you getting the context from? I'm at the edge of what I remember, but I think if you create a bitmap context (with or without a buffer passed in) you should end up with a buffer after creating the context. If iOS is passing you the context, I don't know that you can assume anything. I'm getting it from a SwiftUI Canvas, which is probably weird, but I can draw onto it using the built in functions, just not this way because cgContext.data is never non-nil. code:
|
# ? Dec 13, 2021 17:48 |
|
Well I've got something. It does not clear the screen like it does for the other stuff, oddly. Maybe because it's a different context, and I'm confused about how they work exactly. This is how I set it up: code:
setPixelWhiteColor is where I edit the pixel data. putImageData is where I draw it. I make an image from pixelContext, but I draw it onto the passed context, which is the visible Canvas context. Not sure if that makes sense or not. May not, since it clears the screen for circles and stuff, but not my edited pixels. I have made sure it clears the screen before editing the pixelContext data. code:
Good Sphere fucked around with this message at 07:11 on Dec 15, 2021 |
# ? Dec 14, 2021 01:08 |
|
Ah ok, I wouldn’t be shocked if SwiftUI is doing something funky and giving you a context that refuses to expose its buffer via the data getter. But blitting your own buffer over seems legit to me?
|
# ? Dec 15, 2021 03:49 |
|
pokeyman posted:Ah ok, I wouldn’t be shocked if SwiftUI is doing something funky and giving you a context that refuses to expose its buffer via the data getter. But blitting your own buffer over seems legit to me? Yeah it seems to be okay. I have a huge problem with speed now. My original prototype in Javascript runs fast. It has some optimizations, but still does an upwards of 300,000+ loops or more per render. This is unacceptable on the iOS end, at least for how I have it implemented. And it's not the amount of draws it performs. I've tested by commenting out all drawing, and the performance is about the same. It's a double for loop running on every pixel coordinate to run a distance formula (and skipping that it is optimized for), plus any other loops it needs to perform. Without the optimizations, the amount of loops would be 3 to 4 million.
|
# ? Dec 15, 2021 06:31 |
|
Good Sphere posted:Yeah it seems to be okay. I have a huge problem with speed now. My original prototype in Javascript runs fast. It has some optimizations, but still does an upwards of 300,000+ loops or more per render. This is unacceptable on the iOS end, at least for how I have it implemented. And it's not the amount of draws it performs. I've tested by commenting out all drawing, and the performance is about the same. It's a double for loop running on every pixel coordinate to run a distance formula (and skipping that it is optimized for), plus any other loops it needs to perform. Without the optimizations, the amount of loops would be 3 to 4 million. Are you running an optimized release build? Also, I wouldn’t be surprised if SwiftUI has some weird performance issues. I have run into problems where drag gestures were causes huge framerate drops while programmatic scrolling does not because dragging was somehow causing a navigation bar to set an isEditing state property (there is no editing on this screen) and triggering a full screen diff to happen multiple times a frame. You could try in UIKit land. Also, the new Swift Playgrounds for iPad is out now. The one that lets you upload apps to the App Store. It’s very much an XCode Lite (emphasis on lite). It has its own file format and it doesn’t seem you can convert existing Xcode projects to it. It does support UIKit but no Interface Builder. So I guess all you programmatic layout lovers got the last laugh because it can’t even import xib and storyboard files for the compilation process, let alone actually display them.
|
# ? Dec 15, 2021 21:06 |
|
I'm very excited to see Apple introducing appstore-only bugs to your app via bitcode move from a theoretical problem to an actual problem. What a wonderful feature.
|
# ? Dec 15, 2021 22:51 |
|
Pulcinella posted:Are you running an optimized release build? Also, I wouldn’t be surprised if SwiftUI has some weird performance issues. I have run into problems where drag gestures were causes huge framerate drops while programmatic scrolling does not because dragging was somehow causing a navigation bar to set an isEditing state property (there is no editing on this screen) and triggering a full screen diff to happen multiple times a frame. You could try in UIKit land. Building for release, and you're right about Canvas not running well in Swift UI, according to the million complaints I see out there. e: Actually, I'm still conflicted by this, because I tested it without drawing anything, and it looks like the slowdown really happens inside my loop. I also recently found out that my double-for loop replaced with a double while runs a bit faster. I can also skip ahead in the while if I find that running through it is unnecessary, even if continuing after every iteration. Good Sphere fucked around with this message at 05:07 on Dec 17, 2021 |
# ? Dec 17, 2021 05:00 |
|
In SwiftUI i have a fullscreen view with a buch of other views in a VStack. One of the things is a List. Right now it is taking up all available space (even though it only contains a couple of items) and pushes everything below to the end of the parent view. Is this normal behavior? Any way to make it only take up the space it needs to fit its content?
|
# ? Dec 26, 2021 22:43 |
|
Having a discussion with another dev, Google has not been as helpful as I'd hoped, so figured I'd see if folks know -- If my MacOS app needs some .dylibs -- not entire frameworks, just single compiled libraries -- where are these supposed to go in the app bundle?
|
# ? Dec 29, 2021 01:26 |
|
Small White Dragon posted:Having a discussion with another dev, Google has not been as helpful as I'd hoped, so figured I'd see if folks know -- I think the technical answer is a combination of "somewhere in a run-path search path", which https://developer.apple.com/library...tLibraries.html has a bit of info about in the last section, and "somewhere in your app's bundle", per https://developer.apple.com/library/archive/technotes/tn2206/_index.html#//apple_ref/doc/uid/DTS40007919-CH1-TNTAG207 If you're wondering about a specific path within your app bundle (like Cool.app/Frameworks vs. Cool.app/Vendor or whatever) then I don't know if there's official guidance. I'd make a new Xcode project from a template, drag a .dylib in to the "embedded libraries" section of the app target, and see where it ends up in the built .app.
|
# ? Dec 29, 2021 07:51 |
|
The reason this came up is that it seems like the behavior is different in Monterey than previous OS releases... for whatever reason.
|
# ? Dec 29, 2021 08:52 |
|
I have an OSX app I want to be running during the workday, but only during roughly 9-5 on weekdays. Is there a LaunchDaemon setup I can do for this? The program also crashes a lot, so its not something I can use crons to boot at the beginning of the day and kill at the end.
|
# ? Dec 29, 2021 16:04 |
|
Small White Dragon posted:Having a discussion with another dev, Google has not been as helpful as I'd hoped, so figured I'd see if folks know -- I think most people just put them in Contents/Frameworks alongside their embedded frameworks. That way the default runpath search path of @executable_path/../Frameworks will find them as well. So far as I know, there haven’t been any changes in this area in macOS 12.
|
# ? Dec 29, 2021 21:01 |
|
macOS 12 did change something. We had to switch from setting LD_LIBRARY_PATH to DYLD_LIBRARY_PATH in a few spots, and one of our tests was putting dylibs in a blatantly incorrect place that worked until macOS 12 for unclear reasons. I'm guessing something was rewritten and maintained the same documented behavior but unsurprisingly broke some things which weren't intended to work but previously happened to.
|
# ? Dec 29, 2021 22:26 |
|
All you pros going to be switching to iPads for development now?Hacking with swift newsletter posted:Swift Playgrounds 4 is out!
|
# ? Jan 2, 2022 01:36 |
|
|
# ? May 16, 2024 12:26 |
|
commie kong posted:Yes, you get the fantastic new code completion, just like with Xcode. Which is it? Fantastic, or just like Xcode? Those are pretty contradictory.
|
# ? Jan 2, 2022 04:04 |