If you have to extend an existing object with additional property, always prefer Vue.set()
over Object.assign()
(or spread operator).
Example below explains implications for different implementations.
import Foundation | |
import WebKit | |
// See https://developer.apple.com/library/content/documentation/Swift/Conceptual/BuildingCocoaApps/AdoptingCocoaDesignPatterns.html for more details. | |
private var observerContext = 0 | |
class StackableWebView: WKWebView { | |
// Keep track of height which will change when the view is loaded. | |
var webViewHeight: CGFloat = 0.0 |
let a: Double? = 1.0 | |
let b: Double? = 2.0 | |
let c: Double? = 3.0 | |
let d: Double? = 4.0 | |
let e: Double? = 5.0 | |
let f: Double? = 6.0 | |
let g: Double? = 7.0 | |
extension Optional { | |
func `or`(_ value : Wrapped?) -> Optional { |
// | |
// AGUploadImageWebServices.swift | |
// BaseProject | |
// | |
// Created by AshvinGudaliya on 27/02/18. | |
// Copyright © 2018 AshvinGudaliya. All rights reserved. | |
// | |
import UIKit |