Consider if I'm having this Photo For ML
how would i calculate these Measurements like the below image
how would it be possible to calculate these measurement for the json file?
via direct or indirect methods any suggestion?
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I have created the .json file according to the https://developer.apple.com/documentation/createml/building-an-object-detector-data-source
here is my .json file below
{
"imagefilename":"Five Fingers.HEIC",
"annotation": [
{
"coordinates": {
"y": 156.062,
"x": 195.122,
"height": 148.872,
"width": 148.03
},
"label": "Five Fingers"
}
]
},
{
"imagefilename": "One Finger.HEIC",
"annotation": [
{
"coordinates": {
"y": 156.062,
"x": 195.122,
"height": 148.872,
"width": 148.03
},
"label": "One Finger"
}
]
},
{
"imagefilename": "Two Finger.HEIC",
"annotation": [
{
"coordinates": {
"y": 156.062,
"x": 195.122,
"height": 148.872,
"width": 148.03
},
"label": "Two Finger"
}
]
},
{
"imagefilename": "Four Finger.HEIC",
"annotation": [
{
"coordinates": {
"y": 156.062,
"x": 195.122,
"height": 148.872,
"width": 148.03
},
"label": "Four Finger"
}
]
}
]
but it shows error as Missing required column 'label' in json. at "NameOfJsonFile.json"
Were am I Wrong
As I’m interested to make HomeKit accessory while searching in the internet i found out that hobbyist can make HomeKit accessary without MFI license the link is given below
https://mfi.apple.com/en/who-should-join.html
but it says to download HAP Specification which is pdf containing all the information regarding interacting with Apple devices with HomeKit Accessories
but im not able to see any pdf in the give link
can anyone say where will be the pdf is present to download
Thank you in advance
this is my code
HStack {
Text("\(fitnessData.Progress)/")
Text("2000 KCAL")
}
can any one say how to delete the spaces between 200/_ 2000KCAL
I need to send confirmation mail to customer once, When Customer orders it.
I have some methods in Google but all of those methods Triggers the Mail Extension in Mail App and Opens up Mail
I don't need to trigger and show the Mail to Customers
I just want to send the Order summary to customer Mail Address
is there any way or API , SDK
import Foundation
enum VideoDetails: String, CaseIterable{
case Nature , Food , Animals , Travel
}
struct ResponseBody: Decodable {
var page: Int
var perPage: Int
var totalResults: Int
var url: String
var videos: [Video]
}
struct Video: Identifiable, Decodable{
var id: Int
var image: String
var duration: Int
var user: User
var videofiles: [VideoFile]
struct User: Identifiable, Decodable {
var id: Int
var name: String
var url: String
}
struct VideoFile: Identifiable, Decodable {
var id: Int
var quality: String
var fileType: String
var link: String
}
}
//this one doesn't work but the below code works perfectly can anyone why it is happening
import Foundation
enum VideoDetails: String, CaseIterable{
case Nature , Food , Animals , Travel
}
struct Video: Identifiable, Decodable {
var id: Int
var image: String
var duration: Int
var user: User
var videoFiles: [VideoFile]
struct User: Identifiable, Decodable {
var id: Int
var name: String
var url: String
}
struct VideoFile: Identifiable, Decodable {
var id: Int
var quality: String
var fileType: String
var link: String
}
}
import SwiftUI
struct ButtonUI: View {
var body: some View {
ZStack {
Color.white
RoundedRectangle(cornerRadius: 50)
.fill(.blue)
.frame(width: 250, height: 75, alignment: .center)
Text("Enable Location")
.font(.title3)
.fontWeight(.bold)
.foregroundColor(Color.white)
}
.offset(x: 0, y: 300)
}
}
struct ButtonUI_Previews: PreviewProvider {
static var previews: some View {
ButtonUI()
}
}
// I have used this code to create a button like shape in Xcode how to do i make it work like open the location settings in iPhone
// it should work like a button to open the location settings in iPhone
I have to added the background image and background colour in launch screen
but for user experience i need to add the loading animation in launch screen,
I also used the Activity indicator View but it is not moving (not showing animation)
is there is any way to add LottieView or Rive Animation in Launch Screen
below is my code of reading data from HealthKit for Multiple Data
but for reading Multiple data using Set()
it shows
"Cannot convert value of type 'Set' to expected argument type 'HKQuantityType' "
func readData(completion: @escaping (HKStatisticsCollection?)-> Void){
let stepCount = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.stepCount)!
let MoveCount = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.appleMoveTime)!
let DistanceCount = HKQuantityType.quantityType(forIdentifier: HKQuantityTypeIdentifier.distanceWalkingRunning)!
let Activitysummary = Set([stepCount,MoveCount,DistanceCount])
let startDate = Calendar.current.date(byAdding: .day, value: -7, to: Date())
//MARK: here we setting our start time at 12.00 AM
let anchorDate = Date.monday12AM()
//MARK: we going to calculate the value for each day
let daily = DateComponents(day : 1)
let predicate = HKQuery.predicateForSamples(withStart: startDate, end: Date(), options: .strictStartDate)
//MARK: .cummulativesum -> iPhone and Apple Watch Difference
query = HKStatisticsCollectionQuery(quantityType: Activitysummary, quantitySamplePredicate: predicate,options: .cumulativeSum, anchorDate: anchorDate, intervalComponents: daily)
//MARK: here in ActivitySummary it show the error
query!.initialResultsHandler = { query,statisticsCollection, error in
completion(statisticsCollection)
}
if let healthStore = healthStore, let query = self.query{
healthStore.execute(query)
}
}
Im building the small Map View by accessing the Users Location From the App
Im getting this Error in Xcode 14 in Purple Color
there is no error in this Code side it shows only while running in this simulator
also according to the error My Location is not updating to it
Can any 1 say where am I going wrong
below is my code
// MapUIView.swift
// Login_Via_SwiftUI
//
// Created by Makwin Santhosh K on 10/11/22.
//
import SwiftUI
import MapKit
import CoreLocationUI
struct MapUIView: View {
@StateObject private var ViewModel = ContentViewModal()
var body: some View {
ZStack(alignment: .bottom) {
Map(coordinateRegion: $ViewModel.region, showsUserLocation: true)
.ignoresSafeArea()
LocationButton(.currentLocation){
ViewModel.requestUserLocationForOnce()
}
.foregroundColor(.white)
.cornerRadius(8)
.padding()
}
}
}
struct MapUIView_Previews: PreviewProvider {
static var previews: some View {
MapUIView()
}
}
final class ContentViewModal: NSObject, ObservableObject, CLLocationManagerDelegate{
@Published var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 40, longitude: 120), span: MKCoordinateSpan(latitudeDelta: 100, longitudeDelta: 100))
let locationManager = CLLocationManager()
override init() {
super.init()
locationManager.delegate = self
}
func requestUserLocationForOnce() {
locationManager.requestLocation()
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let latestLocation = locations.first else{
//show error
return
}
DispatchQueue.main.async {
self.region = MKCoordinateRegion(center: latestLocation.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05))
}
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
print(error.localizedDescription)
}
}
Is there any online tool to convert the images to json file for annotation from image exceptionally made for ML app
this is my code I need my toolBar buttons to navigate to other SwiftUi views
what should I write in button action { } to open the other SwiftUi View
// SwiftLoginView.swift
// Login FireBase
//
// Created by Makwin Santhosh K on 08/11/22.
//
import SwiftUI
import MapKit
import CoreLocationUI
struct OverallView: View {
var body: some View{
NavigationView {
ZStack{
ToolBarShape()
.frame(width: 400,height: 110)
.foregroundColor(.white)
.shadow(radius: 6)
.offset(x : 0, y: 410)
.toolbar {
ToolbarItemGroup(placement: .bottomBar){
//MARK: Button Home
Button(action :{
}, label:{
VStack {
Image(systemName: "house")
Text("Home")
}
.font(.footnote)
.foregroundColor(.black)
})
Spacer()
//MARK: Button Money
Button(action :{
},label:{
VStack {
Image(systemName: "dollarsign")
Text("Money")
}
.font(.footnote)
.foregroundColor(.black)
})
Spacer()
//MARK: Button Home
Button(action :{
},label:{
VStack {
Image(systemName: "person")
Text("Help")
}
.font(.footnote)
.foregroundColor(.black)
})
//MARK: Button Home
Spacer()
Button(action :{
},label:{
VStack {
Image(systemName: "menubar.rectangle")
Text("More")
}
.font(.footnote)
.foregroundColor(.black)
})
}
}
}
}
}
}
struct MapUView: View {
@StateObject public var ViewModel = ContentViewModal()
var body: some View {
ZStack(alignment: .bottom) {
AreaMap(region: $ViewModel.region)
LocationButton(.currentLocation){
ViewModel.requestUserLocationForOnce()
}
.foregroundColor(.white)
.cornerRadius(8)
}
}
struct AreaMap: View {
@Binding var region: MKCoordinateRegion
var body: some View {
let binding = Binding(
get: { self.region },
set: { newValue in
DispatchQueue.main.async {
self.region = newValue
}
}
)
return Map(coordinateRegion: binding, showsUserLocation: true)
.ignoresSafeArea()
}
}
final class ContenViewModal: NSObject, ObservableObject, CLLocationManagerDelegate{
@Published var region = MKCoordinateRegion(center: CLLocationCoordinate2D(latitude: 20, longitude: 90), span: MKCoordinateSpan(latitudeDelta: 100, longitudeDelta: 100))
let locationManager = CLLocationManager()
override init() {
super.init()
locationManager.delegate = self
}
func requestUserLocationForOnce() {
locationManager.requestLocation()
}
func locationManager(_ manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) {
guard let latestLocation = locations.first else {
//show error
return
}
self.region = MKCoordinateRegion(center: latestLocation.coordinate, span: MKCoordinateSpan(latitudeDelta: 0.05, longitudeDelta: 0.05))
}
func locationManager(_ manager: CLLocationManager, didFailWithError error: Error) {
print(error.localizedDescription)
}
}
}
struct OverallView_Previews: PreviewProvider {
static var previews: some View {
OverallView()
}
}
im getting this error after this code, what module should Iimport here? or does it causes any other problem?
// ContentView.swift
// Widget_and_LiveActivities
//
// Created by Makwin Santhosh K on 20/11/22.
//
import SwiftUI
import ClockKit
struct ContentView: View {
var body: some View {
var future = Calendar.current.date(byAdding: .minute, value: (Int(minutes) ?? 0), to: Date())! // here is where im getting (cannot find 'minutes' in the scope)
future = Calendar.current.date(byAdding: .second, value: (Int(seconds) ?? 0), to: future)! // also where is where im getting (cannot find 'seconds' in the scope)
let date = Date.now...future
let updatedDeliveryStatus = PizzaDeliveryAttributes.PizzaDeliveryStatus(driverName: "Anne Johnson", deliveryTimer: date)
let alertConfiguration = AlertConfiguration(title: "Delivery Update", body: "Your pizza order will arrive in 25 minutes.", sound: .default)
await deliveryActivity?.update(using: updatedDeliveryStatus, alertConfiguration: alertConfiguration)
let initialContentState = PizzaDeliveryAttributes.ContentState(driverName: "Bill James", deliveryTimer:date)
let activityAttributes = PizzaDeliveryAttributes(numberOfPizzas: 3, totalAmount: "$42.00", orderNumber: "12345")
do {
deliveryActivity = try Activity.request(attributes: activityAttributes, contentState: initialContentState)
print("Requested a pizza delivery Live Activity \(String(describing: deliveryActivity?.id)).")
} catch (let error) {
print("Error requesting pizza delivery Live Activity \(error.localizedDescription).")
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
// this is the example code from
[https://developer.apple.com/documentation/activitykit/displaying-live-data-with-live-activities)
Button(action:
CardView() //here it show an error how to add the CardView Swift ui file in this button //
) {
Image(systemName: "creditcard")
.resizable()
.foregroundColor(Color("Icon Color"))
.frame(width:24, height: 24)
}
.padding(.top, 825.0)
.padding(.trailing, 125.0)