Post

Replies

Boosts

Views

Activity

Comment on TabView Reloads all Tab
@claude31 hmm it certainly did not reload the component. when the tab view was shown, it loaded all components. i figure the culprit is in my custom view. if i use the WebView as sample. we have TextView(), WebView(), TextView2(). the init in text view print shows when i switch from WebView to any of the other 2 TextView() views. but if the switch is between TextView() and TextView2(), its ok.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on Why AVPlayer always nil
Hi @claude31 i actually can load the url in the browser. you are right about the unwrap without checking for nil is dangerous. but I purposely unwrapped it because my video url is fixed. but im using a sample video url to start with. about the url, i assumed it should be working since i can view the video in the browser.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on Why AVPlayer always nil
ill try it. perhaps i wasnt observing that he (the post that said avplayer has to be a state) probably set it as state but did not make it optional. or because i only assigned it in init it resulted this way. it probably will work if it is a state optional but i set the value after a button click?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on Why AVPlayer always nil
it's ok now. since i decided to implement my original workflow which is to load the video on a button selection in the sheet. thanks @claude31. sucks that videoplayer or avplayer doesnt have auto repeat and that some other class has to be used. and it is not even possible to put a thumbnail to the video while it is not playing.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on Why AVPlayer always nil
i did get it to work even if avplayer is state. but only instantiated it on button click. my next problem is how to make it play in a loop based on bool var. opened up a new thread about it. since videoplayer /av player has no way
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on Stepper is still buggy?
opacity count is options.count. i forgot to change that one. it took me quite some hours. my mistake was i tried to integrate the array in the stepper when the stepper should only store the index value which i can tehn use to get the value from the array. beginner's mistake. :D but boy.. it took me quite awhile to figure it out lol
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’22
Comment on "Invalid top-level type in JSON write"
Hi. youre right. i got it to work. ill definitely look into that after im done with ny app. right now i dont have the time to have to convert it to codable since i already have the parsing logic from my android app. so im converting em quickly except this one, got stuck.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on AttributeGraph: cycle detected
what do you mean by first responder
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on TabView Reloads all Tab
hmmm ill check. could be some other code is the caus3
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on TabView Reloads all Tab
@claude31 hmm it certainly did not reload the component. when the tab view was shown, it loaded all components. i figure the culprit is in my custom view. if i use the WebView as sample. we have TextView(), WebView(), TextView2(). the init in text view print shows when i switch from WebView to any of the other 2 TextView() views. but if the switch is between TextView() and TextView2(), its ok.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on TabView Reloads all Tab
seems the problem is of my own doing. I have so many state changes in onAppear that's why it recreates the tabs
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Why AVPlayer always nil
Hi @claude31 i actually can load the url in the browser. you are right about the unwrap without checking for nil is dangerous. but I purposely unwrapped it because my video url is fixed. but im using a sample video url to start with. about the url, i assumed it should be working since i can view the video in the browser.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Why AVPlayer always nil
ill try it. perhaps i wasnt observing that he (the post that said avplayer has to be a state) probably set it as state but did not make it optional. or because i only assigned it in init it resulted this way. it probably will work if it is a state optional but i set the value after a button click?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Why AVPlayer always nil
it's ok now. since i decided to implement my original workflow which is to load the video on a button selection in the sheet. thanks @claude31. sucks that videoplayer or avplayer doesnt have auto repeat and that some other class has to be used. and it is not even possible to put a thumbnail to the video while it is not playing.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Why AVPlayer always nil
i did get it to work even if avplayer is state. but only instantiated it on button click. my next problem is how to make it play in a loop based on bool var. opened up a new thread about it. since videoplayer /av player has no way
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Stepper is still buggy?
opacity count is options.count. i forgot to change that one. it took me quite some hours. my mistake was i tried to integrate the array in the stepper when the stepper should only store the index value which i can tehn use to get the value from the array. beginner's mistake. :D but boy.. it took me quite awhile to figure it out lol
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Stepper is still buggy?
Right. i confused myself with the value of the stepper and the array.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Nov ’22
Comment on Place Text on top of lines separating the colors
Hi @claude31 thank you. i will try this. hmmm maybe use .offset() to adjust the text to make it overlap between the line
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Comment on Place Text on top of lines separating the colors
work3d good. i us3d offset for the desired position
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Comment on How To Remove Extra Space Around Text
@claude31 perfect! i used alignmentGuide instead.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22
Comment on Can A Property In An ObservableObject listen to Another Property? How?
I also tried that. but nothing happens still.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Dec ’22