Post

Replies

Boosts

Views

Activity

Reply to SwiftUI. Want to code in each page that’s connected to the tabBar
Hope I understand your problem… Just create a New file in the project in Xcode (Fle > New > File), and select SwiftUIView Name it MySwiftUIView Adapt the template code to what you want to present: import SwiftUI struct MySwiftUIView: View { var body: some View { Text("Hello, World!") } } struct MySwiftUIView_Previews: PreviewProvider { static var previews: some View { MySwiftUIView() } } Then, call it in the tabbar: TabView { MySwiftUIView() .tabItem { Label("MyView", systemImage: "list.dash") }
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to Open App from custom keyboard button action
I am little bit confuse. Why are you ? Are you trying the same mechanism than the one described in the other post ? If so, eskimo's answer (yes, 4 years ago) was very clear: not possible. Unless things have changed since, but I did not hear about it. If not, please tell how you are trying.
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’21
Reply to Recipes App | SwiftUI | Creating the pages
I didn't notice it was SwiftUI (the tags do not tell correctly). In SwiftUI, it is direct: when you create the TabView, you will have in the main view (with all the tabs), code such as: TabView { FirstTabView() .tabItem { Label("1st", systemImage: "list.dash") } SecondTabView() .tabItem { Label("2nd", systemImage: "square.and.pencil") } } Note: In UIKit, the simplest way to do this: In IB, you create ViewControllers for each destination page (one for each tab bar icon) You add objects in this VC You connect the tabBarController with a relationship segue (connect in the right order, the VC for the first tab first) You create a class for each VC (let's say class FirstViewController: UIViewController { } In IB, in Identity inspector, set the class of the VC(s): FirstViewController for the first VC Now you can connect the IBOutlets, the IBActions of objects FirstViewController to the code.
Topic: Programming Languages SubTopic: Swift Tags:
Jun ’21
Reply to Obsolescence and the new way of consuming
It is useless to post 2 threads for the same topic. In addition, developers cannot do much for you, we are just developers, not Apple customer support. Considering that a 10 years old product has some limits is a proof of planned obsolescence is a far stretch. Unless you consider that OS versions, apps, should be kept frozen for 20 years ? Have a good day though.
Topic: App & System Services SubTopic: Core OS Tags:
Jun ’21
Reply to How to access viewController components in model (MVC)
You need to better understand what MVC is. The model is somehow the back office: you ask it to do some computation, to return you values to display. But it has no access to the front office (the view content) The view is presenting the data that it can get from the Model. And Controller manages the logic and connects the 2. That also where you trigger alerts. So, you should: in VC, when the user taps, you request the model to update some value on return, you pass those values to the view (which usually means updating the IBOutlets) You may have a look at this tutorial: https :// medium. com/@adam_50439/coordinate-dont-delegate-59a04f97996c
Topic: UI Frameworks SubTopic: UIKit Tags:
Jun ’21