Adding some new info to reports. Fixed bug with setting map region on iOS14

This commit is contained in:
Selim Mustafaev 2020-09-18 11:53:00 +03:00
parent f2aeec6fd2
commit 717138bb3e
7 changed files with 191 additions and 17 deletions

View File

@ -763,7 +763,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34; CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = 46DTTB8X4S; DEVELOPMENT_TEAM = 46DTTB8X4S;
INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_FILE = AutoCat/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;
@ -785,7 +785,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements; CODE_SIGN_ENTITLEMENTS = AutoCat/AutoCat.entitlements;
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 34; CURRENT_PROJECT_VERSION = 35;
DEVELOPMENT_TEAM = 46DTTB8X4S; DEVELOPMENT_TEAM = 46DTTB8X4S;
INFOPLIST_FILE = AutoCat/Info.plist; INFOPLIST_FILE = AutoCat/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.0; IPHONEOS_DEPLOYMENT_TARGET = 13.0;

View File

@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/xmartlabs/Eureka", "repositoryURL": "https://github.com/xmartlabs/Eureka",
"state": { "state": {
"branch": null, "branch": null,
"revision": "9a30ae436ec9e9fcb8b3eb1bdfd95e95989d6ca5", "revision": "9fe153d2be663621d4f53196bf1b7effb83d7017",
"version": "5.2.1" "version": "5.3.0"
} }
}, },
{ {
@ -24,8 +24,8 @@
"repositoryURL": "https://github.com/onevcat/Kingfisher", "repositoryURL": "https://github.com/onevcat/Kingfisher",
"state": { "state": {
"branch": null, "branch": null,
"revision": "175eeb4618b0a6ef4d69a7409b6a74ddd235a093", "revision": "22b795dd57766fa0e86773d8733efb31dc0f31fb",
"version": "5.15.0" "version": "5.15.1"
} }
}, },
{ {
@ -42,8 +42,8 @@
"repositoryURL": "https://github.com/realm/realm-cocoa", "repositoryURL": "https://github.com/realm/realm-cocoa",
"state": { "state": {
"branch": null, "branch": null,
"revision": "6310911a38d55003f0b8acca96635aa2bfc3e2c0", "revision": "f64ac045d8cb171d8e317d9b854df7215aed7466",
"version": "5.4.0" "version": "5.4.2"
} }
}, },
{ {
@ -51,8 +51,8 @@
"repositoryURL": "https://github.com/realm/realm-core", "repositoryURL": "https://github.com/realm/realm-core",
"state": { "state": {
"branch": null, "branch": null,
"revision": "34d7fbcbab2a94bcad081bddf9d172961cd84659", "revision": "e051fc73c56830bf3ab0b8a82f7a613968cec6c6",
"version": "6.0.25" "version": "6.0.26"
} }
}, },
{ {
@ -87,8 +87,8 @@
"repositoryURL": "https://github.com/malcommac/SwiftDate.git", "repositoryURL": "https://github.com/malcommac/SwiftDate.git",
"state": { "state": {
"branch": null, "branch": null,
"revision": "700dde1b3417fd4a7fd2bec9f5bc8ab2de1b96b4", "revision": "a25913b19833860b61fac161a706e44834f03c47",
"version": "6.1.0" "version": "6.2.0"
} }
} }
] ]

View File

@ -8,7 +8,7 @@
BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.SwiftErrorBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "C14D0996-5708-44D2-A6BA-4A4B50B522EE" uuid = "C14D0996-5708-44D2-A6BA-4A4B50B522EE"
shouldBeEnabled = "Yes" shouldBeEnabled = "No"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No"> continueAfterRunningActions = "No">
</BreakpointContent> </BreakpointContent>
@ -17,7 +17,7 @@
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint">
<BreakpointContent <BreakpointContent
uuid = "CF01B44D-372B-4C78-A197-7FDEC607CE0E" uuid = "CF01B44D-372B-4C78-A197-7FDEC607CE0E"
shouldBeEnabled = "Yes" shouldBeEnabled = "No"
ignoreCount = "0" ignoreCount = "0"
continueAfterRunningActions = "No" continueAfterRunningActions = "No"
scope = "1" scope = "1"

View File

