Skip to content

Instantly share code, notes, and snippets.

View fx-studio's full-sized avatar
🎯
Focusing

Fx Studio fx-studio

🎯
Focusing
View GitHub Profile
@fx-studio
fx-studio / ParseJSONFromAPI.swift
Created November 24, 2021 04:42
Parse JSON from API with Swift
import Foundation
import UIKit
// Data to JSON
typealias JSON = [String: AnyObject]
extension Data {
func toJSON() -> JSON? {
var json: JSON? = nil
@fx-studio
fx-studio / PropertyWrapper_Basic.swift
Last active July 25, 2021 09:09
Basic Guide to Property Wrapper with Swift. Read more at https://fxstudio.dev/property-wrapper-trong-10-phut/
import UIKit
@propertyWrapper
struct Capitalized {
// MARK: - Properties
private var value: String
// MARK: -
@fx-studio
fx-studio / The_flag_of_Vietnam.swift
Created September 2, 2020 01:46
The flag of Vietnam
import UIKit
import PlaygroundSupport
class StarView: UIView {
override init(frame: CGRect) {
super.init(frame: frame)
backgroundColor = .red
}
required init?(coder: NSCoder) {
@fx-studio
fx-studio / BaseViewController.InApp.swift
Last active April 5, 2019 04:06
Example - Custom UIViewController with StoreKit & SwiftyStoreKit
//
// BaseViewController.InApp.swift
// CrazyMath
//
// Created by Tien Le P. on 4/4/19.
// Copyright © 2019 Fx Studio All rights reserved.
//
import StoreKit
import SwiftyStoreKit
@fx-studio
fx-studio / BaseViewController.Admob.swift
Last active April 5, 2019 04:07
Example - Custom UIViewController with Google Admob
//
// BaseViewController.swift
// CrazyQuizEnglish
//
// Created by Tien Le P. on 2/27/19.
// Copyright © 2019 Fx Studio All rights reserved.
//
import UIKit
import GoogleMobileAds