Skip to content

Instantly share code, notes, and snippets.

View aryasurya21's full-sized avatar
🚀
At School

Arya aryasurya21

🚀
At School
View GitHub Profile
@aryasurya21
aryasurya21 / HomeViewController.swift
Last active June 21, 2020 11:50
Connecting IBOutlet & IBActions
import UIKit
class HomeViewController: UIViewController {
@IBOutlet weak var containerView: UIView!
override func viewDidLoad() {
super.viewDidLoad()
}
@aryasurya21
aryasurya21 / HomeViewController.swift
Last active June 21, 2020 11:50
Adding child ViewControllers as attributes.
import UIKit
class HomeViewController: UIViewController {
@IBOutlet weak var containerView: UIView!
private let checkInController: CheckInViewController
private let checkOutController: CheckOutViewController
init(){
@aryasurya21
aryasurya21 / HomeViewController.swift
Last active June 21, 2020 19:16
SwitchContentController function in HomeViewController
private func switchContentController(_ destinationVC: UIViewController){
destinationVC.view.frame = CGRect(
x: 0,
y: 0,
width: self.containerView.frame.width,
height: self.containerView.frame.height
)
self.containerView.addSubview(destinationVC.view)
}
@aryasurya21
aryasurya21 / HomeViewController.swift
Created June 21, 2020 10:22
Final version of HomeViewController
import UIKit
class HomeViewController: UIViewController {
@IBOutlet weak var containerView: UIView!
private let checkInController: CheckInViewController
private let checkOutController: CheckOutViewController
init(){
let giveBoxToMe = {
print("look to left")
print("find a box")
print("pick the box")
print("hand over me")
}
giveBoxToMe()
@aryasurya21
aryasurya21 / ViewController.swift
Last active December 4, 2020 10:51
Implementing UIPanGestureRecognizer. on ViewController for Draggable Demo
//
// ViewController.swift
// draggabledemo
//
// Created by Philip Indra Prayitno ( https://github.com/s1rent ) on 03/12/20
//
import UIKit
class ViewController: UIViewController {
@aryasurya21
aryasurya21 / ViewController.swift
Last active December 4, 2020 11:05
Handler Function Implementation to Update View's Location
//
// ViewController.swift
// draggabledemo
//
// Created by Philip Indra Prayitno ( https://github.com/s1rent ) on 03/12/20.
//
import UIKit
class ViewController: UIViewController {
private var pokemons = mutableListOf<PokemonModel>(
PokemonModel(
"Pikachu",
"https://images-na.ssl-images-amazon.com/images/I/61iWqqcq%2BKL._AC_SL1500_.jpg"
),
PokemonModel(
"Bulbasaur",
"https://cdn.bulbagarden.net/upload/2/21/001Bulbasaur.png"
),
PokemonModel(
@aryasurya21
aryasurya21 / manfest.json
Last active March 16, 2021 08:32
App Manifest for PWA Starter
{
"name": "Task Manager",
"short_name": "TaskManager",
"icons": [
{
"src": "/images/app_icon48x48.png",
"type": "image/png",
"sizes": "48x48"
},
{
@aryasurya21
aryasurya21 / index.html
Created March 16, 2021 08:06
Add Manifest Link to index.html
<link rel="manifest" href="/manifest.json"/>