@ramzesenok@mastodon.social
@ramzesenok@mastodon.social avatar

ramzesenok

@ramzesenok@mastodon.social

iOS. In love with technologies and creating products. Created ShopFella, Splandid, Quizzy and Poem Library. Love speaking in public about SwiftUI and sharing findings on the internet

This profile is from a federated server and may be incomplete. Browse more on the original instance.

bardi, to SwiftUI
@bardi@mas.to avatar

TIL of two EnvironmentValues for List to assist with default heights:

defaultMinListRowHeight
defaultMinListHeaderHeight

_inside, to random
@_inside@mastodon.social avatar
finnvoorhees, to random
@finnvoorhees@mastodon.social avatar

TIL about URL formatting, which is super easy to use in SwiftUI with Text(url, format: .url.scheme(.omitIfHTTPFamily)...)

ole, to SwiftUI
@ole@chaos.social avatar

Just noticed that SwiftUI in iOS 17/macOS 14 can apply a fill and a stroke to a Shape in one go. Before, you needed two shapes placed on top of each other, one filled and one stroked. The new ShapeView protocol provides the abstraction that makes this work.

RoundedRectangle(cornerRadius: 16)
.fill(.green)
.strokeBorder(.yellow)

lickability, to random

✨ Details make the difference! Dive into our latest blog post by @samhenrigold to discover how to elevate your iOS app from good to great.

https://lickability.com/blog/plussing-your-ios-app/

phill, to random
@phill@mastodon.notsobig.co avatar

Happy to see iOS 17 now gives our views a way to respond to the List selection style.

By reading the backgroundProminence value in the environment our custom controls, say an unread indicator, can adjust their tint as not to be occluded by the background: https://gist.github.com/phillipcaudell/e2ca686fcd6744b8341ac54f240a7798

image/png

jsq, to random
@jsq@mastodon.social avatar

deleted_by_author

  • Loading...
  • ramzesenok, to random
    @ramzesenok@mastodon.social avatar

    TIL there's an init for Text which takes timeInterval and counts down to it by default. Is it anyhow different from using Text(date, style: .timer)?

    adam,
    @adam@iosdev.space avatar

    @ramzesenok It has a couple more options and it won’t count past the end of the date range by default. The older style will flip from counting down to counting up after the date is reached.

    cocoaphony, to random
    @cocoaphony@mastodon.social avatar

    Periodic reminder:

    "Strings in Swift are Unicode correct"

    It is not possible to have a String that is not valid Unicode, and so it is not possible for a String to fail UTF-8 conversion.

    So there is no reason to use the failable string.data(using: .utf8)! that Swift bridges from NSString.

    You can just use Data(string.utf8) and avoid the Optional.

    In many cases, String(decoding:as:) is also a better choice than String(data:encoding:), but that depends on your use case a little.

    twostraws, to random
    @twostraws@mastodon.social avatar
    ramzesenok, to random
    @ramzesenok@mastodon.social avatar

    For quite some time I’ve been collecting some tips and tricks in and that I’d like to share with you. I’ll share a new tip every day and hope to last until at least WWDC

    I'll also post same content on Twitter in case you prefer it over Mastodon

    ramzesenok,
    @ramzesenok@mastodon.social avatar
    • Day 13
      Ever wanted to somehow scope a portion of logic from the rest? You can use do {} for that. Scoping can help you limit lifetime and visibility of some variables resulting in cleaner code and faster app
    ramzesenok,
    @ramzesenok@mastodon.social avatar
    • Day 11
      Ever wanted to quickly check how something works in Swift and had to open a Playground? Well, you shouldn’t have. Run swift repl in console and execute Swift code right from there
    lucabernardi,

    @ramzesenok I would suggesting using string interpolation of Text inside Text.

    Local or computed variable can help with readability.

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