/// | World |
/// |------------------------------------------|
/// | Module A | Module B | Module C | Module D|
- World is a module
- World is aware of all modules.
- Modules aren't aware of World.
/// | World |
/// |------------------------------------------|
/// | Module A | Module B | Module C | Module D|
import UIKit | |
public extension UIColor { | |
var components: (red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat) { | |
var red: CGFloat = 0 | |
var green: CGFloat = 0 | |
var blue: CGFloat = 0 | |
var alpha: CGFloat = 0 |
import UIKit | |
#if canImport(SwiftUI) && DEBUG | |
import SwiftUI | |
struct UIViewControllerPreview<ViewController: UIViewController>: UIViewControllerRepresentable { | |
let viewController: ViewController | |
init(_ builder: @escaping () -> ViewController) { | |
viewController = builder() | |
} |
// | |
// AppDelegate.swift | |
// SwiftUITestApp | |
// | |
// Created by Matt Gallagher on 4/6/24. | |
// Copyright © 2019 Matt Gallagher. All rights reserved. | |
// | |
import Cocoa | |
import SwiftUI |
@discardableResult | |
private func performRequest<T:Decodable>(route: APIRouter, decoder: JSONDecoder = JSONDecoder(), completion:@escaping (Int, Result<T>)->Void) -> DataRequest { | |
return Alamofire.request(route).responseData() { responseData in | |
guard let response = responseData.response else { | |
completion(APIClient.responseErrorCode, .failure(ApiError.internalServerError(NSLocalizedString("service_error", comment: AppConstant.EMPTY)))) | |
return | |
} | |
/// Demo of using the oscilloscope package | |
/// This uses the output from the Acceleromter on a device | |
import 'package:flutter/material.dart'; | |
import 'package:oscilloscope/oscilloscope.dart'; | |
import 'package:sensors/sensors.dart'; | |
void main() => runApp(new MyApp()); |
#!/usr/bin/env bash | |
SDK_LINUX=https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
SDK_MAC=https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip | |
if [ -z ${JAVA_HOME+x} ]; then | |
echo "\$JAVA_HOME environmental variable is not set." | |
echo "Find the location of your Java directory, and then put it in your" | |
echo "~/.bash_profile (or any other shell equivalent)" | |
exit 0 |