Post

Replies

Boosts

Views

Activity

Reply to Page View Controller pages stuck in the middle during fast tap on PageControl
Could you post the code of the pageViewController ? There could be a delegate func in which to insert a very short (0.2 s) pause, like this func:     func pageViewController(_ pageViewController: UIPageViewController, didFinishAnimating finished: Bool, previousViewControllers: [UIViewController], transitionCompleted completed: Bool) { } But I would need to see the code to confirm.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21
Reply to Xcode installation
Please explain exactly the problem. Did you download without problem ? from which website ? during installation, does it crash, does it stops, does it anything else ? do you get error message ? Which ? Have you check you have enough disk space (100 GB typically) available ?
Apr ’21
Reply to Simplify code with textfield and textview delegate methods?
You could also group both actions in a single one, if tou define a property in the class : private var viewMoved = false @IBAction func beginEditing(_ sender: Any) { self.view.setNeedsLayout() UIView.animate(withDuration: 0.2, animations: { self.view.center.y += self.viewMoved ? -150 : 150 }, completion: { finished in self.viewMoved.toggle() }) } And connect the beginEditing and endEditing events for both TextField and TextView to this IBAction. However, I do not recommend such a design, harder to understand.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21
Reply to Simplify code with textfield and textview delegate methods?
A first way to do is to create an IBAction with sender as Any:  @IBAction func beginEditing(_ sender: Any) { self.view.setNeedsLayout() UIView.animate(withDuration: 0.2, animations: { self.view.center.y -= 150 }, completion: { finished in }) } And connect in IB (connections inspector), the sent event "Editing Did Begin" to this IBAction, for both TextField and TextView. Do similar for end editing. Another way (I personally prefer) is to use keyboard notifications. Register the top view to those notifications. Create func to respond to those notifications:     @objc func keyboardWillShow(_ note : Notification) - Void { } and     @objc func keyboardWillHide(_ sender: Notification) { }
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21
Reply to Changing UITabBar item image on selected and unselected state for Three Tabs but getting error
Where do you do this ? If need to change a tabBar item, you should not in the UITabBarController, but in each UIViewController, in its viewDidload and viewWillDisappear for instance. The initial definition should be done in IB directly. Select the TabBarItem in each UIViewController Set the image in the Tab Bar Item section of Attributes Inspector. Same thing for selected Image. And you can define the default image (image) in bar Item as well. If that does not work, please explain more in detail the problem. If that's OK don't forget to mark the correct answer to close the thread.
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21
Reply to Xcode 12.4 Xib Bug
But when I open it from the App Store mostly it works fine Mostly or completely ? Does it work when you launch from Xcode ? What type of app is it ? MacOS App ? Did you notarise your app ? it doesn't loads the xib files properly and while building the project shows errors That's not clear at all: does not load the xib: in Xcode IB or in executable ? Please tell precisely what errors you get. Here you build the project. When you load from appstore, you load the executable. If you loaded on the appstore, that means the app is OK How could you have build errors… Please clarify the context, you are mixing very different things.
Apr ’21
Reply to Changing UITabBar item image on selected and unselected state for Three Tabs but getting error
If you use this code it will fail. Correct code is: declare an IBOutlet for the tabBarItem in its respective VC For instance in VC1:     @IBOutlet weak var tabBarItem1: UITabBarItem!   In viewDidload of VC1: tabBarItem1.title = "Myanmar" tabBarItem1.image = UIImage(systemName: "m.square.fill"), tabBarItem1.selectedImage = UIImage(systemName: "m.square") Do the same in other VCs Once again, it is so easier to do it in IB…
Topic: UI Frameworks SubTopic: UIKit Tags:
Apr ’21