Skip to content

Commit

Permalink
Migrate app to SwiftUI (#801)
Browse files Browse the repository at this point in the history
* Migrate SettingsViewController to SwiftUI
- Using LabeledContent instead of HStack
- Proper handling of settingsSendCrashReports when already set
- Integrated ClientCertificatesView, RTFTexView

* Cleaning up Main.storyboard as OpenHABLegalViewContoller, OpenHABSettingsViewController are not needed anymore

* Extend Migration to Drawer and Notifcations

* Porting ColorPicker and SelectionView to SwiftUI

* Reintegrating develop into branch

* Merge current develop branch

* Enabled Preview for DrawerView

* Cleaning up
Delete obsolete code
Remove unnecessary part of storyboard

* Checking tests

* Update fastlane

* Revert to ColorPickerViewController / to be readdressed when SitemapViewController is migrated to SwiftUI

---------

Co-authored-by: Dan Cunningham <[email protected]>
  • Loading branch information
timbms and digitaldan authored Sep 14, 2024
1 parent 49ff7e8 commit 16eee55
Show file tree
Hide file tree
Showing 30 changed files with 1,385 additions and 2,372 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ openHAB.ipa
build/
BuildTools/.build
OpenHABCore/Package.resolved
OpenHABCore/swift-openapi-generator/
2 changes: 2 additions & 0 deletions BuildTools/.swiftlint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ excluded:
- ../fastlane
- ../OpenHABCore/.build
- .build
- ../OpenHABCore/Sources/OpenHABCore/GeneratedSources/*
- ../OpenHABCore/swift-openapi-generator

nesting:
type_level: 2
Expand Down
2 changes: 1 addition & 1 deletion OpenHABCore/Sources/OpenHABCore/Model/OpenHABItem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public extension OpenHABItem {
public extension OpenHABItem.CodingData {
var openHABItem: OpenHABItem {
let mappedMembers = members?.map(\.openHABItem) ?? []

// swiftlint:disable:next line_length
return OpenHABItem(name: name, type: type, state: state, link: link, label: label, groupType: groupType, stateDescription: stateDescription?.openHABStateDescription, commandDescription: commandDescription?.openHABCommandDescription, members: mappedMembers, category: category, options: options)
}
}
Expand Down
24 changes: 22 additions & 2 deletions OpenHABCore/Sources/OpenHABCore/Util/Endpoint.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,34 @@ public enum ChartStyle {
case light
}

public enum IconType: Int {
public enum IconType: Int, CaseIterable, Identifiable, CustomStringConvertible {
case png
case svg

public var id: Self { self }

public var description: String {
switch self {
case .png:
"PNG"
case .svg:
"SVG"
}
}
}

public enum SortSitemapsOrder: Int {
public enum SortSitemapsOrder: Int, CaseIterable, CustomStringConvertible {
case label
case name

public var description: String {
switch self {
case .label:
"Label"
case .name:
"Name"
}
}
}

public struct Endpoint {
Expand Down
103 changes: 38 additions & 65 deletions openHAB.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions openHAB.xcodeproj/xcshareddata/xcschemes/openHAB.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
showNonLocalizedStrings = "YES">
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
Expand Down
Loading

0 comments on commit 16eee55

Please sign in to comment.