r/iOSProgramming • • Aug 03 '21

Application Contact Application created using the SwiftUI Framework

169 Upvotes

38 comments sorted by

View all comments

3

u/lordzsolt Aug 03 '21

Looks pretty awesome, great job!

Just a note, I'm seeing your code in the background.

You kinda want to split up your views more. Like, the contents of a View file should ideally fit on your screen without needing to scroll. (~100 LOC)

You can split up the All / Missed into a Header, then the Search bar, then the List.

2

u/shubham_iosdev Aug 03 '21

Thank you! :D

Yeah makes sense, and I do it when it gets about 200 LOC and more, I'll do it more often from now on. :D

1

u/FuckTheLAKings Aug 03 '21

I always hate the LOC argument because then beginners will shoot themselves in the foot trying to break things out to meet that LOC requirement they think is so important.

I like framing it in code re-usability instead of you shouldn’t go over 100 LOC, because that’s the actual reason to split it out not some stupid LOC fetish.

2

u/lordzsolt Aug 03 '21

Fair point, I completely agree.

I said 100 LOC because that's generally the point where a View in SwiftUI gets too big. But that' why I gave the examples of "Header", "Search Bar", etc. cohesive units.