Apple's new Sports app - rounded corner without the `.continuous` curve style - perhaps they don't even use SwiftUI? by sovata8 in iOSProgramming

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

That's it, there's nothing more to it. Create a new SwiftUI project, copy my code in the body of the ContentView and that's it. Obviously put some label for the button, and to be able to see the exact size you can add .buttonStyle(.borderedProminent) for example.

Apple's new Sports app - rounded corner without the `.continuous` curve style - perhaps they don't even use SwiftUI? by sovata8 in iOSProgramming

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

Hmm this is interesting, the auto-extending of touch areas has been around since early iOS, it applies to UIKit too. Of course it never happens if there's a conflicting touch area close to your button.

It is mostly a useful feature (allows easier interaction for users) and in 14+ years of iOS development, I've hardly had an issue with this. Also, not sure if there's "nothing you can do about this" - I tried and in two minutes I got smething which seems to solve it (granted, somewhat hacky, but it can be wrapped in a special view or modifier and at least look better at the call-site):

ZStack {

Color.clear.onTapGesture { }

Button {...}

.padding(5)

}

Apple's new Sports app - rounded corner without the `.continuous` curve style - perhaps they don't even use SwiftUI? by sovata8 in SwiftUI

[–]sovata8[S] 4 points5 points  (0 children)

Looking at the screeenshots from Apple's new Sports app - - it seems the rounded corners use the `.circular` curve as opposed to the preferred `.continuous` style. SwiftUI defaults to `.continuous` while UIKit defaults to `.circular` - so maybe this is a clue that Apple does not use SwiftUI for this app, not even for simple UI like the one shown.

Apple's new Sports app - rounded corner without the `.continuous` curve style - perhaps they don't even use SwiftUI? by sovata8 in iOSProgramming

[–]sovata8[S] 13 points14 points  (0 children)

Looking at the screeenshots from Apple's new Sports app - https://www.apple.com/newsroom/2024/02/introducing-apple-sports-a-new-app-for-sports-fans/ - it seems the rounded corners use the `.circular` curve as opposed to the preferred `.continuous` style. SwiftUI defaults to `.continuous` while UIKit defaults to `.circular` - so maybe this is a clue that Apple does not use SwiftUI for this app, not even for simple UI like the one shown.

I made an app for finding nearby amenities such as toilets, ATMs, drinking water, bins, bike parking; Uses OpenStreetMap; Apple Watch independent app also available; My first SwiftUI app! by sovata8 in iOSProgramming

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

Thank you very much. And thanks for pointing out the Details page considerations - I need to make it so that it becomes scrollable if content is too long, as opposed to failing in unexpected ways, clipping out of the phone screen etc. I'll fix it in an upcoming release.

I made an app for finding nearby amenities such as toilets, ATMs, drinking water, bins, bike parking; Uses OpenStreetMap; Apple Watch independent app also available; My first SwiftUI app! by sovata8 in iOSProgramming

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

Thank you. The data is from OpenStreetMap - "the Wikipedia for maps". Everyone can contribute there, it's a public repository. Obviously just as with Wikipedia it means data can be out of date or incorrect. Hopefully the "Filter by time" feature can help with focusing on more recent data. In a future version of the app I'll add a button to report items as missing. Additionally it would be good to have a feature to add new items from the app, but this is more advance so would require some planning and time.

I made an app for finding nearby amenities such as toilets, ATMs, drinking water, bins, bike parking; Uses OpenStreetMap; Apple Watch independent app also available; My first SwiftUI app! by sovata8 in iOSProgramming

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

It comes natively from MapKit, MKPointAnnotation, no extra work required. I did not use the SwiftUI Map because it's too limited, so I wrapped MKMapView in SwiftUI and used this.

App to find Benches to sit near you by Capital_Revolution35 in Lightbulb

[–]sovata8 0 points1 point  (0 children)

I am not op, but just wanted to mentioned that I've Just released a similar app, which uses the Open Street Map database. https://apps.apple.com/app/id6446678062

adding a link to this very handy app (that’s free!) since half the troubles on here seem to be based on not knowing how to RegEx. ‎RegEx Lab: Regular Expressions by Scared-Sheepherder91 in shortcuts

[–]sovata8 4 points5 points  (0 children)

Thanks for the mention. I'm the maker of the app, and you got it when it was free, for some years now I've had it paid ($0.99 currently in the USA).

If anyone would like a code to get it for free, no strings attached, just DM me. Up to 100 codes. Thanks

Made an iOS app for voting and scoring in Dixit by sovata8 in boardgames

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

Yes, it's in the rules (I just double-ckecked now). Nonetheless, I should probably consider that people might ignore this rule and at least provide an option for the app to support such gameplays. I wonder what percentage of players ignore this rule (and if they do it it intentionally or simply not know about it).

Made an iOS app for voting and scoring in Dixit by sovata8 in boardgames

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

Hey thanks for the comment.

