The Last of Us – HBO

I was not expecting much from “The Last of Us” from HBO, after so many poor adaptations of video-games, what could one look forward to? Well, I’m glad to say I was wrong. 

The first two episodes have been so fun to watch. If you enjoyed the game, do check them out. 

Faithful to the material too 🙂 Here’s hoping the rest of the season is as good as the first episodes. 

Marc

And just like that, MarsManaged has reached Beta!

After 18 months of work…

F3dbff58a2c8c907

…I’m excited to announce that MarsManaged has reached a major milestone, it’s now in Beta. 

In the following weeks I’ll be opening up more testing seats, can’t wait for your candid feedback -and bug reports-! 

Until then, here’s a sneak peak of the latest version of the app. 

CARD’s section:

Screenshot 2023 01 07 at 3 07 22 PMACTIONS section:

Screenshot 2023 01 07 at 3 15 11 PMThe way you do Product Management will never be the same 🙂 

Stay tuned! Comments / Feedback? Find me at mastodon.social/@MarcMasVi or @MarcMasVi

Marc

Easily linking any AppKit or UIKit class with SwiftUI

After spending an embarrassing amount of hours trying to get TextField to do what I needed on macOS I decided to try NSViewRepresentable + NSTextField.

I was fully prepared to spend the night on this… Yet I got it done in 30m 😮 

Lesson learned! Going forward, when a SwiftUI object is not mature enough I will not try to hack it with modifiers… Instead,  I will go straight to AppKit or UIKit. I know I’m loosing portability – which is why I spend so much time trying to do it all in SwiftUI – but, especially on macOS, SwiftUI sometimes is just not yet there. 

So, about linking to AppKit or UIKit… Online there’s a lot of, shall we say, over-engineered examples? Frankly, I believe it puts off a lot of people -including myself-, even though its actually very easy. 

Below is the leanest approach I found to link to any AppKit/UIKit class and their respective delegate. For this example I’m linking to NSTextField, but you could do it just as easily with any class.

Here’s how you call it from SwiftUI once implemented:

OSXTextField(textOfWhatToDisplay: someContent)

And here is the wrapper code for NSTextField, all self contained within a Struct:

struct OSXTextField: NSViewRepresentable {

 

    var textOfWhatToDisplay: String

    

    func makeNSView(context:Context) -> NSTextField{

        let osTextView = NSTextField(string: textOfWhatToDisplay)

        osTextView.delegate = context.coordinator       

//      osTextView.isBordered = false //example of calling NSTextField 

//      osTextView.drawsBackground = true //

        return osTextView

    }

    

    func updateNSView(_ nsView: NSTextField, context: Context) {

 

    }

    

    func makeCoordinator() -> Coordinator { //Called automatically by SwiftUI if implemented, used to trigger delegate

        Coordinator(parent: self)

    }

    

    class Coordinator: NSObject, NSTextFieldDelegate {

        

        var parent: OSXTextField

        

        init(parent: OSXTextField) {

            self.parent = parent

        }

        

        //NSTextFieldDelegate methods would go here

        

    }

}

 

This experience, all the hours I put into getting TextField to work, has also been a great reminder of the sunk-cost fallacy.

Comments / Feedback? Find me at mastodon.social/@MarcMasVi or @MarcMasVi

Marc

Here’s to 2023!

As Eisenhower said “Plans are worthless, but planning is indispensable”, so… In no particular order, my plan for 2023 is to:

1. Ship MarsManaged for macOS sometime before June, add iOS versions before EOY

2. Complete two more AI courses & tackle several problems that interest me where ML can make a significant difference

3. Read a book every month, summarizing it for later review in DevonThink (my second, and better?, brain)

3. Exercise & meditate at least 4 times a week 

4.  Find fellow indie devs in San Diego, where my wife and I recently moved

I’ll keep you posted on progress! Hope you all had an awesome end of the year and a great start of 2023!

Comments / Feedback? Find me at mastodon.social/@MarcMasVi or @MarcMasVi

Marc

 

PS. The GIF above is from The White Lotus, my wife and I really loved the show. 

Restoring macOS window after close – SwiftUI WindowsGroup

Typical behavior for macOS apps is that the apps will preserve their size and position when closed (Command + W) or quit (Command + Q) by the user. 

11sgE

 

When using SwiftUI & WindowsGroup that’s not the case though: although it works as designed when quitting, it forgets position and size when closing the window (Command + W).

I’m hoping this gets addressed in the future, but until then I’m using AppDelegate to intercept the close command and instead hiding the window. 

@main

struct MarsManagedApp: App {

    

    @NSApplicationDelegateAdaptor(AppDelegate.self) var appDelegate

    

}

 

class AppDelegate: NSObject, NSApplicationDelegate, NSWindowDelegate {

 

    func applicationDidFinishLaunching(_ notification: Notification) {

        let mainWindow = NSApp.windows[0]

        mainWindow.delegate = self

    }

    func windowShouldClose(_ sender: NSWindow) -> Bool {

        NSApp.hide(nil)

        return false

    }

}

Works like a charm, thanks to Mark G for the tip. 

Feedback / suggestions? Reach me at mastodon.social/@MarcMasVi or @MarcMasVi

Marc

Writing these lines from San Diego!

Some personal news to share, my wife and I have relocated to San Diego! 

We’re still in temporary housing, but I do expect to be fully settled starting January. Until then, I’ll be posting less as there’s a lot of things we’re handling ATM. 

So far, loving it here – here’s a pic from yesterday, just a few minutes from my temporary house. 

IMG 6291

And, yes, AvoToast scene is very much here. Approved!

IMG 7033

If you’re based in SD do hit me @MarcMasVi

Marc

Have an M1/M2 Mac? Use Diffusion Bee locally

If you’d like to try Stable Diffusion, the latest AI image generator, and have a Mac with an M1/M2 chip you can download it and run it locally (no technical expertise required)

Screen Shot 2022 09 12 at 10 25 05 AM

Features include:

  • Full data privacy – nothing is sent to the cloud
  • Clean and easy to use UI
  • One click installer
  • No dependencies needed
  • Multiple image sizes
  • Optimized for M1/M2 Chips
  • Runs locally on your computer

Kudos to @divamgupta for making it available, 

Marc

MarsManaged onboarding – Unleashing a new golden age for humanity!

‘Creating a future for Mars!’ ‘Unleashing a new golden age for humanity!’

This weekend I’ve been working on onboarding CARDs for MarsManaged. What’s that I hear you ask? Let me explain…

When the user first opens the app these onboarding CARDs show how to use it in a subtle way, allowing users to become familiar quickly & learn best practices.

To add personality, all CARDs simulate situations a Mars Product Leader could be dealing with. 

Screen Shot 2022 09 04 at 3 15 20 PMYou may know what this Portal to Earth pitch will end up leading to:

I’ve completed 5 out of the 7 onboarding examples so far. Aiming to get 90% there this weekend so i can fully focus on final app polish & launch website.

Feedback / suggestions? Reach me at @MarcMasVi 

Marc