Cocoa Pods Cocoapods Basic Cheat Sheet
Create a Podfile at the root of your project
platform :ios, '5.0'
pod 'AFNetworking'
pod 'OHAttributedLabel'| // | |
| // ContentView.swift | |
| // FirstWatch WatchKit Extension | |
| // | |
| // Created by Greg Eales on 22/11/20. | |
| // | |
| import SwiftUI | |
| struct Person: Identifiable, Equatable { |
| // Add to View Struct | |
| @State private var editing = false | |
| // TextField Definition | |
| TextField("", text: dailyIntakeGoalString) { (change) in | |
| self.editing = true | |
| } onCommit: {} | |
| // Attach to Parent View | |
| .gesture(TapGesture().onEnded { _ in |
| import Cocoa | |
| struct entry { | |
| let date: Date | |
| let vol: Measurement<UnitVolume> | |
| } | |
| let entries = [ |
| // Custom closure with escaping | |
| func getSentimentScore(searchTerm: String, scoreCallback: @escaping (_ score: Int) -> Void) { | |
| } |
Create a Podfile at the root of your project
platform :ios, '5.0'
pod 'AFNetworking'
pod 'OHAttributedLabel'| import CoreML | |
| import Vision | |
| func detectImage(image: CIImage) { | |
| guard let model = try? VNCoreMLModel(for: FlowerClassifier().model) else { | |
| fatalError("Could not load CoreML model") | |
| } | |
| let request = VNCoreMLRequest(model: model) { (request, err) in | |
| guard let results = request.results as? [VNClassificationObservation] else { |