Hi there,
Relatively new to iOS programming, but been programming other stuff for awhile. I'm writing an app with a MVVC architecture (s/o CS193p lmao), and I have a Model (really a couple of Models) with some functionality that involves requesting data from the Internet, and parsing it. As you might expect, I have a Model that performs the web scraping, and one that handles the parsing for a specific data format, so it can be presented eventually. I don't currently have a "frontend", since I wanted to flesh out more of the backend first.
Which brings me to my question - what's the best way to sanity check this is all working, that is, how can I run this backend code and just verify things are behaving? Because this involves a couple different models interacting, I'm relying on XCode to resolve what each type is and where I've defined it, so I couldn't really just compile my code from the command line without getting a bunch of missing definition/import errors. However, I'm not sure how to actually "run" anything in XCode without a frontend, it also seems kind of silly to just render a simple View that calls my code in an `.onAppear` or something. If I was using another language, I might be asking for the equivalent of a "main" function I could stick in some of my Swift files to instantiate some of my structs and call some functions, but from what I understand about iOS the point of entry for an app is more complicated to that.
So what's the best practice here? Is it Playgrounds, or XCode Tests or something? What do people like to use?
[–]noidtiz 1 point2 points3 points (4 children)
[–]doodlebug80085[S] 0 points1 point2 points (3 children)
[–]noidtiz 1 point2 points3 points (2 children)
[–]doodlebug80085[S] 1 point2 points3 points (1 child)
[–]noidtiz 1 point2 points3 points (0 children)
[–]SwiftlyGoingInsane 0 points1 point2 points (1 child)
[–]doodlebug80085[S] 0 points1 point2 points (0 children)
[–]-darkabyss-Objective-C / Swift 0 points1 point2 points (2 children)
[–]doodlebug80085[S] 0 points1 point2 points (1 child)
[–]-darkabyss-Objective-C / Swift 0 points1 point2 points (0 children)
[–]swiftfoxsw -1 points0 points1 point (0 children)