Post

Replies

Boosts

Views

Activity

Reply to Xcode simulator does not show the same as Preview
Your code will not build in Xcode, as you have not supplied the definition of "tamanosDispositivos". I think "func interfazCambio ()" should be within "tamanosDispositivos"? Your code for "func interfazCambio ()" is not valid (there is an "else if", which is not part of an "if" statement). So it is very difficult to say what might be going wrong. However, I can make some general comments: You seem to have made things very, very complicated. This does not seem to be in keeping with the principles of SwiftUI, which allow the building of a device-independent User Interface, without explicitly accounting for every variation between the different screen sizes (as you seem to do). I would suggest that you simplify your UI down to a minimal specification, and get that working first: What Views appear on screen? What are the spatial relationships between them? What conditions affect these? I would also suggest that you consider abandoning the external code library (which is just an extra complication, at this stage), and use standard SwiftUI until you have a more thorough understanding of it. (This only affects "VisualEffectBlurView", in the supplied code.) You might also want to consider some further study of SwiftUI... ...I highly recommend Paul Hegarty's Stanford course, at https://cs193p.sites.stanford.edu If you have more specific issues, I suggest you post them here on the forum, as new questions.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21
Reply to app rejection in app store
You seem to be saying that your app is about watching ads. Apple agree that: "The primary purpose of your app is to encourage users to watch ads" And they also say that this: "...is not appropriate for the App Store" You mention your app is "exactly like goodeed" (perhaps you mean "GoodDeed"?) It is not a good idea to simply copy an existing app, but in any case, the presence of existing apps on the App Store will not help your own submission (especially if you are rejected for being a copy of another app). Your app's submission will have to succeed on it's own merits. If you want your app to be approved, you will have to add some more functionality to it, beyond just watching ads.
Nov ’21
Reply to self is used before all properties are initialized (Swift)
I like it as it gets rid of the optional. However, but that still requires that the property 'callback' in ModelDemo and the property 'modelDemo' need to be var's. If there was a way to do everything in the init(), they could be let's You could protect the vars by making them "private (set)" (which, as you probably know, makes them read-only to the outside world (as if they were "let")). Giving this: struct ModelDemo { private (set) var callback: () -> () = {} mutating func setCallback(_ callback: @escaping () -> ()) { self.callback = callback } } final class ViewModelDemo { private (set) var modelDemo = ModelDemo() init() { modelDemo.setCallback(modelCallback) } private func modelCallback() { } }
Topic: Programming Languages SubTopic: Swift Tags:
Nov ’21
Reply to LazyVGrid in Xcode 13 ignores Spacer
In GridItem, you can specify the alignment, which in your example is .topLeading Try: private let columns = Array(repeating: GridItem(.flexible(), spacing: 24, alignment: .topLeading), count: 4) That seems to give the result you want. It can be possible for default values to change, between versions of Xcode? Probably best to specify the exact behavior that you want.
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Nov ’21