Welcome to a fun and easy introduction to app development with SwiftUI! This tutorial will…
How to Count Lines in Xcode Project
Sometimes you can be interested in how many lines of code are in your Xcode project files.
There are several ways to figure out the number of lines. Here is the simple one.
How to Count Lines in Xcode Project
- Open terminal on your mac
- Type cd in terminal to navigate to your Xcode project directory
- Inside your project in terminal type this to find only .swift files: find . -name “*.swift” -print0 | xargs -0 wc -l
- You will get the results with the number of lines in terminal and with the total number of lines related to listed files at the bottom
P.S.
If you want to exclude pods from the search results, type this in terminal while being in your Project directory:
find . -path ./Pods -prune -o -name “*.swift” -print0 ! -name “/Pods” | xargs -0 wc -l
Don’t forget to subscribe to AppMakers.Dev mailing list if you love this content and want to stay tuned with recent iOS Development news, tutorials and resources.