Skip to content

Commit

Permalink
Merge pull request #44 from fassko/1.15
Browse files Browse the repository at this point in the history
  • Loading branch information
fassko authored Oct 31, 2020
2 parents c07ae65 + 3444f9c commit bdf06fc
Show file tree
Hide file tree
Showing 37 changed files with 99 additions and 196 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build and test Weather Latvia
on: [push, pull_request]

env:
DEVELOPER_DIR: /Applications/Xcode_12.app
DEVELOPER_DIR: /Applications/Xcode_12.1.app

jobs:
build:
Expand All @@ -17,5 +17,5 @@ jobs:
run: brew install swiftlint

- name: Run tests
run: set -o pipefail && xcodebuild -project MeteoLV.xcodeproj -scheme MeteoLV -destination 'platform=iOS Simulator,name=iPhone 11 Pro' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO clean test build | xcpretty
run: set -o pipefail && xcodebuild -project MeteoLV.xcodeproj -scheme MeteoLV -destination 'platform=iOS Simulator,name=iPhone 12 Pro' CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO clean test build | xcpretty

16 changes: 12 additions & 4 deletions MeteoLV.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
631E462A21BC0D93000CC546 /* meteoLVStation.json in Resources */ = {isa = PBXBuildFile; fileRef = 631E462921BC0D93000CC546 /* meteoLVStation.json */; };
631E462C21BC0DB1000CC546 /* roadLVStation.json in Resources */ = {isa = PBXBuildFile; fileRef = 631E462B21BC0DB1000CC546 /* roadLVStation.json */; };
631E462E21BC0DD6000CC546 /* ObservationsViewController+UITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631E462D21BC0DD6000CC546 /* ObservationsViewController+UITests.swift */; };
6348ECF4254DBD060096386D /* ObservationsStation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635524EE205E56A700EC0E23 /* ObservationsStation.swift */; };
6348ED02254DBD9A0096386D /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631E462521BBF287000CC546 /* Constants.swift */; };
6348ED0F254DBE530096386D /* ObservationsStation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635524EE205E56A700EC0E23 /* ObservationsStation.swift */; };
6348ED16254DBE590096386D /* Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 631E462521BBF287000CC546 /* Constants.swift */; };
635524EF205E56A700EC0E23 /* ObservationsStation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635524EE205E56A700EC0E23 /* ObservationsStation.swift */; };
635524F4205E5E6700EC0E23 /* InfoViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 635524F3205E5E6700EC0E23 /* InfoViewController.swift */; };
6368AE7C253E115600CB8EF1 /* Station+Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 639BC073253CA93800B0E66B /* Station+Extension.swift */; };
Expand Down Expand Up @@ -730,7 +734,9 @@
buildActionMask = 2147483647;
files = (
639BC074253CA93800B0E66B /* Station+Extension.swift in Sources */,
6348ED0F254DBE530096386D /* ObservationsStation.swift in Sources */,
639BC030253C990100B0E66B /* MeteoLVWidget.swift in Sources */,
6348ED16254DBE590096386D /* Constants.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand All @@ -739,8 +745,10 @@
buildActionMask = 2147483647;
files = (
6368AE7C253E115600CB8EF1 /* Station+Extension.swift in Sources */,
6348ECF4254DBD060096386D /* ObservationsStation.swift in Sources */,
63DF76BF253E0C0200907EC8 /* Intents.intentdefinition in Sources */,
63DF769B253E0AB900907EC8 /* IntentHandler.swift in Sources */,
6348ED02254DBD9A0096386D /* Constants.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -863,7 +871,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.14.201019.2343;
CURRENT_PROJECT_VERSION = 1.15.201031.1814;
DEBUG_INFORMATION_FORMAT = dwarf;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
Expand Down Expand Up @@ -925,7 +933,7 @@
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
COPY_PHASE_STRIP = NO;
CURRENT_PROJECT_VERSION = 1.14.201019.2343;
CURRENT_PROJECT_VERSION = 1.15.201031.1814;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
ENABLE_NS_ASSERTIONS = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
Expand Down Expand Up @@ -954,7 +962,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = MeteoLV/MeteoLV.entitlements;
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.14.201019.2343;
CURRENT_PROJECT_VERSION = 1.15.201031.1814;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 3SGNZQGS68;
INFOPLIST_FILE = MeteoLV/Info.plist;
Expand All @@ -981,7 +989,7 @@
CODE_SIGN_ENTITLEMENTS = MeteoLV/MeteoLV.entitlements;
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 1.14.201019.2343;
CURRENT_PROJECT_VERSION = 1.15.201031.1814;
DEVELOPMENT_TEAM = 3SGNZQGS68;
INFOPLIST_FILE = MeteoLV/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 13.1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@
<key>isShown</key>
<false/>
<key>orderHint</key>
<integer>4</integer>
<integer>5</integer>
</dict>
<key>MeteoLVShare.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>2</integer>
</dict>
<key>MeteoLVSiri.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>2</integer>
<integer>3</integer>
</dict>
<key>MeteoLVSiriUI.xcscheme_^#shared#^_</key>
<dict>
Expand All @@ -48,12 +48,12 @@
<key>MeteoLVTodayNotification.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>1</integer>
</dict>
<key>MeteoLVWidgetExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>1</integer>
<integer>4</integer>
</dict>
</dict>
<key>SuppressBuildableAutocreation</key>
Expand Down
6 changes: 3 additions & 3 deletions MeteoLV/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
"author" : "xcode",
"version" : 1
}
}
}
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/favorites-full.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/favorites.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/home-full.imageset/Contents.json

This file was deleted.

Binary file not shown.
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/home.imageset/Contents.json

This file was deleted.

Binary file removed MeteoLV/Assets.xcassets/home.imageset/home.pdf
Binary file not shown.
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/list.imageset/Contents.json

This file was deleted.

Binary file removed MeteoLV/Assets.xcassets/list.imageset/list.pdf
Binary file not shown.
12 changes: 0 additions & 12 deletions MeteoLV/Assets.xcassets/map.imageset/Contents.json

This file was deleted.

Binary file removed MeteoLV/Assets.xcassets/map.imageset/map.pdf
Binary file not shown.
22 changes: 0 additions & 22 deletions MeteoLV/Assets.xcassets/temperature.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
22 changes: 0 additions & 22 deletions MeteoLV/Assets.xcassets/wind.imageset/Contents.json

This file was deleted.

Binary file removed MeteoLV/Assets.xcassets/wind.imageset/wind-dark.pdf
Binary file not shown.
Binary file removed MeteoLV/Assets.xcassets/wind.imageset/wind.pdf
Binary file not shown.
6 changes: 3 additions & 3 deletions MeteoLV/Core/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
let mapNavigationController = UINavigationController()
mapCoordinator = MapViewCooordinator(navigationController: mapNavigationController)
mapCoordinator?.start()
let mapTabBarItem = UITabBarItem(title: "Map".localized, image: UIImage(named: "map"), tag: 0)
let mapTabBarItem = UITabBarItem(title: "Map".localized, image: UIImage(systemName: "map"), tag: 0)
mapTabBarItem.accessibilityLabel = "Map"
mapNavigationController.tabBarItem = mapTabBarItem

let favoritesNavigationController = UINavigationController()
favoritesCoordinator = FavoritesViewCoordinator(navigationController: favoritesNavigationController)
favoritesCoordinator?.start()
let favoritesTabBarItem = UITabBarItem(title: "Favorites".localized, image: UIImage(named: "favorites"), tag: 0)
let favoritesTabBarItem = UITabBarItem(title: "Favorites".localized, image: UIImage(systemName: "star"), tag: 0)
favoritesTabBarItem.accessibilityLabel = "Favorites"
favoritesNavigationController.tabBarItem = favoritesTabBarItem

let listNavigationController = UINavigationController()
listCoordinator = ListCoordinator(navigationController: listNavigationController)
listCoordinator?.start()
let listTabBarItem = UITabBarItem(title: "List".localized, image: UIImage(named: "list"), tag: 0)
let listTabBarItem = UITabBarItem(title: "List".localized, image: UIImage(systemName: "list.dash"), tag: 0)
listTabBarItem.accessibilityLabel = "List"
listNavigationController.tabBarItem = listTabBarItem

Expand Down
8 changes: 4 additions & 4 deletions MeteoLV/Core/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public extension UserDefaults {
}

extension UIImage {
static let favoritesFull = UIImage(named: "favorites-full")
static let favorites = UIImage(named: "favorites")
static let homeFull = UIImage(named: "home-full")
static let home = UIImage(named: "home")
static let favoritesFull = UIImage(systemName: "star.fill")
static let favorites = UIImage(systemName: "star")
static let homeFull = UIImage(systemName: "house.fill")
static let home = UIImage(systemName: "house")
}
4 changes: 2 additions & 2 deletions MeteoLV/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.14</string>
<string>1.15</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
Expand All @@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>1.14.201019.2343</string>
<string>1.15.201031.1814</string>
<key>Fabric</key>
<dict>
<key>APIKey</key>
Expand Down
2 changes: 1 addition & 1 deletion MeteoLV/Map/ObservationsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ class ObservationsViewController: UIViewController, Storyboarded {
let annotation = StationAnnotation(station: station)
annotation.coordinate = CLLocationCoordinate2D(latitude: station.latitude, longitude: station.longitude)
annotation.title = station.title
annotation.subtitle = station.temperature
annotation.subtitle = station.temperatureWithUnits
annotation.accessibilityLabel = station.name
annotation.accessibilityIdentifier = station.name

Expand Down
34 changes: 12 additions & 22 deletions MeteoLV/Models/ObservationsStation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
//

import Foundation
import Intents

#if canImport(WidgetKit)
import WidgetKit
Expand All @@ -18,12 +17,21 @@ import MeteoLVProvider
/// Observation station
extension ObservationStation {

var title: String {
var temperatureWithUnits: String {
guard let temperature = temperature else {
return name
return ""
}

return "\(name) \n \(temperature)"
switch self {
case .meteo:
return "\(temperature)°C"
case .road:
return temperature
}
}

var title: String {
"\(name) \n \(temperatureWithUnits)"
}

var isFavorited: Bool {
Expand Down Expand Up @@ -53,27 +61,9 @@ extension ObservationStation {
WidgetCenter.shared.reloadAllTimelines()
}

donateIntent()

completion()
}

private func donateIntent() {
let intent = CurrentConditionsIntent()
intent.suggestedInvocationPhrase = "Current Temperature"
let interaction = INInteraction(intent: intent, response: nil)

interaction.donate { (error) in
if error != nil {
if let error = error as NSError? {
print("Interaction donation failed: \(error.description)")
} else {
print("Successfully donated interaction")
}
}
}
}

func toggleFavorite(_ completion: @escaping () -> Void) {
let favoritesArray = defaults.favorites
var favorites = Set(favoritesArray)
Expand Down
Loading

0 comments on commit bdf06fc

Please sign in to comment.