Post

Replies

Boosts

Views

Activity

Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
Yeah, this is actually my question. I still have "PodcastViewCell" as Table View Cell, like in my previous question. Now, I want to show "PlayerViewCell" (a full-screen player view I recently added) when the "Play" button in the "PodcastViewCell" nib is pressed. Or should I just add a View to the storyboard then just change its visibility? Or should I do something else?
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I've achieved to play my player outside of the xib, in my view controller as you suggested earlier. Thanks for the idea again! Then I created a container view for the playerViewCell nib on my storyboard for the player and marked it as hidden. When I try to unhide it with swift podcastView.isHidden = false I always get debugger "Unexpectedly found nil while implicitly unwrapping an Optional value" I don't know why it isn't loaded even tho the controller's other elements (like play button, etc.) on the screen. (Even tried to use dummy UIView and just unhide it but still got the same error.)
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I am able to hide/unhide the view in general when I try to do it on most functions. But I get the error when I try to do it on one specific function: the function I call from nib file. I don’t know what is the issue but I think this usually happens if I try to change an element’s properties before loading it. But all of the other elements are loaded when I call the function, like play button or podcast title label.
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
My view controller for podcasts table, now it plays the podcast too. swift class DetailViewController: BaseViewController {     @IBOutlet weak var collectionView: UICollectionView!     @IBOutlet weak var podcastPlayerView: UIView!     var podcastLink: String = ""     static var itemId = "0"     var player: AVPlayer?     var playerItem: AVPlayerItem?     var timeObserverToken: Any?     var played = false     override func viewDidLoad() {         super.viewDidLoad()         "self.podcastPlayerView.isHidden = false" "-------- Unhiding process successful in this step"     }     override func viewWillDisappear(_ animated: Bool) {         showPodcastButton = false         player?.pause()         player?.replaceCurrentItem(with: nil)         player = nil     }     func setupPodcastPlayer(link: String) {         player?.pause()         player?.replaceCurrentItem(with: nil)         player = nil         if !played {             if link != "" {                 playerItem = AVPlayerItem( url:NSURL( string:link )! as URL )                 player = AVPlayer(playerItem:playerItem)                 player!.rate = 1.0;                 player!.play()                 played = true                 didPlayedOnce = true                 podcastPlay()             } else {                 "link empty"             }         } else {             player?.replaceCurrentItem(with: nil)             played = false         }     }     func podcastPlay() { self.podcastPlayerView.isHidden = false "---- If I try to unhide here, app crashes." "Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value"     } } The "Play Button" action from PodcastViewCell, where I call ViewController's player function. This only passes the cell's podcast link. swift @IBAction func playPodcast(_ sender: Any) {         NotificationCenter.default.addObserver(self, selector: #selector(playerItemDidReachEnd), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)         if let itemOffset = DetailViewController.allItems?.itemListv2.firstIndex(where: {$0.itemId == itemAuthor?.itemId}) {         podcastLink = DetailViewController.allItems?.itemListv2[itemOffset].podcastsound         } let url = podcastLink ?? " "         requestAuthorDetailViewController.setupPodcastPlayer(link: url) }
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I can easily hide/unhide the podcastPlayerView in viewWillAppear, or a function calling in the viewWillAppear. But after the load, if any function tries to hide/unhide the view, the application crashes. It's like the view gets destroyed after load. Searched for a force loading method but couldn't find anything working for me. One of them was adding this to viewDidLoad() but I still can't reach the podcastPlayerView swift view.addSubview(podcastPlayerView)
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I have found the answer by using delegates. Now I can hide/unhide (edit, overall) the view's properties. This was the problem answered by Sh_Khan: Problem is here DetailViewController().setupPodcastPlayer(link: url) This DetailViewController() is a new instance not the presented one , hook the real shown one and change it's attribute as needed through delegate or a notification if you need to I have declared a delegate in PodcastViewCell: swift var delegate: PodcastViewCellDelegate? and its protocol for passing data : swift protocol PodcastViewCellDelegate {     func podcastButtonClicked(podcastUrl: String) } In the View Controller, I want to edit element from, added this : swift extension DetailViewController: PodcastViewCellDelegate {     func podcastButtonClicked(podcastUrl: String) {         setupPodcastPlayer(link: podcastUrl)         podcastPlayerView.isHidden = false     } } Now my player works as expected and I can hide/unhide my UIView! Thank you for all of your efforts again! Hope to see you in another thread 😅
Topic: UI Frameworks SubTopic: UIKit Tags:
May ’21
Reply to apple testflight question
An account with Administrator rights would be dangerous to give 3rd party people because Administrator accounts have permission like withdrawing the income money etc. You (or even themselves) can create an account and then you can give App Manager rights to the account, it'd be enough if their job is gonna be only to do the upload process. They might need your rights while setting the certificates, but other than that, App Manager rights should be alright.
Aug ’21
Reply to Updating an app with new features without uploading it to App Store(but still having it updated on all phones where the app is installed on)
I think Spotify does update its UI changes without actually updating the application all the time. I think you can achieve this with backend services easily. You can set up your new views including UI changes and check if a variable from the service is true or false. If true, use the UI with changes, else use the old one. I don't know about guidelines tho. It sounds easily abusable.
Aug ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I am having issues with presenting the nib cell. I want to show the player view when the play button pressed. But couldn’t get how to reach that nib.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
Yeah, this is actually my question. I still have "PodcastViewCell" as Table View Cell, like in my previous question. Now, I want to show "PlayerViewCell" (a full-screen player view I recently added) when the "Play" button in the "PodcastViewCell" nib is pressed. Or should I just add a View to the storyboard then just change its visibility? Or should I do something else?
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I've achieved to play my player outside of the xib, in my view controller as you suggested earlier. Thanks for the idea again! Then I created a container view for the playerViewCell nib on my storyboard for the player and marked it as hidden. When I try to unhide it with swift podcastView.isHidden = false I always get debugger "Unexpectedly found nil while implicitly unwrapping an Optional value" I don't know why it isn't loaded even tho the controller's other elements (like play button, etc.) on the screen. (Even tried to use dummy UIView and just unhide it but still got the same error.)
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I am able to hide/unhide the view in general when I try to do it on most functions. But I get the error when I try to do it on one specific function: the function I call from nib file. I don’t know what is the issue but I think this usually happens if I try to change an element’s properties before loading it. But all of the other elements are loaded when I call the function, like play button or podcast title label.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
My view controller for podcasts table, now it plays the podcast too. swift class DetailViewController: BaseViewController {     @IBOutlet weak var collectionView: UICollectionView!     @IBOutlet weak var podcastPlayerView: UIView!     var podcastLink: String = ""     static var itemId = "0"     var player: AVPlayer?     var playerItem: AVPlayerItem?     var timeObserverToken: Any?     var played = false     override func viewDidLoad() {         super.viewDidLoad()         "self.podcastPlayerView.isHidden = false" "-------- Unhiding process successful in this step"     }     override func viewWillDisappear(_ animated: Bool) {         showPodcastButton = false         player?.pause()         player?.replaceCurrentItem(with: nil)         player = nil     }     func setupPodcastPlayer(link: String) {         player?.pause()         player?.replaceCurrentItem(with: nil)         player = nil         if !played {             if link != "" {                 playerItem = AVPlayerItem( url:NSURL( string:link )! as URL )                 player = AVPlayer(playerItem:playerItem)                 player!.rate = 1.0;                 player!.play()                 played = true                 didPlayedOnce = true                 podcastPlay()             } else {                 "link empty"             }         } else {             player?.replaceCurrentItem(with: nil)             played = false         }     }     func podcastPlay() { self.podcastPlayerView.isHidden = false "---- If I try to unhide here, app crashes." "Thread 1: Fatal error: Unexpectedly found nil while implicitly unwrapping an Optional value"     } } The "Play Button" action from PodcastViewCell, where I call ViewController's player function. This only passes the cell's podcast link. swift @IBAction func playPodcast(_ sender: Any) {         NotificationCenter.default.addObserver(self, selector: #selector(playerItemDidReachEnd), name: NSNotification.Name.AVPlayerItemDidPlayToEndTime, object: nil)         if let itemOffset = DetailViewController.allItems?.itemListv2.firstIndex(where: {$0.itemId == itemAuthor?.itemId}) {         podcastLink = DetailViewController.allItems?.itemListv2[itemOffset].podcastsound         } let url = podcastLink ?? " "         requestAuthorDetailViewController.setupPodcastPlayer(link: url) }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
The comments on lines 50 and 16 are for that purpose. Named podcastView as podcastPlayerView
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I can easily hide/unhide the podcastPlayerView in viewWillAppear, or a function calling in the viewWillAppear. But after the load, if any function tries to hide/unhide the view, the application crashes. It's like the view gets destroyed after load. Searched for a force loading method but couldn't find anything working for me. One of them was adding this to viewDidLoad() but I still can't reach the podcastPlayerView swift view.addSubview(podcastPlayerView)
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I think so. If it didn't connect correctly, I wouldn't hide or unhide the view in viewDidLoad right? I see the view controller's name is correct under Referencing Outlets when I right click the view but still tried removing and then adding the connection again but no use.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to Swift - How to Call and Show XIB/StoryBoard inside from XIB?
I have found the answer by using delegates. Now I can hide/unhide (edit, overall) the view's properties. This was the problem answered by Sh_Khan: Problem is here DetailViewController().setupPodcastPlayer(link: url) This DetailViewController() is a new instance not the presented one , hook the real shown one and change it's attribute as needed through delegate or a notification if you need to I have declared a delegate in PodcastViewCell: swift var delegate: PodcastViewCellDelegate? and its protocol for passing data : swift protocol PodcastViewCellDelegate {     func podcastButtonClicked(podcastUrl: String) } In the View Controller, I want to edit element from, added this : swift extension DetailViewController: PodcastViewCellDelegate {     func podcastButtonClicked(podcastUrl: String) {         setupPodcastPlayer(link: podcastUrl)         podcastPlayerView.isHidden = false     } } Now my player works as expected and I can hide/unhide my UIView! Thank you for all of your efforts again! Hope to see you in another thread 😅
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
May ’21
Reply to iOS 15 bêta
I don't think this is the correct forum to ask it, but here is the article was written by Apple. Installing Apple Beta Software
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jun ’21
Reply to Unable to Dequeue Registered CollectionViewCells
‘awakeFromNib()’ is the equal of ‘viewDidLoad()’ for custom cells (aka XIBs) and I register the cells in where it should be. I already tried debugging and see if the method being called, it actually does run the register steps, but somehow the cells are not registered in the end.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Wrong images in App Store
Did you submit and publish your latest build/version with new screenshots? You need to submit your application again for any screenshot change.
Replies
Boosts
Views
Activity
Aug ’21
Reply to apple testflight question
An account with Administrator rights would be dangerous to give 3rd party people because Administrator accounts have permission like withdrawing the income money etc. You (or even themselves) can create an account and then you can give App Manager rights to the account, it'd be enough if their job is gonna be only to do the upload process. They might need your rights while setting the certificates, but other than that, App Manager rights should be alright.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Updating an app with new features without uploading it to App Store(but still having it updated on all phones where the app is installed on)
I think Spotify does update its UI changes without actually updating the application all the time. I think you can achieve this with backend services easily. You can set up your new views including UI changes and check if a variable from the service is true or false. If true, use the UI with changes, else use the old one. I don't know about guidelines tho. It sounds easily abusable.
Replies
Boosts
Views
Activity
Aug ’21
Reply to Is it possible to change paid to free app
App Store Connect -> Choose the application you want to change pricing And change the pricing from the dropdown menu then press Save button. Don't forget that your application's rankings will reset after pricing change.
Topic: Business & Education SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’21