Skip to content

Instantly share code, notes, and snippets.

View AppleCEO's full-sized avatar
๐Ÿ’ป

๋„๋ฏธ๋‹‰ AppleCEO

๐Ÿ’ป
View GitHub Profile
func swapTwoIntsWithInout(a: inout Int, b: inout Int) {
let temporaryA = a
a = b
b = temporaryA
}
var firstNumber = 10
var secondNumber = 30
import UIKit
import PlaygroundSupport
class TestViewController : UIViewController {
let labelOne: UILabel = {
let label = UILabel()
label.text = "Scroll Top"
label.backgroundColor = .red
label.translatesAutoresizingMaskIntoConstraints = false
<TouchableOpacity onPress={(props) => { this.props.navigation.goBack(null) }}>
<Image style={styles.backImage} source={require('./images/back.png')} />
</TouchableOpacity>
<Button title="go back" onPress={(props) => { this.props.navigation.goBack(null) }} />
let button = UIButton()
button.layer.borderWidth = 1
button.layer.borderColor = UIColor.black.cgcColor
@AppleCEO
AppleCEO / ViewController.swift
Created March 3, 2020 07:12 — forked from goodmorningcody/ViewController.swift
์Šค์œ„ํ”„ํŠธ : ์œ„์น˜์ •๋ณด ์‚ฌ์šฉ ๊ถŒํ•œ์— ๋”ฐ๋ฅธ ์˜ˆ์™ธ์ฒ˜๋ฆฌ ์ถ”๊ฐ€ํ•˜๊ธฐ
import UIKit
import CoreLocation
class ViewController: UIViewController, CLLocationManagerDelegate {
// ์ค‘๋žต
@IBOutlet var requestWeatherButton : UIButton!
override func viewDidAppear(animated: Bool) {
struct Stack {
private var array = [Int]()
mutating func push(element: Int) {
array.append(element)
}
mutating func pop() -> Int? {
return array.popLast()
}
class ParentViewController: UIViewController {
let button: UIButton()
...
func onTapButton() {
let popupVC = PopupViewController()
popupVC.onDoneBlock = { [weak self] in
self?.moveToNextView()
}
}
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
}
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