Skip to content

Commit

Permalink
Merge pull request #357 from SUPLA/develop
Browse files Browse the repository at this point in the history
v24.02.01
  • Loading branch information
przemyslawzygmunt authored Mar 1, 2024
2 parents ed95002 + 7ba50d1 commit c951e84
Show file tree
Hide file tree
Showing 42 changed files with 163 additions and 93 deletions.
20 changes: 10 additions & 10 deletions LibSsl.xcframework/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -6,39 +6,39 @@
<array>
<dict>
<key>BinaryPath</key>
<string>libssl-sim.a</string>
<string>libssl-os.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_x86_64-simulator</string>
<string>ios-arm64_armv7</string>
<key>LibraryPath</key>
<string>libssl-sim.a</string>
<string>libssl-os.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>x86_64</string>
<string>armv7</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
<dict>
<key>BinaryPath</key>
<string>libssl-os.a</string>
<string>libssl-sim.a</string>
<key>HeadersPath</key>
<string>Headers</string>
<key>LibraryIdentifier</key>
<string>ios-arm64_armv7</string>
<string>ios-arm64_x86_64-simulator</string>
<key>LibraryPath</key>
<string>libssl-os.a</string>
<string>libssl-sim.a</string>
<key>SupportedArchitectures</key>
<array>
<string>arm64</string>
<string>armv7</string>
<string>x86_64</string>
</array>
<key>SupportedPlatform</key>
<string>ios</string>
<key>SupportedPlatformVariant</key>
<string>simulator</string>
</dict>
</array>
<key>CFBundlePackageType</key>
Expand Down
Binary file modified LibSsl.xcframework/ios-arm64_armv7/libssl-os.a
Binary file not shown.
Binary file modified LibSsl.xcframework/ios-arm64_x86_64-simulator/libssl-sim.a
Binary file not shown.
Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ target 'SUPLA' do
pod 'QueryKit'
pod 'PaddingLabel', '1.2'
pod 'FMMoveTableView', '~> 1.1'
pod 'SwiftyBeaver', '1.9.5'

target 'SUPLATests' do
inherit! :search_paths
Expand Down
6 changes: 5 additions & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ PODS:
- RxSwiftExt/Core
- RxTest (6.6.0):
- RxSwift (= 6.6.0)
- SwiftyBeaver (1.9.5)

DEPENDENCIES:
- DGCharts (= 5.1.0)
Expand All @@ -40,6 +41,7 @@ DEPENDENCIES:
- RxSwift
- RxSwiftExt
- RxTest
- SwiftyBeaver (= 1.9.5)

SPEC REPOS:
trunk:
Expand All @@ -55,6 +57,7 @@ SPEC REPOS:
- RxSwift
- RxSwiftExt
- RxTest
- SwiftyBeaver

SPEC CHECKSUMS:
DGCharts: 1c6daf585b6cfc78807af44ea690d357c410627f
Expand All @@ -69,7 +72,8 @@ SPEC CHECKSUMS:
RxSwift: a4b44f7d24599f674deebd1818eab82e58410632
RxSwiftExt: 43aaacb6a4d3c69c55e9d1cf4f79920043d13583
RxTest: a23f26bb53a5e146a0a69db4f0fa0b69001ce7f4
SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82

PODFILE CHECKSUM: 763a4a1369084e8ba5d91a633263d8d5859b3920
PODFILE CHECKSUM: a74bba934370ff0bc37899facb84cc5e3cf9d6df

COCOAPODS: 1.11.3
14 changes: 10 additions & 4 deletions SUPLA.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,7 @@
A5AE7A8D2A3ADFAD0097FA8B /* RsOpenningClosingPersentageCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AE7A8C2A3ADFAD0097FA8B /* RsOpenningClosingPersentageCell.swift */; };
A5AE7A8F2A3AE0290097FA8B /* TitleArrowButtonCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AE7A8E2A3AE0290097FA8B /* TitleArrowButtonCell.swift */; };
A5AE7A912A3B17AF0097FA8B /* PermissionCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AE7A902A3B17AF0097FA8B /* PermissionCell.swift */; };
A5AF25A42B91FBB90026DA27 /* SALog.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5AF25A32B91FBB90026DA27 /* SALog.swift */; };
A5B3CBDF2B62504D00F95AC3 /* GetChannelValueUseCase.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B3CBDE2B62504D00F95AC3 /* GetChannelValueUseCase.swift */; };
A5B3CBE22B62525500F95AC3 /* DefaultDoubleValueProvider.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B3CBE12B62525500F95AC3 /* DefaultDoubleValueProvider.swift */; };
A5B3CBE52B62546800F95AC3 /* DoubleValueParser.swift in Sources */ = {isa = PBXBuildFile; fileRef = A5B3CBE42B62546800F95AC3 /* DoubleValueParser.swift */; };
Expand Down Expand Up @@ -2554,6 +2555,7 @@
A5AE7A8C2A3ADFAD0097FA8B /* RsOpenningClosingPersentageCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RsOpenningClosingPersentageCell.swift; sourceTree = "<group>"; };
A5AE7A8E2A3AE0290097FA8B /* TitleArrowButtonCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TitleArrowButtonCell.swift; sourceTree = "<group>"; };
A5AE7A902A3B17AF0097FA8B /* PermissionCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PermissionCell.swift; sourceTree = "<group>"; };
A5AF25A32B91FBB90026DA27 /* SALog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SALog.swift; sourceTree = "<group>"; };
A5B3CBDE2B62504D00F95AC3 /* GetChannelValueUseCase.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GetChannelValueUseCase.swift; sourceTree = "<group>"; };
A5B3CBE12B62525500F95AC3 /* DefaultDoubleValueProvider.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DefaultDoubleValueProvider.swift; sourceTree = "<group>"; };
A5B3CBE42B62546800F95AC3 /* DoubleValueParser.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DoubleValueParser.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4502,6 +4504,7 @@
A5F14B7729DED97400682FA6 /* UI */,
A573B38B29DE9F5600EBAFC4 /* BaseViewControllerExtensions.swift */,
A57785BE29E80406001C631E /* SuplaAppWrapper.swift */,
A5AF25A32B91FBB90026DA27 /* SALog.swift */,
);
path = Core;
sourceTree = "<group>";
Expand Down Expand Up @@ -6280,6 +6283,7 @@
"${BUILT_PRODUCTS_DIR}/RxRelay/RxRelay.framework",
"${BUILT_PRODUCTS_DIR}/RxSwift/RxSwift.framework",
"${BUILT_PRODUCTS_DIR}/RxSwiftExt/RxSwiftExt.framework",
"${BUILT_PRODUCTS_DIR}/SwiftyBeaver/SwiftyBeaver.framework",
);
name = "[CP] Embed Pods Frameworks";
outputPaths = (
Expand All @@ -6294,6 +6298,7 @@
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxRelay.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwift.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/RxSwiftExt.framework",
"${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}/SwiftyBeaver.framework",
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
Expand Down Expand Up @@ -6647,6 +6652,7 @@
A597271129DAEA480090A044 /* SAScene+Ext.swift in Sources */,
A57668C82AE7CE890025509D /* SuplaCombinedChartView.swift in Sources */,
A5477DBD2AA52F5700220B4A /* ThermostatValue.swift in Sources */,
A5AF25A42B91FBB90026DA27 /* SALog.swift in Sources */,
A51BE9132AAAFFEB00718F2F /* SuplaChannelConfig.swift in Sources */,
A51BE9182AAB027400718F2F /* QuarterOfHour.swift in Sources */,
A530EE4E2A5C357100F8DAEE /* StartTimerUseCase.swift in Sources */,
Expand Down Expand Up @@ -7604,7 +7610,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 169;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -7623,7 +7629,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SUPLA/lib",
);
MARKETING_VERSION = 24.02;
MARKETING_VERSION = 24.02.01;
OTHER_SWIFT_FLAGS = "$(inherited) -D COCOAPODS -D DEBUG";
PRODUCT_BUNDLE_IDENTIFIER = com.acsoftware.ios.supla;
PRODUCT_NAME = "$(TARGET_NAME)";
Expand All @@ -7643,7 +7649,7 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = SUPLA/SUPLA.entitlements;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 163;
CURRENT_PROJECT_VERSION = 169;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T6ZPGSWA75;
GCC_PREPROCESSOR_DEFINITIONS = (
Expand All @@ -7662,7 +7668,7 @@
"$(inherited)",
"$(PROJECT_DIR)/SUPLA/lib",
);
MARKETING_VERSION = 24.02;
MARKETING_VERSION = 24.02.01;
PRODUCT_BUNDLE_IDENTIFIER = com.acsoftware.ios.supla;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_OBJC_BRIDGING_HEADER = "SUPLA/SUPLA-Bridging-Header.h";
Expand Down
1 change: 1 addition & 0 deletions SUPLA/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ - (id) init {
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[SALogWrapper setup];

#ifdef DEBUG
// Short-circuit starting app if running unit tests
Expand Down
4 changes: 2 additions & 2 deletions SUPLA/Core/Config/UsetStateHolder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class UserStateHolderImpl: UserStateHolder {
return try decoder.decode(TemperatureChartState.self, from: data)
} catch {
let errorString = String(describing: error)
NSLog("Could not decode state: \(errorString)")
SALog.error("Could not decode state: \(errorString)")
}
}

