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