This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func swapTwoIntsWithInout(a: inout Int, b: inout Int) { | |
| let temporaryA = a | |
| a = b | |
| b = temporaryA | |
| } | |
| var firstNumber = 10 | |
| var secondNumber = 30 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import PlaygroundSupport | |
| class TestViewController : UIViewController { | |
| let labelOne: UILabel = { | |
| let label = UILabel() | |
| label.text = "Scroll Top" | |
| label.backgroundColor = .red | |
| label.translatesAutoresizingMaskIntoConstraints = false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <TouchableOpacity onPress={(props) => { this.props.navigation.goBack(null) }}> | |
| <Image style={styles.backImage} source={require('./images/back.png')} /> | |
| </TouchableOpacity> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| let button = UIButton() | |
| button.layer.borderWidth = 1 | |
| button.layer.borderColor = UIColor.black.cgcColor |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import UIKit | |
| import CoreLocation | |
| class ViewController: UIViewController, CLLocationManagerDelegate { | |
| // ์ค๋ต | |
| @IBOutlet var requestWeatherButton : UIButton! | |
| override func viewDidAppear(animated: Bool) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| struct Stack { | |
| private var array = [Int]() | |
| mutating func push(element: Int) { | |
| array.append(element) | |
| } | |
| mutating func pop() -> Int? { | |
| return array.popLast() | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ParentViewController: UIViewController { | |
| let button: UIButton() | |
| ... | |
| func onTapButton() { | |
| let popupVC = PopupViewController() | |
| popupVC.onDoneBlock = { [weak self] in | |
| self?.moveToNextView() | |
| } | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| func solution(_ n:Int, _ arr1:[Int], _ arr2:[Int]) -> [String] { | |
| var answer: [String] = Array<String>.init(repeating: "", count: arr1.count) | |
| func pad(string : String, toSize: Int) -> String { | |
| var padded = string | |
| for _ in 0..<(toSize - string.count) { | |
| padded = "0" + padded | |
| } | |
| return padded | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| func solution(_ d:[Int], _ budget:Int) -> Int { | |
| var total = 0 | |
| var count = 0 | |
| for department in d.sorted() { | |
| if department + total <= budget { | |
| count += 1 | |
| total += department |