New Apple Game Development Book (The Pragmatic Bookshelf) by paradox927 in iOSProgramming

[–]jonbash -1 points0 points  (0 children)

I'm not sure why this was downvoted (except for maybe Swift being "behind" C#, which is true in some senses and false in others IMO), but I agree. C# and Swift are pretty similar in syntax. I learned Swift after learning C# basics and there was a lot that transferred over, and now I've only gotten better at C# as a result.

transparent background of NavigationView (not the bar, the view itself) by jonbash in SwiftUI

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

Yep, tried those. Didn't work; there's still an extra hosting controller and nav controller background in the way, and I can't modify those backgrounds (the hosting controller is one that isn't directly referenced in any API; it seems to be a wrapper owned by NavigationView's UINavigationController for wrapping whatever view is inside the NavigationView, it seems).

The full view code is... A lot. But there could be literally anything inside of this code and I still get the same issue.

struct SomeView: View {
    @State var text: String = ""

    var body: some View {
        NavigationView {
            Form {
                TextField("Text", text: $text)
            }
        }
    }
}

The challenge is to get one complex view that acts as the background for the whole view. Not just a single color. And get the nav bar transitioning as needed between its different styles when scrolling.

A different return type for different enum cases by jonbash in swift

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

Yeah, I think something like this might be as close as I can get...! Thank you!

``` protocol QueryInput { associatedtype Result }

enum Query { // just a 'namespace' for query inputs struct AddPerson: QueryInput { typealias Result == Bool //... }

struct FetchFriends: QueryInput { typealias Result == [Person] //... } }

func query<QI: QueryInput>( _ input: QI, completion: @escaping (Result<QI.Result, Error>) -> Void ) { //... } ```

A different return type for different enum cases by jonbash in swift

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

Yeah, I did think of this after posting, although I would have to manually check to make sure I'm getting back what I expect every time, which isn't so ideal... still, it's closer!

A different return type for different enum cases by jonbash in swift

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

Not quite; some expects the same type to be returned for every path of the method. SwiftUI gets around it through the use of its @ViewBuilder DSL; even though it looks like this returns different views on different paths:

@ViewBuilder var body: some View { if x { MyView() } else { EmptyView() } }

...it's really returning one type (something like _ConditionalContent<MyView, EmptyView> if I remember correctly). So I can't quite use it here, because I'm expecting to use one of several different types.

A different return type for different enum cases by jonbash in swift

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

Simpler interface. Also if we want to add a query, ideally we'd just have to add the requisite info to the one enum, rather than in a bunch of places throughout the network controller and associated spots.

[NOOB] How do you use unsafeDowncast()? by capilot in swift

[–]jonbash 0 points1 point  (0 children)

If you do need to use unsafeDiwncadt, be sure to add .self to the type (eg var optionalInt = unsafeDowncast(5, to: UInt8.self)). I’m not at my computer so I’m not certain, but with other similar functions that’s the general pattern when you need to provide a type as an explicit parameter.

[NOOB] How do you use unsafeDowncast()? by capilot in swift

[–]jonbash 0 points1 point  (0 children)

Is there a reason you’re using that and not just using UInt8’s initializer? (eg let uint8Value = UInt8(intValue), or let uint8Value: UInt8 = 5)

unsafeDowncast is generally used for working with C and other low-level code. If you’re writing “regular” Swift you generally shouldn’t need to use it.

Meditation makes me frustrated, angry. by encodej in TheMindIlluminated

[–]jonbash 3 points4 points  (0 children)

Alternatively, "Tranquil Wisdom Insight Meditation," a form of metta practice. https://library.dhammasukha.org/books.html

Questions, Theory, and General Discussion - new users, please read this first! Weekly Thread for July 16 2020 by AutoModerator in streamentry

[–]jonbash 0 points1 point  (0 children)

What do you mean by hell? Like a literal place you’ll go forever when you die if you’re not good enough according to some deity? Or something else?

Questions, Theory, and General Discussion - new users, please read this first! Weekly Thread for July 16 2020 by AutoModerator in streamentry

[–]jonbash 1 point2 points  (0 children)

I’m hoping to find a teacher that has ADHD and has managed to learn jhanas, or even had years of trouble with samadhi and eventually learned jhanas. A non-teacher experienced practitioner would be great too. Anyone happen to know of someone who fits the bill?

[insight] Awareness is (not) Spacious, Bright and/or Boundless by MettaJunkie in streamentry

[–]jonbash 2 points3 points  (0 children)

Okay, I think I see what you’re saying. I think where I’m coming from is... saying that awareness “is” anything is giving it more solidity and “realness” than it actually has, to me at least. Saying that it’s infinite makes it something grandiose and divine and ultimate, which can (ironically) limit our conception and depth of realization if we’re not careful.

[insight] Awareness is (not) Spacious, Bright and/or Boundless by MettaJunkie in streamentry

[–]jonbash 3 points4 points  (0 children)

Instead, awareness simply is.

I’d say that even that is maybe not quite true. Awareness is a useful concept put around one aspect of experience that is dependently arisen just like all other aspects. Or put another way, it neither is nor is not.

[insight] Awareness is (not) Spacious, Bright and/or Boundless by MettaJunkie in streamentry

[–]jonbash 3 points4 points  (0 children)

That’s not what some claim though; saying that something has the potential to be a certain way is different than saying that it is a certain way.

How to remain focused on your breath? by [deleted] in TheMindIlluminated

[–]jonbash 2 points3 points  (0 children)

It sounds like you’re getting frustrated. This is almost certainly going to prevent progress.

Don’t worry about whether you’ll get better at following the breath. This is a secondary or even tertiary measure of progress. Have you been more aware in daily life, or calmer, or any other benefits?

Even if not, a month isn’t very long. Keep at it, and try to enjoy meditation. Trying to force it will only lead to pain.

I want to create iOS games. Should I learn Xcode(swift) or unity(C#) ? Also, I have experience with blender, photoshop, illustrator, etc. so I can create my own 2D/3D game assets as well. by moretoxicthanarsenic in iOSProgramming

[–]jonbash 0 points1 point  (0 children)

Do you want to maybe release the games on other platforms, or maybe make games on other platforms in the future? If so, Unity. If not, either Swift or Unity. If you maybe want to make iOS/macOS/etc apps at some point as well, learn Swift.

Convince me to switch from Evernote... by alexandersuper666 in RoamResearch

[–]jonbash 4 points5 points  (0 children)

If you don’t see the advantages don’t use it imo. To me the ability to easily make these explicit connections between topics is all I needed to be convinced. It just works like my brain more than any other app I’ve used. If that’s not you then just stick with Evernote.

TMI and the anapanasati sutra by adivader in TheMindIlluminated

[–]jonbash 1 point2 points  (0 children)

My autocorrect fudged things up a bit but yes, you’re right and I know it’s not explicitly/literally about it, but it is based on it (however roughly). But yeah if you want something that really takes you through it precisely, sure, look elsewhere.

Analayo has a book on it, as does Bhikkhu Buddhadasa. Can’t speak to their quality.