defaults write com.apple.iphonesimulator PasteboardAutomaticSync -bool false
xcrun simctl spawn <device UUID> defaults write com.apple.springboard FBLaunchWatchdogScale 2
import Foundation | |
import UIKit | |
import WebKit | |
class ViewController: UIViewController, WKNavigationDelegate, WKUIDelegate { | |
var webView: WKWebView! | |
var activityIndicator: UIActivityIndicatorView! | |
@IBOutlet var webViewContainer: UIView! | |
import Foundation | |
protocol JSONEncodable: Encodable { } | |
extension JSONEncodable { | |
func toJSON() throws -> String? { | |
try String(data: JSONEncoder().encode(self), encoding: .utf8) | |
} | |
} |
struct Contact: Decodable, CustomStringConvertible { | |
var id: String | |
@NestedKey | |
var firstname: String | |
@NestedKey | |
var lastname: String | |
@NestedKey | |
var address: String | |
enum CodingKeys: String, NestableCodingKey { |
struct Contact: Decodable, CustomStringConvertible { | |
var id: String | |
@NestedKey | |
var firstname: String | |
@NestedKey | |
var lastname: String | |
@NestedKey | |
var address: String | |
enum CodingKeys: String, NestableCodingKey { |
//: ## Demo | |
struct User: CustomStringConvertible { | |
let name: String | |
let age: Int | |
var description: String { "\(name) (\(age))" } | |
} | |
let users = [ | |
User(name: "Bob", age: 22), |
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<!-- All Exceptions --> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent |
class Person { | |
var id: Int | |
var items: [String: Float] | |
init(id: Int, items: [String: Float]) { | |
self.id = id | |
self.items = items | |
} | |
} |
#!/usr/bin/env bash | |
# Build Phase Script for removing NSAppTransportSecurity exceptions from Info.plist | |
# https://gist.github.com/Ashton-W/07654259322e43a2b6a50bb289e72627 | |
set -o errexit | |
set -o nounset | |
if [[ -z "${REMOVE_ATS_EXCEPTIONS+SET}" ]]; then | |
echo "error: User Defined Build Setting REMOVE_ATS_EXCEPTIONS must be set" | |
exit 1 |
import SwiftUI | |
struct SubscriptedTextView: View { | |
// MARK: Properties | |
let abbreviation: String | |
var body: some View { | |
subscriptedText() |