Post

Replies

Boosts

Views

Activity

Reply to Recipes App | SwiftUI | Creating the pages
You create the files in the project as I explained in the other thread. The struct will be named FirstTabView and SecondTabView. Those files content will look like this: FirstTabView.swift import SwiftUI struct FirstTabView: View { var body: some View { Text("Hello, FirstTabView!") } } struct FirstTabView_Previews: PreviewProvider { static var previews: some View { MySwiftUIView() } } and SecondTabView.swift import SwiftUI struct SecondTabView: View { var body: some View { Text("Hello, SecondTabView!") } } struct SecondTabView_Previews: PreviewProvider { static var previews: some View { MySwiftUIView() } } The connection to the tabBar is made by this code in the parent View (the one which will contain the tabbar) TabView { FirstTabView() .tabItem { Label("1st", systemImage: "list.dash") }
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to Collection view not displaying Cells
You don't show enough code. Could you show the code where you define the delegate and data source functions for the collectionView ? How is the cell defined ? Directly in the collectionView or with a specific nib ? Look at your code, I bet you will come in a few minutes after discovering a major flaw, as usual.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to What is the best way to get support for Xcode?
You've posted 4 similar questions in just one hour. That's not the best way to use the forum. I looked back at your original question. It lacks important information: what is Xcode version ? what is MacOS version ? what are simulators that work, those that don't ? What is the target version you have defined for your app ? when it doesn't work, does the simulator launch ? Do you see your app in the simulator screen ? Do you get error messages from Xcode in the Issues Navigator ? So how to get help ? By providing this type of information.
Jun ’21
Reply to iOS Custom Keyboard Extension - Change height to fullscreen
You can hide the Mike (turn dictation off) ; you can hide the globe as well : https://developer.apple.com/documentation/uikit/keyboards_and_input/creating_a_custom_keyboard Use UIInputViewController’s needsInputModeSwitchKey property to determine if you should display a button to switch keyboards. But I don't think we can remove the bar https : / / w w w.reddit. com/r/iphone/comments/7ay7x7/anyone_else_hate_this_bar_under_the_keyboard/ I could not find how to access to UIKeyboardDockView. I do not find it described in doc.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to Button that takes to new view controller does not work
I would check a few things first. Is the func called ? if the vc instantiated ? Is the pushView called ? So, I would instrument the code : @IBAction func fightButton(_ sender: UIButton) { print("fightButton called") if let vc = storyboard?.instantiateViewController(withIdentifier: "Battle") as? BattleViewController { print("BattleViewController instantiated") print("navigationController", navigationController) navigationController?.pushViewController(vc, animated: true) } } Please tell exactly what you get. Note that if you have defined a segue directly from the button, the IBAction will not be called.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’21
Reply to Button that takes to new view controller does not work
How and where is navigationController defined ? Is it defined in BattleViewController ? I would not delete and recreate the Navigation Controller. But better find it. Try what is explained here: https://stackoverflow.com/questions/25053846/swift-how-do-i-get-access-to-the-navigationcontroller-in-appdelegate let navigationController = self.window?.rootViewController as! UINavigationController
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’21