Post

Replies

Boosts

Views

Activity

Reply to why elements don't have equal sizes?
Set horizontal hugging priority for 60 to 252 as suggested Add a equal height constraint between EDIT TIMER DURATION and ANOTHER LABEL Set vertical hugging priority for Duration to 1000 Set vertical hugging priority for Horizontal Slider to 1000
Topic: UI Frameworks SubTopic: UIKit Tags:
Nov ’21
Reply to Decoding JSON
struct OpenTotal: Decodable {     var total: Double?     var overOdds: Int?     var underOdds: Int? } struct CurrentTotal: Decodable {     var total: Double?     var overOdds: Int?     var underOdds: Int? }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to Where to put the animation
struct CardView: View {     @State var isFaceUp = false     var body: some View {         ZStack {             let shape = RoundedRectangle(cornerRadius: 20)             if isFaceUp {                 shape.fill().foregroundColor(.white)                 shape.stroke(lineWidth: 3)                 Text("😀").font(.system(size: 80))             } else {                 shape.fill()             }         }         .rotation3DEffect(Angle(degrees: isFaceUp ? 180 : 0), axis: (x: 0, y: 1, z: 0))         .animation(.spring(), value: isFaceUp)         .onTapGesture {             isFaceUp.toggle()         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Jan ’22
Reply to UIListContentConfiguration text color during selection
let cellConfigiuration = UICollectionView.CellRegistration<UICollectionViewListCell, String> { cell, indexPath, itemIdentifier in         var contentConfiguration = UIListContentConfiguration.sidebarSubtitleCell()         contentConfiguration.text = "Primary Text: \(itemIdentifier)"         contentConfiguration.secondaryText = "Secondary Text"         cell.contentConfiguration = contentConfiguration         var backgroundConfiguration = UIBackgroundConfiguration.listSidebarCell()         backgroundConfiguration.backgroundColor = .systemGray5         cell.backgroundConfiguration = backgroundConfiguration         cell.configurationUpdateHandler = { cell, state in             guard var cConfig = cell.contentConfiguration?.updated(for: state) as? UIListContentConfiguration else { return }             cConfig.textProperties.colorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .white : .black             }             cConfig.secondaryTextProperties.colorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .white : .black             }             cell.contentConfiguration = cConfig             guard var bConfig = cell.backgroundConfiguration?.updated(for: state) else { return }             bConfig.backgroundColorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .systemMint : .systemGray5             }             cell.backgroundConfiguration = bConfig         }     }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’22
Reply to UIListContentConfiguration text color during selection
For iOS 14, I think you have to subclass UICollectionViewListCell and override updateConfiguration(using state: UICellConfigurationState). It should work for iOS 15 also. let cellConfiguration = UICollectionView.CellRegistration<MyCell, String>....     override func updateConfiguration(using state: UICellConfigurationState) {         super.updateConfiguration(using: state)         guard var cConfig = self.contentConfiguration?.updated(for: state) as? UIListContentConfiguration else { return }         cConfig.textProperties.colorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .white : .black         }         cConfig.secondaryTextProperties.colorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .white : .black         }         self.contentConfiguration = cConfig         guard var bConfig = self.backgroundConfiguration?.updated(for: state) else { return }         bConfig.backgroundColorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .systemPink : .systemGray5         }         self.backgroundConfiguration = bConfig     } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Jan ’22
Reply to MKLocalSearch.start returning undocumented MKErrorGEOError
This API is broken https://developer.apple.com/documentation/mapkit/mklocalpointsofinterestrequest/ and either returns MKErrorGEOError=-8 or returns invalid results.
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to WKWebview doesn't handle 421 responses
WKWebView does not handle anything automatically. You have to implement it.
Topic: Programming Languages SubTopic: Swift Tags:
Replies
Boosts
Views
Activity
Jul ’21
Reply to Trackpad issues - 2 finger scroll bouncing around
https://support.apple.com/macos
Topic: App & System Services SubTopic: Core OS Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to why elements don't have equal sizes?
Set horizontal hugging priority for 60 to 252 as suggested Add a equal height constraint between EDIT TIMER DURATION and ANOTHER LABEL Set vertical hugging priority for Duration to 1000 Set vertical hugging priority for Horizontal Slider to 1000
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Nov ’21
Reply to Heads-up: Xcode 13.2 takes a super-long time to install.
This one seems to be extra slow.
Replies
Boosts
Views
Activity
Dec ’21
Reply to XCode stuck installing
Should complete installing in about 8 hours.
Replies
Boosts
Views
Activity
Dec ’21
Reply to Xcode 13.2.1 - code completion failing quite often - rebuild?
Quick Help also doesn't work properly. Refactor is also broken.
Replies
Boosts
Views
Activity
Dec ’21
Reply to After upgrading to Xcode 13.2.1, debugging with a lower version of the iOS device still crashes at launching
Crashes even with iOS 14.5 simulator
Replies
Boosts
Views
Activity
Dec ’21
Reply to This NSPersistentStoreCoordinator has no persistent stores (device locked). It cannot perform a save operation. (null)
Could this be the possible solution:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Difference between @ObservedObject, ObservableObject and @StateObject
This might help https://www.hackingwithswift.com/quick-start/swiftui/whats-the-difference-between-observedobject-state-and-environmentobject
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Inset grouped table cells not aligned with large title
Screenshot
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Decoding JSON
struct OpenTotal: Decodable {     var total: Double?     var overOdds: Int?     var underOdds: Int? } struct CurrentTotal: Decodable {     var total: Double?     var overOdds: Int?     var underOdds: Int? }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to Where to put the animation
struct CardView: View {     @State var isFaceUp = false     var body: some View {         ZStack {             let shape = RoundedRectangle(cornerRadius: 20)             if isFaceUp {                 shape.fill().foregroundColor(.white)                 shape.stroke(lineWidth: 3)                 Text("😀").font(.system(size: 80))             } else {                 shape.fill()             }         }         .rotation3DEffect(Angle(degrees: isFaceUp ? 180 : 0), axis: (x: 0, y: 1, z: 0))         .animation(.spring(), value: isFaceUp)         .onTapGesture {             isFaceUp.toggle()         }     } }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to UIListContentConfiguration text color during selection
let cellConfigiuration = UICollectionView.CellRegistration<UICollectionViewListCell, String> { cell, indexPath, itemIdentifier in         var contentConfiguration = UIListContentConfiguration.sidebarSubtitleCell()         contentConfiguration.text = "Primary Text: \(itemIdentifier)"         contentConfiguration.secondaryText = "Secondary Text"         cell.contentConfiguration = contentConfiguration         var backgroundConfiguration = UIBackgroundConfiguration.listSidebarCell()         backgroundConfiguration.backgroundColor = .systemGray5         cell.backgroundConfiguration = backgroundConfiguration         cell.configurationUpdateHandler = { cell, state in             guard var cConfig = cell.contentConfiguration?.updated(for: state) as? UIListContentConfiguration else { return }             cConfig.textProperties.colorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .white : .black             }             cConfig.secondaryTextProperties.colorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .white : .black             }             cell.contentConfiguration = cConfig             guard var bConfig = cell.backgroundConfiguration?.updated(for: state) else { return }             bConfig.backgroundColorTransformer = UIConfigurationColorTransformer { color in                 state.isSelected || state.isHighlighted ? .systemMint : .systemGray5             }             cell.backgroundConfiguration = bConfig         }     }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22
Reply to UIListContentConfiguration text color during selection
For iOS 14, I think you have to subclass UICollectionViewListCell and override updateConfiguration(using state: UICellConfigurationState). It should work for iOS 15 also. let cellConfiguration = UICollectionView.CellRegistration<MyCell, String>....     override func updateConfiguration(using state: UICellConfigurationState) {         super.updateConfiguration(using: state)         guard var cConfig = self.contentConfiguration?.updated(for: state) as? UIListContentConfiguration else { return }         cConfig.textProperties.colorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .white : .black         }         cConfig.secondaryTextProperties.colorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .white : .black         }         self.contentConfiguration = cConfig         guard var bConfig = self.backgroundConfiguration?.updated(for: state) else { return }         bConfig.backgroundColorTransformer = UIConfigurationColorTransformer { color in             state.isSelected || state.isHighlighted ? .systemPink : .systemGray5         }         self.backgroundConfiguration = bConfig     } }
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jan ’22