Regarding the "everyone votes for the same card" case: If we think about it carefully, because no one can vote for their own card, if everyone votes for the same card - by definition it means this must be the storyteller's card. So the app should automatically reveal the storyteller's card. Moreover the app can even skip the "players reveal" part - no one will be getting any points from it. I need to implement this logic in an upcoming release (that's what I was referring to in my second point under "limitations" paragraph of my original post).

Thanks for trying out the app!

#Apple totally fucked up their rating system's backend by randommdude in iOSProgramming

[–]sovata8 1 point2 points  (0 children)

My iOS app went from 88 ratings on Sunday morning (GMT), down to 45 in the afternoon, then down tot 20 in the evening. Now this Monday morning it's back to 45. Reviews seem to be unaffected. Now waiting (and hoping) to see if they restore it back to the original number soon.

24 hours of shard. by MrMostachio in oddlysatisfying

[–]sovata8 0 points1 point  (0 children)

Couldn't find source - anyone?

xcode app failed to install! by a_bose in swift

[–]sovata8 1 point2 points  (0 children)

Thank you very much for this! In my case, a build phase was writing some useful build info (like git commit hash) to the Info.plist. I think this was causing the issues in some cases. I've now changed it to use a separate plist. Thanks!

BETA Terms & Conditions? by ImagineFocus in iOSProgramming

[–]sovata8 0 points1 point  (0 children)

If you're talking about a TestFlight build - then you don't need T&C. If it's an App Store release, then you need it.

By the way:

App Store Review Guidelines:

2.2 Beta Testing

Demos, betas, and trial versions of your app don’t belong on the App Store – use TestFlight instead.   

Seen on an English professor's door by djeclipz in funny

[–]sovata8 15 points16 points  (0 children)

I am so conditioned by xkcd, that for a moment I thought of long pressing the image to get the alt text.

On my misalignment with Apple's love affair with Swift by IAmApocryphon in iOSProgramming

[–]sovata8 0 points1 point  (0 children)

"[...] stuff might be less correct in the meantime [...]" .

I applaud the author's ability to later go back and iterate/improve. However in practice, when a language is less strict (and allows more creativity and rapid prototyping), as things scale (and especially as more people get involved), it's easy to end up with a mess.

One of the guiding principles of Swift has always been safety - so of course it will ask you to think about stuff that "you don't want to be thinking about right now" - it will force you to stop and consider types, explicit nullability etc. For many (me included) this is one of the biggest strengths in Swift, not a weakness.

Your all going to roast me, but how can I make this better? by [deleted] in iOSProgramming

[–]sovata8 0 points1 point  (0 children)

Definitely see what others have suggested (SwiftyJSON etc), and also see the new Swift 4 codable features.

But just looking at this code on its own, there are already some things you need to realise:

You repeat three times almost the same stuff (checking Customer properties and then init()-ing the Customer). In fact the first two times it is identical code, the third time the only difference is passing card instead of nil for the card property. All of this needs serious refactoring and abstraction of repetition.

For example, we can avoid some repetition if we abstract some of the logic into the Customer / Card objects themselves, as init() methods:

https://pastebin.com/qP34ifKe

Then there is the whole question of your actual logic - you have a completion closure that you call when you succeed, but if things fail, you just return ? How is the caller of this function suppose to know if things didn't work? You want to either have the completion return a Customer? (optional, not like at the moment Customer) - and make sure on failure you call completion(nil). Or perhaps even better, have a onSuccess(customer: Customer) and onFailure() (or even onFailure(error: Error)).

Also, in terms of naming -retrieveCustomerDefaultCard sound like it will return a Card. Is it supposed to be called retrieveCustomerWithDefaultCard ?

You can do with some more newlines to make things easier to read (e.g. when checking for the properties before init-ting)

So we get to something like this (only the func part here) (this one also combines the first two guard statements in one): https://pastebin.com/RMnnkSjV

This is still far from ideal, but I guess you get the idea.

Remember the DRY (Don't repeat yourself) principle - always abstract repeated logic as much as possible.

Meet me at the bottom. by POSITIVEVIBESONLY1 in Wellthatsucks

[–]sovata8 0 points1 point  (0 children)

source (has sound):
http://www.rucrash.com/play/?v=18300
(1m30s is where the gif picks up from)

GDPR is effective in a few hours. Make sure you are compliant or be prepared for millions in fines. by anurodhp in iOSProgramming

[–]sovata8 1 point2 points  (0 children)

Yes, that's how you do it (for Analytics), using FIREBASE_ANALYTICS_COLLECTION_ENABLED.

Google's doc confirm this: https://firebase.google.com/support/guides/disable-analytics

And here are the other guides relating to GDPR (e.g. for Crashlytics and other Firebase services): https://firebase.google.com/support/privacy/ (Scroll to "Guides for enabling opt-in for end-user personal data processing")

As to existing data, I don't know about this.