Programming/Swift (68) 썸네일형 리스트형 Delegation The official Apple documentation defines delegation as: Delegation is a design pattern that enables a class to hand off (or “delegate”) some of its responsibilities to an instance of another class. That’s quite complex, so let’s break it down… Think about delegation in the real world. Imagine you and I are part of a team that delivers chocolate cookies to an event. You’re in charge of baking coo.. Class: UIControl The base class for controls, which are visual elements that convey a specific action or intention in response to user interactions. Declaration class UIControl : UIView Overview Controls implement elements such as buttons and sliders, which your app can use to facilitate navigation, gather user input, or manipulate content. Controls use the target-action mechanism to report user interactions to .. Difference between viewdidappear and viewwillappear in swift - The viewWillAppear method is called when the presentation of the view in the view hierarchy is about to start. - The viewDidAppear method is called when the presentation of the view is done, notably when any and all associated animation has finished. stackoverflow.com/questions/5630649/what-is-the-difference-between-viewwillappear-and-viewdidappear#:~:text=The%20viewWillAppear%20method%20is%20.. IBAction and IBOutlet @IBAction is similar to @IBOutlet , but goes the other way: @IBOutlet is a way of connecting code to storyboard layouts, and @IBAction is a way of making storyboard layouts trigger code. This method takes one parameter, called sender . It's of type UIButton because we know that's what will be calling the method. www.hackingwithswift.com/read/2/5/from-outlets-to-actions-creating-an-ibaction#:~:te.. Storyboard 추가하기 m.blog.naver.com/PostView.nhn?blogId=oklmg&logNo=221318810101&proxyReferer=https:%2F%2Fwww.google.com%2F [Swift] Storyboard 추가하기 [Swift] Storyboard 추가하기 XCode에서 Storyboard를 추가하는 방법 1. Main Storyboard는 그대로 ... blog.naver.com mutating In swift, classes are reference type whereas structures and enumerations are value types. The properties of value types cannot be modified within its instance methods by default. In order to modify the properties of a value type, you have to use the mutating keyword in the instance method. medium.com/the-andela-way/swift-understanding-mutating-functions-in-two-minutes-d9e363904e3a Swift: Underst.. Properties and Methods String: A Unicode string value that is a collection of characters. Declaration @frozen struct String Overview A string is a series of characters, such as "Swift", that forms a collection. Strings in Swift are Unicode correct and locale insensitive, and are designed to be efficient. The String type bridges with the Objective-C class NSString and offers interoperability with C functions that works.. Swift Optionals However there is another data type in Swift called Optional, whose default value is a null value ( nil ). You can use optional when you want a variable or constant contain no value in it. An optional type may contain a value or absent a value (a null value). www.programiz.com/swift-programming/optionals Swift Optionals: How to Use them (With Examples) In the previous article, we learned about di.. Enumeration (열거형: list) An enumeration defines a common type for a group of related values and enables you to work with those values in a type-safe way within your code. Enumeration Syntax You introduce enumerations with the enum keyword and place their entire definition within a pair of braces: enum SomeEnumeration { // enumeration definition goes here } Here’s an example for the four main points of a compass: enum Co.. 상수 constant 상수 [constant, 常數] 변하지 않고 항상 같은 값을 가지는 수를 말한다. 상수란 변하지 않고, 항상 일정한 값을 갖는 수를 말한다. Constants refer to fixed values that a program may not alter during its execution. Constants can be of any of the basic data types like an integer constant, a floating constant, a character constant, or a string literal. Constants Declaration Before you use constants, you must declare them using let keyword as follows.. 이전 1 ··· 3 4 5 6 7 다음