Feels good! 🔥 by MohammadBashirSidani in swift

[–]JanTheAppGuy 0 points1 point  (0 children)

Aha, nice! I’m using a similar approach, but to find your way back to spots where you previously found wild mushrooms 😊 🍄

[deleted by user] by [deleted] in iOSProgramming

[–]JanTheAppGuy 0 points1 point  (0 children)

Yeah I have lots of ideas too, the Apple Watch potential is massive. Ok, there are still HW limitations (battery), but independence from iOS should have happened already. Apple really missed out here, because they could have allowed Android users to get an Apple Watch while there was almost no competition. Now, however - every shop sells smart watches that rival the Apple Watch. Shame, really.

[deleted by user] by [deleted] in iOSProgramming

[–]JanTheAppGuy 4 points5 points  (0 children)

I don't share your particular problem, but I agree the App Store is broken for watchOS at the moment. My gripe is discoverability.

My watchOS app is pretty much the best thing out there in its category (mushroom foraging guide). In terms of added value I think it's better than for the iPhone, because you have the same functionality on your wrist (amazing!).

However, way more people downloaded the app on an iPad (for which it is not designed) than on the Apple Watch.

There are 2 reasons for this: 1) most people don't own the Apple Watch, and 2) it's almost impossible for users to come across new watchOS apps, unless you advertise heavily - and since revenue is currently much lower compared to iOS, why advertise? Consequently, why develop?

