Post

Replies

Boosts

Views

Activity

Reply to Pushed over tabs
Here you go: It does not make sense shown only one view controller. You say you use tab bar controller and navigation controller. You have at least 3 view controllers, two for tab bar controller, and one for pushed in navigation controller.
Mar ’21
Reply to Pushed over tabs
would you like the rest of the code, the project or a screenshot of the storyboard? Any info that helps to write an example. You are not any more a beginner here in the dev forums. Please think yourself what is needed to write an answer best fit for you.
Mar ’21
Reply to Pushed over tabs
Ok, I have other view controllers that don't have any code connected to them. The only other part of code is loading a form. All the code I have is there. I see. There may be some superhero who can read your mind and give you an example. Good luck.
Mar ’21
Reply to onDelete change label
I mean this, if you swipe right, then stands there "Delete". How can I change this? You mean you want to localize the swipe action label "Delete"? Such a system resource should be automatically localized with Language settings properly set. Have you tried? EDIT Seems simply setting the Language does not change "Delete". Have you succeeded? By the way, you marked your own reply as SOLVED, this means your issue is solved. Have you find the solution?
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to onDelete change label
I have added Japanese (ja) to Localizations of PROJECT./Info. And set the Language of the simulator to 日本語(Japanese), then the swipe action for "Delete" is shown as "削除" (meaning "Delete" in Japanese). I believe this may work for your project using Deutsch, assuming the base development language of your project is English (Xcode default).
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to The zIndex of a View does not update correctly inside ForEach?
Unfortunately, SwiftUI cannot detect changes of properties in an Array, when the Element is a reference type. (Even when you add @State on the Array declaration or you add @Published to the properties.) So, changes to color or order do not trigger UI updates in ContentViews. If you make XRectModel struct, and add @State to rects, you will find zIndex works correctly: struct XRectModel: Hashable { var id = UUID() var color: Color var order: Double } struct XRect: View { static var maxorder: Double = 0 @Binding var rect: XRectModel @State var pos: CGSize = CGSize() var drag: some Gesture { DragGesture() .onChanged { pos in self.pos = pos.translation XRect.maxorder += 1 rect.order = XRect.maxorder print("Rect: \(rect.color.description), Order: \(rect.order)") } } var body: some View { Rectangle() .foregroundColor(rect.color) .frame(width: 200, height: 200, alignment: .center) .offset(pos) .gesture(drag) } } struct ContentViews: View { @State var rects = [XRectModel(color: Color.green, order: 0), XRectModel(color: Color.yellow, order: 0), XRectModel(color: Color.red, order: 0)] var body: some View { ZStack { Color.blue ForEach(rects.indices, id: \.self) { index in XRect(rect: $rects[index]) .zIndex(rects[index].order) } } } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21
Reply to Pushed over tabs
You should better not mark non-solution answers as SOLVED. Please read the support page of the dev forums - https://developer.apple.com/support/forums/. (If already read once, then again more carefully.) One more, SOLVED threads would not get much attention. You should better start a refreshed new thread. Please do not forget to include as much info as you can show.
Mar ’21
Reply to onDelete change label
but I don't know how can I undo this. Unfortunately this site does not provide us to unmark SOLVED. You need to make extra care about that. (Bad UI design!) How can I change the language settings in Xcode? Not in Xcode. In simulators (or actual devices). Open Settings app and go General Languages and Regions.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Mar ’21