@ -9,6 +9,132 @@
<key>orderHint</key> <key>orderHint</key>
<integer>0</integer> <integer>0</integer>
</dict> </dict>
<key>Eureka (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>9</integer>
</dict>
<key>Eureka (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>10</integer>
</dict>
<key>Eureka (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>2</integer>
</dict>
<key>GettingStarted (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>11</integer>
</dict>
<key>GettingStarted (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>12</integer>
</dict>
<key>GettingStarted (Playground) 3.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>13</integer>
</dict>
<key>GettingStarted (Playground) 4.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>14</integer>
</dict>
<key>GettingStarted (Playground) 5.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>15</integer>
</dict>
<key>GettingStarted (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>5</integer>
</dict>
<key>Rx (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>3</integer>
</dict>
<key>Rx (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
</dict>
<key>Rx (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>1</integer>
</dict>
<key>SwiftDate (Playground) 1.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>7</integer>
</dict>
<key>SwiftDate (Playground) 2.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>8</integer>
</dict>
<key>SwiftDate (Playground) 3.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>16</integer>
</dict>
<key>SwiftDate (Playground) 4.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>17</integer>
</dict>
<key>SwiftDate (Playground) 5.xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>18</integer>
</dict>
<key>SwiftDate (Playground).xcscheme</key>
<dict>
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>6</integer>
</dict>
</dict> </dict>
</dict> </dict>
</plist> </plist>

View File

@ -149,8 +149,12 @@ public class LocationPickerController : UIViewController, TypedRowControllerType
} }
public func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) { public func mapView(_ mapView: MKMapView, didUpdate userLocation: MKUserLocation) {
mapView.showsUserLocation = false
let region = MKCoordinateRegion(center: userLocation.coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000) let region = MKCoordinateRegion(center: userLocation.coordinate, latitudinalMeters: 1000, longitudinalMeters: 1000)
mapView.setRegion(region, animated: true) mapView.setRegion(region, animated: true)
mapView.showsUserLocation = false
}
public func mapView(_ mapView: MKMapView, didFailToLocateUserWithError error: Error) {
print(error)
} }
} }

View File

@ -144,6 +144,30 @@ extension Vehicle {
y += 24 y += 24
if !self.events.isEmpty {
"LOCATIONS".draw(with: CGRect(x: 15, y: y, width: w - 15, height: 24), options: .usesLineFragmentOrigin, attributes: headerAttributes, context: nil)
y += 24
self.drawLine(y: y, width: w, margin: 0, context: ctx)
y += 1/UIScreen.main.scale
for event in self.events {
let date = Date(timeIntervalSince1970: event.date)
self.drawCell(y: y, width: w, height: cellHeight, title: "Date", value: formatter.string(from: date), context: ctx)
y += cellHeight
if let address = event.address {
self.drawCell(y: y, width: w, height: cellHeight, title: "Address", value: address, context: ctx)
y += cellHeight
}
let location = String(format: "%.05f, %.05f", event.latitude, event.longitude)
self.drawCell(y: y, width: w, height: cellHeight, title: "Location", value: location, context: ctx)
y += cellHeight + 8
}
}
y += 24
"PHOTOS (\(self.photos.count))".draw(with: CGRect(x: 15, y: y, width: w - 15, height: 24), options: .usesLineFragmentOrigin, attributes: headerAttributes, context: nil) "PHOTOS (\(self.photos.count))".draw(with: CGRect(x: 15, y: y, width: w - 15, height: 24), options: .usesLineFragmentOrigin, attributes: headerAttributes, context: nil)
y += 24 y += 24
self.drawLine(y: y, width: w, margin: 0, context: ctx) self.drawLine(y: y, width: w, margin: 0, context: ctx)
@ -218,6 +242,24 @@ extension Vehicle {
} }
} }
if !self.events.isEmpty {
text += "\n"
text += "Locations\n"
text += "\n"
for event in self.events {
let date = Date(timeIntervalSince1970: event.date)
text += "Date: \(formatter.string(from: date))\n"
if let address = event.address {
text += "Address: \(address)\n"
}
let location = String(format: "%.05f, %.05f", event.latitude, event.longitude)
text += "Location: \(location)\n"
text += "\n"
}
}
return text return text
} }
} }

View File

@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Access is needed for storing locations of vehicles</string>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string> <string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
@ -46,6 +44,10 @@
</dict> </dict>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key> <key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>Access is needed for storing locations of vehicles (even when the app was sent to bacground)</string> <string>Access is needed for storing locations of vehicles (even when the app was sent to bacground)</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>Access is needed for storing locations of vehicles (even when the app was sent to bacground)</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>Access is needed for storing locations of vehicles</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>Access is needed for voice recordings</string> <string>Access is needed for voice recordings</string>
<key>NSPhotoLibraryAddUsageDescription</key> <key>NSPhotoLibraryAddUsageDescription</key>