Post

Replies

Boosts

Views

Activity

Reply to Keep face up the cards if equal
Creating a card game with turning cards and everything needed is shown in length in the free cs193p video series from stanford university. Unfortunately I can't link it here, but a search for „cs193p“ in google gives the correct result.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Where is Playgrounds 4? It's 2021-12-14 now...
Yesterday Apple updated its iPadOS 15 web page: For „Universal Control“ they added a badge saying that it was delayed to spring 2022. For Swift Playgrounds they removed a footnote stating it would come „late 2021“. So there is still hope we will see it before the holidays. My children and I are also waiting for it to be released and would be very disappointed if it was delayed even more. Come on Apple, you can do it!
Dec ’21
Reply to How can I fix this leaking memory?
Did you try: init() { timer = Timer.scheduledTimer(withTimeInterval: 0.1, repeats: true) { [weak self] timer in self?.getRandonNumber() } } Capturing self is alway „dangerous“ and can lead to memory leaks. The timer/closure keeps a reference to the ViewModel and the ViewModel keeps a reference to the timer, therefore their memory is never released. I don't know if your ViewModel is recreated many times during the run of your app, but if it where, this reference cycle would lead to a memory leak.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Sep ’21
Reply to Async in Playground
Like with every async function called from a synchronous context (the global context of your playground) you have to wrap your call to doStuff() in an async block and await it: async{ await doStuff() } This is expected to change to Task.async{ await doStuff() } in a later beta. The following list of WWDC videos covering Swift concurrency should provide further background: Meet Swift Concurrency
Jun ’21