What is Swift? Findings obtained in 3 weeks

Swift learning materials

I am learning Swift based on the following books.

A thorough introduction to SwiftUI|Hiroaki Kaneda|Book|mail order| Amazon https://www.amazon.co.jp/dp/4815604061

Findings obtained in 3 weeks

Here's what I actually did.

What I thought in the last three weeks ** "Swift is super easy! Easy to get along with!" ** It was that.

Since one screen corresponds to one swift file, The data structure is very easy to understand, and you can easily imagine what causes what kind of screen.

(Honestly, even if you don't have a book, just decipher the sample program yourself I think it was easy enough to understand somehow)

Even if you create a new directory and organize your files for visual clarity Swift will find it for you. I'm happy that there is no need to redraw the pass.

I understand why Swift is said to be suitable for beginners in programming.

Information I wanted to know before learning Swift

Maybe there are people who want to touch it like I did in the past, so I would like to leave information for such people. At the very least, if you know the following, you should be able to study while investigating the rest.

Role of each file

When you create an "aa" project, the project is created with a data structure like an image. defaultaa.jpg

ContentView.swift The first screen (view) that appears when you open the app. An image of creating a new screen on a lower level with this screen as the top level.

When you create a Swift file by default, two elements are defined as a structure. Taking ContentView.swift as an example, the following two.

ContentView is a structure that actually describes the contents of the application. By default, the text that says "Hello, world!" Is written. I think you can understand it just by touching this part while googled.

ContentView_Previews is a structure for previewing in a place called a canvas. It can be inferred from the fact that ContentView is referenced in the contents. A modern language? So it's fun to see the code you wrote instantly!

Assets.xcassets A place to store assets (meaning like materials) such as images and colors. When displaying an image, specify the image here as the reference destination.

If you find out how to display and insert images in Swift, you can find the explanation here.

Run

There is a play button at the top of the device displayed on the canvas, so press it to start the preview. In addition, you can see the change in the display by changing the terminal displayed on the canvas. previewaaaa.jpg (If you just created the project, you may not see anything on the canvas. In that case, if you press "Resume" on the upper right of the canvas, the terminal will be displayed. It is better to change the magnification to an appropriate value. )

The flow of changing the code and previewing immediately is very interactive and fun to touch.

in conclusion

Here's a miscellaneous summary of the insights I gained when I briefly studied Swift. Only the information I wanted in the past is listed.

Thanks to the easy confirmation in the preview, verification work can be done easily, I was really impressed to be able to intuitively understand which line corresponds to which element.

Since TECH :: CAMP has started, Swift application development is temporarily stopped, but There was a desire to write a solid article for real beginners who have never even touched programming.

Make a note of it in your draft when you have time.

Recommended Posts

What is Swift? Findings obtained in 3 weeks
[Swift] What is dismiss?
[Swift] What is asynchronous processing?
What is a snippet in programming?
What is @Autowired in Spring boot?
[Swift] What is "inheriting a class"?
What is a class in Java language (3 /?)
[Technical memo] What is "include" in Ruby?
What is a class in Java language (1 /?)
What is a class in Java language (2 /?)
What is the main method in Java?
What is gem'foge', require: false in Gemfile?
What is Pullback doing in The Composable Architecture
What is Docker?
What is null? ]
What is java
What is Keycloak
What is maven?
What is Jackson?
What is Docker
What is self
What is Jenkins
What is ArgumentMatcher?
What is IM-Juggling?
What is params
What is SLF4J?
What is Facade? ??
What is Java <>?
What is Gradle?
What is POJO
What is Java
What is centOS
What is RubyGem?
What is programming?
What is before_action?
What is Docker
What is Byte?
What is Tomcat
Compare objects in Swift
What is `docker-compose up`?
What is a constructor?
What is vue cli
What is an interface?
What is Ruby's self?
What is hard coding?
What is a stream
What is Ruby's attr_accessor?
What is Java Encapsulation?
What is permission denied?
What is instance control?
What is an initializer?
What is Spring Tools 4
What is an operator?
What is object orientation?
What is Guava's @VisibleForTesting?
Division becomes 0 in Swift
What is MVC model?
What is an annotation?
What is Java technology?
What is Java API-java
What is @ (instance variable)?