_Davidsmith,
@_Davidsmith@mastodon.social avatar

Every time I hardcode a magic number somewhere in an app I know eventually it will come back to bite me. Today is the day hardcoding widget padding came home to roost. My whole morning is going to be spent migrating to the new iOS 17 dynamic margins API.

sirshannon,
@sirshannon@mastodon.social avatar

@_Davidsmith That’s exactly what bothers me about this https://developer.apple.com/documentation/SwiftUI/View/contentMargins(

I don’t want to hardcode a padding there.

benedictc,
@benedictc@mas.to avatar

@_Davidsmith how would you have written in differently to avoid the problem? With padding specifically I find that the cost of creating constants isn’t worth it because there are always small tweaks which add enough complexity to make it arduous. One of my favourite approaches was to use an unary operator to represent grid unit but it felt like too much cleverness.

asiergmorato,
@asiergmorato@mastodon.social avatar

@_Davidsmith whats the name of the API?

_Davidsmith,
@_Davidsmith@mastodon.social avatar
asiergmorato,
@asiergmorato@mastodon.social avatar

@_Davidsmith thanks 🙌

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • GTA5RPClips
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • tacticalgear
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • osvaldo12
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • everett
  • Durango
  • cisconetworking
  • khanakhh
  • ethstaker
  • tester
  • anitta
  • Leos
  • normalnudes
  • modclub
  • megavids
  • provamag3
  • lostlight
  • All magazines