Post

Replies

Boosts

Views

Activity

Reply to Where's the Sandwich assets & code? wwdc20-10119
Well - no answer yet... Here's a version of Sandwich.swift you can copy & paste. // //  Sandwich.swift //  Sandwich // //  Created by David on 6/23/20. //  Copyright © 2020 Life Works IQ Consulting. All rights reserved. // import Foundation struct Sandwich {     var id = UUID()     var name: String     var ingredientCount: Int     var isSpicy: Bool = false          var imageName: String { return name }     var thumbnailName: String { return name + "Thumb"} } let testData = [     Sandwich(name: "Club", ingredientCount: 4, isSpicy: false),     Sandwich(name: "Pastrami on rye", ingredientCount: 4, isSpicy: true),     Sandwich(name: "French dip", ingredientCount: 3, isSpicy: false),     Sandwich(name: "Banh mi", ingredientCount: 5, isSpicy: true),     Sandwich(name: "Ice cream sandwich", ingredientCount: 2, isSpicy: false),     Sandwich(name: "Croque madame", ingredientCount: 4, isSpicy: false),     Sandwich(name: "Hot dog", ingredientCount: 2, isSpicy: true),     Sandwich(name: "Fluffernutter", ingredientCount: 2, isSpicy: false),     Sandwich(name: "Avocado toast", ingredientCount: 3, isSpicy: true),     Sandwich(name: "Gua bao", ingredientCount: 4, isSpicy: true), ]
Jun ’20
Reply to Aspiring Developer
In addition to Paul Hudson's great work on SwiftUI there is a Udemy course (it goes on sell regularly) iOS 13 & Swift 5 - The Complete iOS App Development Bootcamp I've enjoyed that course a lot - it has many details and lots of content. by Dr Angela Yu
Jun ’20
Reply to How to rotate views in-place when orientation changes?
Hello all, I'm wanting to code something similar.  Right now I have a List - which does a vertical scroll just naturally.  I assumed (what an ) that I'd just add a modifier to make List(.horizontal) but the compiler rejected that real fast.  That resulted in about 6 google searches (one found this thread) with no easy results.  Next (should have been first) went to Mark Moeykens Swift UI Views Mastery book (awesome resource) - quickly found that I needed to sub out the List for a ScrollView that can do HORIZONTAL!!  But my first Purview/Canvas test proved it was not just a drop in replacement for List.  It compiled but the views I have in the list display with differently colored white space. So now that I've a view that can handle up&down as well as side-to-side... I need the env to tell my view which one it should use. I'm confused by the Apple docs... (imagine that Apple - - take some of the nest egg and hire some Tech-Writers for the developers you make so much money with!) what the heck is this trying very hard to tell me??  UIInterfaceOrientation Starting in iOS 8, you should employ the UITraitCollection and UITraitEnvironmentAPIs, and size class properties as used in those APIs, instead of using UIInterfaceOrientation constants or otherwise writing your app in terms of interface orientation. Important -in a nice ugly yellow box- Notice that UIDeviceOrientation.landscapeRight is assigned to UIInterfaceOrientation.landscapeLeft and UIDeviceOrientation.landscapeLeft is assigned to UIInterfaceOrientation.landscapeRight. The reason for this is that rotating the device requires rotating the content in the opposite direction. This UIInterfaceOrientation.isPortrait seems like the call I'd want to shove into the ScrollView   ...   ScrollView( UIInterfaceOrientation.isPortrait ? .horizontal : .vertical ) { ... } I'm trying to decipher the  notes ... about versions ... is it supported ?  is it supported in 14+ and beyond?  Or am I that can not understand the docs English?
Mar ’21