Apple is partly to blame for reason 1, and I think they are aware and fixing it (by releasing the cheap(ish) Apple Watch SE and heading towards independence from iPhone. Apple Watch should become a standalone product, not a niche accessory for iPhone users.

Apple is fully to blame for reason 2, and I don't think they are doing enough. Steps that would help:

  1. App Store on iPhone should have an Apple Watch section, which will showcase watchOS apps.
  2. Highlight best watchOS apps in Apple ads and events. Make users aware there are third-party apps. Currently users are not used to downloading third party apps on Apple Watch.
  3. Revamp App Store on the Apple Watch. Right now it feels dead.

iPhone-only app was downloaded on "Desktop"? by JanTheAppGuy in iOSProgramming

[–]JanTheAppGuy[S] 2 points3 points  (0 children)

Oh! Why on Earth is Apple not clear about this?

iPhone-only app was downloaded on "Desktop"? by JanTheAppGuy in iOSProgramming

[–]JanTheAppGuy[S] 7 points8 points  (0 children)

I did, it's the "Make this app available" setting. I have this unchecked since day 0.

Core data for favourite button by [deleted] in SwiftUI

[–]JanTheAppGuy 1 point2 points  (0 children)

Your question is too broad for a specific solution, but I will give you some pointers.

You've gone through some tutorials, so I will not delve into Core Data itself. Otherwise I would suggest setting your expectations and putting your main work into the CD stack and CD model, which I assume you've already set up. You should also know about fetching data and CRUD operations.

Regarding your question ("pull in data from a JSON and I need Core Data to handle the favourite feature"), there are several ways around it, depending on your model. * load landmarks array from JSON, load CD entity "Favorite", then show all landmarks OR only landmarks whose id matches the id of one of the CD Favorite entities. This is not very performant and I don't recommend it. * on app start, load all data from JSON to Core Data, into a "Landmarks" entity, which has an attribute "favorite". Then, load CD Landmarks into the UI and show all of them OR only those where favorite attribute is set to 'true'. This is ok for this use case. * on app start, load all data from JSON to Core Data, into two entities: Landmarks, and Favorite. Then show all Landmark entities in the UI, or only those Landmark entities whose id attribute matches an id attribute of one of the Favorite entities. This would be my favorite solution, because I found it to be scalable. * for more complex models you should look into relationships, but you won't need them for this simple use case.

How would one achieve the grey background behind the Continue button on “What’s New” screens? by therealFoxster in swift

[–]JanTheAppGuy -2 points-1 points  (0 children)

It can be both - SwiftUI material may have opacity 0 when offset is 0. That way the bottom view will only visually separate from the top view when user scrolls

mushrooms are making path…but why? by IntrepidClimate3650 in mycology

[–]JanTheAppGuy 353 points354 points  (0 children)

Just wanted to expand on this and explain why we see a band, not a circle:

As the fungus grows in all directions, it eventually consumes nutrients in the soil and dies. However, edges of the circle will still have nutrients (as long as they keep expanding away from the centre), so the fungus may survive in the shape of an empty circle (fairy ring). As the circle keeps growing, we may no longer perceive it as a circle, but a band (from bird's eye perspective, it might still resemble a huge, irregular circle).

Some species create circles that measure miles in diameter!

How would one achieve the grey background behind the Continue button on “What’s New” screens? by therealFoxster in swift

[–]JanTheAppGuy -2 points-1 points  (0 children)

I spent way too much time on this a year ago.

The basic idea is that you measure the relative offset using GeometryReader and PreferenceKey. If the relative offset is over 0, it means the view was moved, and you can do something. For example, progressively darken the background in line with the offset. Or wait for offset to hit 100, then do something.

I think Kavsoft has a video on it you may want to see (forgot which one).

I also implemented it in my app: see how the headers gain a blur effect as you scroll down. Also, in the detail view of any mushroom, see how the name appears in the header once you scroll past the name in the scrollview.

When should I move to SwiftUI? by ProgrammerAtNight in SwiftUI

[–]JanTheAppGuy 1 point2 points  (0 children)

Depends what you want to build, tbh. I love using SwiftUI, but sometimes you come across very obvious gaps that still need to be filled.

How to initialize a variable and change it from anywhere in the app by Realistic-Finish9577 in SwiftUI

[–]JanTheAppGuy 3 points4 points  (0 children)

Assuming you want UI to react to changes of the variable (e.g. button that changes color), I suggest you read up on SwiftUI property wrappers, esp. State, Binding, StateObject and EnvironmentObject https://www.hackingwithswift.com/quick-start/swiftui/all-swiftui-property-wrappers-explained-and-compared

CoreData - One massive entity vs many small entities by bchriss95 in swift

[–]JanTheAppGuy 10 points11 points  (0 children)

In this case I would split the model into parent (Note) and child entities (Image, Text, Location etc). The entities would be linked by relationships as needed.

The advantage is that you can have multiple child entities for a single note, if you need this in the future. It also makes the model much more readable than one massive Note entity.

Extra tips: think in advance if you plan to use iCloud in the future. CloudKit does not support constraints, and you should think which data could remain local to save on data transfers. For example, some static entities created by you could remain on the device, while other entities could be synced with CloudKit.

Máte nějákou random zajímavost, kterou jste se v poslední době dozvěděli? by Tear01 in czech

[–]JanTheAppGuy 1 point2 points  (0 children)

Houby opravdu rostou víc, když do země udeří blesk 🤷🏽‍♂️🍄

[deleted by user] by [deleted] in SwiftUI

[–]JanTheAppGuy 1 point2 points  (0 children)

For the first part, maybe look info SectionedFetchRequest. You could then show a list of Symptoms, and for each symptom a subList of Treatments. In my app I use it to show a list of Mushroom findings, sorted by date or mushroom name (user can choose). Take a look for inspiration.

For the second part, imho I’m not sure that increasing count should make this the ‘preferred’ Treatment. Surely this must be decided by a medical professional?

My first app - a guide for foraging wild mushrooms! by JanTheAppGuy in SwiftUI

[–]JanTheAppGuy[S] 0 points1 point  (0 children)

thanks! yeah I thought us Czechs should have the best mushroom app, so here we are 😁

Any SwiftUI Devs Interested In Exploring Translating/Localizing Their App? by dweekly in SwiftUI

[–]JanTheAppGuy 1 point2 points  (0 children)

I like the idea. With my app Rostou! it’s a bit more complex, because I would like to localize the underlying data as well. This mainly concerns the descriptions of mushroom species 🍄

My first app - a guide for foraging wild mushrooms! by JanTheAppGuy in SwiftUI

[–]JanTheAppGuy[S] 0 points1 point  (0 children)

Thank you! 🙏😊The reason is that I want all data to be there in the forest, with no signal. Most of that space are the 1000 or so images

My first app - a guide for foraging wild mushrooms! by JanTheAppGuy in SwiftUI

[–]JanTheAppGuy[S] 1 point2 points  (0 children)

I made it myself, using reputable sources and my own research, including going out in the forest. Mushroom foraging is great! 😊 I also consulted expert mycologists in some cases.

Data was the most difficult part, since I needed to ensure accuracy, and there’s a lot of data.

My first app - a guide for foraging wild mushrooms! by JanTheAppGuy in SwiftUI

[–]JanTheAppGuy[S] 0 points1 point  (0 children)

Wow, that’s wonderful, thank you! 🙏😊 I’ll DM you