简体   繁体   中英

What's a good way to prototype a view controller?

Right now I just edit my AppDelegate or SceneDelegate , and make it the first thing I see (which is pretty annoying). One option I've heard is a UI test with a very long sleep statement. Is there a better option?

To be clear, I'm not trying to create an automated, UI test suite. I just want an easier way to manually test a graphical part of my code that doesn't involve temporarily changing the code path for my project.

I think I found an adequate solution. As was suggested, I decided to use playgrounds. I created a framework target for my main project. I added my project and my playground to the same workspace. Then I imported the framework into my playground. I used this blog as a guide.

I also found that using @testable when you import your framework makes it so that you don't need to mark everything in your project as public just so you can use it in your playground.

Example: @testable import FrameworkName

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM