Skip to content
This repository has been archived by the owner on Jan 10, 2024. It is now read-only.

Commit

Permalink
fixed crash where viewmodels would not be unique
Browse files Browse the repository at this point in the history
  • Loading branch information
tgymnich committed Jul 7, 2020
1 parent 9d114f8 commit 4f3c081
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 15 deletions.
4 changes: 2 additions & 2 deletions TUM Campus App.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1165,7 +1165,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 23;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = LQ83GZ8GRK;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down Expand Up @@ -1214,7 +1214,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 23;
CURRENT_PROJECT_VERSION = 24;
DEVELOPMENT_TEAM = LQ83GZ8GRK;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
Expand Down
4 changes: 2 additions & 2 deletions TUM Campus App/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>NSContactsUsageDescription</key>
<string>TUM Campus App can add contacts from TUM Online to your address book</string>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleDisplayName</key>
Expand All @@ -24,6 +22,8 @@
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSContactsUsageDescription</key>
<string>TUM Campus App can add contacts from TUM Online to your address book</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>TUM Campus App uses your location to show you the distance to the next cafeteria</string>
<key>NSLocationWhenInUseUsageDescription</key>
Expand Down
12 changes: 8 additions & 4 deletions TUM Campus App/Lecture Detail/LectureDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ import Foundation
struct LectureDetailViewModel: Hashable {
var sections: [Section]

struct Section: Hashable {
struct Section: Identifiable, Hashable {
let id = UUID()
let name: String
let cells: [AnyHashable]
}

struct Header: Hashable {
struct Header: Identifiable, Hashable {
let id = UUID()
let title: String
let subtitle: String
}

struct Cell: Hashable {
struct Cell: Identifiable, Hashable {
let id = UUID()
let key: String
let value: String
}

struct LinkCell: Hashable {
struct LinkCell: Identifiable, Hashable {
let id = UUID()
let name: String
let link: URL
}
Expand Down
12 changes: 8 additions & 4 deletions TUM Campus App/Movie Detail/MovieDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,26 @@ import UIKit
struct MovieDetailViewModel: Hashable {
let sections: [Section]

struct Section: Hashable {
struct Section: Identifiable, Hashable {
let id = UUID()
let name: String
let cells: [AnyHashable]
}

struct Header: Hashable {
struct Header: Identifiable, Hashable {
let id = UUID()
let imageURL: URL?
let title: String?
}

struct Cell: Hashable {
struct Cell: Identifiable, Hashable {
let id = UUID()
let key: String
let value: String
}

struct LinkCell: Hashable {
struct LinkCell: Identifiable, Hashable {
let id = UUID()
let name: String
let link: URL
}
Expand Down
9 changes: 6 additions & 3 deletions TUM Campus App/Person Detail/PersonDetailViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,26 +11,29 @@ import UIKit
struct PersonDetailViewModel: Hashable {
let sections: [Section]

struct Header: Hashable {
struct Header: Identifiable, Hashable {
let id = UUID()
let image: UIImage?
let imageURL: URL?
let name: String
}

struct Cell: Hashable {
struct Cell: Identifiable, Hashable {
enum ActionType {
case call
case mail
case openURL
case showRoom
}

let id = UUID()
let key: String
let value: String
let actionType: ActionType?
}

struct Section: Hashable {
struct Section: Identifiable, Hashable {
let id = UUID()
let name: String
let cells: [AnyHashable]
}
Expand Down

0 comments on commit 4f3c081

Please sign in to comment.