|
Yo, am I missing something obvious here? I'm trying to make a SwiftUI wrapper for an NSView and it's driving me crazy.Swift code:
Type 'HexView' does not conform to protocol 'NSViewRepresentable' Candidate has non-matching type '(Context) -> HFTextView' [with Coordinator = Void] Candidate has non-matching type '(HFTextView, Context) -> ()' [with Coordinator = Void] I tried swapping out HFTextView with NSTextView in case it was the view and I'm getting the same error. Copying and pasting example code gets the same error. It's got to be something fundamental or obvious but I am just not seeing it. I'm using Swift 5, Xcode 13.3, building for Mac. edit: if I copy the minimal solution with NSTextView to a playground it runs fine. If I remove the : NSViewRepresentable it compiles fine. WTH is going on? chaosbreather fucked around with this message at 07:39 on Mar 30, 2022 |
# ? Mar 30, 2022 05:58 |
|
|
# ? May 22, 2024 05:28 |
|
Lady Radia posted:i dunno about all that, that's a nice story but steve jobs is also famous for "your holding it wrong", "your jeans are too tight", so You know that whole "land of contrasts" meme? I have met several people who worked directly with Steve Jobs in my career, and based on the tales I've heard I think "land of contrasts" was invented to describe Steve Jobs.
|
# ? Mar 30, 2022 07:45 |
|
Close, but it's actually the word "mercurial"
|
# ? Mar 30, 2022 15:25 |
|
chaosbreather posted:Yo, am I missing something obvious here? I'm trying to make a SwiftUI wrapper for an NSView and it's driving me crazy. Your typealias doesn't match what you're using in the rest of the struct, if your NSViewType is NSTextView then makeNSView and updateNSView must also use NSTextView
|
# ? Mar 30, 2022 15:55 |
|
Or delete the typealias and see if it can be inferred?
|
# ? Mar 30, 2022 15:57 |
|
does nsviewrepresentable need a coordinator like uiviewrepresentable as well?
|
# ? Mar 30, 2022 16:06 |
|
It provides a default Void coordinator if you aren't using one
|
# ? Mar 30, 2022 16:15 |
|
brand engager posted:Your typealias doesn't match what you're using in the rest of the struct, if your NSViewType is NSTextView then makeNSView and updateNSView must also use NSTextView Oh right, sorry, that was half actual code and half sanity test. Here's the sanity test: Swift code:
pokeyman posted:Or delete the typealias and see if it can be inferred? Yeah this is super interesting too – in my project it can't be inferred, but in new projects/playgrounds it can. Boy I wish that I didn't keep running into these 'everything's hosed' scenarios in apple dev chaosbreather fucked around with this message at 00:46 on Mar 31, 2022 |
# ? Mar 31, 2022 00:38 |
|
Has anyone run into an issue where an ipa created in CI has proper entitlements (e.g., push notifications) - validated by unzipping the ipa and inspecting it - but after uploading to the AppStore (TestFlight) the entitlements are gone? We are moving from GitLab CI (and self-hosted runners) to Azure DevOps (MS runners) and for some reason, our builds in TestFlight no longer have push capability (or any entitlements). It's strange because we're able to download the ipa we create, unzip it, and can see the provisioning looks correct. We use this Azure Extension to do the upload: https://marketplace.visualstudio.com/items?itemName=ms-vsclient.app-store which looks like it uses Fastlane, maybe folks have seen this with Fastlane, too. Would this be worth a TSI? I've never really used it but I'm pretty lost on what to try next. Glimm fucked around with this message at 02:21 on Apr 1, 2022 |
# ? Mar 31, 2022 01:58 |
|
chaosbreather posted:Oh right, sorry, that was half actual code and half sanity test. Here's the sanity test: If that exact code works everywhere but your existing project then it's probably something with the build config/extensions/etc
|
# ? Apr 1, 2022 05:10 |
|
Any idea what Project setting would break using c++ 14 features in .mm files? I have a project that has a .mm file which then includes a .h file with the followingcode:
code:
Working Project : Broken Project :
|
# ? Apr 29, 2022 17:25 |
|
No idea but have some uninformed flailing: is the header ever included or imported in a non-c++ context (don't forget about bridging headers)? Does renaming it to .hpp change anything?
|
# ? Apr 29, 2022 18:28 |
|
These investigations should always start by looking at the build log to find the command line that leads to the error. Then you can figure out why the command line isn’t what you expect.
|
# ? Apr 29, 2022 18:48 |
|
Changing to .hpp didn't help. As far as I can tell the command line looks correct - both are specifying -std\=gnu++1z. For testing I added a new .h and .mm file that aren't referenced anywhere else so the header is only included in this single .mm file. Here's the good build code:
code:
|
# ? Apr 29, 2022 19:37 |
|
code:
|
# ? Apr 29, 2022 19:46 |
|
rjmccall posted:
Well I feel dumb. I think I added that flag way back when Xcode didn't have it as a direct configuration. Thanks!
|
# ? Apr 29, 2022 19:55 |
|
I've cranked out a few throwaway projects and a releasable one in Swift in the past few months. In the process, I've gone from being annoyed by how differently SwiftUI works from anything I've done in the past (mainly winforms), to wondering how I can ever write another GUI that isn't done with viewbuilders. It's so clean and quick to chain all these read-only views and have them adapt to the model dynamically. It has me wondering: are there other user interface frameworks out there that behave the same way? Not necessarily for mobile, but as a multiplatform library spanning win/macos/linux? How about for the web? I looked around to see if Swift is multiplatform, but it seems only the core language is there and UI is still very experimental.
|
# ? May 5, 2022 15:14 |
|
Huh, what a coincidence, I just saw a comment on HN about a Rust implementation of a SwitfUI-like in its early days here: https://github.com/audulus/rui
|
# ? May 5, 2022 17:47 |
|
I've never used it, but if you want to stay with Swift, you can check out https://github.com/TokamakUI/Tokamak outside of Swift, Flutter has a similar declarative UI model and some degree of support for desktop apps, as well as enough corporate backing to tackle things like accessibility you can also try React + React Native (not the same thing, though you can share much of your app between the two). I don't think there's real support for Linux with React Native but Microsoft is supporting Windows and macOS if you do end up using any of these, I'm curious how you find it
|
# ? May 5, 2022 19:33 |
|
"everyone" is using declarative style for UIs now, flutter, react, jetpack compose, qt qml
|
# ? May 5, 2022 23:41 |
|
Thank you both-- that helped me go down a few avenues. I didn't realize so many declarative frameworks had popped up.
|
# ? May 6, 2022 04:57 |
|
Vesi posted:"everyone" is using declarative style for UIs now, flutter, react, jetpack compose, qt qml I don’t want to make a baseless claim without doing my research so I won’t say it was the first, but QML was surely one of the early ones. I worked on the framework itself way back in my career - dates get fuzzy at this point but wiki says it launched in 2009 which feels about right. Nokia doomed their own platform for many unrelated reasons, but it’s odd to see so much of the industry latch onto the declarative idea half-to-a decade later.
|
# ? May 6, 2022 06:10 |
|
Froist posted:it’s odd to see so much of the industry latch onto the declarative idea half-to-a decade later. Is declarative easier to work with for complex UIs or easier to learn? I’ve only ever really tinkered with UI to hack together something until fairly recently, but the declarative style seems far easier to work with.
|
# ? May 6, 2022 15:36 |
|
I'm working on an app that uses CoreLocation to calculate the distance between the phone and various locations. code:
Any idea why this is? Do the coordinates need to be formatted or converted for some reason?
|
# ? May 6, 2022 23:30 |
|
have you set the desiredAccuracy on the location manager? https://developer.apple.com/documentation/corelocation/cllocationmanager/1423836-desiredaccuracy
|
# ? May 7, 2022 04:19 |
|
Vesi posted:"everyone" is using declarative style for UIs now, flutter, react, jetpack compose, qt qml You know what’s really declarative? Deserializing a pre-configured object graph!
|
# ? May 7, 2022 10:57 |
|
Thanks for the tips. I managed to find other coordinates which seemed much more accurate in actual use. About to get a new Mac from work. Going to be a Pro with M1-something. How important are the gpu cores when running live previews in SwiftUI? My current one is rear end slow. And what other specs should I aim for on a machine made to develop both iOS and web, and often running some Docker containers/local dev env, and maybe the occasional game?
|
# ? May 11, 2022 11:39 |
|
uncle blog posted:About to get a new Mac from work. Going to be a Pro with M1-something. How important are the gpu cores when running live previews in SwiftUI? My current one is rear end slow. And what other specs should I aim for on a machine made to develop both iOS and web, and often running some Docker containers/local dev env, and maybe the occasional game? I haven't done any research or anything, but my answers are: gpu cores won't make any noticeable difference; more memory is maybe better otherwise no noticeable difference.
|
# ? May 11, 2022 14:55 |
This is a super long shot but — any chance that any wizard goon Mac developers have the ability to do anything with this? https://github.com/cocoahuke/shrink_trackpad It's a kext utility to mask off a selected part of the trackpad so you don't constantly trigger gestures because your palm is resting on the edge of the unnecessarily enormous trackpad. It's the only thing about my M1 Pro MBP that drives me absolutely bugfuck. However it only works on Intel and won't build under Monterey. The developer says: quote:This project does not support M1 macs because M1 equipped something called "Kernel Integrity Protection" prevents kernel code from been modifying, you can not disable that, it's a lower level stuff than SIP. Injecting code into the multitouch driver is critical for this project to function properly. The ideal outcome would be if Apple would somehow add the ability to do this masking-off in the OS itself, but I don't know of any way to bribe or prevail upon any actual Apple devs to do this. So the next best thing would be if anyone had some idea to possibly make this tool work on modern hardware/software. Fallback would be to tape some aluminum foil or felt or something over the left 1" of the trackpad but gently caress that if there's any way to avoid it.
|
|
# ? May 12, 2022 11:50 |
|
Edit: ^ Can’t you just turn off trackpad gestures you don’t want in preferences?pokeyman posted:I haven't done any research or anything, but my answers are: gpu cores won't make any noticeable difference; more memory is maybe better otherwise no noticeable difference. The M1 Pro/max/ultra cpu and faster ram help far, far more than the GPU. It’s my understanding (based o podcasts featuring Apple’s developers) that previews are basically modified simulators (modified to share and reuse resources so each tiny preview doesn’t require an entire simulator instance) so the flu and ram help more with that. SwiftUI previews can still have a lot of jank and performance problems though, it’s just much better than on the x86 cpus. Also ARM’s much lower power requirements means that you laptop doesn’t sound and heat up like a jet engine, even when performance is bad. The best preview experience I’ve had is on the Swift Playgrounds iPad app, probably because it’s not really previewing at that point, just running your code “natively.” Pulcinella fucked around with this message at 19:31 on May 12, 2022 |
# ? May 12, 2022 19:27 |
Pulcinella posted:Edit: ^ Can’t you just turn off trackpad gestures you don’t want in preferences? No, it's more like it's more pervasive and hard to repeat. If my left thumb is floating anywhere near the left edge/corner of the trackpad, it interferes with my right finger just doing normal clicking or two-finger gestures. Very often I'll try to do a two-finger scroll and instead it'll do a three-finger Exposé, or a double-click won't register properly making the haptic feedback all weird or something. I don't know where they think I'm supposed to put my left hand but there's nowhere I can rest it on the keyboard without my thumb draping over the trackpad. It was perfectly fine when the trackpad was half this size.
|
|
# ? May 12, 2022 19:37 |
|
Data Graham posted:It was perfectly fine when the trackpad was half this size.
|
# ? May 14, 2022 00:55 |
|
the point free fellas have released a video showing off some new helpers they've built. it's relatively short (33 mins ) for anyone interested in swiftui, testing, api mocks, etc. Point-Free posted:Tour of Parser-Printers: API Clients for Free
|
# ? May 15, 2022 01:01 |
|
I'm working on subscriptions for my first app, using StoreKit2. Everything is working as expected in TestFlight, except family sharing. Does Family Sharing work in TestFlight? Products purchased by family members are not showing up as entitled. I'm not sure if I'm doing something wrong in my code or if Family Sharing relationships don't copy over into the TestFlight environment. FWIW I'm using StoreKit.Transaction.currentEntitlement(for: productIdentifier) and it returns nil for a product that I know was purchased by another Apple Family member. I'm using this same call for subscriptions and non-consumables. It sure would be nice if you could mock family sharing using sandbox users... Edit: I got a response from apple that Family Sharing does not work in TestFlight (or Sandbox, but I knew that already). Seems like this should be documented somewhere, but I can't find it anywhere. Graniteman fucked around with this message at 21:51 on May 19, 2022 |
# ? May 18, 2022 19:21 |
|
I finally have a chance to use async/await for the project I’m on and…I don’t like it? I know it’s supposed to be simpler and more straightforward than the old method, but I’m so, so used to nested callbacks that it’s been hard to wrap my brain around async await. Like async seems to have this viral quality where when one thing is async, all of a sudden everything around it has to be async and it spreads from there. I just want to wait for one asynchronous data to be retrieved and push a view controller configured with that data but I’m trapped in async world! I just want to get back on the main thread! Give me a pyramid of doom any day. This is mostly just griping. I should probably go re-watch those WWDC videos.
|
# ? May 19, 2022 18:20 |
|
Edit: duplicate some how
|
# ? May 19, 2022 19:48 |
|
Pulcinella posted:I finally have a chance to use async/await for the project I’m on and…I don’t like it? I know it’s supposed to be simpler and more straightforward than the old method, but I’m so, so used to nested callbacks that it’s been hard to wrap my brain around async await. Like async seems to have this viral quality where when one thing is async, all of a sudden everything around it has to be async and it spreads from there. I just want to wait for one asynchronous data to be retrieved and push a view controller configured with that data but I’m trapped in async world! I just want to get back on the main thread! Give me a pyramid of doom any day. are you creating a Task to make your async calls in? otherwise async will definitely virally spread.
|
# ? May 26, 2022 02:50 |
|
commie kong posted:the point free fellas have released a video showing off some new helpers they've built. seems cool but where is the work to create your models and routes? how do you get that for free with their library? or is this just a suggestion for how to structure your networking code? i guess this is how they hook you into paying for episodes. edit: oh this was the last video in a 5 part tour of the technique and library. I will have to get back to this. I'm actually interested in the point free guys work. someone mentioned composable architecture in an interview i had. it's swiftui only though right? KidDynamite fucked around with this message at 17:55 on May 26, 2022 |
# ? May 26, 2022 16:54 |
|
KidDynamite posted:it's swiftui only though right? It is not. There's a UIKit section in the GitHub readme, was just looking at it yesterday. Works like Combine from the looks of it. I think most of all of their videos on it are SwiftUI focused though. I'm interested in it, but I don't know about using something third party for the whole architecture of the app. Anyone here used it and got any thoughts?
|
# ? May 26, 2022 19:43 |
|
|
# ? May 22, 2024 05:28 |
|
Pulcinella posted:I finally have a chance to use async/await for the project I’m on and…I don’t like it? I know it’s supposed to be simpler and more straightforward than the old method, but I’m so, so used to nested callbacks that it’s been hard to wrap my brain around async await. Like async seems to have this viral quality where when one thing is async, all of a sudden everything around it has to be async and it spreads from there. I just want to wait for one asynchronous data to be retrieved and push a view controller configured with that data but I’m trapped in async world! I just want to get back on the main thread! Give me a pyramid of doom any day. b-but most UI functions are marked as @MainActor so you can call them and have them run on the main thread without having to put DispatchQueue.main.async all over the place. If they aren't, just use await MainActor.run{}
|
# ? May 28, 2022 19:24 |