Post

Replies

Boosts

Views

Activity

Reply to Splitting text into cards
I did not receive an answer, and if I did, I could not understand and implement it. Unless you clarify what you want to do, your question will not be answered. https://stackoverflow.com/questions/66537950/how-can-i-split-text-into-cards Anyway, do everything for me-posts are not preferred both in stackoverflow and in the dev forums. Please clarify what you want to do and show what you have done till now.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to How do I add local videos to my app in Swift UI?
How do I mute the video in Swift UI, as this would sort my problem entirely? It's hard to say without seeing the view transition of your app. So just a simplified example: struct ContentView: View { let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "video", withExtension: "mov")!) var body: some View { VideoPlayer(player: avPlayer) .onDisappear { avPlayer.isMuted = false } } } Where you can access avPlayer, you can call methods (or modify properties) of AVPlayer - https://developer.apple.com/documentation/avfoundation/avplayer in some action closure appropriate. If the view transitions of your app is more complex and you need to call AVPlayer methods from within more Views, you may need to consider how to share the same instance avPlayer among such Views.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to How do I add local videos to my app in Swift UI?
Hi, yes video files. I can't get them to play. I've tried using AVKit but idk if that's right So, your issue is playing the video added to the project, not adding the video to the project. First of all, please check the video files are added to the target: Select a video file in the Project navigator Find Target Membership in the File Inspector, and check there is a checked check mark on your app target. Assuming you have checked above and all OK, this is a simple video playing view: import SwiftUI import AVKit struct ContentView: View { let avPlayer = AVPlayer(url: Bundle.main.url(forResource: "video", withExtension: "mov")!) var body: some View { VideoPlayer(player: avPlayer) } } (Assuming video.mov is correctly added to the app target. Please do no forget that file system of iOS is case-sensitive.)
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to How do I add local videos to my app in Swift UI?
What do you mean by local videos? Are they video files? If so, I do not understand what you think is difficult, it is as easy as adding images to your project. By the way, you are not finishing any of your previous posts. If any of the replies solved your issue, please mark the answer as SOLVED. If you solved your issue by yourself (including watching other sites), please post the answer by yourself and mark it SOLVED.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Core Data Make Decodable
Seems you do not think PlayersVC or cPlayerArr is related... OK, I can guess, just that makes me spend more time.         let decoder = JSONDecoder()         let appDelegate = UIApplication.shared.delegate as! AppDelegate //- Intentionally using forced casting.         decoder.userInfo[.managedObjectContext] = appDelegate.persistentContainer.viewContext
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Core Data Make Decodable
I can show you the method but I will have to remove the API key. Thanks for showing additional code, and it's OK I do not need API key. But what I want is context. In which class you defined the method? Please show whole definition of the class, including the definitions of all related properties and methods.
Topic: Programming Languages SubTopic: Swift Tags:
Mar ’21
Reply to Adding png to ImageView causes black screen
So I conclude that there's a size limit (or some similar issue) to launch screen images. Is there? Very likely. I could have reproduced the black screen issue with my 3024x4032 jpg. I do not know if this is a known issue or documented somewhere, but, in fact, I use a full screen image of size 1242x2688 jpg in my recent project and it shows fine. Thanks for finding this and sharing your experience.
Mar ’21
Reply to UICollectionView - Changing UI of one specific cell causes changes for every fifth cell
Add var favorite: Bool parameter to my struct.  When the data of a tweet is fetched from JSON, set favorite's default value to false.  When the button addToFavorite is pushed, toggle favorites value to true and save that object with some persistence manager, Then, every time data is fetched again for the same user to get his/her tweets, do a check if the tweet exists in persistence manager with the favorite parameter set to true, and if it does, set its UI accordingly? Seems to be a possible implementation.
Topic: UI Frameworks SubTopic: UIKit Tags:
Mar ’21
Reply to Splitting text into cards
First of all, please clarify what you want to do. You should better show some example inputs: the text and title comes from the Internet. And output examples for each input, what sort of cards will be shown? (Frankly, I do not understand why device size would affect.) Frankly, Claude31's first reply is too difficult even for me, so it is quite reasonable you do not understand it well. But if it would be the right direction to achieve what you want, you may need to learn it, even if it may take very long time. (Simply saying, writing an app would not be so simple.) So, I recommend you to clarify what you want to achieve. That will help both you and us to judge whether the proposed solution would be the right way to go, or not.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21