Expand All @@ -51,7 +51,7 @@ final class UserStateHolderImpl: UserStateHolder {
userDefaults.set(try encoder.encode(state), forKey: key)
} catch {
let errorString = String(describing: error)
NSLog("Could not encode state: \(errorString)")
SALog.error("Could not encode state: \(errorString)")
}
}

Expand Down
10 changes: 4 additions & 6 deletions SUPLA/Core/Extensions/ObservableType+Ext.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ import RxCocoa
extension ObservableType {
func asDriverWithoutError() -> Driver<Element> {
return asDriver { error in
let errorDescription = String(describing: error)
NSLog("Driver got error: \(error.localizedDescription)")
NSLog(errorDescription)
SALog.error("Driver got error: \(error.localizedDescription)")
SALog.error(String(describing: error))

return Driver.empty()
}
Expand All @@ -35,9 +34,8 @@ extension ObservableType {
extension Single {
func asDriverWithoutError() -> Driver<Element> {
return asDriver { error in
let errorDescription = String(describing: error)
NSLog("Driver got error: \(error.localizedDescription)")
NSLog(errorDescription)
SALog.error("Driver got error: \(error.localizedDescription)")
SALog.error(String(describing: error))

return Driver.empty()
}
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Core/Networking/DelayedCommandSubject.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class DelayedCommandSubject<T: DelayableData> {
return Observable.just(RequestResult.success)
}
}
.subscribe(onError: { NSLog("Could not execute delayed request \($0)")})
.subscribe(onError: { SALog.error("Could not execute delayed request \($0)")})
.disposed(by: disposeBag)
}

Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Core/Networking/Esp/EspHtmlParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class EspHtmlParser: NSObject {
result.mac = html.substring(range: match.range(at: 5))
}
} catch {
NSLog("Could not parse state pattern")
SALog.error("Could not parse state pattern \(error)")
}

return result
Expand Down
38 changes: 38 additions & 0 deletions SUPLA/Core/SALog.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright (C) AC SOFTWARE SP. Z O.O.

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/

import SwiftyBeaver

let SALog = SwiftyBeaver.self

@objc
class SALogWrapper: NSObject {
@objc
static func setup() {
let console = ConsoleDestination()

console.levelColor.verbose = "🟣"
console.levelColor.debug = "🟢"
console.levelColor.info = "🔵"
console.levelColor.warning = "🟡"
console.levelColor.error = "🔴"

console.format = "[$L] $C $DHH:mm:ss.SSS$d $c $N.$F - $M"
SALog.addDestination(console)
}
}
2 changes: 1 addition & 1 deletion SUPLA/Core/UI/BaseViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class BaseViewControllerVM<S : ViewState, E : ViewEvent, VM : BaseViewModel<S, E
#if DEBUG
deinit {
let className = NSStringFromClass(type(of: self))
NSLog("[DEINIT] VC:\(className)")
SALog.debug("[DEINIT] VC:\(className)")
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Core/UI/BaseViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class BaseViewModel<S : ViewState, E : ViewEvent> {
#if DEBUG
deinit {
let className = NSStringFromClass(type(of: self))
NSLog("[DEINIT] VM:\(className)")
SALog.debug("[DEINIT] VM:\(className)")
}
#endif
}
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Core/UI/Components/SuplaTabBarController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class SuplaTabBarController<S : ViewState, E : ViewEvent, VM : BaseViewModel<S,
#if DEBUG
deinit {
let className = NSStringFromClass(type(of: self))
NSLog("[DEINIT] BC:\(className)")
SALog.debug("[DEINIT] BC:\(className)")
}
#endif
}
Expand Down
29 changes: 27 additions & 2 deletions SUPLA/Core/UI/TableView/BaseTableViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ class BaseTableViewController<S: ViewState, E: ViewEvent, VM: BaseTableViewModel
.do(
onNext: { [weak self] in
if ($0.isEmpty == true) {
self?.showEmptyMessage(self?.tableView)
self?.showLoading(self?.tableView)
} else {
self?.tableView.backgroundView = nil
if ($0[0].items.isEmpty) {
self?.showEmptyMessage(self?.tableView)
} else {
self?.tableView.backgroundView = nil
}
}
}
)
Expand Down Expand Up @@ -169,6 +173,10 @@ class BaseTableViewController<S: ViewState, E: ViewEvent, VM: BaseTableViewModel

func showEmptyMessage(_ tableView: UITableView?) {}

func showLoading(_ tableView: UITableView?) {
tableView?.backgroundView = createLoadingView()
}

func createNoContentView(_ buttonLabel: String) -> UIView {
noContentButton.setAttributedTitle(buttonLabel)

Expand All @@ -187,6 +195,23 @@ class BaseTableViewController<S: ViewState, E: ViewEvent, VM: BaseTableViewModel
return content
}

func createLoadingView() -> UIView {
let loadingIndicatorView = UIActivityIndicatorView()
loadingIndicatorView.translatesAutoresizingMaskIntoConstraints = false

let content = UIView()
content.addSubview(loadingIndicatorView)

NSLayoutConstraint.activate([
loadingIndicatorView.centerYAnchor.constraint(equalTo: content.centerYAnchor),
loadingIndicatorView.centerXAnchor.constraint(equalTo: content.centerXAnchor)
])

loadingIndicatorView.startAnimating()

return content
}

// MARK: SACaptionEditorDelegate

func captionEditorDidFinish(_ editor: SACaptionEditor) {
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/CoreDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class CoreDataManager: NSObject {
description?.type = storeType

#if DEBUG
NSLog("Database path: \(dbUrl.absoluteString)")
SALog.info("Database path: \(dbUrl.absoluteString)")
#endif

return container
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Features/AccountCreation/AccountCreationVC.swift
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ class AccountCreationVC: BaseViewControllerVM<AccountCreationViewState, AccountC
self?.viewModel.removeAccount()
}))
actionSheet.addAction(UIAlertAction(title: Strings.General.cancel, style: .cancel, handler: { action in
NSLog("User canceled removal action")
SALog.debug("User canceled removal action")
}))
self.present(actionSheet, animated: true)
}
Expand Down
2 changes: 1 addition & 1 deletion SUPLA/Features/AccountCreation/AccountCreationVM.swift
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ class AccountCreationVM: BaseViewModel<AccountCreationViewState, AccountCreation
}
} else {
let description = String(describing: error)
NSLog("Could not create account: \(description)")
SALog.warning("Could not create account: \(description)")
self?.send(event: .showRequiredDataMisingDialog)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class DelayedWeeklyScheduleConfigSubjectImpl: DelayedCommandSubject<Weekly
@Singleton<SetChannelConfigUseCase> private var setChannelConfigUseCase

override func execute(data: WeeklyScheduleConfigData) -> Observable<RequestResult> {
NSLog("Executing delayed weekly schedule config with \(data)")
SALog.debug("Executing delayed weekly schedule config with \(data)")

return setChannelConfigUseCase.invoke(
remoteId: data.remoteId,
Expand Down
Loading

0 comments on commit c951e84

Please sign in to comment.